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 {
|
||||
ObjectOutputStream ser =
|
||||
new ObjectOutputStream(new SinkOutputStream(into));
|
||||
ser.writeObject(from);
|
||||
ser.flush();
|
||||
try {
|
||||
ser.writeObject(from);
|
||||
ser.flush();
|
||||
} finally {
|
||||
ser.close();
|
||||
}
|
||||
} catch (IOException err) {
|
||||
throw new RuntimeException("Cannot hash as Serializable", err);
|
||||
}
|
||||
|
Reference in New Issue
Block a user