/** * Returns the position within the set of type variables for this type for * the specified type variable name. Returns -1 if there is no type variable * with the specified name. */ private int getRank(String tvname) { TypeVariable[] thisTypesTVars = getGenericType().getTypeVariables(); for (int i = 0; i < thisTypesTVars.length; i++) { TypeVariable tv = thisTypesTVars[i]; if (tv.getName().equals(tvname)) { return i; } } return -1; }
@Override public void ensureConsistent() { annotations = null; annotationTypes = null; newSuperclass = null; bits = 0; // clears the hierarchy complete tag (amongst other things) newInterfaces = null; typeVariables = null; parameterizedInterfaces.clear(); superclassReference = new WeakReference<ResolvedType>(null); if (getDelegate() != null) { delegate.ensureConsistent(); } if (isParameterizedOrRawType()) { ReferenceType genericType = getGenericType(); if (genericType != null) { genericType.ensureConsistent(); } } }
if (isRawType() && getGenericType() != null) { ReferenceType genType = (ReferenceType) getGenericType(); if (genType.getDelegate() != delegate) { // avoids circular updates genType.setDelegate(delegate);
private UnresolvedType[] getTypesForMemberParameterization() { UnresolvedType[] parameters = null; if (isParameterizedType()) { parameters = getTypeParameters(); } else if (isRawType()) { // raw type, use upper bounds of type variables on generic type TypeVariable[] tvs = getGenericType().getTypeVariables(); parameters = new UnresolvedType[tvs.length]; for (int i = 0; i < tvs.length; i++) { parameters[i] = tvs[i].getFirstBound(); } } return parameters; }
declaringType = ((ReferenceType) declaringType).getGenericType();
ReferenceType genericType = (ReferenceType) this.resolvedTypeX.getGenericType();
return this.getGenericType().isCoerceableFrom((other.getRawType()));