diff options
author | aclement <aclement> | 2005-10-18 08:21:21 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-10-18 08:21:21 +0000 |
commit | af85aef2316af6bde178f2fe356b6ab65d0b423a (patch) | |
tree | 12f976da689ac0f6f15aed2e733a88f6d3357d18 /weaver | |
parent | 10e5c437ed35106c8b4827718b756b23ff3eddc2 (diff) | |
download | aspectj-af85aef2316af6bde178f2fe356b6ab65d0b423a.tar.gz aspectj-af85aef2316af6bde178f2fe356b6ab65d0b423a.zip |
see pr112105: tidyup
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedType.java | 18 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java | 29 |
2 files changed, 12 insertions, 35 deletions
diff --git a/weaver/src/org/aspectj/weaver/ResolvedType.java b/weaver/src/org/aspectj/weaver/ResolvedType.java index ae18931b2..1f931754e 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedType.java +++ b/weaver/src/org/aspectj/weaver/ResolvedType.java @@ -1273,7 +1273,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl * * returns null if it can't be found. */ - public ResolvedType discoverActualOccurenceOfTypeInHierarchy(ResolvedType lookingFor) { + public ResolvedType discoverActualOccurrenceOfTypeInHierarchy(ResolvedType lookingFor) { if (!lookingFor.isGenericType()) throw new BCException("assertion failed: method should only be called with generic type, but "+lookingFor+" is "+lookingFor.typeKind); @@ -1288,10 +1288,10 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl for (int i = 0; i < superIs.length; i++) { ResolvedType superI = superIs[i]; if (superI.genericTypeEquals(lookingFor)) return superI; - ResolvedType checkTheSuperI = discoverActualOccurenceOfTypeInHierarchy(lookingFor); + ResolvedType checkTheSuperI = discoverActualOccurrenceOfTypeInHierarchy(lookingFor); if (checkTheSuperI!=null) return checkTheSuperI; } - return discoverActualOccurenceOfTypeInHierarchy(superT); + return discoverActualOccurrenceOfTypeInHierarchy(superT); } /** @@ -1315,17 +1315,17 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl member.resolve(world); // Ensure all parts of the member are resolved if (debug) System.err.println(" Actual target ontype: "+onType+" ("+onType.typeKind+")"); // quickly find the targettype in the type hierarchy for this type (it will be either RAW or PARAMETERIZED) - ResolvedType actualTarget = discoverActualOccurenceOfTypeInHierarchy(onType); + ResolvedType actualTarget = discoverActualOccurrenceOfTypeInHierarchy(onType); if (actualTarget==null) throw new BCException("assertion failed: asked "+this+" for occurrence of "+onType+" in its hierarchy??"); // only bind the tvars if its a parameterized type or the raw type (in which case they collapse to bounds) - don't do it for generic types ;) if (!actualTarget.isGenericType()) { - if (debug) System.err.println("Occurence in "+this+" is actually "+actualTarget+" ("+actualTarget.typeKind+")"); + if (debug) System.err.println("Occurrence in "+this+" is actually "+actualTarget+" ("+actualTarget.typeKind+")"); // parameterize the signature - ResolvedMember newOne = member.parameterizedWith(actualTarget.getTypeParameters(),onType,actualTarget.isParameterizedType()); + // ResolvedMember newOne = member.parameterizedWith(actualTarget.getTypeParameters(),onType,actualTarget.isParameterizedType()); munger = munger.parameterizedFor(actualTarget); - if (debug) System.err.println("New sig: "+newOne); + if (debug) System.err.println("New sig: "+munger.getSignature()); } if (debug) System.err.println("====================================="); @@ -1927,7 +1927,9 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl for (int i = 0; i < typeParameters.length; i++) { UnresolvedType aType = (ResolvedType)typeParameters[i]; - if (aType.isTypeVariableReference() && ((TypeVariableReference)aType).getTypeVariable().getDeclaringElementKind()==TypeVariable.METHOD) { + if (aType.isTypeVariableReference() && + // assume the worst - if its definetly not a type declared one, it could be anything + ((TypeVariableReference)aType).getTypeVariable().getDeclaringElementKind()!=TypeVariable.TYPE) { parameterizedWithAMemberTypeVariable = FuzzyBoolean.YES; return true; } diff --git a/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java b/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java index 65c109dc1..d398a97af 100644 --- a/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java +++ b/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java @@ -45,13 +45,13 @@ public class UnresolvedTypeVariableReferenceType extends UnresolvedType implemen TypeVariableReferenceType tvrt = null; if (typeVariableScope == null) { // throw new BCException("There is no scope in which to lookup type variables!"); - // SAUSAGES correct thing to do is go bang, but to limp along, lets cope with the scope missing + // FIXME asc correct thing to do is go bang, but to limp along, lets cope with the scope missing resolvedTypeVariable = typeVariable.resolve(world); tvrt = new TypeVariableReferenceType(resolvedTypeVariable,world); } else { boolean foundOK = false; resolvedTypeVariable = typeVariableScope.getTypeVariableNamed(typeVariable.getName()); - // SAUSAGES remove this when the shared type var stuff is sorted + // FIXME asc remove this when the shared type var stuff is sorted if (resolvedTypeVariable == null) { resolvedTypeVariable = typeVariable.resolve(world); } else { @@ -62,33 +62,8 @@ public class UnresolvedTypeVariableReferenceType extends UnresolvedType implemen } return tvrt; -// // SAUSAGES should really be resolved in a scope, or you won't get the type variable you really want! -// //throw new BCException("NO - UnresolvedTypeVariableReferenceTypes must be resolved in a type variable scope"); -// if (typeVariable == null) { -// throw new BCException("Cannot resolve this type variable reference, the type variable has not been set!"); -// } -// typeVariable.resolve(world); -// return new TypeVariableReferenceType(typeVariable,world); } -// public ResolvedType resolve(World world,TypeVariableDeclaringElement tvde) { -// if (typeVariable == null) { -// throw new BCException("Cannot resolve this type variable reference, the type variable has not been set!"); -// } -// -// // SAUSAGES temporary whilst the ITD logic gets sorted out -// if (tvde == null) return new TypeVariableReferenceType(typeVariable.resolve(world),world); -// -// TypeVariable resolvedTypeVariable = tvde.getTypeVariableNamed(typeVariable.getName()); -// if (resolvedTypeVariable == null) { -// resolvedTypeVariable = typeVariable.resolve(world); -// // SAUSAGES put this in once ITDs remember the complex shared type var stuff -// // throw new BCException("Could not locate type variable '"+typeVariable.getName()+"' during resolution, scope was: "+tvde); -// } -// TypeVariableReferenceType tvrt = new TypeVariableReferenceType(resolvedTypeVariable,world); -// tvrt.fixedUp = true; -// return tvrt; -// } public boolean isTypeVariableReference() { return true; |