src/share/classes/sun/util/calendar/LocalGregorianCalendar.java
Print this page
rev 3509 : 7021209: convert lang, math, util to use try-with-resources
Reviewed-by: XXX
*** 125,135 ****
final String fname = homeDir + File.separator + "lib" + File.separator
+ "calendars.properties";
calendarProps = (Properties) AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws IOException {
Properties props = new Properties();
! props.load(new FileInputStream(fname));
return props;
}
});
} catch (PrivilegedActionException e) {
throw new RuntimeException(e.getException());
--- 125,137 ----
final String fname = homeDir + File.separator + "lib" + File.separator
+ "calendars.properties";
calendarProps = (Properties) AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws IOException {
Properties props = new Properties();
! try (FileInputStream fis = new FileInputStream(fname)) {
! props.load(fis);
! }
return props;
}
});
} catch (PrivilegedActionException e) {
throw new RuntimeException(e.getException());