
| Key: |
XSTR-244
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Assignee: |
Unassigned
|
| Reporter: |
Rob Eden
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
XStream
Created: 23/Sep/05 01:41 PM
Updated: 07/Aug/06 09:19 PM
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
1.2
|
|
| JDK version and platform: |
1.5.0_02 for Macintosh
|
|
Calling close() multiple times on an ObjectOutputStream created by calling XStream.createObjectOutputStream(...) results in an ArrayIndexOutOfBoundsException. It should detect that it has already been closed and ignore the call.
Here's a test case that can be put in XStreamTest.java:
public void testMultipleClose() {
try {
StringWriter sout = new StringWriter();
ObjectOutputStream oout = xstream.createObjectOutputStream( sout );
oout.writeObject( new Integer( 1 ) );
oout.close();
oout.close();
}
catch( Exception ex ) {
ex.printStackTrace();
fail( ex.toString() );
}
}
A patch for the fix is attached.
|
|
Description
|
Calling close() multiple times on an ObjectOutputStream created by calling XStream.createObjectOutputStream(...) results in an ArrayIndexOutOfBoundsException. It should detect that it has already been closed and ignore the call.
Here's a test case that can be put in XStreamTest.java:
public void testMultipleClose() {
try {
StringWriter sout = new StringWriter();
ObjectOutputStream oout = xstream.createObjectOutputStream( sout );
oout.writeObject( new Integer( 1 ) );
oout.close();
oout.close();
}
catch( Exception ex ) {
ex.printStackTrace();
fail( ex.toString() );
}
}
A patch for the fix is attached. |
Show » |
|
2. changed QuickWriter to be Writer-compliant (same comment)
3. kept PrettyWriter as XStream-compliant (StreamException)
4. kept CompactPrettyWriter as XStream-compliant (StreamException)