aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5')
-rw-r--r--tests/java5/bridgeMethods/AspectX.aj17
-rw-r--r--tests/java5/generics/itds/bridgeMethods/pr91381_2.aj6
-rw-r--r--tests/java5/pertypewithin/H.java11
3 files changed, 12 insertions, 22 deletions
diff --git a/tests/java5/bridgeMethods/AspectX.aj b/tests/java5/bridgeMethods/AspectX.aj
index 12ecf12fc..8222e5e27 100644
--- a/tests/java5/bridgeMethods/AspectX.aj
+++ b/tests/java5/bridgeMethods/AspectX.aj
@@ -4,26 +4,15 @@ public aspect AspectX {
static Set matchedJps = new HashSet();
- before(): call(* Number.compareTo(..)) {
- matchedJps.add(new String("call() matched on "+thisJoinPoint.toString()));
- }
-
before(): execution(* Number.compareTo(..)) {
matchedJps.add(new String("execution() matched on "+thisJoinPoint.toString()));
}
-
+
public static void main(String []argv) {
Number n1 = new Number(5);
Number n2 = new Number(7);
- n1.compareTo(n2);
- n1.compareTo("abc"); // A Java5 compiler would *not* allow this, a call to a bridge method: error should be:
- /**
- AspectX.java:19: compareTo(Number) in Number cannot be applied to (java.lang.String)
- n1.compareTo("abc");
- ^
- 1 error
- */
-
+ n1.compareTo(n2);
+
Iterator i = matchedJps.iterator();
while (i.hasNext()) {
String s = (String)i.next();
diff --git a/tests/java5/generics/itds/bridgeMethods/pr91381_2.aj b/tests/java5/generics/itds/bridgeMethods/pr91381_2.aj
index 78abec976..f5fc9dcfa 100644
--- a/tests/java5/generics/itds/bridgeMethods/pr91381_2.aj
+++ b/tests/java5/generics/itds/bridgeMethods/pr91381_2.aj
@@ -1,5 +1,5 @@
public aspect pr91381_2 {
- public abstract Object A.foo();
+ public abstract Integer A.foo();
public static void main(String[] args) {
A a = new B();
@@ -8,9 +8,9 @@ public aspect pr91381_2 {
}
abstract class A {
-// abstract Object foo();
+// abstract Integer foo();
}
class B extends A {
- public Integer foo() { return new Integer(42); }
+ public Object foo() { return new Integer(42); }
}
diff --git a/tests/java5/pertypewithin/H.java b/tests/java5/pertypewithin/H.java
index fd23c3e57..8de290057 100644
--- a/tests/java5/pertypewithin/H.java
+++ b/tests/java5/pertypewithin/H.java
@@ -1,7 +1,8 @@
-public aspect H pertypewithin(G) {
-
+import org.aspectj.lang.annotation.SuppressAjWarnings;
- after(): call(* *(..)) {
- System.err.println("advice running");
- }
+public aspect H pertypewithin(G) {
+ @SuppressAjWarnings("adviceDidNotMatch")
+ after(): call(* *(..)) {
+ System.err.println("advice running");
+ }
}