### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java,v retrieving revision 1.54 diff -u -r1.54 TestAll.java --- src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java 24 Jan 2006 10:50:06 -0000 1.54 +++ src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java 8 Feb 2006 09:46:30 -0000 @@ -55,6 +55,7 @@ standardTests.add(RuntimeTests.class); standardTests.add(DebugAttributeTest.class); standardTests.add(NullReferenceTest.class); + standardTests.add(CompilerInvocationTests.class); // add all javadoc tests for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i e.g: Element rootE| is completed to Element rootElement. +
  • Added API org.eclipse.jdt.core.CorrectionEngine#getAllWarningTokens() to + get all the valid warning tokens, which can be used into @SuppressWarnings + annotations. See bug + 126326 for details.
  • Problem Reports Fixed

    -120838 +126326 +[api] all supported SuppressWarning tokens +
    120838 typos in spec of ICodeAssist
    126227 default constructor not resolving for method-level classes Index: model/org/eclipse/jdt/core/CorrectionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java,v retrieving revision 1.49 diff -u -r1.49 CorrectionEngine.java --- model/org/eclipse/jdt/core/CorrectionEngine.java 28 Oct 2005 11:52:04 -0000 1.49 +++ model/org/eclipse/jdt/core/CorrectionEngine.java 8 Feb 2006 09:46:34 -0000 @@ -395,6 +395,26 @@ } } }; + + + /** + * Return an array of strings which contains one entry per warning token + * accepted by the @SuppressWarnings annotation. This array is + * neither null nor empty, it contains at least the String all. + * It should not be modified by the caller (please take a copy if modifications + * are needed).
    + * Note: The tokens returned are not necessarily standardized across Java + * compilers. If you were to use one of these tokens in a @SuppressWarnings + * annotation in the Java source code, the effects (if any) may vary from + * compiler to compiler. + * + * @return an array of strings which contains one entry per warning token + * accepted by the @SuppressWarnings annotation. + * @since 3.2 + */ + public static String[] getAllWarningTokens() { + return CompilerOptions.warningTokens; + } /** * Helper method for decoding problem marker attributes. Returns an array of String arguments Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.159 diff -u -r1.159 CompilerOptions.java --- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 6 Feb 2006 10:32:05 -0000 1.159 +++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 8 Feb 2006 09:46:34 -0000 @@ -910,6 +910,7 @@ } public static String warningTokenFromIrritant(long irritant) { + // keep in sync with warningTokens and warningTokenToIrritant int irritantInt = (int) irritant; if (irritantInt == irritant) { switch (irritantInt) { @@ -954,16 +955,38 @@ return "dep-ann"; //$NON-NLS-1$ case (int)(RawTypeReference >>> 32): return "unchecked"; //$NON-NLS-1$ - case (int) UnusedLabel: + case (int) (UnusedLabel >>> 32): return "unused"; //$NON-NLS-1$ case (int) (DiscouragedReference >>> 32) : case (int) (ForbiddenReference >>> 32) : return "restriction"; //$NON-NLS-1$ + case (int) (NullReference >>> 32) : + return "null"; //$NON-NLS-1$ } } return null; } + // keep in sync with warningTokenToIrritant and warningTokenFromIrritant + public final static String[] warningTokens = { + "all", //$NON-NLS-1$ + "boxing", //$NON-NLS-1$ + "dep-ann", //$NON-NLS-1$ + "deprecation", //$NON-NLS-1$ + "finally", //$NON-NLS-1$ + "hiding", //$NON-NLS-1$ + "incomplete-switch", //$NON-NLS-1$ + "nls", //$NON-NLS-1$ + "null", //$NON-NLS-1$ + "restriction", //$NON-NLS-1$ + "serial", //$NON-NLS-1$ + "static-access", //$NON-NLS-1$ + "synthetic-access", //$NON-NLS-1$ + "unchecked", //$NON-NLS-1$ + "unqualified-field-access", //$NON-NLS-1$ + "unused", //$NON-NLS-1$ + }; public static long warningTokenToIrritant(String warningToken) { + // keep in sync with warningTokens and warningTokenFromIrritant if (warningToken == null || warningToken.length() == 0) return 0; switch (warningToken.charAt(0)) { case 'a' :