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 188778 Details for
Bug 179566
[compiler] Support of @SuppressWarnings for JavaDoc Warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression tests
patch_179566.txt (text/plain), 7.07 KB, created by
Olivier Thomann
on 2011-02-11 09:36:52 EST
(
hide
)
Description:
Proposed fix + regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-02-11 09:36:52 EST
Size:
7.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.242 >diff -u -r1.242 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 8 Feb 2011 05:16:20 -0000 1.242 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 11 Feb 2011 14:36:15 -0000 >@@ -777,6 +777,10 @@ > case MethodCanBeStatic : > case MethodCanBePotentiallyStatic : > return "static-method"; //$NON-NLS-1$ >+ case InvalidJavadoc : >+ case MissingJavadocComments : >+ case MissingJavadocTags: >+ return "javadoc"; //$NON-NLS-1$ > } > return null; > } >@@ -817,6 +821,10 @@ > if ("incomplete-switch".equals(warningToken)) //$NON-NLS-1$ > return IrritantSet.INCOMPLETE_SWITCH; > break; >+ case 'j' : >+ if ("javadoc".equals(warningToken)) //$NON-NLS-1$ >+ return IrritantSet.JAVADOC; >+ break; > case 'n' : > if ("nls".equals(warningToken)) //$NON-NLS-1$ > return IrritantSet.NLS; >Index: compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java,v >retrieving revision 1.13 >diff -u -r1.13 IrritantSet.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java 16 Jan 2011 22:43:21 -0000 1.13 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java 11 Feb 2011 14:36:15 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -58,6 +58,7 @@ > public static final IrritantSet UNCHECKED = new IrritantSet(CompilerOptions.UncheckedTypeOperation); > public static final IrritantSet UNQUALIFIED_FIELD_ACCESS = new IrritantSet(CompilerOptions.UnqualifiedFieldAccess); > >+ public static final IrritantSet JAVADOC = new IrritantSet(CompilerOptions.InvalidJavadoc); > public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default > public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet(0); // see static initializer below > static { >@@ -126,6 +127,10 @@ > if (suppressRawWhenUnchecked != null && "true".equalsIgnoreCase(suppressRawWhenUnchecked)) { //$NON-NLS-1$ > UNCHECKED.set(CompilerOptions.RawTypeReference); > } >+ >+ JAVADOC >+ .set(CompilerOptions.MissingJavadocComments) >+ .set(CompilerOptions.MissingJavadocTags); > } > > // Internal state >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java,v >retrieving revision 1.219 >diff -u -r1.219 AnnotationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 22 Oct 2010 22:42:32 -0000 1.219 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 11 Feb 2011 14:36:15 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -46,8 +46,8 @@ > // All specified tests which do not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test293" }; >-// TESTS_NUMBERS = new int[] { 290, 291 }; >-// TESTS_RANGE = new int[] { 249, -1 }; >+// TESTS_NUMBERS = new int[] { 294 }; >+// TESTS_RANGE = new int[] { 294, -1 }; > } > > String reportMissingJavadocComments = null; >@@ -9711,4 +9711,82 @@ > "The field X.QUERY is not visible\n" + > "----------\n"); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=179566 >+public void test294() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED); >+ String testFiles [] = new String[] { >+ "A.java", >+ "/** */\n" + >+ "public class A {\n" + >+ " @SuppressWarnings(\"javadoc\")\n" + >+ " public int foo(int i) { return 0; }\n" + >+ "}\n" >+ }; >+ runConformTest( >+ testFiles, >+ null, >+ null, >+ true, >+ null, >+ customOptions, >+ null); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=179566 >+public void test295() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED); >+ String testFiles [] = new String[] { >+ "A.java", >+ "/** */\n" + >+ "public class A {\n" + >+ " /**\n" + >+ " * @param j the given param/\n" + >+ " */\n" + >+ " @SuppressWarnings(\"javadoc\")\n" + >+ " public int foo(int i) { return 0; }\n" + >+ "}\n" >+ }; >+ runConformTest( >+ testFiles, >+ null, >+ null, >+ true, >+ null, >+ customOptions, >+ null); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=179566 >+public void test296() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED); >+ String testFiles [] = new String[] { >+ "A.java", >+ "/** */\n" + >+ "public class A {\n" + >+ " /**\n" + >+ " * @param i/\n" + >+ " */\n" + >+ " @SuppressWarnings(\"javadoc\")\n" + >+ " public int foo(int i) { return 0; }\n" + >+ "}\n" >+ }; >+ runConformTest( >+ testFiles, >+ null, >+ null, >+ true, >+ null, >+ customOptions, >+ null); >+} > }
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 179566
: 188778