Clone the given types by applying the type parameter mapping when necessary.

@param types the types to clone.
@param typeParameterMap the type parameter mapping.
@return the clones.
196806
private List<LightweightTypeReference> cloneTypeReferences(List<JvmTypeReference> types,
			Map<String, JvmTypeReference> typeParameterMap) {
		final List<LightweightTypeReference> newList = new ArrayList<>(types.size());
		for (final JvmTypeReference type : types) {
			newList.add(cloneTypeReference(type, typeParameterMap));
		}
		return newList;
	}
744469
void addGenericTypes(String paramName, Map<String, Object> generics) {
        genericTypes.put(paramName, generics);
    }
655401
@SuppressWarnings("unchecked")
  public <S, D> TypeMap<S, D> getOrCreate(S source, Class<S> sourceType, Class<D> destinationType,
      String typeMapName, PropertyMap<S, D> propertyMap, Converter<S, D> converter,
      MappingEngineImpl engine) {
    synchronized (lock) {
      TypePair<S, D> typePair = TypePair.of(sourceType, destinationType, typeMapName);
      TypeMapImpl<S, D> typeMap = (TypeMapImpl<S, D>) typeMaps.get(typePair);

      if (typeMap == null) {
        typeMap = new TypeMapImpl<S, D>(sourceType, destinationType, typeMapName, config, engine);
        if (propertyMap != null)
          typeMap.addMappings(propertyMap);
        if (converter == null && config.isImplicitMappingEnabled()
            && Types.mightContainsProperties(typeMap.getSourceType())
            && Types.mightContainsProperties(typeMap.getDestinationType()))
          ImplicitMappingBuilder.build(source, typeMap, config.typeMapStore, config.converterStore);

        if (typeMap.isFullMatching()) {
          typeMaps.put(typePair, typeMap);
        }
      } else if (propertyMap != null) {
        typeMap.addMappings(propertyMap);
      }

      if (converter != null)
        typeMap.setConverter(converter);
      return typeMap;
    }
  }
1227166
public static <T extends GraphQLType> List<T> sortGraphQLTypes(Collection<T> types) {
        List<T> sorted = new ArrayList<>(types);
        sorted.sort(graphQLTypeComparator());
        return sorted;
    }
234040
protected List<PExp> cloneListPExp(List<PExp> args)
	{
		List<PExp> clones = new LinkedList<PExp>();
		for (PExp pexp : args)
		{
			clones.add(pexp.clone());
		}
		return clones;
	}
1250349
public static Map<String, String> transformMap(final Map<String, Object> paramMap) {
        final Map<String, String> paramStrMap = new LinkedHashMap<String, String>();
        for (final Map.Entry<String, Object> entry : paramMap.entrySet()) {
            paramStrMap.put(entry.getKey(), entry.getValue().toString());
        }

        return paramStrMap;
    }
454204
protected List<PType> cloneListType(List<PType> types)
	{
		List<PType> r = new LinkedList<PType>();
		for (PType type : types)
		{
			r.add(type.clone());
		}
		return r;
	}
737873
@NotNull
    protected Map<String, Object> toTypeArguments(@NotNull Map<String, ClassElement> typeArguments) {
        final LinkedHashMap<String, Object> map = new LinkedHashMap<>(typeArguments.size());
        for (Map.Entry<String, ClassElement> entry : typeArguments.entrySet()) {
            final ClassElement ce = entry.getValue();
            final Map<String, ClassElement> subArgs = ce.getTypeArguments();
            if (CollectionUtils.isNotEmpty(subArgs)) {
                map.put(entry.getKey(), toTypeArguments(subArgs));
            } else {
                final Type typeReference = getTypeForElement(ce);
                map.put(entry.getKey(), typeReference);
            }
        }

        return map;
    }
