import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
/**
* @author Jim Hugunin
if (binding == null || binding.qualifiedSourceName() == null) {
return ResolvedTypeX.MISSING;
}
+ // first piece of generics support!
+ if (binding instanceof TypeVariableBinding) {
+ // this is a type variable...
+ TypeVariableBinding tvb = (TypeVariableBinding) binding;
+ return TypeX.forName(getName(tvb.firstBound)); // XXX needs more investigation as to whether this is correct in all cases
+ }
return TypeX.forName(getName(binding));
}
--- /dev/null
+import java.util.*;
+
+public aspect ITDReturningParameterizedType {
+
+ private List<String> C.strings = new ArrayList<String>();
+
+ public List<String> C.getStrings() {
+ return strings;
+ }
+
+
+ public static void main(String[] args) {
+ C c = new C();
+ List<String> ss = c.getStrings();
+ }
+}
+
+
+class C {
+
+}
\ No newline at end of file
runTest("dirs on aspectpath");
}
+ public void testIntroSample() {
+ runTest("introduction sample");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
--- /dev/null
+package org.aspectj.systemtest.ajc150;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class GenericsTests extends XMLBasedAjcTestCase {
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(GenericsTests.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
+ }
+
+ public void testITDReturningParameterizedType() {
+ runTest("ITD with parameterized type");
+ }
+}
<ajc-test dir="bugs150" title="bad asm for enums" vm="1.5">
<compile files="Rainbow.java" options="-emacssym,-1.5"/>
</ajc-test>
+
+ <ajc-test dir="../docs/dist/doc/examples/introduction" title="introduction sample" vm="1.5">
+ <compile files="CloneablePoint.java,ComparablePoint.java,HashablePoint.java,Point.java" options="-1.5"/>
+ </ajc-test>
<ajc-test dir="java5/varargs" title="varargs in constructor sig" vm="1.5">
<compile files="Pr88652.aj" options="-1.5">
</compile>
</ajc-test>
+ <!-- Generics tests -->
+
+ <ajc-test dir="java5/generics" title="ITD with parameterized type" vm="1.5">
+ <compile files="ITDReturningParameterizedType.aj" options="-1.5"/>
+ <run class="ITDReturningParameterizedType"/>
+ </ajc-test>
+
</suite>
\ No newline at end of file