Severity of Java compiler warning

Introduction
Some continuous integration tools (like Hudson) assume that compilers generate warnings of varying severity (aka priority): high, normal, and low.
Depending on the number and severity of the compiler warnings, the tool may flag an assembly as unstable.
I want my assemblies to become unstable if the compiler generates high priority warnings.

I've never seen high (and low) priority warnings in our project - just normal, so I'm a little suspicious if they actually exist.

Question
Where can I see the list of high priority compiler warnings generated by javac and / or ecj.
Or maybe you can provide some examples of high priority alerts.

Other
Related, but possibly different question: I suspect that high priority compiler warnings are actually errors, and there really cannot be a situation where you have source code compiled with high priority warnings (in this the assembly will be broken).

0


a source to share


3 answers


You can get a list of all compiler warnings by typing:

javac -X



and look at the list given for the -Xlint option.

Java really has no concept of "high" and "low" priority, and maybe it shouldn't ... what specific warnings might indicate a problem with your project are really specific to your particular development path.

+2


a source


If you want to see high and low priority alerts, you can use PMD, FindBug and / or checkstyle. Checkstyle is especially good at producing a lot of very low priority alerts.;)



+1


a source


Referring specifically to Hudson, it looks like the "Scan log files for compiler" option is for general compilers, and the options for high and medium and low are probably for compilers capable of generating these severity levels (like gcc or PC- Lint or (possibly) the Java Eclipse compiler). I don’t think I’m javac

capable of that.

0


a source







All Articles