diff options
author | aclement <aclement> | 2005-11-25 09:39:43 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-25 09:39:43 +0000 |
commit | 749461102f3d5b4d89cf0b1ad744be97e161951b (patch) | |
tree | 5b91f41d853445db16480f18ae476826a1a2d0c2 /weaver | |
parent | 9f5c8ea89b848be4f0d8a88bbc595dbd84d0846d (diff) | |
download | aspectj-749461102f3d5b4d89cf0b1ad744be97e161951b.tar.gz aspectj-749461102f3d5b4d89cf0b1ad744be97e161951b.zip |
fixes and improved tests for 117622
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java | 2 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/World.java | 20 | ||||
-rw-r--r-- | weaver/testsrc/BcweaverModuleTests15.java | 1 |
3 files changed, 21 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java index 4a3d6ebc8..dbc48f125 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java @@ -602,7 +602,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno public ResolvedMemberImpl parameterizedWith(UnresolvedType[] typeParameters,ResolvedType newDeclaringType, boolean isParameterized,List aliases) { if (//isParameterized && <-- might need this bit... !getDeclaringType().isGenericType()) { - throw new IllegalStateException("Can't ask to parameterize a member of a non-generic type"); + throw new IllegalStateException("Can't ask to parameterize a member of non-generic type: "+getDeclaringType()+" kind("+getDeclaringType().typeKind+")"); } TypeVariable[] typeVariables = getDeclaringType().getTypeVariables(); if (isParameterized && (typeVariables.length != typeParameters.length)) { diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index d5df39a19..31db56be9 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -23,7 +23,6 @@ import java.util.Set; import java.util.WeakHashMap; import org.aspectj.asm.IHierarchy; -import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; @@ -50,6 +49,7 @@ public abstract class World implements Dump.INode { /** The heart of the world, a map from type signatures to resolved types */ protected TypeMap typeMap = new TypeMap(); // Signature to ResolvedType + /** Calculator for working out aspect precedence */ private AspectPrecedenceCalculator precedenceCalculator; @@ -831,5 +831,23 @@ public abstract class World implements Dump.INode { } public void validateType(UnresolvedType type) { } + + // --- with java5 we can get into a recursive mess if we aren't careful when resolving types (*cough* java.lang.Enum) --- + + // --- this first map is for java15 delegates which may try and recursively access the same type variables. + // --- I would rather stash this against a reference type - but we don't guarantee referencetypes are unique for + // so we can't :( + private Map workInProgress1 = new HashMap(); + public TypeVariable[] getTypeVariablesCurrentlyBeingProcessed(Class baseClass) { + return (TypeVariable[])workInProgress1.get(baseClass); + } + public void recordTypeVariablesCurrentlyBeingProcessed(Class baseClass, TypeVariable[] typeVariables) { + workInProgress1.put(baseClass,typeVariables); + } + public void forgetTypeVariablesCurrentlyBeingProcessed(Class baseClass) { + workInProgress1.remove(baseClass); + } + + // --- } diff --git a/weaver/testsrc/BcweaverModuleTests15.java b/weaver/testsrc/BcweaverModuleTests15.java index 7523fb85b..55f118d3c 100644 --- a/weaver/testsrc/BcweaverModuleTests15.java +++ b/weaver/testsrc/BcweaverModuleTests15.java @@ -35,6 +35,7 @@ public class BcweaverModuleTests15 extends TestCase { suite.addTestSuite(WildTypePatternResolutionTestCase.class); if (LangUtil.is15VMOrGreater()) { TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.tools.Java15PointcutExpressionTest", false); + TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.TestJava5ReflectionBasedReferenceTypeDelegate", false); } return suite; } |