ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22345] - In J2SDK 1.5.0 (Tiger) enum is a keyword
Date Wed, 13 Aug 2003 12:41:04 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22345>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22345

In J2SDK 1.5.0 (Tiger) enum is a keyword





------- Additional Comments From jan@materne.de  2003-08-13 12:41 -------
I have written a Check for checkstyle. It seems to work.
That check logs an error if a reserved word is used as identifier. I 
listet the keywords described in 
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html, the
words "true", "false", "null" (described there), "assert" (JDK 1.4) and "enum"
(JDK 1.5).

For running the test, include the JAR in the classpath and add that statement 
into the src\etc\checkstyle\checkstyle-config (somewhere under the "TreeWalker" 
module).
      <module 
name="com.puppycrawl.tools.checkstyle.api.checks.naming.WrongUseOfReservedWordsC
heck"/>



You can specify a list of alternative reserved words as parameter. E.g. for a 
quick test I wanted to list all sources which uses "handleOutput".
    <module 
name="com.puppycrawl.tools.checkstyle.api.checks.naming.WrongUseOfReservedWordsC
heck">
      <property name="reservedWords" value="handleOutput"/>
    </module>


After finishing the doc- and test-stuff I try to contribute that to the 
checkstyle project. Until then I upload the sources, JAR and the check-result.

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


Mime
View raw message