Skip to content

Commit

Permalink
TCI - Disallow serializable
Browse files Browse the repository at this point in the history
* make sure all streams are closed

Change-Id: Ib3a1ca29994d8af41c690aeb7bf767079e199849
  • Loading branch information
jfaltermeier committed Oct 13, 2021
1 parent 9f70558 commit a4aaec0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,18 @@ protected java.lang.Class<?> resolveClass(java.io.ObjectStreamClass desc)
throw new IllegalArgumentException("Deserialzation is not supported"); //$NON-NLS-1$
}
};
return ois.readObject();
final Object object = ois.readObject();
try {
ois.close();
} catch (final IOException ex) {
/* silent */
}
try {
bais.close();
} catch (final IOException ex) {
/* silent */
}
return object;
} catch (final IOException e) {
throw new XmlRpcException("Failed to read result object: " + e.getMessage(), e); //$NON-NLS-1$
} catch (final ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ public void write(final ContentHandler pHandler, Object pObject) throws SAXExcep
final OutputStream ostream = new EncoderOutputStream(encoder);
final ObjectOutputStream oos = new ObjectOutputStream(ostream);
oos.writeObject(pObject);
oos.close();
try {
oos.close();
} catch (final IOException ex) {
/* silent */
}
try {
ostream.close();
} catch (final IOException ex) {
/* silent */
}
} catch (final Base64.SAXIOException e) {
throw e.getSAXException();
} catch (final IOException e) {
Expand Down

0 comments on commit a4aaec0

Please sign in to comment.