Changeset 7004 in josm
- Timestamp:
- 2014-04-26T15:28:16+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r6992 r7004 32 32 33 33 /** 34 * Loads a JOSM session 34 * Loads a JOSM session. 35 35 * @since 4668 36 36 */ … … 174 174 } 175 175 } catch (IllegalDataException e) { 176 Main.error(e); 177 HelpAwareOptionPane.showMessageDialogInEDT( 178 Main.parent, 179 tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>", uri != null ? uri : file.getName(), e.getMessage()), 180 tr("Data Error"), 181 JOptionPane.ERROR_MESSAGE, 182 null 183 ); 184 cancel(); 176 handleException(tr("Data Error"), e); 185 177 } catch (IOException e) { 186 Main.error(e); 187 HelpAwareOptionPane.showMessageDialogInEDT( 188 Main.parent, 189 tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>", uri != null ? uri : file.getName(), e.getMessage()), 190 tr("IO Error"), 191 JOptionPane.ERROR_MESSAGE, 192 null 193 ); 194 cancel(); 178 handleException(tr("IO Error"), e); 195 179 } catch (RuntimeException e) { 196 180 cancel(); … … 201 185 } 202 186 } 187 188 private void handleException(String dialogTitle, Exception e) { 189 Main.error(e); 190 HelpAwareOptionPane.showMessageDialogInEDT( 191 Main.parent, 192 tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>", uri != null ? uri : file.getName(), e.getMessage()), 193 dialogTitle, 194 JOptionPane.ERROR_MESSAGE, 195 null 196 ); 197 cancel(); 198 } 203 199 } 204 200 } 205 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
r6643 r7004 5 5 6 6 import java.io.IOException; 7 import java.net.MalformedURLException;8 7 import java.net.URISyntaxException; 9 8 import java.net.URL; … … 54 53 loader = new Loader(Utils.openURL(u), u.toURI(), url.endsWith(".joz")); 55 54 return Main.worker.submit(loader); 56 } catch (URISyntaxException e) { 57 Main.error(e); 58 } catch (MalformedURLException e) { 59 Main.error(e); 60 } catch (IOException e) { 55 } catch (URISyntaxException | IOException e) { 61 56 Main.error(e); 62 57 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6990 r7004 1167 1167 try { 1168 1168 structPrototype = klass.newInstance(); 1169 } catch (InstantiationException ex) { 1170 throw new RuntimeException(ex); 1171 } catch (IllegalAccessException ex) { 1169 } catch (InstantiationException | IllegalAccessException ex) { 1172 1170 throw new RuntimeException(ex); 1173 1171 } … … 1187 1185 } 1188 1186 } 1189 } catch (IllegalArgumentException ex) { 1190 throw new RuntimeException(ex); 1191 } catch (IllegalAccessException ex) { 1187 } catch (IllegalArgumentException | IllegalAccessException ex) { 1192 1188 throw new RuntimeException(ex); 1193 1189 } … … 1200 1196 try { 1201 1197 struct = klass.newInstance(); 1202 } catch (InstantiationException ex) { 1203 throw new RuntimeException(ex); 1204 } catch (IllegalAccessException ex) { 1198 } catch (InstantiationException | IllegalAccessException ex) { 1205 1199 throw new RuntimeException(ex); 1206 1200 } -
trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
r6995 r7004 175 175 try { 176 176 fromXML(in); 177 } catch (RuntimeException e) { 178 Main.error(e); 179 } catch (XMLStreamException e) { 177 } catch (RuntimeException | XMLStreamException e) { 180 178 Main.error(e); 181 179 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r6883 r7004 268 268 Constructor<?> c = activeRenderer.getConstructor(new Class<?>[]{Graphics2D.class, NavigatableComponent.class, boolean.class}); 269 269 return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode)); 270 } catch(NoSuchMethodException e){ 271 throw new MapRendererFactoryException(e); 272 } catch (IllegalArgumentException e) { 273 throw new MapRendererFactoryException(e); 274 } catch (InstantiationException e) { 275 throw new MapRendererFactoryException(e); 276 } catch (IllegalAccessException e) { 270 } catch(NoSuchMethodException | IllegalArgumentException | InstantiationException | IllegalAccessException e){ 277 271 throw new MapRendererFactoryException(e); 278 272 } catch (InvocationTargetException e) { -
trunk/src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java
r5227 r7004 18 18 try { 19 19 proj = projClass.newInstance(); 20 } catch (InstantiationException e) { 21 throw new RuntimeException(e); 22 } catch (IllegalAccessException e) { 20 } catch (InstantiationException | IllegalAccessException e) { 23 21 throw new RuntimeException(e); 24 22 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r6986 r7004 209 209 errors.add(new OpeningHoursTestError(tr("opening_hours value can be prettified"), Severity.OTHER, prettifiedValue)); 210 210 } 211 } catch (ScriptException ex) { 212 Main.error(ex); 213 } catch (NoSuchMethodException ex) { 211 } catch (ScriptException | NoSuchMethodException ex) { 214 212 Main.error(ex); 215 213 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6823 r7004 714 714 } catch (IllegalStateException e) { 715 715 return tr("Illegal expression ''{0}''", exp); 716 } 717 catch (PatternSyntaxException e) { 716 } catch (PatternSyntaxException e) { 718 717 return tr("Illegal regular expression ''{0}''", exp); 719 718 } -
trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
r6990 r7004 217 217 UserInfo info = new OsmServerUserInfoReader().fetchUserInfo(NullProgressMonitor.INSTANCE); 218 218 setFullyIdentified(info.getDisplayName(), info); 219 } catch (IllegalArgumentException e) { 220 Main.error(e); 221 } catch (OsmTransferException e) { 219 } catch (IllegalArgumentException | OsmTransferException e) { 222 220 Main.error(e); 223 221 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r6529 r7004 638 638 } 639 639 }); 640 } catch(InterruptedException e) { 640 } catch(InterruptedException | InvocationTargetException e) { 641 641 // FIXME: signature of realRun should have a generic checked exception we 642 642 // could throw here 643 643 throw new RuntimeException(e); 644 } catch(InvocationTargetException e) {645 throw new RuntimeException(e);646 644 } finally { 647 645 monitor.finishTask(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentDownloadTask.java
r6830 r7004 196 196 return; 197 197 lastException = e; 198 } catch(RuntimeException e) {199 throw e;200 198 } 201 199 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r6792 r7004 552 552 dirExif = metadata.getDirectory(ExifIFD0Directory.class); 553 553 dirGps = metadata.getDirectory(GpsDirectory.class); 554 } catch (CompoundException p) { 555 e.setExifCoor(null); 556 e.setPos(null); 557 return; 558 } catch (IOException p) { 554 } catch (CompoundException | IOException p) { 559 555 e.setExifCoor(null); 560 556 e.setPos(null); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r6927 r7004 83 83 parameterFunctions.add(Math.class.getMethod("tan", double.class)); 84 84 parameterFunctions.add(Math.class.getMethod("tanh", double.class)); 85 } catch (NoSuchMethodException ex) { 86 throw new RuntimeException(ex); 87 } catch (SecurityException ex) { 85 } catch (NoSuchMethodException | SecurityException ex) { 88 86 throw new RuntimeException(ex); 89 87 } … … 752 750 try { 753 751 result = m.invoke(FUNCTIONS_INSTANCE, convertedArgs); 754 } catch (IllegalAccessException ex) { 755 throw new RuntimeException(ex); 756 } catch (IllegalArgumentException ex) { 752 } catch (IllegalAccessException | IllegalArgumentException ex) { 757 753 throw new RuntimeException(ex); 758 754 } catch (InvocationTargetException ex) { … … 815 811 try { 816 812 result = m.invoke(null, convertedArgs); 817 } catch (IllegalAccessException ex) { 818 throw new RuntimeException(ex); 819 } catch (IllegalArgumentException ex) { 813 } catch (IllegalAccessException | IllegalArgumentException ex) { 820 814 throw new RuntimeException(ex); 821 815 } catch (InvocationTargetException ex) { -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r6995 r7004 26 26 import oauth.signpost.OAuthProvider; 27 27 import oauth.signpost.basic.DefaultOAuthProvider; 28 import oauth.signpost.exception.OAuthCommunicationException;29 28 import oauth.signpost.exception.OAuthException; 30 29 … … 110 109 con.disconnect(); 111 110 } 112 } catch (NoSuchFieldException e) { 113 Main.error(e); 114 Main.warn(tr("Failed to cancel running OAuth operation")); 115 } catch (SecurityException e) { 116 Main.error(e); 117 Main.warn(tr("Failed to cancel running OAuth operation")); 118 } catch (IllegalAccessException e) { 111 } catch (NoSuchFieldException | SecurityException | IllegalAccessException e) { 119 112 Main.error(e); 120 113 Main.warn(tr("Failed to cancel running OAuth operation")); … … 146 139 provider.retrieveRequestToken(consumer, ""); 147 140 return OAuthToken.createToken(consumer); 148 } catch(OAuthCommunicationException e){149 if (canceled)150 throw new OsmTransferCanceledException(e);151 throw new OsmOAuthAuthorizationException(e);152 141 } catch(OAuthException e){ 153 142 if (canceled) … … 180 169 provider.retrieveAccessToken(consumer, null); 181 170 return OAuthToken.createToken(consumer); 182 } catch(OAuthCommunicationException e){183 if (canceled)184 throw new OsmTransferCanceledException(e);185 throw new OsmOAuthAuthorizationException(e);186 171 } catch(OAuthException e){ 187 172 if (canceled) … … 441 426 connection.setDoOutput(false); 442 427 connection.connect(); 443 } catch(MalformedURLException e) {444 throw new OsmOAuthAuthorizationException(e);445 428 } catch(IOException e) { 446 429 throw new OsmOAuthAuthorizationException(e); … … 504 487 if (retCode != HttpURLConnection.HTTP_OK) 505 488 throw new OsmOAuthAuthorizationException(tr("Failed to authorize OAuth request ''{0}''", requestToken.getKey())); 506 } catch(MalformedURLException e) {507 throw new OsmOAuthAuthorizationException(e);508 489 } catch(IOException e) { 509 490 throw new OsmOAuthAuthorizationException(e); -
trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java
r6906 r7004 7 7 import java.io.IOException; 8 8 import java.net.HttpURLConnection; 9 import java.net.MalformedURLException;10 9 import java.net.URL; 11 10 … … 123 122 Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(connection.getInputStream()); 124 123 return OsmServerUserInfoReader.buildFromXML(d); 125 } catch(SAXException e) { 124 } catch(SAXException | ParserConfigurationException e) { 126 125 throw new XmlParsingException(e); 127 } catch(ParserConfigurationException e){ 128 throw new XmlParsingException(e); 129 } catch(MalformedURLException e) { 130 throw new OsmTransferException(e); 131 } catch(IOException e){ 126 } catch(IOException e) { 132 127 throw new OsmTransferException(e); 133 128 } catch(OAuthException e) { -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r7001 r7004 372 372 } 373 373 }); 374 } catch (InterruptedException e) { 375 Main.error(e); 376 } catch (InvocationTargetException e) { 374 } catch (InterruptedException | InvocationTargetException e) { 377 375 Main.error(e); 378 376 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r6990 r7004 374 374 } 375 375 model.fireTableDataChanged(); 376 } catch (PatternSyntaxException ex) { 376 } catch (PatternSyntaxException | ClassCastException ex) { 377 377 Main.warn(ex); 378 } catch (ClassCastException ex2) {379 Main.warn(ex2);380 378 } 381 379 } -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r6920 r7004 82 82 try { 83 83 SwingUtilities.invokeAndWait(task); 84 } catch (InterruptedException e) { 84 } catch (InterruptedException | InvocationTargetException e) { 85 85 Main.error(e); 86 } catch (InvocationTargetException e) { 87 Main.error(e); 88 } 89 } 90 } 91 92 /** 93 * returns true if the user wants to cancel, false if they 94 * want to continue 86 } 87 } 88 } 89 90 /** 91 * @return true if the user wants to cancel, false if they want to continue 95 92 */ 96 93 public static final boolean warnUser(String title, String content, ImageIcon baseActionIcon, String continueToolTip) { -
trunk/src/org/openstreetmap/josm/io/DiffResultProcessor.java
r6906 r7004 85 85 InputSource inputSource = new InputSource(new StringReader(diffUploadResponse)); 86 86 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new Parser()); 87 } catch(IOException e) {88 throw new XmlParsingException(e);89 } catch(ParserConfigurationException e) {90 throw new XmlParsingException(e);91 87 } catch(XmlParsingException e) { 92 88 throw e; 93 } catch(SAXException e) { 89 } catch(IOException | ParserConfigurationException | SAXException e) { 94 90 throw new XmlParsingException(e); 95 91 } finally { -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r6830 r7004 356 356 merge(result.dataSet); 357 357 } 358 } catch (InterruptedException e) { 359 Main.error(e); 360 } catch (ExecutionException e) { 358 } catch (InterruptedException | ExecutionException e) { 361 359 Main.error(e); 362 360 } -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r6995 r7004 20 20 import java.net.SocketTimeoutException; 21 21 import java.net.URL; 22 import java.net.UnknownHostException;23 22 import java.util.Collection; 24 23 import java.util.Collections; … … 716 715 throw new OsmApiException(retCode, errorHeader, errorBody); 717 716 } 718 } catch (UnknownHostException e) { 719 throw new OsmTransferException(e); 720 } catch (SocketTimeoutException e) { 721 if (retries-- > 0) { 722 continue; 723 } 724 throw new OsmTransferException(e); 725 } catch (ConnectException e) { 717 } catch (SocketTimeoutException | ConnectException e) { 726 718 if (retries-- > 0) { 727 719 continue; … … 730 722 } catch(IOException e) { 731 723 throw new OsmTransferException(e); 732 } catch(OsmTransferCanceledException e) {733 throw e;734 724 } catch(OsmTransferException e) { 735 725 throw e; -
trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
r6906 r7004 142 142 } catch(XmlParsingException e) { 143 143 throw e; 144 } catch (ParserConfigurationException e) { 145 throw new XmlParsingException(e); 146 } catch(SAXException e) { 147 throw new XmlParsingException(e); 148 } catch(IOException e) { 144 } catch (ParserConfigurationException | SAXException | IOException e) { 149 145 throw new XmlParsingException(e); 150 146 } finally { -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r6906 r7004 223 223 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, parser.new Parser()); 224 224 return parser.getChangesets(); 225 } catch(ParserConfigurationException e) { 226 throw new IllegalDataException(e.getMessage(), e); 227 } catch(SAXException e) { 225 } catch(ParserConfigurationException | SAXException e) { 228 226 throw new IllegalDataException(e.getMessage(), e); 229 227 } catch(Exception e) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r6941 r7004 88 88 initOK = true; 89 89 } 90 } catch (KeyStoreException e) { 91 Main.error(e); 92 } catch (NoSuchAlgorithmException e) { 93 Main.error(e); 94 } catch (CertificateException e) { 95 Main.error(e); 96 } catch (IOException e) { 97 Main.error(e); 98 } catch (UnrecoverableKeyException e) { 99 Main.error(e); 100 } catch (KeyManagementException e) { 90 } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | 91 IOException | UnrecoverableKeyException | KeyManagementException e) { 101 92 Main.error(e); 102 93 } -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r6992 r7004 77 77 try { 78 78 importer = importerClass.newInstance(); 79 } catch (InstantiationException e) { 80 throw new RuntimeException(e); 81 } catch (IllegalAccessException e) { 79 } catch (InstantiationException | IllegalAccessException e) { 82 80 throw new RuntimeException(e); 83 81 } … … 457 455 try { 458 456 layer = imp.load(e, support, progressMonitor.createSubTaskMonitor(1, false)); 459 } catch (IllegalDataException ex) { 460 exception = ex; 461 } catch (IOException ex) { 457 } catch (IllegalDataException | IOException ex) { 462 458 exception = ex; 463 459 } … … 542 538 } 543 539 }); 544 } catch (InvocationTargetException ex) { 545 throw new RuntimeException(ex); 546 } catch (InterruptedException ex) { 540 } catch (InvocationTargetException | InterruptedException ex) { 547 541 throw new RuntimeException(ex); 548 542 } -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6990 r7004 1167 1167 GuiHelper.runInEDT(task); 1168 1168 return task.get(); 1169 } catch (InterruptedException e) { 1170 Main.warn(e); 1171 } catch (ExecutionException e) { 1169 } catch (InterruptedException | ExecutionException e) { 1172 1170 Main.warn(e); 1173 1171 } -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r6890 r7004 320 320 Object plugin = c.newInstance(this); 321 321 return new PluginProxy(plugin, this); 322 } catch(NoSuchMethodException e) { 323 throw new PluginException(name, e); 324 } catch(IllegalAccessException e) { 325 throw new PluginException(name, e); 326 } catch (InstantiationException e) { 327 throw new PluginException(name, e); 328 } catch(InvocationTargetException e) { 322 } catch(NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { 329 323 throw new PluginException(name, e); 330 324 } … … 343 337 try { 344 338 return Class.forName(className, true, classLoader); 345 } catch (ClassNotFoundException e) { 346 throw new PluginException(name, e); 347 } catch (ClassCastException e) { 339 } catch (ClassNotFoundException | ClassCastException e) { 348 340 throw new PluginException(name, e); 349 341 } -
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r6830 r7004 87 87 final Directory dir = metadata.getDirectory(ExifIFD0Directory.class); 88 88 return dir.getInt(ExifIFD0Directory.TAG_ORIENTATION); 89 } catch (JpegProcessingException e) { 90 Main.error(e); 91 } catch (MetadataException e) { 92 Main.error(e); 93 } catch (IOException e) { 89 } catch (JpegProcessingException | MetadataException | IOException e) { 94 90 Main.error(e); 95 91 } -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r6920 r7004 28 28 url = URLDecoder.decode(url, "UTF-8"); 29 29 } 30 } catch (UnsupportedEncodingException x) { 31 Main.error(x); 32 } catch (IllegalArgumentException x) { 30 } catch (UnsupportedEncodingException | IllegalArgumentException x) { 33 31 Main.error(x); 34 32 } … … 72 70 z == null ? 18 : Integer.parseInt(z)); 73 71 } 74 } catch (NumberFormatException x) { 75 Main.error(x); 76 } catch (NullPointerException x) { 77 Main.error(x); 78 } catch (ArrayIndexOutOfBoundsException x) { 72 } catch (NumberFormatException | NullPointerException | ArrayIndexOutOfBoundsException x) { 79 73 Main.error(x); 80 74 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r7001 r7004 57 57 } 58 58 return; 59 } catch (IOException e) { 60 Main.warn(e); 61 } catch (URISyntaxException e) { 59 } catch (IOException | URISyntaxException e) { 62 60 Main.warn(e); 63 61 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r7003 r7004 461 461 return (String) t.getTransferData(DataFlavor.stringFlavor); 462 462 } 463 } catch (UnsupportedFlavorException ex) { 464 Main.error(ex); 465 return null; 466 } catch (IOException ex) { 463 } catch (UnsupportedFlavorException | IOException ex) { 467 464 Main.error(ex); 468 465 return null;
Note:
See TracChangeset
for help on using the changeset viewer.