aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-31 12:25:47 +0000
committeracolyer <acolyer>2005-08-31 12:25:47 +0000
commit014c5c64b44c697946c4c7c21c18f273ab0e913b (patch)
tree97b5b67fd30eaef4838ebae5b187f9d93469d980
parent2c9ea11c6d7354d3e44aa59531964a15b4486519 (diff)
downloadaspectj-014c5c64b44c697946c4c7c21c18f273ab0e913b.tar.gz
aspectj-014c5c64b44c697946c4c7c21c18f273ab0e913b.zip
tests for pr108454, 'Waving' crash on a 1.5 java generics?
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java15
-rw-r--r--tests/bugs150/pr108054/ASequence.java12
-rw-r--r--tests/bugs150/pr108054/ICounter.java3
-rw-r--r--tests/bugs150/pr108054/ISequence.java3
-rw-r--r--tests/bugs150/pr108054/pr108054.aj12
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml7
7 files changed, 52 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
index 576229bbc..07dc47a95 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
@@ -228,15 +228,24 @@ public class EclipseFactory {
arguments[i] = fromBinding(ptb.arguments[i]);
}
}
- ResolvedType baseType = UnresolvedType.forName(getName(binding)).resolve(getWorld());
+
+ String baseTypeSignature = null;
+
+ ResolvedType baseType = getWorld().resolve(UnresolvedType.forName(getName(binding)),true);
+ if (baseType != ResolvedType.MISSING) {
+ // can legitimately be missing if a bound refers to a type we haven't added to the world yet...
+ if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType();
+ baseTypeSignature = baseType.getErasureSignature();
+ } else {
+ baseTypeSignature = UnresolvedType.forName(getName(binding)).getSignature();
+ }
// Create an unresolved parameterized type. We can't create a resolved one as the
// act of resolution here may cause recursion problems since the parameters may
// be type variables that we haven't fixed up yet.
- if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType();
if (arguments==null) arguments=new UnresolvedType[0];
String parameterizedSig = ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER+CharOperation.charToString(binding.genericTypeSignature()).substring(1);
- return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseType.getErasureSignature(),arguments);
+ return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseTypeSignature,arguments);
}
// Convert the source type binding for a generic type into a generic UnresolvedType
diff --git a/tests/bugs150/pr108054/ASequence.java b/tests/bugs150/pr108054/ASequence.java
new file mode 100644
index 000000000..eee773a0b
--- /dev/null
+++ b/tests/bugs150/pr108054/ASequence.java
@@ -0,0 +1,12 @@
+public abstract class ASequence <V, T extends ICounter<V> >
+ implements ISequence<V> {
+
+}
+
+aspect EnsureTypesUnpackedInWeaver {
+
+ before() : staticinitialization(*) && !within(EnsureTypesUnpackedInWeaver) {
+ System.out.println("hi");
+ }
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr108054/ICounter.java b/tests/bugs150/pr108054/ICounter.java
new file mode 100644
index 000000000..f22eba407
--- /dev/null
+++ b/tests/bugs150/pr108054/ICounter.java
@@ -0,0 +1,3 @@
+public interface ICounter<T> {
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr108054/ISequence.java b/tests/bugs150/pr108054/ISequence.java
new file mode 100644
index 000000000..2b327cd0b
--- /dev/null
+++ b/tests/bugs150/pr108054/ISequence.java
@@ -0,0 +1,3 @@
+public interface ISequence<V> {
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr108054/pr108054.aj b/tests/bugs150/pr108054/pr108054.aj
new file mode 100644
index 000000000..4d136beff
--- /dev/null
+++ b/tests/bugs150/pr108054/pr108054.aj
@@ -0,0 +1,12 @@
+interface ISequence<V> {
+
+}
+
+interface ICounter<T> {
+
+}
+
+abstract class ASequence <V, T extends ICounter<V> >
+ implements ISequence<V> {
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 4413b9a26..afe055400 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -309,6 +309,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testFieldAccessInsideITDM() {
runTest("itd field access inside itd method");
}
+
+ public void testTypeVarWithTypeVarBound() {
+ runTest("type variable with type variable bound");
+ }
// helper methods.....
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 0a4929d11..201b95688 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -362,7 +362,12 @@
<compile files="pr108377.aj"/>
<run class="pr108377"/>
</ajc-test>
-
+
+ <ajc-test dir="bugs150/pr108054" pr="108054" title="type variable with type variable bound">
+ <compile files="pr108054.aj" options="-1.5"/>
+ <compile files="ISequence.java,ICounter.java,ASequence.java" options="-1.5"/>
+ </ajc-test>
+
<!-- ============================================================================ -->
<!-- ============================================================================ -->