Changeset 7033 in josm for trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
- Timestamp:
- 2014-05-01T02:34:43+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r7005 r7033 171 171 File file = new File(getValidatorDir() + "ignorederrors"); 172 172 if (file.exists()) { 173 BufferedReader in = null; 174 try { 175 in = new BufferedReader(new InputStreamReader(new FileInputStream(file), Utils.UTF_8)); 173 try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), Utils.UTF_8))) { 176 174 for (String line = in.readLine(); line != null; line = in.readLine()) { 177 175 ignoredErrors.add(line); … … 181 179 } catch (final IOException e) { 182 180 Main.error(e); 183 } finally {184 Utils.close(in);185 181 } 186 182 } … … 197 193 198 194 public static void saveIgnoredErrors() { 199 PrintWriter out = null; 200 try { 201 out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(getValidatorDir() + "ignorederrors"), Utils.UTF_8), false); 195 try (PrintWriter out = new PrintWriter(new OutputStreamWriter( 196 new FileOutputStream(getValidatorDir() + "ignorederrors"), Utils.UTF_8), false)) { 202 197 for (String e : ignoredErrors) { 203 198 out.println(e); … … 205 200 } catch (IOException e) { 206 201 Main.error(e); 207 } finally {208 Utils.close(out);209 202 } 210 203 }
Note:
See TracChangeset
for help on using the changeset viewer.