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 2011/12/27 19:14:53 UTC

svn commit: r1224963 - in /incubator/rat/whisker/trunk: ./ apache-whisker-velocity/ apache-whisker-velocity/src/main/java/org/apache/rat/whisker/out/velocity/ apache-whisker-velocity/src/main/resources/org/apache/rat/whisker/template/velocity/

Author: rdonkin
Date: Tue Dec 27 18:14:52 2011
New Revision: 1224963

URL: http://svn.apache.org/viewvc?rev=1224963&view=rev
Log:
Remember to close streams.

Modified:
    incubator/rat/whisker/trunk/apache-whisker-velocity/pom.xml
    incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/rat/whisker/out/velocity/VelocityReports.java
    incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/resources/org/apache/rat/whisker/template/velocity/license.vm
    incubator/rat/whisker/trunk/pom.xml

Modified: incubator/rat/whisker/trunk/apache-whisker-velocity/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rat/whisker/trunk/apache-whisker-velocity/pom.xml?rev=1224963&r1=1224962&r2=1224963&view=diff
==============================================================================
--- incubator/rat/whisker/trunk/apache-whisker-velocity/pom.xml (original)
+++ incubator/rat/whisker/trunk/apache-whisker-velocity/pom.xml Tue Dec 27 18:14:52 2011
@@ -46,6 +46,11 @@
     </dependency>
       
     <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+    </dependency>
+      
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

Modified: incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/rat/whisker/out/velocity/VelocityReports.java
URL: http://svn.apache.org/viewvc/incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/rat/whisker/out/velocity/VelocityReports.java?rev=1224963&r1=1224962&r2=1224963&view=diff
==============================================================================
--- incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/rat/whisker/out/velocity/VelocityReports.java (original)
+++ incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/rat/whisker/out/velocity/VelocityReports.java Tue Dec 27 18:14:52 2011
@@ -19,8 +19,10 @@
 package org.apache.rat.whisker.out.velocity;
 
 import java.io.IOException;
+import java.io.Writer;
 import java.util.Collection;
 
+import org.apache.commons.io.IOUtils;
 import org.apache.rat.whisker.app.ResultWriterFactory;
 import org.apache.rat.whisker.app.analysis.LicenseAnalyst;
 import org.apache.rat.whisker.app.analysis.ResourceDefinitionException;
@@ -111,7 +113,9 @@ public class VelocityReports implements 
      * @throws ResourceNotFoundException 
      */
     private void merge(final Product product, final VelocityContext context) throws Exception {
-        engine.getTemplate(template(product.getTemplate())).merge(context, product.writerFrom(writerFactory));
+        final Writer writer = product.writerFrom(writerFactory);
+        engine.getTemplate(template(product.getTemplate())).merge(context, writer);
+        IOUtils.closeQuietly(writer);
     }
 
     /**

Modified: incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/resources/org/apache/rat/whisker/template/velocity/license.vm
URL: http://svn.apache.org/viewvc/incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/resources/org/apache/rat/whisker/template/velocity/license.vm?rev=1224963&r1=1224962&r2=1224963&view=diff
==============================================================================
--- incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/resources/org/apache/rat/whisker/template/velocity/license.vm (original)
+++ incubator/rat/whisker/trunk/apache-whisker-velocity/src/main/resources/org/apache/rat/whisker/template/velocity/license.vm Tue Dec 27 18:14:52 2011
@@ -18,14 +18,6 @@
 ##  under the License.    
 ## 
 #################################################################################
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-[JDOM] LICENSE.vm START -------------> 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 $work.PrimaryLicense.Text
 
 This distribution contains third party resources.
@@ -65,9 +57,3 @@ $indent.indent(12,$license.CopyrightNoti
 #end
 #end
 #end    
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
---------------------> LICENSE.vm END  
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Modified: incubator/rat/whisker/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rat/whisker/trunk/pom.xml?rev=1224963&r1=1224962&r2=1224963&view=diff
==============================================================================
--- incubator/rat/whisker/trunk/pom.xml (original)
+++ incubator/rat/whisker/trunk/pom.xml Tue Dec 27 18:14:52 2011
@@ -58,6 +58,13 @@
         <version>1.2</version>
       </dependency>
 
+    <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>2.1</version>
+    </dependency>
+
+
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>