Only modify Serializable types when stripping reflection metadata.
966453
@Override
  public boolean visit(TypeDeclaration node) {
    TypeMirror serializableType = typeUtil.resolveJavaType("java.io.Serializable").asType();
    TypeMirror nodeType = node.getTypeElement().asType();
    boolean isSerializable = typeUtil.isAssignable(nodeType, serializableType);
    boolean stripReflection = !translationUtil.needsReflection(node.getTypeElement());
    return stripReflection && isSerializable;
  }
317345
protected void serializeModifiers(QueryMetadata metadata, SQLSerializer context) {
        QueryModifiers mod = metadata.getModifiers();
        if (mod.getLimit() != null) {
            context.handle(limitTemplate, mod.getLimit());
        } else if (limitRequired) {
            context.handle(limitTemplate, maxLimit);
        }
        if (mod.getOffset() != null) {
            context.handle(offsetTemplate, mod.getOffset());
        }
    }
729904
def scrub(data):
    """"""
    # blanks, Nones, and empty strings can stay as is
    if not data:
        return data
    if isinstance(data, (int, float)):
        return data
    if isinstance(data, list):
        return [scrub(entry) for entry in data]
    if isinstance(data, dict):
        return {scrub(key): scrub(value) for key, value in data.items()}
    try:
        return json.encoder.encode_basestring(data)[1:-1]
    except TypeError as exc:
        raise ValidationError("Input '%s' is not a permitted type: %s" % (data,
                                                                          exc))
    except Exception as exc:
        raise ValidationError("Input '%s' not permitted: %s" % (data, exc))
1149392
public void deleteMetadata(String typeName) {
        String scope = Metadata.scopeBasedOnType(typeName);
        this.deleteMetadata(typeName, scope);
    }
999257
protected void unsetSerializationService(ServiceReference<SerializationService> ref) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "unsetSerializationService", "unsetting " + ref);
        }
        serializationServiceRef.unsetReference(ref);
    }
895152
def purge_cache(self, object_type):
        
        if object_type in self.mapping:
            cache = self.mapping[object_type]
            log.debug("Purging [{}] cache of {} values.".format(object_type, len(cache)))
            cache.purge()
413141
private static Serializable jsonObjectToSerializableType(JSONObject input) {
		String type = input.optString(Apptentive.Version.KEY_TYPE, null);
		try {
			if (type != null) {
				if (type.equals(Apptentive.Version.TYPE)) {
					return new Apptentive.Version(input);
				} else if (type.equals(Apptentive.DateTime.TYPE)) {
					return new Apptentive.DateTime(input);
				}
			}
		} catch (JSONException e) {
			ApptentiveLog.e(CONVERSATION, e, "Error migrating JSONObject.");
			logException(e);
		}
		return null;
	}
587344
@SuppressWarnings("unchecked")
	protected void removeCurrentTypeConversion() {
		final IStructuredSelection selection = this.list.getStructuredSelection();
		final String[] types = new String[selection.size()];
		final Iterator<ConversionMapping> iter = selection.iterator();
		int i = 0;
		while (iter.hasNext()) {
			types[i] = iter.next().getSource();
			i++;
		}
		removeTypeConversions(types);
	}
392737
def with_metaclass(Type, skip_attrs=set(('__dict__', '__weakref__'))):
    

    def _clone_with_metaclass(Class):
        attrs = dict((key, value) for key, value in items(vars(Class))
                     if key not in skip_attrs)
        return Type(Class.__name__, Class.__bases__, attrs)

    return _clone_with_metaclass
783171
public static void cleanup ()
  {
    if (MimeTypeInfoManager.isDefaultInstantiated ())
      MimeTypeInfoManager.getDefaultInstance ().reinitializeToDefault ();
    if (MicroTypeConverterRegistry.isInstantiated ())
      MicroTypeConverterRegistry.getInstance ().reinitialize ();
    if (XMLSchemaCache.isInstantiated ())
      XMLSchemaCache.getInstance ().clearCache ();
    XMLSchemaCache.clearPerClassLoaderCache ();
  }
1295962
private void removePropertyDocs(
      final Node objLit, PolymerClassDefinition.DefinitionType defType) {
    for (MemberDefinition prop :
        PolymerPassStaticUtils.extractProperties(
            objLit,
            defType,
            compiler,
            /** constructor= */
            null)) {
      prop.name.removeProp(Node.JSDOC_INFO_PROP);
    }
  }
982796
def serialize(cls, obj, buf, lineLength, validate=True):
        

        cls.generateImplicitParameters(obj)
        if validate:
            cls.validate(obj, raiseException=True)

        if obj.isNative:
            transformed = obj.transformFromNative()
            undoTransform = True
        else:
            transformed = obj
            undoTransform = False

        out = base.defaultSerialize(transformed, buf, lineLength)
        if undoTransform:
            obj.transformToNative()
        return out
694956
def remove_current_specific_fields(obj):
    """"""
    obj = remove_global_dynamo_specific_fields(obj)

    obj.pop("ttl", None)
    obj.pop("eventSource", None)

    return obj
921964
def serialize(self, serializable: Optional[Union[SerializableType, List[SerializableType]]]) \
            -> PrimitiveJsonType:
        
        if serializable is None:
            # Implements #17
            return None
        elif isinstance(serializable, List):
            return [self.serialize(item) for item in serializable]
        else:
            serialized = self._create_serialized_container()

            for mapping in self._property_mappings:
                if mapping.object_property_getter is not None and mapping.serialized_property_setter is not None:
                    value = mapping.object_property_getter(serializable)
                    if not (mapping.optional and value is None):
                        if isinstance(value, type(mapping.collection_factory([]))):
                            value = list(mapping.collection_iter(value))
                        encoded_value = self._serialize_property_value(value, mapping.serializer_cls)
                        mapping.serialized_property_setter(serialized, encoded_value)

            return serialized
272780
def _deserialize(self, value, attr, data):
        """"""
        value = super(SanitizedHTML, self)._deserialize(value, attr, data)
        return bleach.clean(
            value,
            tags=self.tags,
            attributes=self.attrs,
            strip=True,
        ).strip()
849157
private String stripOffParameters(String contentType)
    {
        if (contentType == null)
            return null;
        int index = contentType.indexOf(';');

        if (index > 0)
            return contentType.substring(0, index);
        else
            return contentType;
    }
692251
private static void unwrapArgs(final Class<?>[] types, final Object[] args) {
        if (args == null) {
            return;
        }
        try {
            for (int i = 0; i < args.length; ++i) {
                args[i] = ReflectionHelper.unwrap(types[i], args[i]);
            }
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }

    }