Browse Source

test and fix for 154332: broken java.lang.<annotation> processing

tags/post_pr_153572
aclement 18 years ago
parent
commit
59123b0efb

+ 45
- 0
tests/bugs153/pr154332/Annot.java View File

import java.lang.annotation.*;

@Deprecated @Marker

public aspect Annot {


pointcut test() : within(@Marker *);// *);


declare warning: staticinitialization(@Deprecated *): "deprecated";

declare warning: staticinitialization(@Marker *): "marker";


public static void main(String argz[]) {

new Baz().foo();

}

}


@Deprecated @Marker

class Baz {

public void foo() {}

}


@Retention(RetentionPolicy.RUNTIME)

@interface Marker {


}

+ 1
- 0
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java View File

// public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");} // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
// public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); } // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
// public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");} // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
public void testIncorrectDeprecatedAnnotationProcessing_pr154332() { runTest("incorrect deprecated annotation processing");}
public void testPipeliningProblemWithAnnotationsDecp_pr153380_1() { runTest("pipelining decps");} public void testPipeliningProblemWithAnnotationsDecp_pr153380_1() { runTest("pipelining decps");}
public void testUnwantedPointcutWarning_pr148219() { runTest("unwanted warning for pointcut");} public void testUnwantedPointcutWarning_pr148219() { runTest("unwanted warning for pointcut");}
public void testDecpAndCflowadderMungerClash_pr152631() { runTest("decp and cflowadder munger clash");} public void testDecpAndCflowadderMungerClash_pr152631() { runTest("decp and cflowadder munger clash");}

+ 9
- 0
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml View File

</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="bugs153/pr154332" title="incorrect deprecated annotation processing">
<compile files="Annot.java" options="-1.5">
<message kind="warning" line="5" text="marker"/>
<message kind="warning" line="31" text="marker"/>
<message kind="warning" line="5" text="deprecated"/>
<message kind="warning" line="31" text="deprecated"/>
</compile>
</ajc-test>
<ajc-test dir="bugs153/pr148381" title="argNames and javac"> <ajc-test dir="bugs153/pr148381" title="argNames and javac">
<!--compile files="C.java" options="-1.5"/> <!--compile files="C.java" options="-1.5"/>
<compile files="A.java" options="-1.5"/--> <compile files="A.java" options="-1.5"/-->

+ 1
- 1
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java View File

annotations = new AnnotationX[annos.length]; annotations = new AnnotationX[annos.length];
for (int i = 0; i < annos.length; i++) { for (int i = 0; i < annos.length; i++) {
Annotation annotation = annos[i]; Annotation annotation = annos[i];
annotationTypes[i] = w.resolve(UnresolvedType.forName(annotation.getTypeName()));
annotationTypes[i] = w.resolve(UnresolvedType.forSignature(annotation.getTypeSignature()));
annotations[i] = new AnnotationX(annotation,w); annotations[i] = new AnnotationX(annotation,w);
} }
} }

Loading…
Cancel
Save