Use try-with-resources.
This commit is contained in:
parent
e3e020fe2f
commit
9ebcddc0b1
|
@ -142,10 +142,9 @@ public class EventListenerSupportTest {
|
||||||
|
|
||||||
//serialize:
|
//serialize:
|
||||||
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
|
try (final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream)) {
|
||||||
|
|
||||||
objectOutputStream.writeObject(listenerSupport);
|
objectOutputStream.writeObject(listenerSupport);
|
||||||
objectOutputStream.close();
|
}
|
||||||
|
|
||||||
//deserialize:
|
//deserialize:
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in New Issue