ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Fallthrough in FixCrLfFilter.java intended?
Date Wed, 09 Mar 2005 08:05:29 GMT
Hi,

Jikes complains

,----
| Issued 1 semantic warning compiling "src/main/org/apache/tools/ant/filters/FixCrLfFilter.java":
| 
|                     <---------------------
|    525.             case TRANS_TO_COMMENT:
|    . . .
|    533.                 }
|         ---------------->
| *** Semantic Warning: This switch block can fall through to the next case. Did you forget
a break statement?
`----

and from a first glance at the code I think this really is a bug and
the break is missing.  Consider what happens in the state ==
TRANS_TO_COMMENT && thisChar == '/' case.

On a related note, I personally prefer to have break in the very
latest case of a switch statement as well as I always forget to add
once when I add another case at the end otherwise.  With that break
would also be missing three lines below the line Jikes talks about.

Hmm, maybe I should write a testcase to prove Jikes is correct.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message