Ignore:
Timestamp:
2014-05-01T02:34:43+02:00 (12 years ago)
Author:
Don-vip
Message:

see #8465 - global use of try-with-resources, according to

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r7005 r7033  
    7575        init();
    7676        try {
    77             InputStream in = getSourceInputStream();
    78             try {
    79                 InputStreamReader reader = new InputStreamReader(in, Utils.UTF_8);
     77            try (
     78                InputStream in = getSourceInputStream();
     79                InputStreamReader reader = new InputStreamReader(in, Utils.UTF_8)
     80            ) {
    8081                XmlObjectParser parser = new XmlObjectParser(new XmlStyleSourceHandler(this));
    8182                parser.startWithValidation(reader,
     
    8384                        "resource://data/mappaint-style.xsd");
    8485                while (parser.hasNext());
    85             } finally {
    86                 closeSourceInputStream(in);
    87             }
    88 
     86            }
    8987        } catch (IOException e) {
    9088            Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
     
    377375        }
    378376    }
    379 
    380377}
Note: See TracChangeset for help on using the changeset viewer.