From 5c67166488df998bc208567c2fd27f21b52592c5 Mon Sep 17 00:00:00 2001 From: acolyer Date: Mon, 15 Mar 2004 22:38:03 +0000 Subject: fix for Bugzilla Bug 51322 Introduce Unknown Type to class causes Null pointer exception --- .../ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'org.aspectj.ajdt.core') diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java index d5bf73da6..ef69dc022 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java @@ -28,6 +28,7 @@ import org.eclipse.jdt.internal.compiler.flow.FlowInfo; import org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext; import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.parser.Parser; +import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; /** * An inter-type method declaration. @@ -101,6 +102,11 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { if (ignoreFurtherInvestigation) return null; binding = classScope.referenceContext.binding.resolveTypesFor(binding); + if (binding == null) { + // if binding is null, we failed to find a type used in the method params, this error + // has already been reported. + throw new AbortCompilation(); + } ResolvedMember sig = new ResolvedMember(Member.METHOD, EclipseFactory.fromBinding(onTypeBinding), declaredModifiers, EclipseFactory.fromBinding(binding.returnType), new String(declaredSelector), EclipseFactory.fromBindings(binding.parameters), -- cgit v1.2.3