aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/src/org
diff options
context:
space:
mode:
authoraclement <aclement>2006-05-31 11:51:21 +0000
committeraclement <aclement>2006-05-31 11:51:21 +0000
commitd072fd16eccdca9df642585297804902f68e16cc (patch)
tree2b2b61ee6bc53a420c7ffc1ccd3371252b9b07f3 /org.aspectj.ajdt.core/src/org
parent7e86ccf44daa9140a6576e03583c7be7aaa094ff (diff)
downloadaspectj-d072fd16eccdca9df642585297804902f68e16cc.tar.gz
aspectj-d072fd16eccdca9df642585297804902f68e16cc.zip
test and fix for 129282
Diffstat (limited to 'org.aspectj.ajdt.core/src/org')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java1
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java41
2 files changed, 39 insertions, 3 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index 3d49c7e77..c4d5fd333 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -672,6 +672,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
bcelWorld.setXlazyTjp(buildConfig.isXlazyTjp());
bcelWorld.setXHasMemberSupportEnabled(buildConfig.isXHasMemberEnabled());
bcelWorld.setPinpointMode(buildConfig.isXdevPinpoint());
+ bcelWorld.setErrorAndWarningThreshold(buildConfig.getOptions().errorThreshold,buildConfig.getOptions().warningThreshold);
BcelWeaver bcelWeaver = new BcelWeaver(bcelWorld);
state.setWorld(bcelWorld);
state.setWeaver(bcelWeaver);
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 5485397a0..6c6e362f2 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
@@ -18,13 +18,16 @@ import java.io.File;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceLocation;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.SourceLocation;
-import org.aspectj.weaver.IHasPosition;
-import org.aspectj.weaver.ISourceContext;
+import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult.ProblemsForRemovalFilter;
+import org.aspectj.weaver.IEclipseSourceContext;
+import org.aspectj.weaver.IHasPosition;
+import org.aspectj.weaver.Member;
-public class EclipseSourceContext implements ISourceContext {
+public class EclipseSourceContext implements IEclipseSourceContext {
CompilationResult result;
int offset = 0;
@@ -73,4 +76,36 @@ public class EclipseSourceContext implements ISourceContext {
result=null;
}
+ 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);
+ }
+ }
+ }
+ }
+
+ private class UnusedDeclaredThrownExceptionFilter implements ProblemsForRemovalFilter {
+ private IProblem problemToRemove;
+
+ public UnusedDeclaredThrownExceptionFilter(IProblem p) {
+ problemToRemove = p;
+ }
+
+ public boolean accept(IProblem p) {
+ if (p.equals(problemToRemove)) {
+ return true;
+ }
+ return false;
+ }
+
+ }
}