private boolean areSameTypeBindings(final ITypeBinding type1, final ITypeBinding type2) { if (type1 == null || type2 == null) { return true; } return type1.isParameterizedType() == type2.isParameterizedType() && areSameParameterizedTypeBindings(type1, type2); }
private boolean isParameterizedTypeWithOneArgument(ITypeBinding typeBinding) { return typeBinding != null && typeBinding.isParameterizedType() && typeBinding.getTypeArguments().length == 1; }
private boolean isParameterizedTypeWithNbArguments(final ITypeBinding typeBinding, int nbArgs) { return typeBinding != null && typeBinding.isParameterizedType() && typeBinding.getTypeArguments().length == nbArgs; }
public static String getRawName(ITypeBinding binding) { String name= binding.getName(); if (binding.isParameterizedType() || binding.isGenericType()) { int idx= name.indexOf('<'); if (idx != -1) { return name.substring(0, idx); } } return name; }
public static String getRawName(ITypeBinding binding) { String name= binding.getName(); if (binding.isParameterizedType() || binding.isGenericType()) { int idx= name.indexOf('<'); if (idx != -1) { return name.substring(0, idx); } } return name; }
public static String getRawName(ITypeBinding binding) { String name= binding.getName(); if (binding.isParameterizedType() || binding.isGenericType()) { int idx= name.indexOf('<'); if (idx != -1) { return name.substring(0, idx); } } return name; }
private static ITypeBinding handleBug84585(ITypeBinding typeBinding) { if (typeBinding == null) return null; else if (typeBinding.isGenericType() && ! typeBinding.isRawType() && ! typeBinding.isParameterizedType()) return null; //see bug 84585 else return typeBinding; }
private static ITypeBinding handleBug84585(ITypeBinding typeBinding) { if (typeBinding == null) return null; else if (typeBinding.isGenericType() && ! typeBinding.isRawType() && ! typeBinding.isParameterizedType()) return null; //see bug 84585 else return typeBinding; }
private static ITypeBinding handleBug84585(ITypeBinding typeBinding) { if (typeBinding == null) return null; else if (typeBinding.isGenericType() && ! typeBinding.isRawType() && ! typeBinding.isParameterizedType()) return null; //see bug 84585 else return typeBinding; }
private boolean isGenericRuntimeParameterIdiom(IMethodBinding method, ITypeBinding parameterType) { if (!parameterType.isParameterizedType()) { return false; } if (!"java.lang.Class".equals(qualifiedName(parameterType))) { return false; } // detecting if the T in Class<T> comes from the method itself final ITypeBinding classTypeArgument = parameterType.getTypeArguments()[0]; return classTypeArgument.getDeclaringMethod() == method; }
public static boolean isAGenericType(ITypeBinding type) { return type.isGenericType() || type.isParameterizedType() || (type.isRawType() && type.getTypeDeclaration().isGenericType()); }
public static boolean isAGenericType(ITypeBinding type) { return type.isGenericType() || type.isParameterizedType() || (type.isRawType() && type.getTypeDeclaration().isGenericType()); }
public static boolean isAGenericType(ITypeBinding type) { return type.isGenericType() || type.isParameterizedType() || (type.isRawType() && type.getTypeDeclaration().isGenericType()); }
public boolean isSubTypeOf(ITypeBinding type1, ITypeBinding type2){ // to ensure that, e.g., Comparable<String> is considered a subtype of raw Comparable if (type1.isParameterizedType() && type1.getTypeDeclaration().isEqualTo(type2.getTypeDeclaration())){ return true; } Set<ITypeBinding> superTypes= getAllSuperTypes(type1); return contains(superTypes, type2); }
public boolean isSubTypeOf(ITypeBinding type1, ITypeBinding type2){ // to ensure that, e.g., Comparable<String> is considered a subtype of raw Comparable if (type1.isParameterizedType() && type1.getTypeDeclaration().isEqualTo(type2.getTypeDeclaration())){ return true; } Set superTypes= getAllSuperTypes(type1); return contains(superTypes, type2); }
public boolean isSubTypeOf(ITypeBinding type1, ITypeBinding type2){ // to ensure that, e.g., Comparable<String> is considered a subtype of raw Comparable if (type1.isParameterizedType() && type1.getTypeDeclaration().isEqualTo(type2.getTypeDeclaration())){ return true; } Set<ITypeBinding> superTypes= getAllSuperTypes(type1); return contains(superTypes, type2); }
private static boolean parameterTypesMatch(ITypeBinding implementedType, boolean isInstanceOf, IMethodBinding methodBinding, String[] parameterTypesQualifiedNames) { if (implementedType != null && !implementedType.isRawType()) { final ITypeBinding erasure = implementedType.getErasure(); if (erasure.isGenericType() || erasure.isParameterizedType()) { return parameterizedTypesMatch(implementedType, erasure, methodBinding); } } return isInstanceOf && concreteTypesMatch(methodBinding.getParameterTypes(), parameterTypesQualifiedNames); }
protected void initialize(ITypeBinding binding, IType javaElementType) { Assert.isTrue(binding.isParameterizedType()); super.initialize(binding, javaElementType); TypeEnvironment environment= getEnvironment(); fTypeDeclaration= (GenericType)environment.create(binding.getTypeDeclaration()); ITypeBinding[] typeArguments= binding.getTypeArguments(); fTypeArguments= new TType[typeArguments.length]; for (int i= 0; i < typeArguments.length; i++) { fTypeArguments[i]= environment.create(typeArguments[i]); } }
@Override protected void initialize(ITypeBinding binding, IType javaElementType) { Assert.isTrue(binding.isParameterizedType()); super.initialize(binding, javaElementType); TypeEnvironment environment= getEnvironment(); fTypeDeclaration= (GenericType)environment.create(binding.getTypeDeclaration()); ITypeBinding[] typeArguments= binding.getTypeArguments(); fTypeArguments= new TType[typeArguments.length]; for (int i= 0; i < typeArguments.length; i++) { fTypeArguments[i]= environment.create(typeArguments[i]); } }
@Override protected void initialize(ITypeBinding binding, IType javaElementType) { Assert.isTrue(binding.isParameterizedType()); super.initialize(binding, javaElementType); TypeEnvironment environment= getEnvironment(); fTypeDeclaration= (GenericType)environment.create(binding.getTypeDeclaration()); ITypeBinding[] typeArguments= binding.getTypeArguments(); fTypeArguments= new TType[typeArguments.length]; for (int i= 0; i < typeArguments.length; i++) { fTypeArguments[i]= environment.create(typeArguments[i]); } }