Community
Participate
Working Groups
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.
(In reply to comment #0) Sounds like a nice to have post 3.3 feature
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.
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.
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.
I'm not sure about that. Passing on to the specialist (who is currently away)
(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.
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.
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.
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) { } }
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?
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.
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! ;-)
@SuppressWarnings("javadoc") sounds good.
Created attachment 188778 [details] Proposed fix + regression tests
Quickfix works for free with the new @SuppressWarnings token.
Released for 3.7M6.
Verified for 3.7M6 using build I20110307-0800