aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-07-27 09:27:55 +0000
committeraclement <aclement>2006-07-27 09:27:55 +0000
commit54f7bb4f25792e717eadf21421c81ae1dc8e0718 (patch)
tree8c7f43b7f4ab8ad910d81f05e8b873083561d91f
parentc4e60095c3ff2987b4605803c8f639ad2d3ef4c2 (diff)
downloadaspectj-54f7bb4f25792e717eadf21421c81ae1dc8e0718.tar.gz
aspectj-54f7bb4f25792e717eadf21421c81ae1dc8e0718.zip
fix for Bug 151845: NPE while building
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java20
1 files 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);
+ }
}
}
}