Browse Source

test for 136393: NPE on funky ITD ctor

tags/V1_5_2rc1
aclement 18 years ago
parent
commit
2ed766cd9f

+ 3
- 3
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java View File

@@ -180,7 +180,8 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration {
MethodBinding explicitConstructor = null;
if (explicitConstructorCall != null) {
explicitConstructor = explicitConstructorCall.binding;
if (explicitConstructor.alwaysNeedsAccessMethod()) {
// If it is null then we are going to report something else is wrong with this code!
if (explicitConstructor!=null && explicitConstructor.alwaysNeedsAccessMethod()) {
explicitConstructor = explicitConstructor.getAccessMethod(true);
}
}
@@ -305,13 +306,12 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration {
private AjAttribute makeAttribute(EclipseFactory world) {
if (explicitConstructorCall != null && !(explicitConstructorCall.binding instanceof ProblemMethodBinding)) {
if (explicitConstructorCall != null && (explicitConstructorCall.binding!=null) && !(explicitConstructorCall.binding instanceof ProblemMethodBinding)) {
MethodBinding explicitConstructor = explicitConstructorCall.binding;
if (explicitConstructor.alwaysNeedsAccessMethod()) {
explicitConstructor = explicitConstructor.getAccessMethod(true);
}
((NewConstructorTypeMunger)munger).setExplicitConstructor(
world.makeResolvedMember(explicitConstructor));
} else {

+ 2
- 1
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java View File

@@ -46,7 +46,8 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
//public void testAtAspectWithReferencePCPerClause_pr138220() { runTest("@Aspect with reference pointcut in perclause");}

public void testJarChecking_pr137235_1() { runTest("directory with .jar extension: source and outjar"); }
public void testJarChecking_pr137235_2() { runTest("directory with .jar extension"); }
public void testJarChecking_pr137235_2() { runTest("directory with .jar extension"); }
public void testMakePreMethodNPE_pr136393() { runTest("NPE in makePreMethod");}
/////////////////////////////////////////
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc152Tests.class);

Loading…
Cancel
Save