From: aclement Date: Wed, 20 Aug 2008 20:47:14 +0000 (+0000) Subject: 145391: moved tests 152>162 and fixed them X-Git-Tag: V162DEV_M1~111 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fe2f8cdae5328a768922bebe387492d583901cad;p=aspectj.git 145391: moved tests 152>162 and fixed them --- diff --git a/tests/bugs152/pr145391/GenericType.java b/tests/bugs152/pr145391/GenericType.java deleted file mode 100644 index 897e1b729..000000000 --- a/tests/bugs152/pr145391/GenericType.java +++ /dev/null @@ -1,38 +0,0 @@ -public class GenericType { - - public GenericType(V value) {} - - public void foo() {} -// -// public void bar() {} - - protected V getValue() { - return null; - } - - public static void main(String[] args) { - new GenericType(null).foo(); - } - -} - -aspect SomeAspect { - before(GenericType t): call(* GenericType.foo()) && target(t) { - // Direct call to non-generic method works -// t.bar(); - // Indirect call to non-generic method works -// t.callNormalMethod(); - // Direct call to generic method works -// t.getValue(); - // Indirect call to generic method produces a NoSuchMethodError - t.callGenericMethod(); - } - -// private void GenericType.callNormalMethod() { -// bar(); -// } - - private void GenericType.callGenericMethod() { - getValue(); - } -} \ No newline at end of file diff --git a/tests/bugs152/pr145391/GenericType2.java b/tests/bugs152/pr145391/GenericType2.java deleted file mode 100644 index c5c6ab386..000000000 --- a/tests/bugs152/pr145391/GenericType2.java +++ /dev/null @@ -1,37 +0,0 @@ -public class GenericType2 { - - public GenericType2(V value) {} - - public void foo() {} -// -// public void bar() {} - - protected void getValue(V aV) { - } - - public static void main(String[] args) { - new GenericType2(null).foo(); - } - -} - -aspect SomeAspect { - before(GenericType2 t): call(* GenericType2.foo()) && target(t) { - // Direct call to non-generic method works -// t.bar(); - // Indirect call to non-generic method works -// t.callNormalMethod(); - // Direct call to generic method works -// t.getValue(); - // Indirect call to generic method produces a NoSuchMethodError - t.callGenericMethod(); - } - -// private void GenericType.callNormalMethod() { -// bar(); -// } - - private void GenericType2.callGenericMethod() { - getValue(new Integer(45)); - } -} \ No newline at end of file diff --git a/tests/bugs162/pr145391/B.class b/tests/bugs162/pr145391/B.class new file mode 100644 index 000000000..e91f70136 Binary files /dev/null and b/tests/bugs162/pr145391/B.class differ diff --git a/tests/bugs162/pr145391/GenericType.java b/tests/bugs162/pr145391/GenericType.java new file mode 100644 index 000000000..897e1b729 --- /dev/null +++ b/tests/bugs162/pr145391/GenericType.java @@ -0,0 +1,38 @@ +public class GenericType { + + public GenericType(V value) {} + + public void foo() {} +// +// public void bar() {} + + protected V getValue() { + return null; + } + + public static void main(String[] args) { + new GenericType(null).foo(); + } + +} + +aspect SomeAspect { + before(GenericType t): call(* GenericType.foo()) && target(t) { + // Direct call to non-generic method works +// t.bar(); + // Indirect call to non-generic method works +// t.callNormalMethod(); + // Direct call to generic method works +// t.getValue(); + // Indirect call to generic method produces a NoSuchMethodError + t.callGenericMethod(); + } + +// private void GenericType.callNormalMethod() { +// bar(); +// } + + private void GenericType.callGenericMethod() { + getValue(); + } +} \ No newline at end of file diff --git a/tests/bugs162/pr145391/GenericType2.java b/tests/bugs162/pr145391/GenericType2.java new file mode 100644 index 000000000..c99919e88 --- /dev/null +++ b/tests/bugs162/pr145391/GenericType2.java @@ -0,0 +1,25 @@ +public class GenericType2 { + + public GenericType2(V value) {} + + public void foo() {} + + protected void getValue(V aV) { + } + + public static void main(String[] args) { + new GenericType2(null).foo(); + } + +} + +aspect SomeAspect { + before(GenericType2 t): call(* GenericType2.foo()) && target(t) { + // Indirect call to generic method produces a NoSuchMethodError + t.callGenericMethod(); + } + + private void GenericType2.callGenericMethod() { + getValue(new Integer(45)); + } +} diff --git a/tests/bugs162/pr145391/x/GenericType2.java b/tests/bugs162/pr145391/x/GenericType2.java new file mode 100644 index 000000000..8d5fb565c --- /dev/null +++ b/tests/bugs162/pr145391/x/GenericType2.java @@ -0,0 +1,25 @@ +interface Bar {} + +class B implements Bar {} + +public class GenericType2 { + + public GenericType2(V value) {} + + protected void getValue(V aV) { + } + public void m() { + getValue(new B()); +} +} + +aspect SomeAspect { + before(GenericType2 t): call(* GenericType2.foo()) && target(t) { + // Indirect call to generic method produces a NoSuchMethodError + t.callGenericMethod(); + } + + private void GenericType2.callGenericMethod() { +// getValue(new Integer(45)); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index dc7d2aede..570a51343 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -27,8 +27,6 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // public void testSuperITDExplosion_pr134425() { runTest("super ITDs");} // public void testMisbehavingDeclareAnnotation_pr135865() { runTest("misbehaving declare annotation");} // public void testMisbehavingDeclareAnnotation_pr135865_2() { runTest("misbehaving declare annotation - 2");} -// public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");} -// public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");} // public void testClassCastForInvalidAnnotationValue_pr148537() { runTest("classcast annotation value");} diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index 3e7b08082..ecd73f106 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -78,10 +78,6 @@ - - - - @@ -105,11 +101,6 @@ - - - - - diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index 71cadc222..3f970fb2f 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -19,6 +19,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 + public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");} + public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");} public void testPublicPointcut_pr239539() { runTest("public pointcut"); } public void testGenericDecp_pr241047() { runTest("generic decp"); } public void testGenericDecp_pr241047_2() { runTest("generic decp - 2"); } diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index 5685bc9e5..7699dcc38 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -3,6 +3,17 @@ + + + + + + + + + + +