mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8274809: Update java.base classes to use try-with-resources
Reviewed-by: mullan, alanb, dfuchs
This commit is contained in:
parent
debaa28e9c
commit
dee447f8ae
7 changed files with 20 additions and 58 deletions
|
@ -292,12 +292,9 @@ public class SealedObject implements Serializable {
|
|||
throws IOException, ClassNotFoundException, IllegalBlockSizeException,
|
||||
BadPaddingException
|
||||
{
|
||||
ObjectInput a = getExtObjectInputStream(c);
|
||||
try {
|
||||
try (ObjectInput a = getExtObjectInputStream(c)) {
|
||||
Object obj = a.readObject();
|
||||
return obj;
|
||||
} finally {
|
||||
a.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -412,12 +409,9 @@ public class SealedObject implements Serializable {
|
|||
throw new RuntimeException(iape.getMessage());
|
||||
}
|
||||
|
||||
ObjectInput a = getExtObjectInputStream(c);
|
||||
try {
|
||||
try (ObjectInput a = getExtObjectInputStream(c)) {
|
||||
Object obj = a.readObject();
|
||||
return obj;
|
||||
} finally {
|
||||
a.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue