Returns true if {@code typeMirror} is a raw type.
773851
static boolean isRawType(TypeMirror typeMirror) {
    Set<TypeParameterElement> visited = new HashSet<>();
    return typeMirror.accept(CheckRawTypesVisitor.INSTANCE, visited);
  }
1008404
public static String rawTypeToString(TypeMirror type, char innerClassSeparator) {
    if (!(type instanceof DeclaredType)) {
      throw new IllegalArgumentException("Unexpected type: " + type);
    }
    StringBuilder result = new StringBuilder();
    DeclaredType declaredType = (DeclaredType) type;
    rawTypeToString(result, (TypeElement) declaredType.asElement(), innerClassSeparator);
    return result.toString();
  }
1116103
public void checkcast(TypeMirror type) throws IOException
    {
        switch (type.getKind())
        {
            case ARRAY:
                ArrayType array = (ArrayType) type;
                int index = subClass.resolveClassIndex(array);
                checkcast(index);
                break;
            case DECLARED:
                DeclaredType dt = (DeclaredType) type;
                TypeElement te = (TypeElement) dt.asElement();
                checkcast(te);
                break;
            case TYPEVAR:
                TypeVariable tv = (TypeVariable) type;
                checkcast(tv.getUpperBound());
                break;
        }
    }
56637
public boolean isJavaScriptObject( JType type ) {
        return null != type.isClass() && type.isClass().isAssignableTo( jsoType );
    }
987350
private String getNativeNameForJavaType(TypeMirror typeMirror) {
    TypeName typeName = TypeName.get(typeMirror);

    if (typeName.equals(TypeName.INT)
        || typeName.equals(TypeName.BYTE)
        || typeName.equals(TypeName.SHORT)
        || typeName.equals(TypeName.LONG)
        || typeName.equals(TypeName.FLOAT)
        || typeName.equals(TypeName.DOUBLE)) {
      return "Number";
    } else if (typeName.equals(TypeName.BOOLEAN)) {
      return "Boolean";
    } else if (typeName.equals(TypeName.get(String.class)) || typeName.equals(TypeName.CHAR)) {
      return "String";
    } else if (typeMirror.toString().startsWith(JsArray.class.getCanonicalName())) {
      return "Array";
    } else {
      return "Object";
    }
  }
218704
public static boolean isInternalType(Types typeUtils, TypeMirror type) {
		Element element = ((TypeElement) typeUtils.asElement(type)).getEnclosingElement();
		return element.getKind() != ElementKind.PACKAGE;
	}
1337599
public static boolean isAbstract(TypeRef  typeRef) {
        DefinitionRepository repository =  DefinitionRepository.getRepository();
        TypeDef def = repository.getDefinition(typeRef);
        if (def == null && typeRef instanceof ClassRef) {
            def = ((ClassRef)typeRef).getDefinition();
        }
        return def != null ? def.isAbstract() : false;
    }
1311499
public boolean isSarlAgent(LightweightTypeReference type) {
		return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_AGENT
				|| type.isSubtypeOf(Agent.class));
	}
1124505
@Requires("type != null")
  @Ensures("result == null || result.getDeclaredName().equals(type.toString())")
  TypeName getTypeNameForType(TypeMirror type) {
    switch (type.getKind()) {
      case NONE:
        return null;
      default:
        return new TypeName(type.toString());
    }
  }
339031
public static Class<?> rawClassOf(Type type) {
        if (type instanceof Class<?>) {
            return (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            Type rawType = parameterizedType.getRawType();
            return (Class<?>) rawType;
        } else if (type instanceof GenericArrayType) {
            Type componentType = ((GenericArrayType) type).getGenericComponentType();
            return Array.newInstance(rawClassOf(componentType), 0).getClass();
        } else if (type instanceof TypeVariable) {
            return Object.class;
        } else {
            throw new IllegalArgumentException("Unsupported type " + type.getTypeName());
        }
    }
480094
public TypeMirror getType(Element element) {
    return elementTypeMap.containsKey(element) ? elementTypeMap.get(element) : element.asType();
  }
687113
private static boolean isAssignableFrom(ParameterizedType type1, Class<?> type2) {
        Class<?> rawType1 = Reflections.getRawType(type1);

        // raw types have to be assignable
        if (!isAssignableFrom(rawType1, type2)) {
            return false;
        }
        // this is a raw type with missing type arguments
        if (!Types.getCanonicalType(type2).equals(type2)) {
            return true;
        }

        return matches(type1, new HierarchyDiscovery(type2));
    }
122918
public static boolean isInteger(TypeMirror type)
    {
        switch (type.getKind())
        {
            case INT:
            case SHORT:
            case CHAR:
            case BYTE:
            case BOOLEAN:
                return true;
            default:
                return false;
        }
    }
110170
public static boolean isSingle(Class<?> type) {
        for (Class<?> reactiveType : SINGLE_TYPES) {
            if (reactiveType.isAssignableFrom(type)) {
                return true;
            }
        }
        return false;
    }
328869
public static Optional<TypeMirror> maybeUnbox(TypeMirror mirror, Types types) {
    try {
      return Optional.of(types.unboxedType(mirror));
    } catch (IllegalArgumentException e) {
      return Optional.empty();
    }
  }
716830
public TypeMirror unaryNumericPromotion(TypeMirror type) {
    TypeKind t = type.getKind();
    if (t == TypeKind.DECLARED) {
      type = javacTypes.unboxedType(type);
      t = type.getKind();
    }
    if (t == TypeKind.BYTE || t == TypeKind.SHORT || t == TypeKind.CHAR) {
      return getInt();
    } else {
      return type;
    }
  }
83836
public boolean isSarlEvent(LightweightTypeReference type) {
		return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_EVENT
				|| type.isSubtypeOf(Event.class));
	}