--- /dev/null
+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
--- /dev/null
+
+public class ClassUtils {
+ public static Class guessGenericType(Class c) { return c; }
+}
--- /dev/null
+public interface Finder {
+}
--- /dev/null
+import java.util.List;
+public class H2Deployment {
+ public static H2Deployment instance() { return new H2Deployment(); }
+ List<String> getPartitionOrder(Class c) { return null;}
+}
--- /dev/null
+public interface Localized {}
--- /dev/null
+public interface LocalizedFinder<L extends Localized> extends Finder {
+}
--- /dev/null
+public class OnetElement<T> implements Partitioned,Localized {
+
+}
--- /dev/null
+public abstract class OnetFinder<S,P extends Partitioned<?>, L extends Localized, O extends OnetElement<?>> implements Finder,PartitionedFinder<O>,LocalizedFinder<O> {
+}
--- /dev/null
+public interface Partitioned<A> {
+ public String getPartitionId();
+}
+
+aspect PartitionedI {
+ public String Partitioned<A>.getPartitionId() {
+ return null;
+ }
+}
\ No newline at end of file
--- /dev/null
+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;}
+}
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"); }
<!-- 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>