summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-08-13 16:12:26 +0000
committeraclement <aclement>2008-08-13 16:12:26 +0000
commitff47623a811fc7747e7ca9ea87e003457fb511ba (patch)
treeaf315d18169b0523fd9cb66aea0cda9435f94d5e
parent0cb10e17780d422526c3d90235c8c5ae69070894 (diff)
downloadaspectj-ff47623a811fc7747e7ca9ea87e003457fb511ba.tar.gz
aspectj-ff47623a811fc7747e7ca9ea87e003457fb511ba.zip
242797: a testcase
-rw-r--r--tests/bugs162/pr242797/case1/CMEFinder.java9
-rw-r--r--tests/bugs162/pr242797/case1/ClassUtils.java4
-rw-r--r--tests/bugs162/pr242797/case1/Finder.java2
-rw-r--r--tests/bugs162/pr242797/case1/H2Deployment.java5
-rw-r--r--tests/bugs162/pr242797/case1/Localized.java1
-rw-r--r--tests/bugs162/pr242797/case1/LocalizedFinder.java2
-rw-r--r--tests/bugs162/pr242797/case1/OnetElement.java3
-rw-r--r--tests/bugs162/pr242797/case1/OnetFinder.java2
-rw-r--r--tests/bugs162/pr242797/case1/Partitioned.java9
-rw-r--r--tests/bugs162/pr242797/case1/PartitionedFinder.java34
-rw-r--r--tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc162/ajc162.xml9
12 files changed, 79 insertions, 2 deletions
diff --git a/tests/bugs162/pr242797/case1/CMEFinder.java b/tests/bugs162/pr242797/case1/CMEFinder.java
new file mode 100644
index 000000000..a7bb5f4b1
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/CMEFinder.java
@@ -0,0 +1,9 @@
+import java.util.List;
+
+public class CMEFinder extends OnetFinder<CMEStub, PartitionedCME, LocalizedCME, ContentModelElement>{
+}
+
+class CMEStub {}
+class PartitionedCME implements Partitioned{ }
+class LocalizedCME implements Localized {}
+class ContentModelElement extends OnetElement {} \ No newline at end of file
diff --git a/tests/bugs162/pr242797/case1/ClassUtils.java b/tests/bugs162/pr242797/case1/ClassUtils.java
new file mode 100644
index 000000000..496255d5b
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/ClassUtils.java
@@ -0,0 +1,4 @@
+
+public class ClassUtils {
+ public static Class guessGenericType(Class c) { return c; }
+}
diff --git a/tests/bugs162/pr242797/case1/Finder.java b/tests/bugs162/pr242797/case1/Finder.java
new file mode 100644
index 000000000..68021e550
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/Finder.java
@@ -0,0 +1,2 @@
+public interface Finder {
+}
diff --git a/tests/bugs162/pr242797/case1/H2Deployment.java b/tests/bugs162/pr242797/case1/H2Deployment.java
new file mode 100644
index 000000000..6b80df488
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/H2Deployment.java
@@ -0,0 +1,5 @@
+import java.util.List;
+public class H2Deployment {
+ public static H2Deployment instance() { return new H2Deployment(); }
+ List<String> getPartitionOrder(Class c) { return null;}
+}
diff --git a/tests/bugs162/pr242797/case1/Localized.java b/tests/bugs162/pr242797/case1/Localized.java
new file mode 100644
index 000000000..ba6076cbd
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/Localized.java
@@ -0,0 +1 @@
+public interface Localized {}
diff --git a/tests/bugs162/pr242797/case1/LocalizedFinder.java b/tests/bugs162/pr242797/case1/LocalizedFinder.java
new file mode 100644
index 000000000..983cbd9a8
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/LocalizedFinder.java
@@ -0,0 +1,2 @@
+public interface LocalizedFinder<L extends Localized> extends Finder {
+}
diff --git a/tests/bugs162/pr242797/case1/OnetElement.java b/tests/bugs162/pr242797/case1/OnetElement.java
new file mode 100644
index 000000000..7091a5461
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/OnetElement.java
@@ -0,0 +1,3 @@
+public class OnetElement<T> implements Partitioned,Localized {
+
+}
diff --git a/tests/bugs162/pr242797/case1/OnetFinder.java b/tests/bugs162/pr242797/case1/OnetFinder.java
new file mode 100644
index 000000000..ddcbba97b
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/OnetFinder.java
@@ -0,0 +1,2 @@
+public abstract class OnetFinder<S,P extends Partitioned<?>, L extends Localized, O extends OnetElement<?>> implements Finder,PartitionedFinder<O>,LocalizedFinder<O> {
+}
diff --git a/tests/bugs162/pr242797/case1/Partitioned.java b/tests/bugs162/pr242797/case1/Partitioned.java
new file mode 100644
index 000000000..fba526c62
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/Partitioned.java
@@ -0,0 +1,9 @@
+public interface Partitioned<A> {
+ public String getPartitionId();
+}
+
+aspect PartitionedI {
+ public String Partitioned<A>.getPartitionId() {
+ return null;
+ }
+} \ No newline at end of file
diff --git a/tests/bugs162/pr242797/case1/PartitionedFinder.java b/tests/bugs162/pr242797/case1/PartitionedFinder.java
new file mode 100644
index 000000000..02ad16bcb
--- /dev/null
+++ b/tests/bugs162/pr242797/case1/PartitionedFinder.java
@@ -0,0 +1,34 @@
+import java.util.List;
+
+public interface PartitionedFinder<P extends Partitioned<?>> extends Finder {
+// public <T extends Localized> List<T> bestLanguageMatch(List<T> list, List<String> languageOrder);
+ public <T extends Partitioned<?>> List<T> bestPartitionMatch(List<T> list, List<String> partitionOrder);
+}
+
+aspect PartitionedFinderAspect {
+
+ public Class<? extends P> PartitionedFinder<P>.getPartitionedType(){
+ return ClassUtils.guessGenericType(getClass());
+ }
+
+ public List<String> PartitionedFinder<P>.getPartitionOrder(){
+ return H2Deployment.instance().getPartitionOrder(getPartitionedType());
+ }
+
+ public <T extends Partitioned<?>> List<T> PartitionedFinder<P>.bestPartitionMatch(List<T> list, List<String> partitionOrder){
+ return new OrderComparator<T, String>(partitionOrder){
+
+ @Override
+ public String getOrdering(T partitioned){
+ return partitioned.getPartitionId();
+ }
+
+ }.bestMatch(list);
+ }
+}
+
+class OrderComparator<A,B> {
+ OrderComparator(List<String> ls) {}
+ public String getOrdering(A a) {return "";}
+ List bestMatch(List l) {return null;}
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
index 1b278cb6c..0871d5b86 100644
--- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
@@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.2
+ public void testGenericItds_pr242797_1() { runTest("generic itds - 1"); }
// public void testParamAnnosPipelining_pr241847() { runTest("param annos pipelining");}
// public void testParamAnnoInner_pr241861() { runTest("param annotation inner class"); }
public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
index dc9d4bf8c..1fc19bbbf 100644
--- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
+++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
@@ -3,13 +3,18 @@
<!-- AspectJ v1.6.2 Tests -->
<suite>
- <ajc-test dir="bugs162/pr241847" title="param annos pipelining">
+ <ajc-test dir="bugs162/pr242797/case1" title="generic itds - 1">
+ <compile files="ClassUtils.java CMEFinder.java Finder.java H2Deployment.java Localized.java LocalizedFinder.java OnetElement.java OnetFinder.java Partitioned.java PartitionedFinder.java" options="-1.5">
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs162/pr241847" title="param annos pipelining">
<compile files="Asp.aj Ann.java CC.java II.java LongLong.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'method-execution(void LongLong.m1(java.lang.String))' in Type 'LongLong' (LongLong.java:2) advised by before advice from 'Asp' (Asp.aj:5)"/>
<message kind="weave" line="3"/>
</compile>
</ajc-test>
-
+
<ajc-test dir="bugs162/pr239441" title="annotation decp">
<compile files="Test3.java SampleAspect.java" options="-1.5 -showWeaveInfo -XhasMember">
</compile>