diff options
author | aclement <aclement> | 2006-09-29 12:20:31 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-09-29 12:20:31 +0000 |
commit | ea4ff8adad2347557c25d6e10e114132b7491870 (patch) | |
tree | eb9d91a4745e12ecd49edfb6e355da0817808a91 | |
parent | c50a557d3c5de6868dee87e187bf1ae33636cae4 (diff) | |
download | aspectj-ea4ff8adad2347557c25d6e10e114132b7491870.tar.gz aspectj-ea4ff8adad2347557c25d6e10e114132b7491870.zip |
test and fix for 158624: generic types and arrays
4 files changed, 36 insertions, 2 deletions
diff --git a/tests/bugs153/pr158624/ValueChange.java b/tests/bugs153/pr158624/ValueChange.java new file mode 100644 index 000000000..3c1e4cafe --- /dev/null +++ b/tests/bugs153/pr158624/ValueChange.java @@ -0,0 +1,27 @@ +abstract class ValueChange<Q> { + public ValueChange(Q initValue) { } +} + +abstract class SyncValueGroup<T> extends ValueChange<T> { + public SyncValueGroup(T initValue) { + super(initValue); + } + public final synchronized void link(SyncValueGroup<T> ... list) { } +} + +class SyncValueTest { + class SyncInteger extends SyncValueGroup<Integer> { + public SyncInteger(int val) { + super(new Integer(val)); + } + } + private SyncInteger a = new SyncInteger(1); + public void testSyncValueGroup() { + a.link(a); + } +} + +aspect X { + before(): call(* *(..)) {} +} +
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 9e3da6829..ab1c5524b 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -31,6 +31,7 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");} // public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); } // public void testNegatedAnnotationMatchingProblem_pr153464() { runTest("negated annotation matching problem");} + public void testGenericArrays_pr158624() { runTest("generics and arrays"); } public void testMissingLineNumbersInStacktraceBefore_pr145442() { runTest("missing line numbers in stacktrace before");} public void testMissingLineNumbersInStacktraceBefore_pr145442_Binary() { runTest("missing line numbers in stacktrace before - binary");} public void testAnnotationStylePointcutNPE_pr158412() { runTest("annotation style pointcut npe"); } diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index f65a256a3..6c5b05e6e 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -5,6 +5,10 @@ <ajc-test dir="bugs153/pr148908" title="ensure getSourceSignature correct with static field"> <compile files="BadInterface.java" options="-emacssym"/> </ajc-test> + + <ajc-test dir="bugs153/pr158624" title="generics and arrays"> + <compile files="ValueChange.java" options="-1.5"/> + </ajc-test> <ajc-test dir="bugs153/pr153845" title="IllegalStateException at GenericSignatureParser.java"> <compile files="GenericType.java,Aspect.java,Aspect2.java,Interface.java" options="-1.5" outjar="blob.jar"/> diff --git a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java index f5bd991c7..d1bff9816 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java @@ -638,10 +638,11 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno } UnresolvedType parameterizedReturnType = parameterize(getGenericReturnType(),typeMap,isParameterized); - UnresolvedType[] parameterizedParameterTypes = new UnresolvedType[getGenericParameterTypes().length]; + UnresolvedType[] parameterizedParameterTypes = new UnresolvedType[getGenericParameterTypes().length]; + UnresolvedType[] genericParameterTypes = getGenericParameterTypes(); for (int i = 0; i < parameterizedParameterTypes.length; i++) { parameterizedParameterTypes[i] = - parameterize(getGenericParameterTypes()[i], typeMap,isParameterized); + parameterize(genericParameterTypes[i], typeMap,isParameterized); } ResolvedMemberImpl ret = new ResolvedMemberImpl( getKind(), @@ -677,6 +678,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno return (UnresolvedType) typeVariableMap.get(variableName); } else if (aType.isParameterizedType()) { if (inParameterizedType) { + if (aType instanceof UnresolvedType) aType= aType.resolve(((ResolvedType)getDeclaringType()).getWorld()); return aType.parameterize(typeVariableMap); } else { return aType.getRawType(); |