summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/java5/generics/pointcuts/WithinCodeOverriding.aj23
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml14
2 files changed, 34 insertions, 3 deletions
diff --git a/tests/java5/generics/pointcuts/WithinCodeOverriding.aj b/tests/java5/generics/pointcuts/WithinCodeOverriding.aj
index ba7160968..005de7b2c 100644
--- a/tests/java5/generics/pointcuts/WithinCodeOverriding.aj
+++ b/tests/java5/generics/pointcuts/WithinCodeOverriding.aj
@@ -11,6 +11,21 @@ public aspect WithinCodeOverriding {
declare warning : withincode(void *.foo(Object))
: "wildcard declaring type match on erasure";
+
+ declare warning : withincode(void Generic.foo(Object))
+ : "base declaring type match on erasure";
+
+ declare warning : withincode(void SubGeneric.foo(Object))
+ : "not expecting any matches";
+
+ declare warning : withincode(void SubGeneric.foo(Number))
+ : "sub type match on erasure";
+
+ declare warning : withincode(void SubParameterized.foo(Object))
+ : "not expecting any matches";
+
+ declare warning : withincode(void SubParameterized.foo(String))
+ : "parameterized match on erasure";
}
class Generic<T> {
@@ -64,5 +79,13 @@ class ParameterizedI implements I<Double> {
public void bar(Double d) {
x = 1;
}
+
+ static aspect ParameterizedChecker {
+
+ declare warning : withincode(void I.bar(Object)) : "erasure match on base interface";
+ declare warning : withincode(void *.bar(Object)) : "wildcard match on erasure";
+ declare warning : withincode(void ParameterizedI.bar(Double)) : "parameterized match";
+ declare warning : withincode(void ParameterizedI.bar(Object)) : "no match expected";
+ }
}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 7bd0776aa..4d149a135 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -2815,9 +2815,17 @@
<ajc-test dir="java5/generics/pointcuts" title="withincode with overriding of inherited generic members">
<compile files="WithinCodeOverriding.aj" options="-1.5">
- <message kind="warning" line="22" text="wildcard declaring type match on erasure"/>
- <message kind="warning" line="35" text="wildcard declaring type match on erasure"/>
- <message kind="warning" line="48" text="wildcard declaring type match on erasure"/>
+ <message kind="warning" line="37" text="wildcard declaring type match on erasure"/>
+ <message kind="warning" line="50" text="wildcard declaring type match on erasure"/>
+ <message kind="warning" line="63" text="wildcard declaring type match on erasure"/>
+ <message kind="warning" line="37" text="base declaring type match on erasure"/>
+ <message kind="warning" line="50" text="base declaring type match on erasure"/>
+ <message kind="warning" line="63" text="base declaring type match on erasure"/>
+ <message kind="warning" line="50" text="sub type match on erasure"/>
+ <message kind="warning" line="63" text="parameterized match on erasure"/>
+ <message kind="warning" line="80" text="erasure match on base interface"/>
+ <message kind="warning" line="80" text="wildcard match on erasure"/>
+ <message kind="warning" line="80" text="parameterized match"/>
</compile>
</ajc-test>