I use Eclipse, so to me my use of //$FALL-THROUGH$ comments is common practice on switch statements and the like. But my coworker uses Netbeans and questioned what on earth I was doing with these. And trying to google anything with a symbol in it is like trying to pull teeth with a pair of frozen mittens and no tools…
Is the use of the //$FALL-THROUGH$ comment, dollar signs and all, a standard java thing, or some sort of Eclipse magic? If I load up the same code in Netbeans or another IDE, or run it through the standalone java compiler, will fall through switch statements still be marked with warnings, even with said comment or not? Is there a standard way to do this beyond using the @SupressWarning annotation (which would simply clutter code given how you have to use it)?
Things like this are IDE/style-check-tool dependent. There are no “standard Java comments”.
(Well, Javadocs are standard, but they don’t control compilation/error reporting.)
An explanation of the
$FALL-THROUGH$construct is mentioned in eclipse release documentation:Note that warning names for the
@Suppresswarningsannotation are compiler dependent, and not a Java language standard.