cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r669174 - /cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/FileGenerator.java
Date Wed, 18 Jun 2008 14:12:56 GMT
Author: reinhard
Date: Wed Jun 18 07:12:55 2008
New Revision: 669174

URL: http://svn.apache.org/viewvc?rev=669174&view=rev
Log:
null check when closing the inputstream

Modified:
    cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/FileGenerator.java

Modified: cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/FileGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/FileGenerator.java?rev=669174&r1=669173&r2=669174&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/FileGenerator.java
(original)
+++ cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/FileGenerator.java
Wed Jun 18 07:12:55 2008
@@ -81,15 +81,18 @@
             xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", this.getXMLConsumer());
 
             inputStream = new BufferedInputStream(this.source.openStream());
+
             xmlReader.parse(new InputSource(inputStream));
         } catch (Exception e) {
             this.logger.error("Can't parse " + this.source, e);
             throw new RuntimeException(e);
         } finally {
-            try {
-                inputStream.close();
-            } catch (IOException e) {
-                this.logger.error("Error while closing input stream on " + this.source, e);
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    this.logger.error("Error while closing input stream on " + this.source,
e);
+                }
             }
         }
     }



Mime
View raw message