You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2012/08/20 19:38:24 UTC

svn commit: r1375131 - in /creadur/whisker/trunk: apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/ apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/

Author: rdonkin
Date: Mon Aug 20 17:38:23 2012
New Revision: 1375131

URL: http://svn.apache.org/viewvc?rev=1375131&view=rev
Log:
Fixed some inconsistencies reported by check-style

Modified:
    creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/Directory.java
    creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/FromFileSystem.java
    creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityReports.java

Modified: creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/Directory.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/Directory.java?rev=1375131&r1=1375130&r2=1375131&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/Directory.java (original)
+++ creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/Directory.java Mon Aug 20 17:38:23 2012
@@ -14,7 +14,7 @@
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License. 
+ * under the License.
  */
 package org.apache.creadur.whisker.scan;
 
@@ -29,8 +29,8 @@ public class Directory implements Compar
     private String name;
     /** Names resources contained. */
     private Set<String> contents = new TreeSet<String>();
-  
-    
+
+
     /**
      * Gets the directory name.
      * @return the name
@@ -47,7 +47,7 @@ public class Directory implements Compar
         this.name = name;
         return this;
     }
-    
+
     /**
      * Gets the directory contents.
      * @return the contents
@@ -55,7 +55,7 @@ public class Directory implements Compar
     public Set<String> getContents() {
         return contents;
     }
-    
+
     /**
      * Sets the directory contents.
      * @param contents the contents to set
@@ -63,7 +63,7 @@ public class Directory implements Compar
     public void setContents(final Set<String> contents) {
         this.contents = contents;
     }
-    
+
     /**
      * @return the hash code
      * @see java.lang.Object#hashCode()
@@ -75,7 +75,7 @@ public class Directory implements Compar
         result = prime * result + ((name == null) ? 0 : name.hashCode());
         return result;
     }
-    
+
     /**
      * Equal if and only if names are equal.
      * @param obj possibly null
@@ -98,7 +98,7 @@ public class Directory implements Compar
             return false;
         return true;
     }
-    
+
     /**
      * Suitable for logging.
      * @return not null
@@ -108,7 +108,7 @@ public class Directory implements Compar
     public String toString() {
         return "Directory [name=" + name + "]";
     }
-    
+
     /**
      * Registers a contained resource.
      * @param name not null
@@ -116,7 +116,7 @@ public class Directory implements Compar
     public void addResource(final String name) {
         contents.add(name);
     }
-    
+
     /**
      * Natural comparison based on name.
      * @param other another directory
@@ -130,4 +130,3 @@ public class Directory implements Compar
         return this.name.compareTo(other.name);
     }
 }
-

Modified: creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/FromFileSystem.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/FromFileSystem.java?rev=1375131&r1=1375130&r2=1375131&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/FromFileSystem.java (original)
+++ creadur/whisker/trunk/apache-whisker-scan/src/main/java/org/apache/creadur/whisker/scan/FromFileSystem.java Mon Aug 20 17:38:23 2012
@@ -14,7 +14,7 @@
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License. 
+ * under the License.
  */
 package org.apache.creadur.whisker.scan;
 
@@ -31,7 +31,7 @@ import java.util.TreeSet;
  * Scans directories for resources, within a file system.
  */
 public class FromFileSystem {
-    
+
     /**
      * Base constructor.
      */
@@ -40,15 +40,19 @@ public class FromFileSystem {
     }
 
     /**
-     * Builds 
+     * Builds description based on given directory.
      * @param base names the base directory, not null
      * @return collected directories within the base, not null
      * @throws IOException when the scanning fails
      */
-    public Collection<Directory> withBase(final String base) throws IOException {
+    public Collection<Directory> withBase(final String base)
+            throws IOException {
         return new Builder(base).build();
     }
-    
+
+    /**
+     * Builds a description of a file system.
+     */
     private final static class Builder {
         /** Initial capacity for the backing array. */
         private static final int DEFAULT_INITIAL_CAPACITY = 64;
@@ -60,9 +64,9 @@ public class FromFileSystem {
         private final Queue<Work> workInProgress;
         /** Stores work done. */
         private final Collection<Work> workDone;
-        
+
         /**
-         * Constructs a builder with given base 
+         * Constructs a builder with given base
          * (and default backing array).
          * @param base not null
          */
@@ -82,7 +86,7 @@ public class FromFileSystem {
             workInProgress = new LinkedList<Work>();
             workDone = new ArrayList<Work>(initialCapacity);
         }
-        
+
         /**
          * Builds directories.
          * @return not null
@@ -106,7 +110,7 @@ public class FromFileSystem {
         private Builder put(final File file) {
             return put(new Work(file));
         }
-        
+
         /**
          * Queues work.
          * @param work not null
@@ -122,7 +126,7 @@ public class FromFileSystem {
             }
             return this;
         }
-        
+
         /**
          * Notes that work has already been done.
          * @param work not null
@@ -154,19 +158,23 @@ public class FromFileSystem {
             directories.add(next.build());
             return next;
         }
-        
+
         /**
          * Computes the contents of a directory.
          */
-        private final static class Work {
+        private static final class Work {
             /** Represents base directory. */
             private static final String BASE_DIRECTORY = ".";
             /** Names the directory. */
             private final String name;
             /** The directory worked on. */
             private final File file;
-            
-            public Work(File file) {
+
+            /**
+             * Constructs work.
+             * @param file not null
+             */
+            public Work(final File file) {
                 this(BASE_DIRECTORY, file);
             }
 
@@ -176,13 +184,13 @@ public class FromFileSystem {
              * @param file not null
              */
             public Work(final String name, final File file) {
-                if (! file.exists()) {
+                if (!file.exists()) {
                     throw new IllegalArgumentException(
-                            "Expected '"+ file.getAbsolutePath() + "' to exist");
+                            "Expected '" + file.getAbsolutePath() + "' to exist");
                 }
-                if (! file.isDirectory()) {
+                if (!file.isDirectory()) {
                     throw new IllegalArgumentException(
-                            "Expected '"+ file.getAbsolutePath() + "' to be a directory");
+                            "Expected '" + file.getAbsolutePath() + "' to be a directory");
                 }
                 this.name = name;
                 this.file = file;
@@ -298,7 +306,7 @@ public class FromFileSystem {
                         + ((name == null) ? 0 : name.hashCode());
                 return result;
             }
-            
+
             /**
              * Equal when both name and file are equal.
              * @param obj possibly null
@@ -331,7 +339,7 @@ public class FromFileSystem {
                 }
                 return true;
             }
-            
+
             /**
              * Something suitable for logging.
              * @return not null

Modified: creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityReports.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityReports.java?rev=1375131&r1=1375130&r2=1375131&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityReports.java (original)
+++ creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityReports.java Mon Aug 20 17:38:23 2012
@@ -180,10 +180,10 @@ public class VelocityReports implements 
                 default:
                     products.add(product);
             }
-                
-                
+
+
         }
-        final Product[] pruductArray = new Product[products.size()]; 
+        final Product[] pruductArray = new Product[products.size()];
         merge(products.toArray(pruductArray), context(work));
     }