views:

364

answers:

3

Intro
Some continuous-integration tools (say, Hudson) assume compilers generate warnings of different severity (aka priority): high, normal and low.
Depending on number and severity of compiler warnings, the tool can mark a build as unstable.
I want my builds unstable if compiler generates high priority warnings.

I never seen any high (and low) priority warnings on our project -- only normal, so I'm a bit suspicious if they really exist.

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

Other
Related, but maybe different question: I suspect high priority compiler warnings are actually errors and there can't be actually a situation you have source code compiled with high priority warnings (build will be broken in that case).

A: 

Referring to Hudson specifically, it looks like the "Scan log files for compiler warnings" option is meant to be generic across compilers, and the options for high priority vs medium vs low is probably intended for compilers capable of generating these severity levels (such as gcc or PC-Lint or (maybe) the Eclipse Java compiler). I don't believe that javac is capable of this.

matt b
Regarding Hudson, I guess you are right. Btw, I've checked Eclipse Java compiler (ecj) -- it is very flexible in Eclipse itself (you can configure which checks consider like errors, just warnings or even ignore), yet in command-line mode (separate single ecj.jar) it can't do that :( it has warnings list, but you can only enable/disable them
Yurii Soldak
+2  A: 

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

javac -X

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

Java doesn't really have a notion of "high" vs "low" priority, and arguably shouldn't-- which particuarly warnings are likely to indicate a problem with your project is really specific to your particular mode of development.

Neil Coffey
I think you meant "javac -X"
Yurii Soldak
d'oh thank you-- corrected. How dare they put the 'x' and 'c' keys next to each other...
Neil Coffey
A: 

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

Peter Lawrey