Index: compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java,v retrieving revision 1.43 diff -u -r1.43 CompilationResult.java --- compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java 28 Jul 2005 16:33:23 -0000 1.43 +++ compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java 24 Aug 2005 14:18:02 -0000 @@ -125,29 +125,29 @@ } public void discardSuppressedWarnings() { - + if (this.suppressWarningsCount == 0) return; int removed = 0; nextProblem: for (int i = 0, length = this.problemCount; i < length; i++) { IProblem problem = this.problems[i]; - if (!problem.isWarning()) - continue nextProblem; - int start = problem.getSourceStart(); - int end = problem.getSourceEnd(); int problemID = problem.getID(); - nextSuppress: for (int j = 0, max = this.suppressWarningsCount; j < max; j++) { - long position = this.suppressWarningScopePositions[j]; - int startSuppress = (int) (position >>> 32); - int endSuppress = (int) position; - if (start < startSuppress) continue nextSuppress; - if (end > endSuppress) continue nextSuppress; - if ((ProblemReporter.getIrritant(problemID) & this.suppressWarningIrritants[j]) == 0) - continue nextSuppress; - // discard suppressed warning - removed++; - problems[i] = null; - if (problemsMap != null) problemsMap.remove(problem); - continue nextProblem; + if (problem.isWarning() || problemID == IProblem.NonExternalizedStringLiteral) { + int start = problem.getSourceStart(); + int end = problem.getSourceEnd(); + nextSuppress: for (int j = 0, max = this.suppressWarningsCount; j < max; j++) { + long position = this.suppressWarningScopePositions[j]; + int startSuppress = (int) (position >>> 32); + int endSuppress = (int) position; + if (start < startSuppress) continue nextSuppress; + if (end > endSuppress) continue nextSuppress; + if ((ProblemReporter.getIrritant(problemID) & this.suppressWarningIrritants[j]) == 0) + continue nextSuppress; + // discard suppressed warning + removed++; + problems[i] = null; + if (problemsMap != null) problemsMap.remove(problem); + continue nextProblem; + } } } if (removed > 0) { Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java,v retrieving revision 1.18 diff -u -r1.18 ProblemHandler.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java 6 May 2005 19:18:04 -0000 1.18 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java 24 Aug 2005 14:18:03 -0000 @@ -89,7 +89,8 @@ // if no reference context, we need to abort from the current compilation process if (referenceContext == null) { if ((severity & Error) != 0) { // non reportable error is fatal - IProblem problem = this.createProblem(null, problemId, problemArguments, messageArguments, severity, 0, 0, 0); + if (problemId == IProblem.UnusedImport) return; + IProblem problem = this.createProblem(null, problemId, problemArguments, messageArguments, severity, 0, 0, 0); throw new AbortCompilation(null, problem); } else { return; // ignore non reportable warning @@ -113,14 +114,21 @@ switch (severity & Error) { case Error : this.record(problem, unitResult, referenceContext); - referenceContext.tagAsHavingErrors(); - - // should abort ? - int abortLevel; - if ((abortLevel = - (this.policy.stopOnFirstError() ? AbortCompilation : severity & Abort)) != 0) { - - referenceContext.abort(abortLevel, problem); + // we might want to filter other non jls mandatory errors + switch(problemId) { + case IProblem.UnusedImport : + case IProblem.NonExternalizedStringLiteral : + break; + default: + referenceContext.tagAsHavingErrors(); + + // should abort ? + int abortLevel; + if ((abortLevel = + (this.policy.stopOnFirstError() ? AbortCompilation : severity & Abort)) != 0) { + + referenceContext.abort(abortLevel, problem); + } } break; case Warning :