You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by hu...@apache.org on 2003/12/12 10:40:47 UTC
cvs commit: cocoon-2.1/src/java/org/apache/cocoon/reading ResourceReader.java
huber 2003/12/12 01:40:47
Modified: src/java/org/apache/cocoon/reading ResourceReader.java
Log:
fix Bugzilla Bug 25069, close inputStream in finally block
Revision Changes Path
1.3 +11 -4 cocoon-2.1/src/java/org/apache/cocoon/reading/ResourceReader.java
Index: ResourceReader.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/reading/ResourceReader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResourceReader.java 19 Mar 2003 15:42:17 -0000 1.2
+++ ResourceReader.java 12 Dec 2003 09:40:47 -0000 1.3
@@ -289,9 +289,16 @@
throw SourceUtil.handle("Error during resolving of the input stream", se);
}
- processStream();
-
- inputStream.close();
+ // Bugzilla Bug 25069, close inputStream in finally block
+ // this will close inputStream even if processStream throws
+ // an exception
+ try {
+ processStream();
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
if (!quickTest) {
// if everything is ok, add this to the list of generated documents