--- a/jdk/test/java/util/Locale/LocaleEnhanceTest.java Tue Feb 22 12:01:35 2011 -0800
+++ b/jdk/test/java/util/Locale/LocaleEnhanceTest.java Tue Feb 22 15:34:17 2011 -0800
@@ -1187,14 +1187,12 @@
locale = new Locale(lang, country, variant);
}
- // desrialize
- try {
- FileInputStream fis = new FileInputStream(testfile);
- ObjectInputStream ois = new ObjectInputStream(fis);
-
+ // deserialize
+ try (FileInputStream fis = new FileInputStream(testfile);
+ ObjectInputStream ois = new ObjectInputStream(fis))
+ {
Object o = ois.readObject();
assertEquals("Deserialize Java 6 Locale " + locale, o, locale);
- ois.close();
} catch (Exception e) {
errln("Exception while reading " + testfile.getAbsolutePath() + " - " + e.getMessage());
}