Bug 179566 - [compiler] Support of @SuppressWarnings for JavaDoc Warnings
Summary: [compiler] Support of @SuppressWarnings for JavaDoc Warnings
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement with 13 votes (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-27 13:06 EDT by Ulli Hafner CLA
Modified: 2011-04-26 07:39 EDT (History)
13 users (show)

See Also:


Attachments
Proposed fix + regression tests (7.07 KB, patch)
2011-02-11 09:36 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulli Hafner CLA 2007-03-27 13:06:44 EDT
It would be nice if the Eclipse compiler would evaluate the @SupressWarnings annotation for wrong JavaDoc comment warnings, too. Currently a @SupressWarnings("") annotation suppresses all compiler warnings except JavaDoc warnings. There is no way, to suppress JavaDoc warnings without disabling the checker on the whole project.
Comment 1 Eric Jodet CLA 2007-03-29 00:45:21 EDT
(In reply to comment #0)
Sounds like a nice to have post 3.3 feature
Comment 2 Robert Elliot CLA 2007-07-19 02:45:24 EDT
I'm told there is an "allJavadoc" warnings suppression token, but Eclipse doesn't recognise it.
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm

This would be very useful; this or being able to set different Errors/Warnings for different source folders.  I don't want to be as strict about my unit test code as my "real" code as it just discourages unit test writing.
Comment 3 Jerome Lanneluc CLA 2007-08-09 06:52:07 EDT
There is no "allJavadoc" warnings suppression token. When used with the -warn option, "allJavadoc" just indicates to the batch compiler to enable all Javadoc warnings.
Comment 4 Robert Elliot CLA 2007-08-09 07:25:07 EDT
It's quite likely my understanding is deficient, but I thought that the @SuppressWarnings annotation took as an argument anything that could be supplied as an argument to -warn on the compiler; so if "allJavadoc" can be an argument to -warn on the compiler, you should be able to have an @SuppressWarnings("allJavadoc") annotation.  Which I'd expect Eclipse to interpret as meaning it should not warn me about invalid or missing Javadoc.

As I say, my understanding may be deficient.
Comment 5 Jerome Lanneluc CLA 2007-08-10 08:06:06 EDT
I'm not sure about that. Passing on to the specialist (who is currently away)
Comment 6 Olivier Thomann CLA 2007-08-13 10:14:26 EDT
(In reply to comment #4)
> It's quite likely my understanding is deficient, but I thought that the
> @SuppressWarnings annotation took as an argument anything that could be
> supplied as an argument to -warn on the compiler; so if "allJavadoc" can be an
> argument to -warn on the compiler, you should be able to have an
> @SuppressWarnings("allJavadoc") annotation.  Which I'd expect Eclipse to
> interpret as meaning it should not warn me about invalid or missing Javadoc.
We don't cover all types of warnings.
There is a list of expected tokens for the SuppressWarning annotation in the Help section.
Comment 7 Robert Elliot CLA 2007-08-13 14:15:55 EDT
Fine.  Can it be considered as an enhancement, then?  I think it's a pretty reasonable use case to want to have strict Javadoc requirements for production code and looser requirements for test cases, to encourage people to write them.
Comment 8 Ulli Hafner CLA 2007-08-14 07:14:41 EDT
Moreover, it is useful for generated classes (EMF). This actually was my reason for filing this report. Currently we do not have a possibility to suppress all warnings for a whole bunch of generated files.
Comment 9 Maxime Daniel CLA 2007-08-16 09:49:11 EDT
By the way, if suppressing all warnings in a given method or class is acceptable, the "all" parameter passed to SuppressWarnings also suppresses the Javadoc warnings. At least it does with Eclipse 3.3 on the following test case (complains upon argsv else):
public class X {
  /**
   * @param argsv
   */
  @SuppressWarnings("all")
  public static void main(String[] args) {
  }
}
Comment 10 dev2null CLA 2008-04-21 12:07:20 EDT
I'd like to suppress javadoc warnings for test classes but get other warnings, hence @SuppressWarnings("all") is not an option. Are there other ways to configure eclipse to ignore javadoc warnings for test classes? 
Comment 11 Steve Page CLA 2008-10-29 11:42:44 EDT
I ran across this, also. allJavadoc and javadoc (invalid syntax) seem to be pretty common in lists of things that work with @SuppressWarnings. I want to see Javadoc warnings in general, as they force me to document my code. However, when I use Matisse, it will delete my comments. "all" works, but that suppresses relevant warnings, such as private methods used by generated event handlers.

I realize this is not a bug, but it would be a very helpful enhancement. Matisse-generated code can produce dozens of these warnings per class.
Comment 12 Boris Kairat CLA 2010-05-18 05:38:18 EDT
We want it! :-)

It would really be a nice feature to be able to suppress warnings for missing javadoc (only!) by a "@SuppressWarnings" annotation! The "all" value is not a good solution!

We have many generated, self documenting data beans where there is no need to have any type of javadoc which would blow up the code.

Make it so! PLEASE! ;-)
Comment 13 Markus Keller CLA 2011-02-11 06:37:28 EST
@SuppressWarnings("javadoc") sounds good.
Comment 14 Olivier Thomann CLA 2011-02-11 09:36:52 EST
Created attachment 188778 [details]
Proposed fix + regression tests
Comment 15 Olivier Thomann CLA 2011-02-11 09:37:30 EST
Quickfix works for free with the new @SuppressWarnings token.
Comment 16 Olivier Thomann CLA 2011-02-11 10:03:21 EST
Released for 3.7M6.
Comment 17 Satyam Kandula CLA 2011-03-08 09:30:59 EST
Verified for 3.7M6 using build I20110307-0800