151158
private void registerTypeMappings(
      TypeMapping registryTypeMapping, List<TypeMapping> typeMappings) {
    Preconditions.checkNotNull(registryTypeMapping, "Null registry type mapping");
    Preconditions.checkNotNull(typeMappings, "Null type mappings");
    Preconditions.checkArgument(!typeMappings.isEmpty(), "Empty type mappings");
    for (TypeMapping typeMapping : typeMappings) {
      for (Class<?> mappingClass : typeMapping.getAllClasses()) {
        QName classQName = typeMapping.getTypeQName(mappingClass);
        DeserializerFactory deserializer = typeMapping.getDeserializer(mappingClass, classQName);
        if (deserializer != null && !registryTypeMapping.isRegistered(mappingClass, classQName)) {
          registryTypeMapping.register(
              mappingClass, classQName, (SerializerFactory) null, deserializer);
        }
      }
    }
  }
423740
public static <T> T createInstance(Class<T> type, Object... parameters) {

    // get types for parameters
    Class<?>[] parameterTypes = new Class<?>[parameters.length];
    for (int i = 0; i < parameters.length; i++) {
      Object parameter = parameters[i];
      parameterTypes[i] = parameter.getClass();
    }

    try {
      // create instance
      Constructor<T> constructor = type.getConstructor(parameterTypes);
      return constructor.newInstance(parameters);

    } catch (Exception e) {
      throw new ModelException("Exception while creating an instance of type "+type, e);
    }
  }
308597
public void put(TypeMap<?, ?> typeMap) {
    TypePair<?, ?> typePair = TypePair.of(typeMap.getSourceType(),
        typeMap.getDestinationType(), typeMap.getName());
    synchronized (lock) {
      if (typeMaps.containsKey(typePair))
        throw new IllegalArgumentException("TypeMap exists in the store: " + typePair.toString());
      typeMaps.put(typePair, typeMap);
    }
  }
602976
@Override
    public void setTypeMap(Map<String,Class<?>> map) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
497400
public static Map<String, ValueCommand> createParameterMap(Object... params) {
        assert params.length % 2 == 0;
        Map<String, ValueCommand> ret = new HashMap<String, ValueCommand>();
        for (int i = 0; i < params.length; i = i + 2) {
            String param = params[i].toString();
            Value value = convertFromJava(params[i + 1]);
            ret.put(param, new LiteralCommand(value));
        }
        return ret;
    }
810841
public function setTypeMap($typeMap)
    {
        $this->_typeMap = is_array($typeMap) ? new TypeMap($typeMap) : $typeMap;

        return $this;
    }
1144946
public boolean addOptionalParams(JSType ...types) {
    if (hasVarArgs()) {
      return false;
    }

    for (JSType type : types) {
      newParameter(registry.createOptionalType(type)).setOptionalArg(true);
    }
    return true;
  }
1289716
public static <K, V> Map<K, V> copy(final Map<K, V> map) {
		if (map == null) {
			return null;
		}

		TypeEnum keyType = null;
		TypeEnum valueType = null;

		Map<K, V> copy = new HashMap<K, V>();
		for (Map.Entry<K, V> entry : map.entrySet()) {
			K key = entry.getKey();
			V value = entry.getValue();

			K keyCopy = null;
			if (key != null) {
				if (keyType == null) {
					keyType = TypeEnum.dataTypeOf(key.getClass());
				}
				keyCopy = copy(key, keyType);
			}

			V valueCopy = null;
			if (value != null) {
				if (valueType == null) {
					valueType = TypeEnum.dataTypeOf(value.getClass());
				}
				valueCopy = copy(value, valueType);
			}

			copy.put(keyCopy, valueCopy);
		}

		return copy;
	}
50468
private void genOptTypeArguments(List<? extends TypeMirror> typeArguments, StringBuilder sb) {
    if (!typeArguments.isEmpty()) {
      sb.append('<');
      for (TypeMirror typeParam : typeArguments) {
        genTypeSignature(typeParam, sb);
      }
      sb.append('>');
    }
  }