public InferredType addType(char[] className, boolean isDefinition, String providerId) {
    InferredType type = findInferredType(className);

    if (type == null && className.length > 0) {
      if (numberInferredTypes == inferredTypes.length) {
        System.arraycopy(
            inferredTypes,
            0,
            (inferredTypes = new InferredType[numberInferredTypes * 2]),
            0,
            numberInferredTypes);
      }

      type = inferredTypes[numberInferredTypes++] = new InferredType(className);
      type.inferenceProviderID = providerId;
      if (className.length > 2
          && className[className.length - 2] == '['
          && className[className.length - 1] == ']') {
        type.isArray = true;
      }

      inferredTypesHash.put(className, type);
    }
    if (isDefinition && type != null) type.setIsDefinition(isDefinition);
    return type;
  }