From 54f7bb4f25792e717eadf21421c81ae1dc8e0718 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 27 Jul 2006 09:27:55 +0000 Subject: [PATCH] fix for Bug 151845: NPE while building --- .../core/builder/EclipseSourceContext.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java index a722a2e40..f92d37877 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java @@ -79,15 +79,17 @@ public class EclipseSourceContext implements IEclipseSourceContext { public void removeUnnecessaryProblems(Member member, int problemLineNumber) { if (result == null) return; IProblem[] probs = result.getProblems(); - for (int i = 0; i < probs.length; i++) { - IProblem problem = probs[i]; - if (problem == null) continue; - if (problem.getID() == IProblem.UnusedMethodDeclaredThrownException - || problem.getID() == IProblem.UnusedConstructorDeclaredThrownException) { - if (problem.getSourceLineNumber() == problemLineNumber) { - UnusedDeclaredThrownExceptionFilter filter = - new UnusedDeclaredThrownExceptionFilter(problem); - result.removeProblems(filter); + if (probs!=null) { + for (int i = 0; i < probs.length; i++) { + IProblem problem = probs[i]; + if (problem == null) continue; + if (problem.getID() == IProblem.UnusedMethodDeclaredThrownException + || problem.getID() == IProblem.UnusedConstructorDeclaredThrownException) { + if (problem.getSourceLineNumber() == problemLineNumber) { + UnusedDeclaredThrownExceptionFilter filter = + new UnusedDeclaredThrownExceptionFilter(problem); + result.removeProblems(filter); + } } } } -- 2.39.5