From bf51fe3e3fded74ae0ba424fdcf8f07394e665b5 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 4 Nov 2005 10:05:05 +0000 Subject: [PATCH] test and fix for pr115038 --- .../compiler/ast/InterTypeDeclaration.java | 6 ++- tests/bugs150/pr115038.aj | 5 +++ .../systemtest/ajc150/Ajc150Tests.java | 1 + .../org/aspectj/systemtest/ajc150/ajc150.xml | 40 ++++++------------- 4 files changed, 23 insertions(+), 29 deletions(-) create mode 100644 tests/bugs150/pr115038.aj diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java index 2de741e10..ef7ecdb7e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java @@ -358,7 +358,11 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { scope.problemReporter().signalError(sourceStart,sourceEnd, "Cannot make inter-type declarations on type variables, use an interface and declare parents"); this.ignoreFurtherInvestigation=true; - rb = new ProblemReferenceBinding(rb.compoundName,((TypeVariableBinding)rb).firstBound.enclosingType(),0); + ReferenceBinding closestMatch = null; + if (((TypeVariableBinding)rb).firstBound!=null) { + closestMatch = ((TypeVariableBinding)rb).firstBound.enclosingType(); + } + rb = new ProblemReferenceBinding(rb.compoundName,closestMatch,0); return; } diff --git a/tests/bugs150/pr115038.aj b/tests/bugs150/pr115038.aj new file mode 100644 index 000000000..46dc5a1d5 --- /dev/null +++ b/tests/bugs150/pr115038.aj @@ -0,0 +1,5 @@ +public abstract aspect pr115038 { + public boolean Observer.handle(Observable o, Event e) { + return true; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 92b29d6b8..8d8f2a837 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -52,6 +52,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { */ public void testUnboundFormal_pr112027() { runTest("unexpected error unboundFormalInPC");} + public void testNPEScopeSetup_pr115038() { runTest("NPE in ensureScopeSetup");} public void testCCEGenerics_pr113445() { runTest("Generics ClassCastException");} public void testMatthewsAspect_pr113947_1() { runTest("maws generic aspect - 1");} public void testMatthewsAspect_pr113947_2() { runTest("maws generic aspect - 2");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 4316e6ec8..b6b5e6bf8 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -10,13 +10,22 @@ - - + + + + + + + + + + + - + @@ -27,31 +36,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -- 2.39.5