Browse Source

Fix 484941 - NPE AnnotationDiscoveryVisitor

tags/V1_8_8
Andy Clement 8 years ago
parent
commit
d902947407

+ 2
- 4
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java View File

@@ -646,10 +646,8 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
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

+ 10
- 0
tests/bugs188/484941/Test2.java View File

@@ -0,0 +1,10 @@
@ContextConfiguration
public class Test2 {
static class ContextConfiguration {
}
}
@interface ContextConfiguration {
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc188/Ajc188Tests.java View File

@@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
*/
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");
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc188/ajc188.xml View File

@@ -2,6 +2,10 @@

<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">

Loading…
Cancel
Save