diff options
Diffstat (limited to 'tests/bugs150')
-rw-r--r-- | tests/bugs150/pr105479/Driver.java | 10 | ||||
-rw-r--r-- | tests/bugs150/pr105479/ReturnTypeTest.aj | 13 | ||||
-rw-r--r-- | tests/bugs150/pr105479/ReturnTypeTester.java | 14 | ||||
-rw-r--r-- | tests/bugs150/pr105479part2.aj | 39 |
4 files changed, 76 insertions, 0 deletions
diff --git a/tests/bugs150/pr105479/Driver.java b/tests/bugs150/pr105479/Driver.java new file mode 100644 index 000000000..6bc4b1bfc --- /dev/null +++ b/tests/bugs150/pr105479/Driver.java @@ -0,0 +1,10 @@ +public class Driver { + + public static void main(String[] args) { + ReturnTypeTester rtt = new ReturnTypeTester(); + rtt.hashCode(); + System.out.println(rtt.getId()); + if (rtt.hashCode() != "id".hashCode()) throw new RuntimeException("dispatch failure"); + } + +}
\ No newline at end of file diff --git a/tests/bugs150/pr105479/ReturnTypeTest.aj b/tests/bugs150/pr105479/ReturnTypeTest.aj new file mode 100644 index 000000000..108c5319d --- /dev/null +++ b/tests/bugs150/pr105479/ReturnTypeTest.aj @@ -0,0 +1,13 @@ +public aspect ReturnTypeTest { + private interface Test { + Object getId(); + int hashCode(); + } + + public int Test.hashCode() { + System.out.println("in Test.hashCode()"); + return getId().hashCode(); + } + + declare parents : ReturnTypeTester implements Test; +}
\ No newline at end of file diff --git a/tests/bugs150/pr105479/ReturnTypeTester.java b/tests/bugs150/pr105479/ReturnTypeTester.java new file mode 100644 index 000000000..b26445e1c --- /dev/null +++ b/tests/bugs150/pr105479/ReturnTypeTester.java @@ -0,0 +1,14 @@ +import java.util.HashSet; +import java.util.Set; + +public class ReturnTypeTester { + static Set<ReturnTypeTester> set = new HashSet<ReturnTypeTester>(); + static { + ReturnTypeTester tester = new ReturnTypeTester(); + set.add(tester); + } + + public String getId() { + return "id"; + } +}
\ No newline at end of file diff --git a/tests/bugs150/pr105479part2.aj b/tests/bugs150/pr105479part2.aj new file mode 100644 index 000000000..0a2d39438 --- /dev/null +++ b/tests/bugs150/pr105479part2.aj @@ -0,0 +1,39 @@ +import java.util.HashSet; +import java.util.Set; + +aspect ReturnTypeTest { + private interface Test { + Object getId(); + int hashCode(); + } + + public int Test.hashCode() { + System.out.println("in Test.hashCode()"); + return getId().hashCode(); + } + + declare parents : ReturnTypeTester implements Test; +} + +class ReturnTypeTester { + static Set<ReturnTypeTester> set = new HashSet<ReturnTypeTester>(); + static { + ReturnTypeTester tester = new ReturnTypeTester(); + set.add(tester); + } + + public String getId() { + return "id"; + } +} + +public class pr105479part2 { + + public static void main(String[] args) { + ReturnTypeTester rtt = new ReturnTypeTester(); + rtt.hashCode(); + System.out.println(rtt.getId()); + if (rtt.hashCode() != "id".hashCode()) throw new RuntimeException("dispatch failure"); + } + +}
\ No newline at end of file |