Changeset 11746 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2017-03-19T02:26:34+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r11288 r11746 233 233 GuiHelper.runInEDT(this::displayNotification); 234 234 } 235 } catch (RuntimeException t) { 235 } catch (RuntimeException t) { // NOPMD 236 236 // Don't let exception stop time thread 237 237 Main.error("Autosave failed:"); -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r11728 r11746 1420 1420 Utils.setObjectsAccessible(field); 1421 1421 field.set(null, ResourceBundle.getBundle("sun.awt.resources.awt")); 1422 } catch (ReflectiveOperationException | RuntimeException e) { 1422 } catch (ReflectiveOperationException | RuntimeException e) { // NOPMD 1423 // Catch RuntimeException in order to catch InaccessibleObjectException, new in Java 9 1423 1424 Main.warn(e); 1424 1425 } -
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r11400 r11746 182 182 } catch (IOException e) { 183 183 throw e; 184 } catch (Exception e) { 184 } catch (Exception e) { // NOPMD 185 185 throw new IOException(e); 186 186 } -
trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
r10627 r11746 9 9 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.tools.JosmRuntimeException; 11 12 import org.openstreetmap.josm.tools.Utils; 12 13 … … 212 213 } 213 214 214 } catch ( RuntimeException e) {215 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 215 216 writer.println("Exception during dataset integrity test:"); 216 217 e.printStackTrace(writer); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r11731 r11746 86 86 import org.openstreetmap.josm.tools.Geometry.AreaAndPerimeter; 87 87 import org.openstreetmap.josm.tools.ImageProvider; 88 import org.openstreetmap.josm.tools.JosmRuntimeException; 88 89 import org.openstreetmap.josm.tools.Utils; 89 90 import org.openstreetmap.josm.tools.bugreport.BugReport; … … 1735 1736 } 1736 1737 return output; 1737 } catch ( RuntimeException e) {1738 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 1738 1739 throw BugReport.intercept(e).put("input-size", input.size()).put("output-size", output.size()); 1739 1740 } finally { … … 1747 1748 osm.accept(this); 1748 1749 } 1749 } catch ( RuntimeException e) {1750 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 1750 1751 throw BugReport.intercept(e).put("osm", osm); 1751 1752 } … … 1855 1856 1856 1857 benchmark.renderDone(); 1857 } catch ( RuntimeException e) {1858 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 1858 1859 throw BugReport.intercept(e) 1859 1860 .put("data", data) … … 1870 1871 try { 1871 1872 record.paintPrimitive(paintSettings, this); 1872 } catch ( RuntimeException e) {1873 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 1873 1874 throw BugReport.intercept(e).put("record", record); 1874 1875 } -
trunk/src/org/openstreetmap/josm/data/preferences/PreferencesWriter.java
r11553 r11746 88 88 addDefaults(); 89 89 } else { 90 throw new NullPointerException();90 throw new IllegalArgumentException(setting.toString()); 91 91 } 92 92 } … … 105 105 addDefaults(); 106 106 } else { 107 throw new NullPointerException();107 throw new IllegalArgumentException(setting.toString()); 108 108 } 109 109 } … … 126 126 addDefaults(); 127 127 } else { 128 throw new NullPointerException();128 throw new IllegalArgumentException(setting.toString()); 129 129 } 130 130 } … … 147 147 addDefaults(); 148 148 } else { 149 throw new NullPointerException();149 throw new IllegalArgumentException(setting.toString()); 150 150 } 151 151 } -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r11553 r11746 32 32 import org.openstreetmap.josm.data.projection.proj.Proj; 33 33 import org.openstreetmap.josm.data.projection.proj.ProjParameters; 34 import org.openstreetmap.josm.tools.JosmRuntimeException; 34 35 import org.openstreetmap.josm.tools.Utils; 35 36 import org.openstreetmap.josm.tools.bugreport.BugReport; … … 831 832 } 832 833 } 833 } catch ( RuntimeException e) {834 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 834 835 Main.error(e); 835 836 } -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r11642 r11746 338 338 try { 339 339 proj = pc.getProjection(); 340 } catch ( RuntimeException e) {340 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 341 341 Main.warn(e, "Unable to get projection "+code+" with "+pc+':'); 342 342 } -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r11594 r11746 333 333 test.initialize(); 334 334 } 335 } catch (Exception e) { 335 } catch (Exception e) { // NOPMD 336 336 Main.error(e); 337 337 if (!GraphicsEnvironment.isHeadless()) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r11385 r11746 271 271 for (TaggingPresetItem i : p.data) { 272 272 if (i instanceof KeyedItem) { 273 addPresetValue( p,(KeyedItem) i);273 addPresetValue((KeyedItem) i); 274 274 } else if (i instanceof CheckGroup) { 275 275 for (Check c : ((CheckGroup) i).checks) { 276 addPresetValue( p,c);276 addPresetValue(c); 277 277 } 278 278 } … … 282 282 } 283 283 284 private static void addPresetValue( TaggingPreset p,KeyedItem ky) {284 private static void addPresetValue(KeyedItem ky) { 285 285 Collection<String> values = ky.getValues(); 286 286 if (ky.key != null && values != null) { 287 try { 288 presetsValueData.putAll(ky.key, values); 289 harmonizedKeys.put(harmonizeKey(ky.key), ky.key); 290 } catch (NullPointerException e) { 291 Main.error(e, p+": Unable to initialize "+ky+'.'); 292 } 287 presetsValueData.putAll(ky.key, values); 288 harmonizedKeys.put(harmonizeKey(ky.key), ky.key); 293 289 } 294 290 } … … 543 539 544 540 private static String harmonizeKey(String key) { 545 key = key.toLowerCase(Locale.ENGLISH).replace('-', '_').replace(':', '_').replace(' ', '_'); 546 return Utils.strip(key, "-_;:,"); 541 return Utils.strip(key.toLowerCase(Locale.ENGLISH).replace('-', '_').replace(':', '_').replace(' ', '_'), "-_;:,"); 547 542 } 548 543 549 544 private static String harmonizeValue(String value) { 550 value = value.toLowerCase(Locale.ENGLISH).replace('-', '_').replace(' ', '_'); 551 return Utils.strip(value, "-_;:,"); 545 return Utils.strip(value.toLowerCase(Locale.ENGLISH).replace('-', '_').replace(' ', '_'), "-_;:,"); 552 546 } 553 547
Note:
See TracChangeset
for help on using the changeset viewer.