]> source.dussan.org Git - aspectj.git/commitdiff
fix for Bug 151845: NPE while building
authoraclement <aclement>
Thu, 27 Jul 2006 09:27:55 +0000 (09:27 +0000)
committeraclement <aclement>
Thu, 27 Jul 2006 09:27:55 +0000 (09:27 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java

index a722a2e40e1f63a37ba018a492f0c7ec4ec47ac9..f92d37877d7e9254041f4c7941c1b728e43e3dad 100644 (file)
@@ -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);  
+                                       }
                                }
                        }
                }