creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1374749 - in /creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app: analysis/ load/ out/
Date Sun, 19 Aug 2012 13:00:40 GMT
Author: rdonkin
Date: Sun Aug 19 13:00:40 2012
New Revision: 1374749

URL: http://svn.apache.org/viewvc?rev=1374749&view=rev
Log:
Tidied up some code and add some javadocs, as suggested by checkstyle

Modified:
    creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/LicenseAnalyst.java
    creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/ResourceDefinitionException.java
    creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableClassPathResource.java
    creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableFileNameResource.java
    creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsIntoDirectoryFactory.java
    creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsToSystemOutFactory.java

Modified: creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/LicenseAnalyst.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/LicenseAnalyst.java?rev=1374749&r1=1374748&r2=1374749&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/LicenseAnalyst.java
(original)
+++ creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/LicenseAnalyst.java
Sun Aug 19 13:00:40 2012
@@ -45,7 +45,8 @@ public class LicenseAnalyst {
                     Collection<ResourceDescription>> results =
                     new HashMap<ResourceDefinitionError,
                         Collection<ResourceDescription>>();
-        for (final ResourceDefinitionError error: ResourceDefinitionError.values()) {
+        for (final ResourceDefinitionError error:
+                ResourceDefinitionError.values()) {
             initIssues(results, error);
         }
         return results;
@@ -57,7 +58,9 @@ public class LicenseAnalyst {
      * @param error not null
      */
     private static void initIssues(
-            final Map<ResourceDefinitionError, Collection<ResourceDescription>>
results,
+            final Map<
+                ResourceDefinitionError,
+                Collection<ResourceDescription>> results,
             ResourceDefinitionError error) {
         results.put(error, new TreeSet<ResourceDescription>());
     }
@@ -77,7 +80,7 @@ public class LicenseAnalyst {
 
     /**
      * Analyse the given directories.
-     * @param directories, not null
+     * @param directories not null
      */
     public LicenseAnalyst(final Collection<Directory> directories) {
         super();

Modified: creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/ResourceDefinitionException.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/ResourceDefinitionException.java?rev=1374749&r1=1374748&r2=1374749&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/ResourceDefinitionException.java
(original)
+++ creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/analysis/ResourceDefinitionException.java
Sun Aug 19 13:00:40 2012
@@ -94,4 +94,4 @@ public final class ResourceDefinitionExc
                 Collection<ResourceDescription>> getIssues() {
         return issues;
     }
-}
\ No newline at end of file
+}

Modified: creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableClassPathResource.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableClassPathResource.java?rev=1374749&r1=1374748&r2=1374749&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableClassPathResource.java
(original)
+++ creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableClassPathResource.java
Sun Aug 19 13:00:40 2012
@@ -76,4 +76,4 @@ public final class StreamableClassPathRe
     public String toString() {
         return "StreamableClassPathResource [name=" + name + "]";
     }
-}
\ No newline at end of file
+}

Modified: creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableFileNameResource.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableFileNameResource.java?rev=1374749&r1=1374748&r2=1374749&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableFileNameResource.java
(original)
+++ creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/load/StreamableFileNameResource.java
Sun Aug 19 13:00:40 2012
@@ -29,7 +29,7 @@ import org.apache.creadur.whisker.app.St
  * Streams, on demand, the contents of a file identified by a full file name,
  * including path.
  */
-public class StreamableFileNameResource extends StreamableResource {
+public final class StreamableFileNameResource extends StreamableResource {
     /**
      * The full file name, including path,
      * of the resource to be streamed.
@@ -39,7 +39,8 @@ public class StreamableFileNameResource 
     /**
      * Constructs an instance that streams
      * the resource identified by name on demand.
-     * @param fileName, full file name, including path, of the resource to be streamed
+     * @param fileName full file name, including path,
+     * of the resource to be streamed
      * on demand, not null
      */
     public StreamableFileNameResource(final String fileName) {

Modified: creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsIntoDirectoryFactory.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsIntoDirectoryFactory.java?rev=1374749&r1=1374748&r2=1374749&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsIntoDirectoryFactory.java
(original)
+++ creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsIntoDirectoryFactory.java
Sun Aug 19 13:00:40 2012
@@ -30,7 +30,8 @@ import org.apache.creadur.whisker.app.Re
 /**
  * Writes results as files within a directory.
  */
-public class WriteResultsIntoDirectoryFactory implements ResultWriterFactory  {
+public final class WriteResultsIntoDirectoryFactory
+                       implements ResultWriterFactory  {
 
     /** Output directory. */
     private final File directory;
@@ -53,12 +54,13 @@ public class WriteResultsIntoDirectoryFa
 
     /**
      * Creates a suitable write for the given report.
-     * @param not null
+     * @param result not null
      * @return not null
      * @see ResultWriterFactory#writerFor(Result)
      * @throws IOException when the report cannot be written
      */
-    public Writer writerFor(final Result result) throws IOException {
+    public Writer writerFor(final Result result)
+            throws IOException {
         return new BufferedWriter(
                 new FileWriterWithEncoding(
                         result.within(directory), encoding));

Modified: creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsToSystemOutFactory.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsToSystemOutFactory.java?rev=1374749&r1=1374748&r2=1374749&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsToSystemOutFactory.java
(original)
+++ creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/out/WriteResultsToSystemOutFactory.java
Sun Aug 19 13:00:40 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.app.out;
 
@@ -29,25 +29,39 @@ import org.apache.creadur.whisker.app.Re
 /**
  * Factory builds writers that output to <code>System.out</code>.
  */
-public class WriteResultsToSystemOutFactory implements ResultWriterFactory {
+public final class WriteResultsToSystemOutFactory
+                        implements ResultWriterFactory {
 
-    /** Encoding to be used */
+    /** Encoding used. */
     private final String encoding;
-    
-    public WriteResultsToSystemOutFactory(String encoding) {
+
+    /**
+     * Constructs a factory with given encoding.
+     * @param encoding not null
+     */
+    public WriteResultsToSystemOutFactory(final String encoding) {
         super();
         this.encoding = encoding;
     }
 
+    /**
+     * Constructs a factory with default
+     * (<code>UTF-8</code>) encoding.
+     */
     public WriteResultsToSystemOutFactory() {
         this("UTF-8");
     }
 
     /**
+     * Writes given result to <code>System.our</code>.
+     * @param result not null
+     * @return not null
+     * @throws IOException when result cannot be written
      * @see ResultWriterFactory#writerFor(Result)
      */
-    public Writer writerFor(Result result) throws IOException {
-        return new BufferedWriter(new OutputStreamWriter(System.out, encoding));
+    public Writer writerFor(final Result result)
+            throws IOException {
+        return new BufferedWriter(
+                new OutputStreamWriter(System.out, encoding));
     }
-
 }



Mime
View raw message