aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs162
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 /tests/bugs162
parent0cb10e17780d422526c3d90235c8c5ae69070894 (diff)
downloadaspectj-ff47623a811fc7747e7ca9ea87e003457fb511ba.tar.gz
aspectj-ff47623a811fc7747e7ca9ea87e003457fb511ba.zip
242797: a testcase
Diffstat (limited to 'tests/bugs162')
-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
10 files changed, 71 insertions, 0 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;}
+}