I am an evil copy paste programmer and have replaced one line too much in the patch.
Sorry for this, the valid patch is attached now.
Oliver
Oliver Zeigermann wrote:
Hi,
when reading internally from a stream to fill contentBytes or content in getContent() and getContentBytes() the input stream gets nulled afterwards, but not closed.
Patch is attached.
Oliver
------------------------------------------------------------------------
Index: NodeRevisionContent.java =================================================================== RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionContent.java,v retrieving revision 1.12 diff -u -w -r1.12 NodeRevisionContent.java --- NodeRevisionContent.java 7 Apr 2003 11:45:42 -0000 1.12 +++ NodeRevisionContent.java 24 Oct 2003 12:00:29 -0000 @@ -151,6 +151,11 @@ contentBytes = read(inputStream); } catch (IOException e) { e.printStackTrace(); + } finally { + try { + inputStream.close(); + } catch (IOException e) { + } } content = new String(contentBytes).toCharArray(); result = content; @@ -177,8 +182,12 @@ contentBytes = read(inputStream); } catch (IOException e) { e.printStackTrace(); + } finally { + try { + inputStream.close(); + } catch (IOException e) { + } } - result = contentBytes; inputStream = null; reader = null; }
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Index: NodeRevisionContent.java
===================================================================
RCS file:
/home/cvspublic/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionContent.java,v
retrieving revision 1.12
diff -u -w -r1.12 NodeRevisionContent.java
--- NodeRevisionContent.java 7 Apr 2003 11:45:42 -0000 1.12
+++ NodeRevisionContent.java 27 Oct 2003 10:02:33 -0000
@@ -151,6 +151,11 @@
contentBytes = read(inputStream);
} catch (IOException e) {
e.printStackTrace();
+ } finally {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ }
}
content = new String(contentBytes).toCharArray();
result = content;
@@ -177,6 +182,11 @@
contentBytes = read(inputStream);
} catch (IOException e) {
e.printStackTrace();
+ } finally {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ }
}
result = contentBytes;
inputStream = null;--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
