Class MissingResolvedTypeWithKnownSignature
java.lang.Object
org.aspectj.weaver.UnresolvedType
org.aspectj.weaver.ResolvedType
org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
- All Implemented Interfaces:
AnnotatedElement, Traceable, TypeVariableDeclaringElement
When we try to resolve a type in the world that we require to be present, and then fail to find it, we return an instance of this
class. This class defers the production of the "can't find type error" until the first time that someone asks a question that
can't be answered solely from the signature. This enables the weaver to be more tolerant of missing types.
-
Nested Class Summary
Nested classes/interfaces inherited from class UnresolvedType
UnresolvedType.TypeKind -
Field Summary
Fields inherited from class ResolvedType
bits, crosscuttingMembers, EMPTY_ARRAY, EMPTY_RESOLVED_TYPE_ARRAY, interTypeMungers, MISSING, NONE, PARAMETERIZED_TYPE_IDENTIFIER, temporaryAnnotationTypes, validBoxing, worldModifier and TypeFieldDescriptionprotected intstatic final ResolvedType[]static final ResolvedType[]protected List<ConcreteTypeMunger> static final org.aspectj.weaver.ResolvedType.Missingstatic final ResolvedType[]static final Stringprotected WorldFields inherited from class UnresolvedType
AJC_PRIVILEGED, ANNOTATION, ARRAY_WITH_JUST_OBJECT, AT_INHERITED, AT_RETENTION, AT_TARGET, BOOLEAN, BYTE, CHAR, CLONEABLE, DOUBLE, ENUM, ERROR, FLOAT, INT, JAVA_LANG_ANNOTATION, JAVA_LANG_CLASS_ARRAY, JAVA_LANG_REFLECT_CONSTRUCTOR, JAVA_LANG_REFLECT_FIELD, JAVA_LANG_REFLECT_METHOD, JL_CLASS, JL_EXCEPTION, JL_STRING, JOINPOINT_ENCLOSINGSTATICPART, JOINPOINT_STATICPART, LONG, MISSING_NAME, OBJECT, OBJECTARRAY, PROCEEDING_JOINPOINT, RUNTIME_EXCEPTION, SERIALIZABLE, SHORT, signature, signatureErasure, SOMETHING, SUPPRESS_AJ_WARNINGS, THROWABLE, typeKind, typeParameters, typeVariables, VOIDModifier and TypeFieldDescriptionstatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedType[]static final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final Stringstatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypeprotected Stringprotected StringThe erasure of the signature.static final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypeprotected UnresolvedType.TypeKindprotected UnresolvedType[]Iff isParameterized(), then these are the type parametersprotected TypeVariable[]Iff isGeneric(), then these are the type variables declared on the type Iff isParameterized(), then these are the type variables bound as parameters in the typestatic final UnresolvedType -
Constructor Summary
ConstructorsConstructorDescriptionMissingResolvedTypeWithKnownSignature(String signature, String signatureErasure, World world) MissingResolvedTypeWithKnownSignature(String signature, World world) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcollectInterTypeMungers(List collector) ??? This method is O(N*M) where N = number of methods and M is number of inter-type declarations in my superintbooleanhasAnnotation(UnresolvedType ofType) booleanisAssignableFrom(ResolvedType other) Determines if the variables of this type could be assigned values of another type without casting.booleanisAssignableFrom(ResolvedType other, boolean allowMissing) booleanisCoerceableFrom(ResolvedType other) Determines if values of another type could possibly be cast to this type.booleanvoidraiseWarningOnJoinPointSignature(String signature) voidMethods inherited from class ResolvedType
addAnnotation, addInterTypeMunger, addParent, ajMembersNeedParameterization, canAnnotationTargetType, canBeSeenBy, checkInterTypeMungers, checkLegalOverride, clearInterTypeMungers, collectCrosscuttingMembers, collectDeclares, conflictingSignature, conflictingSignature, discoverActualOccurrenceOfTypeInHierarchy, doesNotExposeShadowMungers, ensureConsistent, equals, fillInAnyTypeParameters, findPointcut, getAjMemberParameterizationMap, getAnnotationOfType, getAnnotationTargetKinds, getAnnotationTypes, getBinaryPath, getCompilerVersion, getDeclaredAdvice, getDeclaredJavaFields, getDeclaredJavaMethods, getDeclaredShadowMungers, getDeclares, getDeclaringType, getDirectSupertypes, getExposedPointcuts, getFields, getGenericType, getHierarchy, getHierarchy, getHierarchyWithoutIterator, getMemberParameterizationMap, getMethods, getMethodsIncludingIntertypeDeclarations, getMethodsWithoutIterator, getOuterClass, getPerClause, getPointcuts, getPrivilegedAccesses, getRawType, getResolvedComponentType, getResolvedTypeParameters, getSignatureForAttribute, getSize, getSourceLocation, getTopmostImplementor, getTypeMungers, getWeaverState, getWorld, hasAnnotations, isAbstract, isAnnotation, isAnnotationStyleAspect, isAnnotationWithRuntimeRetention, isAnonymous, isAspect, isCacheable, isCheckedException, isClass, isConvertableFrom, isEnum, isException, isExposedToWeaver, isFinal, isGroovyObject, isInheritedAnnotation, isInterface, isMissing, isMoreVisible, isNested, isParameterizedWithTypeVariable, isPrimitiveArray, isPrivilegedAspect, isSynthetic, isTopmostImplementor, isTypeHierarchyComplete, isVisible, lookupDirectlyDeclaredMemberNoSupers, lookupField, lookupMemberIncludingITDsOnInterfaces, lookupMemberNoSupers, lookupMemberWithSupersAndITDs, lookupMethod, lookupMethodInITDs, lookupResolvedMember, lookupSyntheticMember, makeArray, matches, needsNoConversionFrom, parameterize, parameterizedWith, setBinaryPath, tagAsTypeHierarchyCompleteModifier and TypeMethodDescriptionvoidaddAnnotation(AnnotationAJ annotationX) voidaddInterTypeMunger(ConcreteTypeMunger munger, boolean isDuringCompilation) Add an intertype munger to this type.voidaddParent(ResolvedType newParent) protected booleanbooleanNote: Only overridden by ReferenceType subtypebooleancanBeSeenBy(ResolvedType from) voidCheck: 1) That we don't have any abstract type mungers unless this type is abstract.booleancheckLegalOverride(ResolvedMember parent, ResolvedMember child, int transformerPosition, ResolvedType aspectType) voidcollectCrosscuttingMembers(boolean shouldConcretizeIfNeeded) collectDeclares(boolean includeAdviceLike) static booleanconflictingSignature(Member m1, Member m2) static booleanconflictingSignature(Member m1, Member m2, boolean v2itds) Do the two members conflict? Due to the change in 1.7.1, field itds on interfaces now act like 'default' fields - so types implementing those fields get the field if they don't have it already, otherwise they keep what they have.Look up the actual occurence of a particular type in the hierarchy for 'this' type.protected booleanvoidUndo any temporary modifications to the type (for example it may be holding annotations temporarily whilst some matching is occurring - These annotations will be added properly during weaving but sometimes for type completion they need to be held here for a while).booleanEquality is checked based on the underlying signature.Called for all type mungers but only does something if they share type variables with a generic type which they target.findPointcut(String name) protected Map<String, UnresolvedType> getAnnotationOfType(UnresolvedType ofType) Note: Only overridden by ReferenceType subtypeReturns the path to the jar or class file from which this binary aspect came or null if not a binary aspectintreturn the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.Returns a ResolvedType object representing the declaring type of this type, or null if this type does not represent a non-package-level-type.final Iterator<ResolvedType> Returns an iterator through ResolvedType objects representing all the direct supertypes of this type.returns an iterator through all of the fields of this type, in order for checking from JVM spec 2ed 5.4.3.2.Overridden by ReferenceType to return a sensible answer for parameterized and raw types.Return an iterator over the types in this types hierarchy - starting with this type first, then all superclasses up to Object and then all interfaces (starting with those 'nearest' this type).getHierarchy(boolean wantGenerics, boolean wantDeclaredParents) Return an iterator over the types in this types hierarchy - starting with this type first, then all superclasses up to Object and then all interfaces (starting with those 'nearest' this type).getHierarchyWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) Return a list of the types in the hierarchy of this type, starting with this type.protected Map<String, UnresolvedType> getMethods(boolean wantGenerics, boolean wantDeclaredParents) returns an iterator through all of the methods of this type, in order for checking from JVM spec 2ed 5.4.3.3.getMethodsIncludingIntertypeDeclarations(boolean wantGenerics, boolean wantDeclaredParents) getMethodsWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) Return a list of methods, first those declared on this class, then those declared on the superclass (recurse) and then those declared on the superinterfaces.returns an iterator through all of the pointcuts of this type, in order for checking from JVM spec 2ed 5.4.3.2 (as for fields).intgetSize()This is the size of this type as used in JVM.getTopmostImplementor(ResolvedType interfaceType) getWorld()booleanfinal booleanbooleanNote: Only overridden by Name subtype.booleanbooleanNote: Only overridden by Name subtype.booleanbooleanisAspect()booleanbooleanbooleanisClass()final booleanisConvertableFrom(ResolvedType other) Determines if variables of this type could be assigned values of another with lots of help.booleanisEnum()Note: Only overridden by Name subtype.booleanbooleanfinal booleanisFinal()booleanbooleanFor an annotation type, this will return if it is marked with @Inheritedfinal booleanstatic booleanisMissing(UnresolvedType unresolved) static booleanisMoreVisible(int m1, int m2) booleanisNested()booleanreturn true if the parameterization of this type includes a member type variable.booleanbooleanbooleanbooleanisTopmostImplementor(ResolvedType interfaceType) booleanstatic booleanisVisible(int modifiers, ResolvedType targetType, ResolvedType fromType) as lookupMemberNoSupers, but does not include ITDslookupField(Member field) described in JVM spec 2ed 5.4.3.2This lookup has specialized behaviour - a null result tells the EclipseTypeMunger that it should make a default implementation of a method on this type.lookupMemberNoSupers(Member member) Look up a member, takes into account any ITDs on this type.lookupMemberWithSupersAndITDs(Member member) described in JVM spec 2ed 5.4.3.3.lookupMethodInITDs(Member member) lookupResolvedMember(ResolvedMember aMember, boolean allowMissing, boolean eraseGenerics) Looks for the first member in the hierarchy matching aMember.lookupSyntheticMember(Member member) static ResolvedTypemakeArray(ResolvedType type, int dim) static booleanbooleanparameterize(Map<String, UnresolvedType> typeBindings) Iff I am a parameterized type, and any of my parameters are type variable references (or nested parameterized types), return a version with those type parameters replaced in accordance with the passed bindings.parameterizedWith(UnresolvedType[] typeParameters) voidsetBinaryPath(String binaryPath) voidMethods inherited from class UnresolvedType
add, forGenericType, forGenericTypeSignature, forGenericTypeVariables, forName, forNames, forPrimitiveType, forRawTypeName, forSignature, forSignatures, getBaseName, getClassName, getComponentType, getDimensions, getErasureSignature, getName, getNameAsIdentifier, getNames, getOutermostType, getPackageName, getPackageNameAsIdentifier, getRawName, getSignature, getSimpleBaseName, getSimpleName, getTypekind, getTypeParameters, getTypeVariableNamed, getTypeVariables, hashCode, insert, isArray, isGenericType, isGenericWildcard, isParameterizedOrGenericType, isParameterizedOrRawType, isParameterizedType, isPrimitiveType, isRawType, isSimpleType, isTypeVariableReference, isVoid, makeArray, needsModifiableDelegate, read, readArray, resolve, setNeedsModifiableDelegate, toDebugString, toString, toTraceString, write, writeArrayModifier and TypeMethodDescriptionstatic UnresolvedType[]add(UnresolvedType[] types, UnresolvedType end) Creates a new type array with a fresh type appended to the end.static UnresolvedTypeforGenericType(String name, TypeVariable[] tvbs, String genericSig) static UnresolvedTypeforGenericTypeSignature(String sig, String declaredGenericSig) static UnresolvedTypeforGenericTypeVariables(String sig, TypeVariable[] tVars) static UnresolvedTypeNOTE: Use forSignature() if you can, it'll be cheaper ! Constructs a UnresolvedType for a java language type name.static UnresolvedType[]Constructs a UnresolvedType for each java language type name in an incoming array.static UnresolvedTypeforPrimitiveType(String signature) static UnresolvedTypeforRawTypeName(String name) static UnresolvedTypeforSignature(String signature) Constructs a Type for a JVM bytecode signature string.static UnresolvedType[]forSignatures(String[] sigs) Constructs a UnresolvedType for each JVM bytecode type signature in an incoming array.Returns a UnresolvedType object representing the component type of this array, or null if this type does not represent an array type.final intFor parameterized types, return the signature for the raw typegetName()Returns the name of this type in java language form (e.g.static String[]getNames(UnresolvedType[] types) Returns an array of strings representing the java langauge names of an array of types.Returns a UnresolvedType object representing the effective outermost enclosing type for a name type.Returns the name of this type in JVM signature form.getTypeVariableNamed(String name) inthashCode()Equality is checked based on the underlying signature, so the hash code of a particular type is the hash code of its signature string.static UnresolvedType[]insert(UnresolvedType start, UnresolvedType[] types) Creates a new type array with a fresh type inserted at the beginning.final booleanisArray()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisVoid()static UnresolvedTypemakeArray(UnresolvedType base, int dims) booleanstatic UnresolvedTypeRead in an UnresolvedType - just read the signature and rebuild the UnresolvedType.static UnresolvedType[]Returns a resolved version of this type according to a particular world.voidsetNeedsModifiableDelegate(boolean b) toString()Returns a java language string representation of this type.final voidWrite out an UnresolvedType - the signature should be enough.static voidwriteArray(UnresolvedType[] types, CompressingDataOutputStream stream)
-
Constructor Details
-
MissingResolvedTypeWithKnownSignature
-
MissingResolvedTypeWithKnownSignature
-
-
Method Details
-
isMissing
public boolean isMissing()- Overrides:
isMissingin classResolvedType
-
getDeclaredFields
- Specified by:
getDeclaredFieldsin classResolvedType
-
getDeclaredMethods
- Specified by:
getDeclaredMethodsin classResolvedType
-
getAnnotations
- Overrides:
getAnnotationsin classResolvedType
-
getDeclaredInterfaces
- Specified by:
getDeclaredInterfacesin classResolvedType
-
getDeclaredPointcuts
- Specified by:
getDeclaredPointcutsin classResolvedType
-
getSuperclass
- Specified by:
getSuperclassin classResolvedType- Returns:
- the superclass of this type, or null (if this represents a jlObject, primitive, or void)
-
getModifiers
public int getModifiers()- Specified by:
getModifiersin classResolvedType
-
getSourceContext
- Specified by:
getSourceContextin classResolvedType
-
isAssignableFrom
Description copied from class:ResolvedTypeDetermines if the variables of this type could be assigned values of another type without casting. This still allows for assignment conversion as per JLS 2ed 5.2. For object types, this means supertypeOrEqual(THIS, OTHER).- Specified by:
isAssignableFromin classResolvedType- Parameters:
other- the other type- Returns:
- true iff variables of this type could be assigned values of other without casting
-
isAssignableFrom
- Specified by:
isAssignableFromin classResolvedType
-
isCoerceableFrom
Description copied from class:ResolvedTypeDetermines if values of another type could possibly be cast to this type. The rules followed are from JLS 2ed 5.5, "Casting Conversion".This method should be commutative, i.e., for all UnresolvedType a, b and all World w:
a.isCoerceableFrom(b, w) == b.isCoerceableFrom(a, w)
- Specified by:
isCoerceableFromin classResolvedType- Parameters:
other- the other type- Returns:
- true iff values of other could possibly be cast to this type.
-
hasAnnotation
-
getInterTypeMungers
- Overrides:
getInterTypeMungersin classResolvedType
-
getInterTypeMungersIncludingSupers
Description copied from class:ResolvedType??? This method is O(N*M) where N = number of methods and M is number of inter-type declarations in my super- Overrides:
getInterTypeMungersIncludingSupersin classResolvedType
-
getInterTypeParentMungers
- Overrides:
getInterTypeParentMungersin classResolvedType
-
getInterTypeParentMungersIncludingSupers
- Overrides:
getInterTypeParentMungersIncludingSupersin classResolvedType
-
collectInterTypeMungers
- Overrides:
collectInterTypeMungersin classResolvedType
-
raiseWarningOnJoinPointSignature
-
raiseWarningOnMissingInterfaceWhilstFindingMethods
public void raiseWarningOnMissingInterfaceWhilstFindingMethods()
-