Ensure that ObjectOutputStream in H2CacheImpl is closed
Change-Id: I8a999a6203254deab2e55e242a660e23616d36c2 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -277,8 +277,12 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> {
|
|||||||
try {
|
try {
|
||||||
ObjectOutputStream ser =
|
ObjectOutputStream ser =
|
||||||
new ObjectOutputStream(new SinkOutputStream(into));
|
new ObjectOutputStream(new SinkOutputStream(into));
|
||||||
ser.writeObject(from);
|
try {
|
||||||
ser.flush();
|
ser.writeObject(from);
|
||||||
|
ser.flush();
|
||||||
|
} finally {
|
||||||
|
ser.close();
|
||||||
|
}
|
||||||
} catch (IOException err) {
|
} catch (IOException err) {
|
||||||
throw new RuntimeException("Cannot hash as Serializable", err);
|
throw new RuntimeException("Cannot hash as Serializable", err);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user