ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r471918 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc: JJDoc.java JJTree.java JavaCC.java
Date Mon, 06 Nov 2006 22:55:36 GMT
Author: peterreilly
Date: Mon Nov  6 14:55:35 2006
New Revision: 471918

URL: http://svn.apache.org/viewvc?view=rev&rev=471918
Log:
checkstyle

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java?view=diff&rev=471918&r1=471917&r2=471918
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java Mon Nov
 6 14:55:35 2006
@@ -61,23 +61,26 @@
 
     /**
      * Sets the TEXT BNF documentation option.
+     * @param plainText a <code>boolean</code> value.
      */
     public void setText(boolean plainText) {
-        optionalAttrs.put(TEXT, new Boolean(plainText));
+        optionalAttrs.put(TEXT, plainText ? Boolean.TRUE : Boolean.FALSE);
         this.plainText = plainText;
     }
 
     /**
      * Sets the ONE_TABLE documentation option.
+     * @param oneTable a <code>boolean</code> value.
      */
     public void setOnetable(boolean oneTable) {
-        optionalAttrs.put(ONE_TABLE, new Boolean(oneTable));
+        optionalAttrs.put(ONE_TABLE, oneTable ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * The outputfile to write the generated BNF documentation file to.
      * If not set, the file is written with the same name as
      * the JavaCC grammar file with a suffix .html or .txt.
+     * @param outputFile the name of the output file.
      */
     public void setOutputfile(String outputFile) {
         this.outputFile = outputFile;
@@ -85,6 +88,7 @@
 
     /**
      * The javacc grammar file to process.
+     * @param target the grammar file.
      */
     public void setTarget(File target) {
         this.targetFile = target;
@@ -92,6 +96,7 @@
 
     /**
      * The directory containing the JavaCC distribution.
+     * @param javaccHome the home directory.
      */
     public void setJavacchome(File javaccHome) {
         this.javaccHome = javaccHome;
@@ -104,6 +109,10 @@
         cmdl.setVm(JavaEnvUtils.getJreExecutable("java"));
     }
 
+    /**
+     * Do the task.
+     * @throws BuildException if there is an error.
+     */
     public void execute() throws BuildException {
 
         // load command line with optional attributes

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java?view=diff&rev=471918&r1=471917&r2=471918
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java Mon
Nov  6 14:55:35 2006
@@ -70,85 +70,97 @@
 
     /**
      * Sets the BUILD_NODE_FILES grammar option.
+     * @param buildNodeFiles a <code>boolean</code> value.
      */
     public void setBuildnodefiles(boolean buildNodeFiles) {
-        optionalAttrs.put(BUILD_NODE_FILES, new Boolean(buildNodeFiles));
+        optionalAttrs.put(BUILD_NODE_FILES, buildNodeFiles ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the MULTI grammar option.
+     * @param multi a <code>boolean</code> value.
      */
     public void setMulti(boolean multi) {
-        optionalAttrs.put(MULTI, new Boolean(multi));
+        optionalAttrs.put(MULTI, multi ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the NODE_DEFAULT_VOID grammar option.
+     * @param nodeDefaultVoid a <code>boolean</code> value.
      */
     public void setNodedefaultvoid(boolean nodeDefaultVoid) {
-        optionalAttrs.put(NODE_DEFAULT_VOID, new Boolean(nodeDefaultVoid));
+        optionalAttrs.put(NODE_DEFAULT_VOID, nodeDefaultVoid ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the NODE_FACTORY grammar option.
+     * @param nodeFactory a <code>boolean</code> value.
      */
     public void setNodefactory(boolean nodeFactory) {
-        optionalAttrs.put(NODE_FACTORY, new Boolean(nodeFactory));
+        optionalAttrs.put(NODE_FACTORY, nodeFactory ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the NODE_SCOPE_HOOK grammar option.
+     * @param nodeScopeHook a <code>boolean</code> value.
      */
     public void setNodescopehook(boolean nodeScopeHook) {
-        optionalAttrs.put(NODE_SCOPE_HOOK, new Boolean(nodeScopeHook));
+        optionalAttrs.put(NODE_SCOPE_HOOK, nodeScopeHook ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the NODE_USES_PARSER grammar option.
+     * @param nodeUsesParser a <code>boolean</code> value.
      */
     public void setNodeusesparser(boolean nodeUsesParser) {
-        optionalAttrs.put(NODE_USES_PARSER, new Boolean(nodeUsesParser));
+        optionalAttrs.put(NODE_USES_PARSER, nodeUsesParser ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the STATIC grammar option.
+     * @param staticParser a <code>boolean</code> value.
      */
     public void setStatic(boolean staticParser) {
-        optionalAttrs.put(STATIC, new Boolean(staticParser));
+        optionalAttrs.put(STATIC, staticParser ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the VISITOR grammar option.
+     * @param visitor a <code>boolean</code> value.
      */
     public void setVisitor(boolean visitor) {
-        optionalAttrs.put(VISITOR, new Boolean(visitor));
+        optionalAttrs.put(VISITOR, visitor ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the NODE_PACKAGE grammar option.
+     * @param nodePackage the option to use.
      */
     public void setNodepackage(String nodePackage) {
-        optionalAttrs.put(NODE_PACKAGE, new String(nodePackage));
+        optionalAttrs.put(NODE_PACKAGE, nodePackage);
     }
 
     /**
      * Sets the VISITOR_EXCEPTION grammar option.
+     * @param visitorException the option to use.
      */
     public void setVisitorException(String visitorException) {
-        optionalAttrs.put(VISITOR_EXCEPTION, new String(visitorException));
+        optionalAttrs.put(VISITOR_EXCEPTION, visitorException);
     }
 
     /**
      * Sets the NODE_PREFIX grammar option.
+     * @param nodePrefix the option to use.
      */
     public void setNodeprefix(String nodePrefix) {
-        optionalAttrs.put(NODE_PREFIX, new String(nodePrefix));
+        optionalAttrs.put(NODE_PREFIX, nodePrefix);
     }
 
     /**
      * The directory to write the generated JavaCC grammar and node files to.
      * If not set, the files are written to the directory
      * containing the grammar file.
+     * @param outputDirectory the output directory.
      */
     public void setOutputdirectory(File outputDirectory) {
         this.outputDirectory = outputDirectory;
@@ -158,6 +170,7 @@
      * The outputfile to write the generated JavaCC grammar file to.
      * If not set, the file is written with the same name as
      * the JJTree grammar file with a suffix .jj.
+     * @param outputFile the output file name.
      */
     public void setOutputfile(String outputFile) {
         this.outputFile = outputFile;
@@ -165,6 +178,7 @@
 
     /**
      * The jjtree grammar file to process.
+     * @param targetFile the grammar file.
      */
     public void setTarget(File targetFile) {
         this.targetFile = targetFile;
@@ -172,6 +186,7 @@
 
     /**
      * The directory containing the JavaCC distribution.
+     * @param javaccHome the directory containing JavaCC.
      */
     public void setJavacchome(File javaccHome) {
         this.javaccHome = javaccHome;
@@ -184,6 +199,10 @@
         cmdl.setVm(JavaEnvUtils.getJreExecutable("java"));
     }
 
+    /**
+     * Run the task.
+     * @throws BuildException on error.
+     */
     public void execute() throws BuildException {
 
         // load command line with optional attributes

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java?view=diff&rev=471918&r1=471917&r2=471918
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java Mon
Nov  6 14:55:35 2006
@@ -106,6 +106,7 @@
 
     /**
      * Sets the LOOKAHEAD grammar option.
+     * @param lookahead an <code>int</code> value.
      */
     public void setLookahead(int lookahead) {
         optionalAttrs.put(LOOKAHEAD, new Integer(lookahead));
@@ -113,6 +114,7 @@
 
     /**
      * Sets the CHOICE_AMBIGUITY_CHECK grammar option.
+     * @param choiceAmbiguityCheck an <code>int</code> value.
      */
     public void setChoiceambiguitycheck(int choiceAmbiguityCheck) {
         optionalAttrs.put(CHOICE_AMBIGUITY_CHECK, new Integer(choiceAmbiguityCheck));
@@ -120,6 +122,7 @@
 
     /**
      * Sets the OTHER_AMBIGUITY_CHECK grammar option.
+     * @param otherAmbiguityCheck an <code>int</code> value.
      */
     public void setOtherambiguityCheck(int otherAmbiguityCheck) {
         optionalAttrs.put(OTHER_AMBIGUITY_CHECK, new Integer(otherAmbiguityCheck));
@@ -127,132 +130,152 @@
 
     /**
      * Sets the STATIC grammar option.
+     * @param staticParser a <code>boolean</code> value.
      */
     public void setStatic(boolean staticParser) {
-        optionalAttrs.put(STATIC, new Boolean(staticParser));
+        optionalAttrs.put(STATIC, staticParser ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the DEBUG_PARSER grammar option.
+     * @param debugParser a <code>boolean</code> value.
      */
     public void setDebugparser(boolean debugParser) {
-        optionalAttrs.put(DEBUG_PARSER, new Boolean(debugParser));
+        optionalAttrs.put(DEBUG_PARSER, debugParser ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the DEBUG_LOOKAHEAD grammar option.
+     * @param debugLookahead a <code>boolean</code> value.
      */
     public void setDebuglookahead(boolean debugLookahead) {
-        optionalAttrs.put(DEBUG_LOOKAHEAD, new Boolean(debugLookahead));
+        optionalAttrs.put(DEBUG_LOOKAHEAD, debugLookahead ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the DEBUG_TOKEN_MANAGER grammar option.
+     * @param debugTokenManager a <code>boolean</code> value.
      */
     public void setDebugtokenmanager(boolean debugTokenManager) {
-        optionalAttrs.put(DEBUG_TOKEN_MANAGER, new Boolean(debugTokenManager));
+        optionalAttrs.put(DEBUG_TOKEN_MANAGER, debugTokenManager ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the OPTIMIZE_TOKEN_MANAGER grammar option.
+     * @param optimizeTokenManager a <code>boolean</code> value.
      */
     public void setOptimizetokenmanager(boolean optimizeTokenManager) {
-        optionalAttrs.put(OPTIMIZE_TOKEN_MANAGER, new Boolean(optimizeTokenManager));
+        optionalAttrs.put(OPTIMIZE_TOKEN_MANAGER,
+                          optimizeTokenManager ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the ERROR_REPORTING grammar option.
+     * @param errorReporting a <code>boolean</code> value.
      */
     public void setErrorreporting(boolean errorReporting) {
-        optionalAttrs.put(ERROR_REPORTING, new Boolean(errorReporting));
+        optionalAttrs.put(ERROR_REPORTING, errorReporting ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the JAVA_UNICODE_ESCAPE grammar option.
+     * @param javaUnicodeEscape a <code>boolean</code> value.
      */
     public void setJavaunicodeescape(boolean javaUnicodeEscape) {
-        optionalAttrs.put(JAVA_UNICODE_ESCAPE, new Boolean(javaUnicodeEscape));
+        optionalAttrs.put(JAVA_UNICODE_ESCAPE, javaUnicodeEscape ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the UNICODE_INPUT grammar option.
+     * @param unicodeInput a <code>boolean</code> value.
      */
     public void setUnicodeinput(boolean unicodeInput) {
-        optionalAttrs.put(UNICODE_INPUT, new Boolean(unicodeInput));
+        optionalAttrs.put(UNICODE_INPUT, unicodeInput ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the IGNORE_CASE grammar option.
+     * @param ignoreCase a <code>boolean</code> value.
      */
     public void setIgnorecase(boolean ignoreCase) {
-        optionalAttrs.put(IGNORE_CASE, new Boolean(ignoreCase));
+        optionalAttrs.put(IGNORE_CASE, ignoreCase ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the COMMON_TOKEN_ACTION grammar option.
+     * @param commonTokenAction a <code>boolean</code> value.
      */
     public void setCommontokenaction(boolean commonTokenAction) {
-        optionalAttrs.put(COMMON_TOKEN_ACTION, new Boolean(commonTokenAction));
+        optionalAttrs.put(COMMON_TOKEN_ACTION, commonTokenAction ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the USER_TOKEN_MANAGER grammar option.
+     * @param userTokenManager a <code>boolean</code> value.
      */
     public void setUsertokenmanager(boolean userTokenManager) {
-        optionalAttrs.put(USER_TOKEN_MANAGER, new Boolean(userTokenManager));
+        optionalAttrs.put(USER_TOKEN_MANAGER, userTokenManager ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the USER_CHAR_STREAM grammar option.
+     * @param userCharStream a <code>boolean</code> value.
      */
     public void setUsercharstream(boolean userCharStream) {
-        optionalAttrs.put(USER_CHAR_STREAM, new Boolean(userCharStream));
+        optionalAttrs.put(USER_CHAR_STREAM, userCharStream ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the BUILD_PARSER grammar option.
+     * @param buildParser a <code>boolean</code> value.
      */
     public void setBuildparser(boolean buildParser) {
-        optionalAttrs.put(BUILD_PARSER, new Boolean(buildParser));
+        optionalAttrs.put(BUILD_PARSER, buildParser ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the BUILD_TOKEN_MANAGER grammar option.
+     * @param buildTokenManager a <code>boolean</code> value.
      */
     public void setBuildtokenmanager(boolean buildTokenManager) {
-        optionalAttrs.put(BUILD_TOKEN_MANAGER, new Boolean(buildTokenManager));
+        optionalAttrs.put(BUILD_TOKEN_MANAGER, buildTokenManager ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the SANITY_CHECK grammar option.
+     * @param sanityCheck a <code>boolean</code> value.
      */
     public void setSanitycheck(boolean sanityCheck) {
-        optionalAttrs.put(SANITY_CHECK, new Boolean(sanityCheck));
+        optionalAttrs.put(SANITY_CHECK, sanityCheck ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the FORCE_LA_CHECK grammar option.
+     * @param forceLACheck a <code>boolean</code> value.
      */
     public void setForcelacheck(boolean forceLACheck) {
-        optionalAttrs.put(FORCE_LA_CHECK, new Boolean(forceLACheck));
+        optionalAttrs.put(FORCE_LA_CHECK, forceLACheck ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the CACHE_TOKENS grammar option.
+     * @param cacheTokens a <code>boolean</code> value.
      */
     public void setCachetokens(boolean cacheTokens) {
-        optionalAttrs.put(CACHE_TOKENS, new Boolean(cacheTokens));
+        optionalAttrs.put(CACHE_TOKENS, cacheTokens ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the KEEP_LINE_COLUMN grammar option.
+     * @param keepLineColumn a <code>boolean</code> value.
      */
     public void setKeeplinecolumn(boolean keepLineColumn) {
-        optionalAttrs.put(KEEP_LINE_COLUMN, new Boolean(keepLineColumn));
+        optionalAttrs.put(KEEP_LINE_COLUMN, keepLineColumn ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
      * Sets the JDK_VERSION option.
+     * @param jdkVersion the version to use.
      * @since Ant1.7
      */
     public void setJDKversion(String jdkVersion) {
@@ -263,6 +286,7 @@
      * The directory to write the generated files to.
      * If not set, the files are written to the directory
      * containing the grammar file.
+     * @param outputDirectory the output directory.
      */
     public void setOutputdirectory(File outputDirectory) {
         this.outputDirectory = outputDirectory;
@@ -270,6 +294,7 @@
 
     /**
      * The grammar file to process.
+     * @param targetFile the grammar file.
      */
     public void setTarget(File targetFile) {
         this.targetFile = targetFile;
@@ -277,15 +302,23 @@
 
     /**
      * The directory containing the JavaCC distribution.
+     * @param javaccHome the directory.
      */
     public void setJavacchome(File javaccHome) {
         this.javaccHome = javaccHome;
     }
 
+    /**
+     * Constructor
+     */
     public JavaCC() {
         cmdl.setVm(JavaEnvUtils.getJreExecutable("java"));
     }
 
+    /**
+     * Run the task.
+     * @throws BuildException on error.
+     */
     public void execute() throws BuildException {
 
         // load command line with optional attributes
@@ -400,6 +433,8 @@
                 mainClass = COM_JJDOC_CLASS;
 
                 break;
+            default:
+                // Fall Through
             }
         } else {
             javaccClass = ORG_PACKAGE_3_1 + ORG_JAVACC_CLASS;
@@ -432,6 +467,8 @@
                     mainClass = ORG_JJDOC_CLASS;
 
                     break;
+                default:
+                    // Fall Through
                 }
             }
         }



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


Mime
View raw message