Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 26404 Details for
Bug 107814
@SuppressWarnings("unused") requires additional //$NON-NLS-1$
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_107814.txt (text/plain), 4.42 KB, created by
Olivier Thomann
on 2005-08-24 10:20:06 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-08-24 10:20:06 EDT
Size:
4.42 KB
patch
obsolete
>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 :
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 107814
: 26404