diff options
author | aclement <aclement> | 2006-06-07 08:19:14 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-06-07 08:19:14 +0000 |
commit | e769745da4ba14cb68c220b33f0232a920eeafae (patch) | |
tree | 02ee827b4fe0ef4ec86236c5905936a458dd14c2 /tests/bugs152/pr145391 | |
parent | 3e0650d8a084248c4eb93f22cd8abfdabe6ba2a8 (diff) | |
download | aspectj-e769745da4ba14cb68c220b33f0232a920eeafae.tar.gz aspectj-e769745da4ba14cb68c220b33f0232a920eeafae.zip |
testcode for 145391,145693
Diffstat (limited to 'tests/bugs152/pr145391')
-rw-r--r-- | tests/bugs152/pr145391/GenericType.java | 38 | ||||
-rw-r--r-- | tests/bugs152/pr145391/GenericType2.java | 37 |
2 files changed, 75 insertions, 0 deletions
diff --git a/tests/bugs152/pr145391/GenericType.java b/tests/bugs152/pr145391/GenericType.java new file mode 100644 index 000000000..897e1b729 --- /dev/null +++ b/tests/bugs152/pr145391/GenericType.java @@ -0,0 +1,38 @@ +public class GenericType<V extends Integer> { + + public GenericType(V value) {} + + public void foo() {} +// +// public void bar() {} + + protected V getValue() { + return null; + } + + public static void main(String[] args) { + new GenericType<Integer>(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 new file mode 100644 index 000000000..c5c6ab386 --- /dev/null +++ b/tests/bugs152/pr145391/GenericType2.java @@ -0,0 +1,37 @@ +public class GenericType2<V extends Integer> { + + public GenericType2(V value) {} + + public void foo() {} +// +// public void bar() {} + + protected void getValue(V aV) { + } + + public static void main(String[] args) { + new GenericType2<Integer>(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 |