return true; // code style
} else if (declaration.annotations != null) { // check for annotation style
for (int index = 0; index < declaration.annotations.length; index++) {
- TypeDeclaration
- .resolveAnnotations(declaration.staticInitializerScope, declaration.annotations, declaration.binding); // force
- // annotation
- // resolution
+ // Cause annotation resolution
+ declaration.binding.getAnnotationTagBits();
Annotation a = declaration.annotations[index];
if (a.resolvedType == null) {
continue; // another problem is being reported, so don't crash here
--- /dev/null
+\r
+@ContextConfiguration\r
+public class Test2 {\r
+ static class ContextConfiguration {\r
+\r
+ }\r
+}\r
+\r
+@interface ContextConfiguration {\r
+}\r
*/
public class Ajc188Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testAnnotationDiscoveryNpe() throws Exception {
+ runTest("annotation discovery npe");
+ }
+
public void testDefaultMethodsWithXnoInline() throws Exception {
runTest("default methods 1");
}
<suite>
+<ajc-test dir="bugs188/484941" title="annotation discovery npe">
+<compile files="Test2.java" options="-1.8 -XnoInline"/>
+</ajc-test>
+
<ajc-test dir="bugs188/defaultmethods" title="default methods 1">
<compile files="Code.java" options="-1.8 -XnoInline"/>
<run class="Code">