ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r474075 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional: PropertyFile.java XMLValidateTask.java net/FTP.java
Date Sun, 12 Nov 2006 22:32:27 GMT
Author: peterreilly
Date: Sun Nov 12 14:32:27 2006
New Revision: 474075

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

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java?view=diff&rev=474075&r1=474074&r2=474075
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java Sun Nov
12 14:32:27 2006
@@ -547,14 +547,23 @@
         public static class Operation extends EnumeratedAttribute {
 
             // Property type operations
+            /** + */
             public static final int INCREMENT_OPER =   0;
+            /** - */
             public static final int DECREMENT_OPER =   1;
+            /** = */
             public static final int EQUALS_OPER =      2;
 
+            /** {@inheritDoc}. */
             public String[] getValues() {
                 return new String[] {"+", "-", "="};
             }
 
+            /**
+             * Convert string to index.
+             * @param oper the string to convert.
+             * @return the index.
+             */
             public static int toOperation(String oper) {
                 if ("+".equals(oper)) {
                     return INCREMENT_OPER;
@@ -571,14 +580,23 @@
         public static class Type extends EnumeratedAttribute {
 
             // Property types
+            /** int */
             public static final int INTEGER_TYPE =     0;
+            /** date */
             public static final int DATE_TYPE =        1;
+            /** string */
             public static final int STRING_TYPE =      2;
 
+            /** {@inheritDoc} */
             public String[] getValues() {
                 return new String[] {"int", "date", "string"};
             }
 
+            /**
+             * Convert string to index.
+             * @param type the string to convert.
+             * @return the index.
+             */
             public static int toType(String type) {
                 if ("int".equals(type)) {
                     return INTEGER_TYPE;
@@ -612,6 +630,7 @@
 
         private Map calendarFields = new HashMap();
 
+        /** no arg constructor */
         public Unit() {
             calendarFields.put(MILLISECOND,
                                     new Integer(Calendar.MILLISECOND));
@@ -624,12 +643,17 @@
             calendarFields.put(YEAR, new Integer(Calendar.YEAR));
         }
 
+        /**
+         * Convert the value to a Calendar field index.
+         * @return the calander value.
+         */
         public int getCalendarField() {
             String key = getValue().toLowerCase();
             Integer i = (Integer) calendarFields.get(key);
             return i.intValue();
         }
 
+        /** {@inheritDoc}. */
         public String[] getValues() {
             return UNITS;
         }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java?view=diff&rev=474075&r1=474074&r2=474075
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java Sun
Nov 12 14:32:27 2006
@@ -66,6 +66,7 @@
 
     // ant task properties
     // defaults
+    // CheckStyle:VisibilityModifier OFF - bc
     protected boolean failOnError = true;
     protected boolean warn = true;
     protected boolean lenient = false;
@@ -87,6 +88,7 @@
     // XMLReader used to validation process
     protected ValidatorErrorHandler errorHandler = new ValidatorErrorHandler();
     // to report sax parsing errors
+    // CheckStyle:VisibilityModifier ON
 
     /** The vector to store all attributes (features) to be set on the parser. **/
     private Vector attributeList = new Vector();
@@ -97,7 +99,9 @@
     private final Vector propertyList = new Vector();
 
     private XMLCatalog xmlCatalog = new XMLCatalog();
-    public static final String MESSAGE_FILES_VALIDATED = " file(s) have been successfully
validated.";
+    /** Message for sucessfull validation */
+    public static final String MESSAGE_FILES_VALIDATED
+        = " file(s) have been successfully validated.";
 
     /**
      * Specify how parser error are to be handled.
@@ -517,6 +521,8 @@
 
     /**
      * parse the file
+     * @param afile the file to validate.
+     * @return true if the file validates.
      */
     protected boolean doValidate(File afile) {
         //for every file, we have a new instance of the validator
@@ -562,9 +568,11 @@
      */
     protected class ValidatorErrorHandler implements ErrorHandler {
 
+        // CheckStyle:VisibilityModifier OFF - bc
         protected File currentFile = null;
         protected String lastErrorMessage = null;
         protected boolean failed = false;
+        // CheckStyle:VisibilityModifier ON
         /**
          * initialises the class
          * @param file file used
@@ -730,4 +738,4 @@
 
 
 
-}
\ No newline at end of file
+}

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?view=diff&rev=474075&r1=474074&r2=474075
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Sun Nov 12
14:32:27 2006
@@ -180,8 +180,12 @@
      * followSymlinks defaults to false
      */
     protected class FTPDirectoryScanner extends DirectoryScanner {
+        // CheckStyle:VisibilityModifier OFF - bc
         protected FTPClient ftp = null;
+        // CheckStyle:VisibilityModifier ON
+
         private String rootPath = null;
+
         /**
          * since ant 1.6
          * this flag should be set to true on UNIX and can save scanning time
@@ -542,8 +546,7 @@
             return result;
         }
 
-        private void forceRemoteSensitivityCheck()
-        {
+        private void forceRemoteSensitivityCheck() {
             if (!remoteSensitivityChecked) {
                 try {
                     checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
@@ -813,7 +816,9 @@
                         // hit a hidden file assume not a symlink
                         relPath = relPath + currentElement;
                         currentPath = currentPath + remoteFileSep + currentElement;
-                        log("Hidden file " + relPath + " assumed to not be a symlink.", Project.MSG_VERBOSE);
+                        log("Hidden file " + relPath
+                            + " assumed to not be a symlink.",
+                            Project.MSG_VERBOSE);
                     } else {
                         traversesSymlinks = traversesSymlinks || theFile.isSymbolicLink();
                         relPath = relPath + theFile.getName();
@@ -900,6 +905,10 @@
                 return traversesSymlinks;
             }
 
+            /**
+             * Get a string rep of this object.
+             * @return a string containing the pwd and the file.
+             */
             public String toString() {
                 return "AntFtpFile: " + curpwd + "%" + ftpFile;
             }
@@ -1297,8 +1306,7 @@
      * @see org.apache.commons.net.ftp.FTPClientConfig
      */
     public void setSystemTypeKey(FTPSystemType systemKey) {
-        if (systemKey != null && !systemKey.getValue().equals(""))
-        {
+        if (systemKey != null && !systemKey.getValue().equals("")) {
             this.systemTypeKey = systemKey;
             configurationHasBeenSet();
         }
@@ -1311,8 +1319,7 @@
      * @see org.apache.commons.net.ftp.FTPClientConfig
      */
     public void setDefaultDateFormatConfig(String defaultDateFormat) {
-        if (defaultDateFormat != null && !defaultDateFormat.equals(""))
-        {
+        if (defaultDateFormat != null && !defaultDateFormat.equals("")) {
             this.defaultDateFormatConfig = defaultDateFormat;
             configurationHasBeenSet();
         }
@@ -1325,8 +1332,7 @@
      * @see org.apache.commons.net.ftp.FTPClientConfig
      */
     public void setRecentDateFormatConfig(String recentDateFormat) {
-        if (recentDateFormat != null && !recentDateFormat.equals(""))
-        {
+        if (recentDateFormat != null && !recentDateFormat.equals("")) {
             this.recentDateFormatConfig = recentDateFormat;
             configurationHasBeenSet();
         }
@@ -1339,8 +1345,7 @@
      * @see org.apache.commons.net.ftp.FTPClientConfig
      */
     public void setServerLanguageCodeConfig(LanguageCode serverLanguageCode) {
-        if (serverLanguageCode != null && !serverLanguageCode.equals(""))
-        {
+        if (serverLanguageCode != null && !serverLanguageCode.equals("")) {
             this.serverLanguageCodeConfig = serverLanguageCode;
             configurationHasBeenSet();
         }
@@ -1353,8 +1358,7 @@
      * @see org.apache.commons.net.ftp.FTPClientConfig
      */
     public void setServerTimeZoneConfig(String serverTimeZoneId) {
-        if (serverTimeZoneId != null && !serverTimeZoneId.equals(""))
-        {
+        if (serverTimeZoneId != null && !serverTimeZoneId.equals("")) {
             this.serverTimeZoneConfig = serverTimeZoneId;
             configurationHasBeenSet();
         }
@@ -1368,8 +1372,7 @@
      * @see org.apache.commons.net.ftp.FTPClientConfig
      */
     public void setShortMonthNamesConfig(String shortMonthNames) {
-        if (shortMonthNames != null && !shortMonthNames.equals(""))
-        {
+        if (shortMonthNames != null && !shortMonthNames.equals("")) {
             this.shortMonthNamesConfig = shortMonthNames;
             configurationHasBeenSet();
         }
@@ -1518,14 +1521,14 @@
                 Class.forName("org.apache.commons.net.ftp.FTPClientConfig");
             } catch (ClassNotFoundException e) {
                 throw new BuildException(
-                 "commons-net.jar >= 1.4.0 is required for at least one of the attributes
specified.");
+                 "commons-net.jar >= 1.4.0 is required for at least one"
+                 + " of the attributes specified.");
             }
         }
     }
 
     protected void executeRetryable(RetryHandler h, Retryable r, String descr)
-    throws IOException
-    {
+        throws IOException {
         h.execute(r, descr);
     }
 
@@ -1626,7 +1629,8 @@
                                     listFile(ftp, fbw, dsfile);
                                     break;
                                 case CHMOD:
-                                    doSiteCommand(ftp, "chmod " + chmod + " " + resolveFile(dsfile));
+                                    doSiteCommand(ftp, "chmod " + chmod
+                                                  + " " + resolveFile(dsfile));
                                     transferred++;
                                     break;
                                 default:
@@ -2448,7 +2452,9 @@
         private static final String[] VALID_GRANULARITIES = {
                 "", "MINUTE", "NONE"
         };
-         /*
+
+        /**
+         * Get the valid values.
          * @return the list of valid Granularity values
          */
         public String[] getValues() {
@@ -2494,7 +2500,8 @@
            };
 
 
-            /*
+            /**
+             * Get the valid values.
              * @return the list of valid system types.
              */
             public String[] getValues() {
@@ -2507,6 +2514,9 @@
                 return ftpst;
             }
     }
+    /**
+     * Enumerated class for languages.
+     */
     public static class LanguageCode extends EnumeratedAttribute {
 
 
@@ -2525,8 +2535,9 @@
         }
 
 
-             /*
-              * @return the list of valid system types.
+             /**
+              * Return the value values.
+              * @return the list of valid language types.
               */
              public String[] getValues() {
                  return VALID_LANGUAGE_CODES;



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


Mime
View raw message