From 047173e8683e4ab9004ae2151a8abad886d1b84b Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 2 Sep 2005 10:40:19 +0000 Subject: tests and fix for pr99136 (dup adviceDidNotMatch warnings), plus extended testing for pr105479 --- tests/bugs150/pr105479/Driver.java | 10 ++++++++++ tests/bugs150/pr105479/ReturnTypeTest.aj | 13 +++++++++++++ tests/bugs150/pr105479/ReturnTypeTester.java | 14 ++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 tests/bugs150/pr105479/Driver.java create mode 100644 tests/bugs150/pr105479/ReturnTypeTest.aj create mode 100644 tests/bugs150/pr105479/ReturnTypeTester.java (limited to 'tests/bugs150/pr105479') 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 set = new HashSet(); + static { + ReturnTypeTester tester = new ReturnTypeTester(); + set.add(tester); + } + + public String getId() { + return "id"; + } +} \ No newline at end of file -- cgit v1.2.3