summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-18 15:04:21 +0000
committeraclement <aclement>2005-11-18 15:04:21 +0000
commit99504bc120db0049fb441bb69b0f37a4a4f29cd9 (patch)
tree69d1eb8013c39a4b494eea598e27e295ff3b9488 /tests
parentb1a8c138a6af2d94747a66a03dc9249d9c5554ce (diff)
downloadaspectj-99504bc120db0049fb441bb69b0f37a4a4f29cd9.tar.gz
aspectj-99504bc120db0049fb441bb69b0f37a4a4f29cd9.zip
fixes for 115252 from Helen (xlint on incorrect annotation usage in signatures)
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml89
2 files changed, 96 insertions, 2 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 08209ca26..18b73fd8c 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -718,6 +718,15 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
*/
public void testNPEinWeavingAdaptor_pr116626() { runTest("NPE in WeavingAdaptor");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_Exact() {runTest("xlint message for improper exact annotation type");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_OR() {runTest("xlint message for improper annotation type inside OR");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_AND() {runTest("xlint message for improper annotation type inside AND");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_Return() {runTest("xlint message for improper annotated return type");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_Declaring() {runTest("xlint message for improper annotated declaring type");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_Parameter() {runTest("xlint message for improper annotated parameter type");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_Throws() {runTest("xlint message for improper annotated throws pattern");}
+ public void testXlintMessageForImproperAnnotationType_pr115252_MoreThanOne() {runTest("xlint message for more than one improper annotated parameter type");}
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index de7cf19d2..739897885 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -62,7 +62,16 @@
<ajc-test dir="bugs150/pr113066" title="possible static imports bug - 1">
<compile files="Consts.java,TestNPE.java" options="-1.5"/>
</ajc-test>
-
+
+ <ajc-test dir="bugs150" title="parameterized type and around advice">
+ <compile files="pr115250.aj" options="-1.5 -Xlint:ignore"/>
+ <run class="pr115250"/>
+ <!--stderr>
+ <line text="Advice running"/>
+ </stderr>
+ </run-->
+ </ajc-test>
+
<ajc-test dir="bugs150/pr115788" title="parser exception">
<compile files="AAA.java">
<message kind="warning" line="3" text="no match for this type name: Screen"/>
@@ -1024,6 +1033,79 @@
</compile>
</ajc-test>
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper exact annotation type">
+ <compile files="ExactAnnotationTypePattern.java" options="-1.5">
+ <message kind="warning" line="20" text="field blah"/>
+ <message kind="warning" line="28" text="does not match because annotation @TypeAnnotation has @Target{ElementType.TYPE} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="37" text="does not match because annotation @FieldAnnotation has @Target{ElementType.FIELD} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="46" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper annotation type inside OR">
+ <compile files="OrTypePattern.java" options="-1.5">
+ <message kind="warning" line="26" text="does not match because annotation @FieldAnnotation has @Target{ElementType.FIELD} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="31" text="does not match because annotation @TypeAnnotation has @Target{ElementType.TYPE} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="31" text="does not match because annotation @FieldAnnotation has @Target{ElementType.FIELD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper annotation type inside AND">
+ <compile files="AndTypePattern.java" options="-1.5">
+ <message kind="warning" line="23" text="does not match because annotation @FieldAnnotation has @Target{ElementType.FIELD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper annotated return type">
+ <compile files="AnnotationReturnType.java" options="-1.5">
+ <!-- warnings coming from matching pointcuts and corresponding declare warnings -->
+ <message kind="warning" line="12" text="(@TypeAnnotation *) *(..)"/>
+ <message kind="warning" line="12" text="(@(TypeAnnotation || MethodAnnotation) *) *(..)"/>
+ <!-- xlint warnings that were put in as part of fix for pr115252 -->
+ <message kind="warning" line="32" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="37" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper annotated declaring type">
+ <compile files="AnnotationDeclaringType.java" options="-1.5">
+ <!-- warning coming from matching pointcuts and corresponding declare warnings -->
+ <message kind="warning" line="13" text="* (@TypeAnnotation *).*(..)"/>
+ <!-- xlint warning that was put in as part of fix for pr115252 -->
+ <message kind="warning" line="27" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper annotated parameter type">
+ <compile files="AnnotationParameterType.java" options="-1.5">
+ <!-- warning coming from matching pointcuts and corresponding declare warnings -->
+ <message kind="warning" line="12" text="* *(@TypeAnnotation *)"/>
+ <!-- xlint warning that was put in as part of fix for pr115252 -->
+ <message kind="warning" line="31" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for improper annotated throws pattern">
+ <compile files="AnnotationThrowsPattern.java" options="-1.5">
+ <!-- warnings coming from matching pointcuts and corresponding declare warnings -->
+ <message kind="warning" line="12" text="(* *.*(..) throws (@TypeAnnotation *))"/>
+ <message kind="warning" line="12" text="* *.*(..) throws !(@MethodAnnotation *)"/>
+ <message kind="warning" line="14" text="(* *.*(..) throws !(@TypeAnnotation *))"/>
+ <message kind="warning" line="14" text="* *.*(..) throws !(@MethodAnnotation *)"/>
+ <!-- xlint warnings that were put in as part of fix for pr115252 -->
+ <message kind="warning" line="40" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="46" text="does not match because annotation @MethodAnnotation has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr115252" title="xlint message for more than one improper annotated parameter type">
+ <compile files="MoreThanOneTargetAnnotation.java" options="-1.5">
+ <!-- xlint warning that was put in as part of fix for pr115252 -->
+ <message kind="warning" line="28" text="does not match because annotation @MethodAndFieldAnnotation has @Target{ElementType.FIELD,ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="38" text="does not match because annotation @TypeAndMethodAnnotation has @Target{ElementType.METHOD,ElementType.TYPE} [Xlint:unmatchedTargetKind]"/>
+ </compile>
+ </ajc-test>
+
<!-- ============================================================================ -->
<!-- ============================================================================ -->
@@ -2870,7 +2952,10 @@
<compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
<message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
<message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
- </compile>
+ <!-- xlint warnings that were put in as part of fix for pr115252 -->
+ <message kind="warning" line="13" text="does not match because annotation @MethodColoring has @Target{ElementType.METHOD} [Xlint:unmatchedTargetKind]"/>
+ <message kind="warning" line="16" text="does not match because annotation @TypeColoring has @Target{ElementType.TYPE} [Xlint:unmatchedTargetKind]"/>
+ </compile>
</ajc-test>
<ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - source weaving">