Changeset 6643 in josm
- Timestamp:
- 2014-01-06T16:39:45+01:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 96 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6642 r6643 227 227 if (logLevel < 1) 228 228 return; 229 System.err.println(tr("ERROR: {0}", msg)); 229 if (msg != null && !msg.isEmpty()) { 230 System.err.println(tr("ERROR: {0}", msg)); 231 } 230 232 } 231 233 … … 237 239 if (logLevel < 2) 238 240 return; 239 System.err.println(tr("WARNING: {0}", msg)); 241 if (msg != null && !msg.isEmpty()) { 242 System.err.println(tr("WARNING: {0}", msg)); 243 } 240 244 } 241 245 … … 247 251 if (logLevel < 3) 248 252 return; 249 System.out.println(tr("INFO: {0}", msg)); 253 if (msg != null && !msg.isEmpty()) { 254 System.out.println(tr("INFO: {0}", msg)); 255 } 250 256 } 251 257 … … 257 263 if (logLevel < 4) 258 264 return; 259 System.out.println(tr("DEBUG: {0}", msg)); 265 if (msg != null && !msg.isEmpty()) { 266 System.out.println(tr("DEBUG: {0}", msg)); 267 } 260 268 } 261 269 … … 323 331 * @param t The throwable object causing the error 324 332 * @param stackTrace {@code true}, if the stacktrace should be displayed 325 * @since 6 442333 * @since 6642 326 334 */ 327 335 public static void error(Throwable t, boolean stackTrace) { … … 336 344 * @param t The throwable object causing the error 337 345 * @param stackTrace {@code true}, if the stacktrace should be displayed 338 * @since 6 442346 * @since 6642 339 347 */ 340 348 public static void warn(Throwable t, boolean stackTrace) { … … 1395 1403 * @param t The network error 1396 1404 * @return The previous error associated to the given resource, if any. Can be {@code null} 1397 * @since 66 391405 * @since 6642 1398 1406 */ 1399 1407 public static Throwable addNetworkError(URL url, Throwable t) { … … 1415 1423 * @param t The network error 1416 1424 * @return The previous error associated to the given resource, if any. Can be {@code null} 1417 * @since 66 391425 * @since 6642 1418 1426 */ 1419 1427 public static Throwable addNetworkError(String url, Throwable t) { -
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r6054 r6643 111 111 future.get(); 112 112 } catch (Exception e) { 113 e.printStackTrace();113 Main.error(e); 114 114 return; 115 115 } -
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r6380 r6643 86 86 try { 87 87 exporter.exportData(file, layer); 88 } catch (IOException e 1) {89 e1.printStackTrace();88 } catch (IOException e) { 89 Main.error(e); 90 90 } 91 91 } -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r6474 r6643 143 143 } 144 144 } catch (Exception e) { 145 e.printStackTrace();145 Main.error(e); 146 146 } 147 147 } … … 163 163 result.append(task.acceptsDocumentationSummary()); 164 164 } catch (Exception e) { 165 e.printStackTrace();165 Main.error(e); 166 166 } 167 167 } -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r6234 r6643 54 54 restartJOSM(); 55 55 } catch (IOException ex) { 56 ex.printStackTrace();56 Main.error(ex); 57 57 } 58 58 } … … 123 123 Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()])); 124 124 } catch (IOException e) { 125 e.printStackTrace();125 Main.error(e); 126 126 } 127 127 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r6380 r6643 87 87 Main.parent.repaint(); 88 88 } catch (IOException e) { 89 e.printStackTrace();89 Main.error(e); 90 90 return false; 91 91 } -
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r6271 r6643 47 47 @Override 48 48 public void actionPerformed(ActionEvent e) { 49 JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"), 50 Arrays.asList(SessionImporter.FILE_FILTER, FileFilterAllFiles.getInstance()), 49 JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"), 50 Arrays.asList(SessionImporter.FILE_FILTER, FileFilterAllFiles.getInstance()), 51 51 SessionImporter.FILE_FILTER, JFileChooser.FILES_ONLY, "lastDirectory"); 52 52 if (fc == null) return; … … 174 174 } 175 175 } catch (IllegalDataException e) { 176 e.printStackTrace();176 Main.error(e); 177 177 HelpAwareOptionPane.showMessageDialogInEDT( 178 178 Main.parent, … … 184 184 cancel(); 185 185 } catch (IOException e) { 186 e.printStackTrace();186 Main.error(e); 187 187 HelpAwareOptionPane.showMessageDialogInEDT( 188 188 Main.parent, -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r6271 r6643 134 134 sw.write(file); 135 135 } catch (IOException ex) { 136 ex.printStackTrace();136 Main.error(ex); 137 137 HelpAwareOptionPane.showMessageDialogInEDT( 138 138 Main.parent, -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r6103 r6643 165 165 } 166 166 } catch (Exception x) { 167 x.printStackTrace();167 Main.error(x); 168 168 } 169 169 -
trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
r6053 r6643 97 97 future.get(); 98 98 } catch(Exception e) { 99 e.printStackTrace();99 Main.error(e); 100 100 return; 101 101 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
r6245 r6643 55 55 return Main.worker.submit(loader); 56 56 } catch (URISyntaxException e) { 57 e.printStackTrace();57 Main.error(e); 58 58 } catch (MalformedURLException e) { 59 e.printStackTrace();59 Main.error(e); 60 60 } catch (IOException e) { 61 e.printStackTrace();61 Main.error(e); 62 62 } 63 63 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r6524 r6643 249 249 future.get(); 250 250 } catch (Exception e) { 251 e.printStackTrace();251 Main.error(e); 252 252 return; 253 253 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r6524 r6643 70 70 future.get(); 71 71 } catch(Exception e) { 72 e.printStackTrace();72 Main.error(e); 73 73 return; 74 74 } -
trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java
r6248 r6643 41 41 getLayer().getConflicts().add(conflict); 42 42 } catch(IllegalStateException e) { 43 e.printStackTrace();43 Main.error(e); 44 44 warnBecauseOfDoubleConflict(); 45 45 } -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r6357 r6643 216 216 Main.error("Autosave failed:"); 217 217 Main.error(t); 218 t.printStackTrace();219 218 } 220 219 } -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r6578 r6643 274 274 ts.transform(new DOMSource(exportDocument), new StreamResult(f.toURI().getPath())); 275 275 } catch (Exception ex) { 276 Main.warn("Error saving preferences part: " +ex.getMessage());277 ex.printStackTrace();276 Main.warn("Error saving preferences part:"); 277 Main.error(ex); 278 278 } 279 279 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6626 r6643 781 781 } 782 782 } catch(IOException e) { 783 e.printStackTrace();783 Main.error(e); 784 784 JOptionPane.showMessageDialog( 785 785 Main.parent, … … 793 793 load(); 794 794 } catch (Exception e) { 795 e.printStackTrace();795 Main.error(e); 796 796 File backupFile = new File(prefDir,"preferences.xml.bak"); 797 797 JOptionPane.showMessageDialog( … … 806 806 save(); 807 807 } catch(IOException e1) { 808 e1.printStackTrace();808 Main.error(e1); 809 809 Main.warn(tr("Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile())); 810 810 } -
trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
r6578 r6643 78 78 } catch (IOException e) { 79 79 Main.error(e); 80 e.printStackTrace();81 80 } 82 81 return null; … … 107 106 ); 108 107 } catch (Exception e) { 109 e.printStackTrace();108 Main.error(e); 110 109 JOptionPane.showMessageDialog( 111 110 Main.parent, … … 123 122 connection = new Connection(new URL(serverUrl+"user/preferences")); 124 123 } catch (MalformedURLException e) { 125 e.printStackTrace();124 Main.error(e); 126 125 JOptionPane.showMessageDialog( 127 126 Main.parent, … … 173 172 fromXML(in); 174 173 } catch (RuntimeException e) { 175 e.printStackTrace();174 Main.error(e); 176 175 } catch (XMLStreamException e) { 177 e.printStackTrace();176 Main.error(e); 178 177 } 179 178 return res; -
trunk/src/org/openstreetmap/josm/data/Version.java
r6421 r6643 50 50 } catch (IOException e) { 51 51 Main.error(tr("Failed to load resource ''{0}'', error is {1}.", resource.toString(), e.toString())); 52 e.printStackTrace();52 Main.error(e); 53 53 } 54 54 return s; -
trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
r6248 r6643 126 126 } catch (IOException e) { 127 127 Main.error("Unable to load layers index for wms cache"); 128 e.printStackTrace();128 Main.error(e); 129 129 } 130 130 … … 152 152 } catch (IOException e) { 153 153 Main.error("Unable to save layer index for wms cache"); 154 e.printStackTrace();154 Main.error(e); 155 155 } 156 156 } … … 201 201 } catch (Exception e) { 202 202 if (indexFile.exists()) { 203 e.printStackTrace();203 Main.error(e); 204 204 Main.info("Unable to load index for wms-cache, new file will be created"); 205 205 } else { … … 298 298 } catch (Exception e) { 299 299 Main.error("Failed to save wms-cache file"); 300 e.printStackTrace();300 Main.error(e); 301 301 } 302 302 } … … 365 365 } catch (IOException e) { 366 366 Main.error("Unable to load file from wms cache"); 367 e.printStackTrace();367 Main.error(e); 368 368 return null; 369 369 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r6380 r6643 791 791 } 792 792 793 794 793 /** 795 794 * Show message and stack trace in log in case primitive is not found … … 803 802 + "at http://josm.openstreetmap.de/. This is not a critical error, it should be safe to continue in your work.", 804 803 primitiveId.getType(), Long.toString(primitiveId.getUniqueId()))); 805 new Exception().printStackTrace();804 Main.error(new Exception()); 806 805 } 807 806 -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r6629 r6643 160 160 } 161 161 } catch (Exception e){ 162 e.printStackTrace();162 Main.error(e); 163 163 } 164 164 } … … 174 174 } 175 175 } catch (final FileNotFoundException e) { 176 // Ignore176 Main.debug(Main.getErrorMessage(e)); 177 177 } catch (final IOException e) { 178 e.printStackTrace();178 Main.error(e); 179 179 } finally { 180 180 Utils.close(in); … … 199 199 } 200 200 } catch (IOException e) { 201 e.printStackTrace();201 Main.error(e); 202 202 } finally { 203 203 Utils.close(out); … … 291 291 } 292 292 } catch (Exception e) { 293 e.printStackTrace();293 Main.error(e); 294 294 JOptionPane.showMessageDialog(Main.parent, 295 295 tr("Error initializing test {0}:\n {1}", test.getClass() -
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r6362 r6643 90 90 */ 91 91 public static void explainGeneric(Exception e) { 92 e.printStackTrace();92 Main.error(e); 93 93 BugReportExceptionHandler.handleException(e); 94 94 } -
trunk/src/org/openstreetmap/josm/gui/FileDrop.java
r6221 r6643 85 85 private static Color defaultBorderColor = new Color( 0f, 0f, 1f, 0.25f ); 86 86 87 /** 88 * Constructor for JOSM file drop 87 /** 88 * Constructor for JOSM file drop 89 89 * @param c The drop target 90 90 */ … … 226 226 catch ( IOException io) 227 227 { Main.warn("FileDrop: IOException - abort:" ); 228 io.printStackTrace();228 Main.error(io); 229 229 evt.rejectDrop(); 230 230 } // end catch IOException 231 231 catch (UnsupportedFlavorException ufe) 232 232 { Main.warn("FileDrop: UnsupportedFlavorException - abort:" ); 233 ufe.printStackTrace();233 Main.error(ufe); 234 234 evt.rejectDrop(); 235 235 } // end catch: UnsupportedFlavorException … … 333 333 } // end try 334 334 catch( TooManyListenersException e ) 335 { e.printStackTrace();335 { Main.error(e); 336 336 Main.warn("FileDrop: Drop will not work due to previous error. Do you have another listener attached?" ); 337 337 } // end catch … … 413 413 * 414 414 * @param c The component to unregister as a drop target 415 * @return {@code true} if at least one item has been removed, {@code false} otherwise 415 * @return {@code true} if at least one item has been removed, {@code false} otherwise 416 416 */ 417 417 public static boolean remove( Component c) -
trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
r6362 r6643 65 65 instance.initFromOAuth(Main.parent); 66 66 } catch (Throwable t) { 67 t.printStackTrace();67 Main.error(t); 68 68 // Fall back to preferences if OAuth identification fails for any reason 69 69 instance.initFromPreferences(); … … 218 218 setFullyIdentified(info.getDisplayName(), info); 219 219 } catch (IllegalArgumentException e) { 220 e.printStackTrace();220 Main.error(e); 221 221 } catch (OsmTransferException e) { 222 e.printStackTrace();222 Main.error(e); 223 223 } 224 224 } … … 277 277 instance.initFromOAuth(Main.parent); 278 278 } catch (Throwable t) { 279 t.printStackTrace();279 Main.error(t); 280 280 } 281 281 } -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r6314 r6643 904 904 thread.interrupt(); 905 905 } catch (Exception e) { 906 e.printStackTrace();906 Main.error(e); 907 907 } 908 908 } -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r6539 r6643 273 273 } 274 274 } catch (Exception e) { 275 e.printStackTrace();275 Main.error(e); 276 276 } 277 277 } -
trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
r6310 r6643 46 46 import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; 47 47 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader; 48 import org.openstreetmap.josm.Main; 48 49 import org.openstreetmap.josm.data.Bounds; 49 50 import org.openstreetmap.josm.data.Version; … … 718 719 g.drawRect(x_min, y_min, w, h); 719 720 } catch (Exception e) { 720 e.printStackTrace();721 Main.error(e); 721 722 } 722 723 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r6361 r6643 514 514 } catch(InterruptedException e) { 515 515 Main.warn("InterruptedException in "+getClass().getSimpleName()+" while downloading changeset header"); 516 } catch(ExecutionException e) {517 e.printStackTrace();516 } catch(ExecutionException e) { 517 Main.error(e); 518 518 BugReportExceptionHandler.handleException(e.getCause()); 519 519 return; -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r6361 r6643 847 847 } else { 848 848 Main.warn("Button " + button + " doesn't have action defined"); 849 new Exception().printStackTrace();849 Main.error(new Exception()); 850 850 } 851 851 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r6380 r6643 223 223 return getBaseUserUrl() + "/" + URLEncoder.encode(user.getName(), "UTF-8").replaceAll("\\+", "%20"); 224 224 } catch(UnsupportedEncodingException e) { 225 e.printStackTrace();225 Main.error(e); 226 226 JOptionPane.showMessageDialog( 227 227 Main.parent, -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6623 r6643 1094 1094 } 1095 1095 } catch (Exception e) { 1096 e.printStackTrace();1096 Main.error(e); 1097 1097 } 1098 1098 } 1099 1099 }); 1100 1100 } catch (Exception e1) { 1101 e1.printStackTrace();1101 Main.error(e1); 1102 1102 } 1103 1103 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r6248 r6643 132 132 return; 133 133 if (lastException != null) { 134 lastException.printStackTrace();134 Main.error(lastException); 135 135 return; 136 136 } -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r6552 r6643 246 246 } 247 247 } catch (NumberFormatException x) { 248 x.printStackTrace(); // SAXException does not chain correctly248 Main.error(x); // SAXException does not chain correctly 249 249 throw new SAXException(x.getMessage(), x); 250 250 } catch (NullPointerException x) { 251 x.printStackTrace(); // SAXException does not chain correctly251 Main.error(x); // SAXException does not chain correctly 252 252 throw new SAXException(tr("Null pointer exception, possibly some missing tags."), x); 253 253 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r6296 r6643 146 146 } catch(Exception e) { 147 147 Main.error(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString())); 148 e.printStackTrace();148 Main.error(e); 149 149 return ss; 150 150 } finally { … … 237 237 help.getEditorKit().read(new StringReader(content), document, 0); 238 238 } catch (Exception e) { 239 e.printStackTrace();239 Main.error(e); 240 240 } 241 241 help.setDocument(document); … … 317 317 return; 318 318 } catch(HelpContentReaderException e2) { 319 e2.printStackTrace();319 Main.error(e2); 320 320 handleHelpContentReaderException(relativeHelpTopic, e2); 321 321 return; 322 322 } 323 323 } catch(HelpContentReaderException e1) { 324 e1.printStackTrace();324 Main.error(e1); 325 325 handleHelpContentReaderException(relativeHelpTopic, e1); 326 326 return; 327 327 } 328 328 } catch(HelpContentReaderException e) { 329 e.printStackTrace();329 Main.error(e); 330 330 handleHelpContentReaderException(relativeHelpTopic, e); 331 331 return; … … 352 352 return; 353 353 } catch(HelpContentReaderException e) { 354 e.printStackTrace();354 Main.error(e); 355 355 handleHelpContentReaderException(absoluteHelpTopic, e); 356 356 return; … … 556 556 } catch (BadLocationException e) { 557 557 Main.warn(tr("Bad location in HTML document. Exception was: {0}", e.toString())); 558 e.printStackTrace();558 Main.error(e); 559 559 } 560 560 } -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r6519 r6643 154 154 } 155 155 } catch(UnsupportedEncodingException e) { 156 e.printStackTrace();156 Main.error(e); 157 157 lblUser.setUrl(null); 158 158 } … … 172 172 lblUser.setUrl(url); 173 173 } catch(UnsupportedEncodingException e) { 174 e.printStackTrace();174 Main.error(e); 175 175 lblUser.setUrl(null); 176 176 } -
trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
r6248 r6643 149 149 download(); 150 150 } catch(DownloadException e) { 151 e.printStackTrace();151 Main.error(e); 152 152 } 153 153 } -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java
r5835 r6643 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import org.openstreetmap.josm.Main; 6 7 import org.openstreetmap.josm.actions.SaveAction; 7 8 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 56 57 } 57 58 } catch(Exception e) { 58 e.printStackTrace();59 Main.error(e); 59 60 setLastException(e); 60 61 } -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r6084 r6643 28 28 import javax.swing.DefaultListCellRenderer; 29 29 import javax.swing.ImageIcon; 30 import javax.swing.JButton; 30 31 import javax.swing.JComponent; 31 import javax.swing.JButton;32 32 import javax.swing.JDialog; 33 33 import javax.swing.JLabel; … … 482 482 model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.CANCELED); 483 483 } catch(Exception e) { 484 e.printStackTrace();484 Main.error(e); 485 485 model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.FAILED); 486 486 ExceptionDialogUtil.explainException(e); … … 489 489 model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.CANCELED); 490 490 } else if (currentTask.isFailed()) { 491 currentTask.getLastException().printStackTrace();491 Main.error(currentTask.getLastException()); 492 492 ExceptionDialogUtil.explainException(currentTask.getLastException()); 493 493 model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.FAILED); … … 516 516 model.setSaveState(layerInfo.getLayer(), UploadOrSaveState.CANCELED); 517 517 } catch(Exception e) { 518 e.printStackTrace();518 Main.error(e); 519 519 model.setSaveState(layerInfo.getLayer(), UploadOrSaveState.FAILED); 520 520 ExceptionDialogUtil.explainException(e); … … 524 524 } else if (currentTask.isFailed()) { 525 525 if (currentTask.getLastException() != null) { 526 currentTask.getLastException().printStackTrace();526 Main.error(currentTask.getLastException()); 527 527 ExceptionDialogUtil.explainException(currentTask.getLastException()); 528 528 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
r6316 r6643 254 254 break; 255 255 } catch(OsmTransferCanceledException e) { 256 e.printStackTrace();256 Main.error(e); 257 257 uploadCanceled = true; 258 258 break uploadloop; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r6450 r6643 78 78 import org.xml.sax.SAXException; 79 79 80 /** 80 /** 81 81 * This class displays the window to select the GPX file and the offset (timezone + delta). 82 82 * Then it correlates the images of the layer with that GPX file. … … 180 180 181 181 } catch (SAXException x) { 182 x.printStackTrace();182 Main.error(x); 183 183 JOptionPane.showMessageDialog( 184 184 Main.parent, … … 189 189 return; 190 190 } catch (IOException x) { 191 x.printStackTrace();191 Main.error(x); 192 192 JOptionPane.showMessageDialog( 193 193 Main.parent, … … 1145 1145 } catch(ParseException e) { 1146 1146 Main.error("Error while parsing date \"" + curWpTimeStr + '"'); 1147 e.printStackTrace();1147 Main.error(e); 1148 1148 prevWp = null; 1149 1149 prevWpTime = 0; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r6524 r6643 182 182 canonical = f.getCanonicalPath(); 183 183 } catch (IOException e) { 184 e.printStackTrace();184 Main.error(e); 185 185 rememberError(tr("Unable to get canonical path for directory {0}\n", 186 186 f.getAbsolutePath())); … … 199 199 addRecursiveFiles(files, Arrays.asList(children)); 200 200 } catch(NullPointerException npe) { 201 npe.printStackTrace();201 Main.error(npe); 202 202 rememberError(tr("Found null file in directory {0}\n", f.getPath())); 203 203 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r6362 r6643 254 254 } catch (IOException e) { 255 255 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString())); 256 e.printStackTrace();256 Main.error(e); 257 257 } finally { 258 258 Utils.close(in); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r6552 r6643 79 79 } catch (IOException e) { 80 80 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString())); 81 e.printStackTrace();81 Main.error(e); 82 82 logError(e); 83 83 } catch (TokenMgrError e) { 84 84 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage())); 85 e.printStackTrace();85 Main.error(e); 86 86 logError(e); 87 87 } catch (ParseException e) { 88 88 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage())); 89 e.printStackTrace();89 Main.error(e); 90 90 logError(new ParseException(e.getMessage())); // allow e to be garbage collected, it links to the entire token stream 91 91 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
r6579 r6643 83 83 } catch (IOException e) { 84 84 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString())); 85 e.printStackTrace();85 Main.error(e); 86 86 logError(e); 87 87 } catch (SAXParseException e) { 88 88 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage())); 89 e.printStackTrace();89 Main.error(e); 90 90 logError(e); 91 91 } catch (SAXException e) { 92 92 Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage())); 93 e.printStackTrace();93 Main.error(e); 94 94 logError(e); 95 95 } -
trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
r6340 r6643 196 196 } 197 197 } catch(CredentialsAgentException e) { 198 e.printStackTrace();198 Main.error(e); 199 199 tfUserName.setText(""); 200 200 tfPassword.setText(""); … … 525 525 } 526 526 }; 527 e.printStackTrace();527 Main.error(e); 528 528 GuiHelper.runInEDT(r); 529 529 } -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r6599 r6643 111 111 } 112 112 } catch (NoSuchFieldException e) { 113 e.printStackTrace();113 Main.error(e); 114 114 Main.warn(tr("Failed to cancel running OAuth operation")); 115 115 } catch (SecurityException e) { 116 e.printStackTrace();116 Main.error(e); 117 117 Main.warn(tr("Failed to cancel running OAuth operation")); 118 118 } catch (IllegalAccessException e) { 119 e.printStackTrace();119 Main.error(e); 120 120 Main.warn(tr("Failed to cancel running OAuth operation")); 121 121 } -
trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java
r5899 r6643 9 9 import javax.swing.JOptionPane; 10 10 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.data.oauth.OAuthParameters; 12 13 import org.openstreetmap.josm.data.oauth.OAuthToken; … … 87 88 return; 88 89 } catch (OsmOAuthAuthorizationException e) { 89 e.printStackTrace();90 Main.error(e); 90 91 alertRetrievingAccessTokenFailed(e); 91 92 accessToken = null; -
trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java
r5266 r6643 9 9 import javax.swing.JOptionPane; 10 10 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.data.oauth.OAuthParameters; 12 13 import org.openstreetmap.josm.data.oauth.OAuthToken; … … 81 82 return; 82 83 } catch (OsmOAuthAuthorizationException e) { 83 e.printStackTrace();84 Main.error(e); 84 85 alertRetrievingRequestTokenFailed(e); 85 86 requestToken = null; -
trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java
r6362 r6643 17 17 import oauth.signpost.exception.OAuthException; 18 18 19 import org.openstreetmap.josm.Main; 19 20 import org.openstreetmap.josm.data.oauth.OAuthParameters; 20 21 import org.openstreetmap.josm.data.oauth.OAuthToken; … … 253 254 }catch(OsmOAuthAuthorizationException e) { 254 255 if (canceled) return; 255 e.printStackTrace();256 Main.error(e); 256 257 alertFailedSigning(); 257 258 } catch(OsmApiException e) { 258 259 if (canceled) return; 259 e.printStackTrace();260 Main.error(e); 260 261 if (e.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) { 261 262 alertInternalError(); … … 271 272 } catch(OsmTransferException e) { 272 273 if (canceled) return; 273 e.printStackTrace();274 Main.error(e); 274 275 alertFailedConnection(); 275 276 } -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r6529 r6643 552 552 sps.addGui(this); 553 553 } catch (SecurityException ex) { 554 ex.printStackTrace();554 Main.error(ex); 555 555 } catch (Throwable ex) { 556 556 BugReportExceptionHandler.handleException(ex); … … 566 566 setSelectedIndex(index); 567 567 } catch (SecurityException ex) { 568 ex.printStackTrace();568 Main.error(ex); 569 569 } catch (Throwable ex) { 570 570 // allow to change most settings even if e.g. a plugin fails -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r6380 r6643 732 732 return true; 733 733 } catch (Exception e) { 734 e.printStackTrace();734 Main.error(e); 735 735 } 736 736 return false; … … 751 751 } 752 752 } catch (Exception e) { 753 e.printStackTrace();753 Main.error(e); 754 754 } 755 755 movingComponent = ""; -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r6317 r6643 12 12 import java.util.List; 13 13 import java.util.Map; 14 import java.util.Map.Entry; 14 15 import java.util.Observable; 15 16 import java.util.Set; 16 import java.util.Map.Entry;17 17 18 18 import org.openstreetmap.josm.Main; … … 359 359 oldinfo.updateLocalInfo(newinfo); 360 360 } catch(PluginException e) { 361 e.printStackTrace();361 Main.error(e); 362 362 } 363 363 } -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java
r6529 r6643 14 14 import javax.swing.JOptionPane; 15 15 16 import org.openstreetmap.josm.Main; 16 17 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 17 18 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 211 212 // ignore exceptions 212 213 return; 213 e.printStackTrace();214 Main.error(e); 214 215 alertConnectionFailed(); 215 216 return; -
trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
r6529 r6643 108 108 } 109 109 } catch(CredentialsAgentException e) { 110 e.printStackTrace();110 Main.error(e); 111 111 Main.warn(tr("Failed to retrieve OSM credentials from credential manager.")); 112 112 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); … … 128 128 cm.store(RequestorType.SERVER, OsmApi.getOsmApi().getHost(), pa); 129 129 } catch (CredentialsAgentException e) { 130 e.printStackTrace();130 Main.error(e); 131 131 Main.warn(tr("Failed to save OSM credentials to credential manager.")); 132 132 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
r6529 r6643 154 154 token = cm.lookupOAuthAccessToken(); 155 155 } catch(CredentialsAgentException e) { 156 e.printStackTrace();156 Main.error(e); 157 157 Main.warn(tr("Failed to retrieve OAuth Access Token from credential manager")); 158 158 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); … … 185 185 } 186 186 } catch(CredentialsAgentException e){ 187 e.printStackTrace();187 Main.error(e); 188 188 Main.warn(tr("Failed to store OAuth Access Token to credentials manager")); 189 189 Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName())); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
r6529 r6643 359 359 } 360 360 } catch(CredentialsAgentException e) { 361 e.printStackTrace();361 Main.error(e); 362 362 tfProxyHttpUser.setText(""); 363 363 tfProxyHttpPassword.setText(""); … … 434 434 cm.store(RequestorType.PROXY, tfProxyHttpHost.getText(), pa); 435 435 } catch(CredentialsAgentException e) { 436 e.printStackTrace();436 Main.error(e); 437 437 } 438 438 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r6529 r6643 83 83 } 84 84 } catch (Exception e) { 85 e.printStackTrace();85 Main.error(e); 86 86 } 87 87 } -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r6362 r6643 82 82 SwingUtilities.invokeAndWait(task); 83 83 } catch (InterruptedException e) { 84 e.printStackTrace();84 Main.error(e); 85 85 } catch (InvocationTargetException e) { 86 e.printStackTrace();86 Main.error(e); 87 87 } 88 88 } -
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r6552 r6643 173 173 output.flush(); 174 174 } catch(Exception e) { 175 e.printStackTrace();175 Main.error(e); 176 176 } finally { 177 177 Utils.close(output); -
trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
r6248 r6643 84 84 } catch(ParseException ex) { 85 85 Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2))); 86 ex.printStackTrace();86 Main.error(ex); 87 87 } 88 88 } else { -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r6440 r6643 19 19 import java.util.Map.Entry; 20 20 21 import org.openstreetmap.josm.Main; 21 22 import org.openstreetmap.josm.data.Bounds; 22 23 import org.openstreetmap.josm.data.coor.LatLon; … … 259 260 sb.append("display_name").append("=").append(URLEncoder.encode(userName, "UTF-8")); 260 261 } catch (UnsupportedEncodingException e) { 261 e.printStackTrace();262 Main.error(e); 262 263 } 263 264 } -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r6634 r6643 83 83 84 84 private static void displayError(File f, Exception e) { 85 e.printStackTrace();85 Main.error(e); 86 86 HelpAwareOptionPane.showMessageDialogInEDT( 87 87 Main.parent, … … 110 110 return true; 111 111 } catch (Exception e) { 112 e.printStackTrace();112 Main.error(e); 113 113 HelpAwareOptionPane.showMessageDialogInEDT( 114 114 Main.parent, -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r6084 r6643 179 179 fo.flush(); 180 180 } catch (IOException x) { 181 x.printStackTrace();181 Main.error(x); 182 182 JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}:\n{1}", fn, x.getMessage()), 183 183 tr("Error"), JOptionPane.ERROR_MESSAGE); -
trunk/src/org/openstreetmap/josm/io/GpxImporter.java
r6084 r6643 92 92 addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName, tr("Markers from {0}", fileName))); 93 93 } catch (SAXException e) { 94 e.printStackTrace();94 Main.error(e); 95 95 throw new IOException(tr("Parsing data for layer ''{0}'' failed", fileName)); 96 96 } … … 167 167 return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName); 168 168 } catch (SAXException e) { 169 e.printStackTrace();169 Main.error(e); 170 170 throw new IOException(tr("Parsing data for layer ''{0}'' failed", gpxLayerName)); 171 171 } -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r6380 r6643 467 467 throw e; 468 468 } catch (ParserConfigurationException e) { 469 e.printStackTrace(); // broken SAXException chaining469 Main.error(e); // broken SAXException chaining 470 470 throw new SAXException(e); 471 471 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r6248 r6643 357 357 } 358 358 } catch (InterruptedException e) { 359 e.printStackTrace();359 Main.error(e); 360 360 } catch (ExecutionException e) { 361 e.printStackTrace();361 Main.error(e); 362 362 } 363 363 } -
trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java
r6070 r6643 25 25 "osc,osc.bz2,osc.bz,osc.gz", "osc", tr("OsmChange File") + " (*.osc *.osc.bz2 *.osc.bz *.osc.gz)"); 26 26 27 /** 28 * Constructs a new {@code OsmChangeImporter}. 29 */ 27 30 public OsmChangeImporter() { 28 31 super(FILE_FILTER); … … 46 49 47 50 } catch (FileNotFoundException e) { 48 e.printStackTrace();51 Main.error(e); 49 52 throw new IOException(tr("File ''{0}'' does not exist.", file.getName())); 50 53 } -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r6552 r6643 9 9 import java.nio.CharBuffer; 10 10 import java.nio.charset.CharacterCodingException; 11 import java.nio.charset.Charset;12 11 import java.nio.charset.CharsetEncoder; 13 12 … … 42 41 HttpURLConnection.setFollowRedirects(true); 43 42 } catch (SecurityException e) { 44 e.printStackTrace();43 Main.error(e); 45 44 } 46 45 } 47 46 47 /** 48 * Cancels the connection. 49 */ 48 50 public void cancel() { 49 51 cancel = true; -
trunk/src/org/openstreetmap/josm/io/OsmExporter.java
r6552 r6643 87 87 layer.onPostSaveToFile(); 88 88 } catch (IOException e) { 89 e.printStackTrace();89 Main.error(e); 90 90 JOptionPane.showMessageDialog( 91 91 Main.parent, … … 102 102 } 103 103 } catch (IOException e2) { 104 e2.printStackTrace();104 Main.error(e2); 105 105 JOptionPane.showMessageDialog( 106 106 Main.parent, -
trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
r6552 r6643 11 11 import javax.xml.parsers.SAXParserFactory; 12 12 13 import org.openstreetmap.josm.Main; 13 14 import org.openstreetmap.josm.data.osm.history.HistoryDataSet; 14 15 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive; … … 42 43 } 43 44 45 @Override 44 46 protected void throwException(String message) throws SAXException { 45 47 throw new SAXException(getCurrentPosition() + message); … … 86 88 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new Parser()); 87 89 } catch (ParserConfigurationException e) { 88 e.printStackTrace(); // broken SAXException chaining90 Main.error(e); // broken SAXException chaining 89 91 throw new SAXException(e); 90 92 } finally { -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r6070 r6643 65 65 importData(in, file, progressMonitor); 66 66 } catch (FileNotFoundException e) { 67 e.printStackTrace();67 Main.error(e); 68 68 throw new IOException(tr("File ''{0}'' does not exist.", file.getName())); 69 69 } finally { -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r6380 r6643 110 110 activeConnection.connect(); 111 111 } catch (Exception e) { 112 e.printStackTrace();112 Main.error(e); 113 113 OsmTransferException ote = new OsmTransferException(tr("Could not connect to the OSM server. Please check your internet connection."), e); 114 114 ote.setUrl(url.toString()); … … 171 171 * @param progressMonitor The progress monitor 172 172 * @return The corresponding dataset 173 * @throws OsmTransferException if any error occurs 173 * @throws OsmTransferException if any error occurs 174 174 */ 175 175 public abstract DataSet parseOsm(final ProgressMonitor progressMonitor) throws OsmTransferException; … … 179 179 * @param progressMonitor The progress monitor 180 180 * @return The corresponding dataset 181 * @throws OsmTransferException if any error occurs 181 * @throws OsmTransferException if any error occurs 182 182 */ 183 183 public DataSet parseOsmChange(final ProgressMonitor progressMonitor) throws OsmTransferException { … … 189 189 * @param progressMonitor The progress monitor 190 190 * @return The corresponding dataset 191 * @throws OsmTransferException if any error occurs 191 * @throws OsmTransferException if any error occurs 192 192 */ 193 193 public DataSet parseOsmChangeBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { … … 199 199 * @param progressMonitor The progress monitor 200 200 * @return The corresponding dataset 201 * @throws OsmTransferException if any error occurs 201 * @throws OsmTransferException if any error occurs 202 202 */ 203 203 public DataSet parseOsmChangeGzip(final ProgressMonitor progressMonitor) throws OsmTransferException { … … 230 230 * @param progressMonitor The progress monitor 231 231 * @return The corresponding dataset 232 * @throws OsmTransferException if any error occurs 232 * @throws OsmTransferException if any error occurs 233 233 */ 234 234 public DataSet parseOsmBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { … … 240 240 * @param progressMonitor The progress monitor 241 241 * @return The corresponding dataset 242 * @throws OsmTransferException if any error occurs 242 * @throws OsmTransferException if any error occurs 243 243 */ 244 244 public DataSet parseOsmGzip(final ProgressMonitor progressMonitor) throws OsmTransferException { -
trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
r6365 r6643 7 7 import java.util.Map; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.io.OsmApi; 10 11 … … 57 58 return new PasswordAuthentication(response.getUsername(), response.getPassword()); 58 59 } catch(CredentialsAgentException e) { 59 e.printStackTrace();60 Main.error(e); 60 61 return null; 61 62 } -
trunk/src/org/openstreetmap/josm/io/imagery/Grabber.java
r6313 r6643 70 70 } 71 71 if(i == maxTries) { 72 e.printStackTrace();72 Main.error(e); 73 73 request.finish(State.FAILED, null); 74 74 } -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r6552 r6643 15 15 import javax.xml.parsers.SAXParserFactory; 16 16 17 import org.openstreetmap.josm.Main; 17 18 import org.openstreetmap.josm.data.imagery.ImageryInfo; 18 19 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds; … … 21 22 import org.openstreetmap.josm.io.MirroredInputStream; 22 23 import org.openstreetmap.josm.io.UTFInputStreamReader; 23 import org.openstreetmap.josm.tools.Utils;24 24 import org.xml.sax.Attributes; 25 25 import org.xml.sax.InputSource; … … 59 59 throw e; 60 60 } catch (ParserConfigurationException e) { 61 e.printStackTrace(); // broken SAXException chaining61 Main.error(e); // broken SAXException chaining 62 62 throw new SAXException(e); 63 63 } -
trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
r6248 r6643 72 72 73 73 } catch(Exception e) { 74 e.printStackTrace();75 throw new Exception(e.getMessage() + "\nImage couldn't be fetched: " + (url != null ? url.toString() : "") );74 Main.error(e); 75 throw new Exception(e.getMessage() + "\nImage couldn't be fetched: " + (url != null ? url.toString() : ""), e); 76 76 } 77 77 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r6248 r6643 40 40 Integer.toString(port), ex.getLocalizedMessage()); 41 41 } catch (IOException ioe) { 42 ioe.printStackTrace();42 Main.error(ioe); 43 43 } 44 44 } … … 54 54 instance = null; 55 55 } catch (IOException ioe) { 56 ioe.printStackTrace();56 Main.error(ioe); 57 57 } 58 58 } … … 64 64 * @throws IOException when connection errors 65 65 */ 66 public RemoteControlHttpServer(int port) 67 throws IOException 68 { 66 public RemoteControlHttpServer(int port) throws IOException { 69 67 super("RemoteControl HTTP Server"); 70 68 this.setDaemon(true); … … 81 79 */ 82 80 @Override 83 public void run() 84 { 81 public void run() { 85 82 Main.info(marktr("RemoteControl::Accepting connections on port {0}"), 86 83 Integer.toString(server.getLocalPort())); 87 while (true) 88 { 89 try 90 { 84 while (true) { 85 try { 91 86 Socket request = server.accept(); 92 87 RequestProcessor.processRequest(request); 93 } 94 catch( SocketException se) 95 { 88 } catch( SocketException se) { 96 89 if( !server.isClosed() ) 97 se.printStackTrace(); 98 } 99 catch (IOException ioe) 100 { 101 ioe.printStackTrace(); 90 Main.error(se); 91 } catch (IOException ioe) { 92 Main.error(ioe); 102 93 } 103 94 } … … 109 100 * @throws IOException 110 101 */ 111 public void stopServer() throws IOException 112 { 102 public void stopServer() throws IOException { 113 103 server.close(); 114 104 Main.info(marktr("RemoteControl::Server stopped.")); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r6536 r6643 240 240 241 241 } catch (IOException ioe) { 242 Main.debug(Main.getErrorMessage(ioe)); 242 243 } catch (Exception e) { 243 e.printStackTrace();244 Main.error(e); 244 245 try { 245 246 sendError(out); … … 250 251 request.close(); 251 252 } catch (IOException e) { 253 Main.debug(Main.getErrorMessage(e)); 252 254 } 253 255 } … … 389 391 handler = handlers.get(cmd).newInstance(); 390 392 } catch (Exception ex) { 391 ex.printStackTrace();393 Main.error(ex); 392 394 return null; 393 395 } … … 450 452 * @return HTML message with the description of all available commands 451 453 * @throws IllegalAccessException 452 * @throws InstantiationException 454 * @throws InstantiationException 453 455 */ 454 456 public static String getUsageAsHtml() throws IllegalAccessException, InstantiationException { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r6536 r6643 36 36 } catch (Exception ex) { 37 37 Main.warn("RemoteControl: Error parsing import remote control request:"); 38 ex.printStackTrace();38 Main.error(ex); 39 39 throw new RequestHandlerErrorException(); 40 40 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r6536 r6643 89 89 public String[] getUsageExamples(String cmd) { 90 90 if (command.equals(cmd)) { 91 return new String[] { 91 return new String[] { 92 92 "/load_and_zoom?addtags=wikipedia:de=Wei%C3%9Fe_Gasse|maxspeed=5&select=way23071688,way23076176,way23076177,&left=13.740&right=13.741&top=51.05&bottom=51.049", 93 93 "/load_and_zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999&new_layer=true"}; 94 94 } else { 95 return new String[] { 95 return new String[] { 96 96 "/zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999"}; 97 97 } … … 139 139 } catch (Exception ex) { 140 140 Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:"); 141 ex.printStackTrace();141 Main.error(ex); 142 142 throw new RequestHandlerErrorException(); 143 143 } -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r6310 r6643 458 458 } 459 459 if (exception != null) { 460 exception.printStackTrace();460 Main.error(exception); 461 461 CancelOrContinueDialog dialog = new CancelOrContinueDialog(); 462 462 dialog.show( -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r6248 r6643 163 163 download(d, pluginFile); 164 164 } catch(PluginDownloadException e) { 165 e.printStackTrace();165 Main.error(e); 166 166 failed.add(d); 167 167 continue; -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6615 r6643 560 560 msg = null; 561 561 } catch (PluginException e) { 562 Main.error(e.getMessage()); 563 Throwable cause = e.getCause(); 564 if (cause != null) { 565 msg = cause.getLocalizedMessage(); 566 if (msg != null) { 567 Main.error("Cause: " + cause.getClass().getName()+": " + msg); 568 } else { 569 cause.printStackTrace(); 570 } 571 } 562 Main.error(e); 572 563 if (e.getCause() instanceof ClassNotFoundException) { 573 564 msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>" … … 575 566 } 576 567 } catch (Throwable e) { 577 e.printStackTrace();568 Main.error(e); 578 569 } 579 570 if (msg != null && confirmDisablePlugin(parent, msg, plugin.name)) { … … 687 678 future.get(); 688 679 } catch(ExecutionException e) { 689 e.printStackTrace();680 Main.error(e); 690 681 return null; 691 682 } catch(InterruptedException e) { … … 817 808 } catch (PluginException e) { 818 809 Main.warn(tr("Failed to find plugin {0}", name)); 819 e.printStackTrace();810 Main.error(e); 820 811 } 821 812 } … … 858 849 } catch (ExecutionException e) { 859 850 Main.warn(tr("Failed to download plugin information list")+": ExecutionException"); 860 e.printStackTrace();851 Main.error(e); 861 852 // don't abort in case of error, continue with downloading plugins below 862 853 } catch (InterruptedException e) { … … 905 896 future.get(); 906 897 } catch(ExecutionException e) { 907 e.printStackTrace();898 Main.error(e); 908 899 alertFailedPluginUpdate(parent, pluginsToUpdate); 909 900 return plugins; … … 1098 1089 pi.updateFromJar(new PluginInformation(downloadedPluginFile, pi.name)); 1099 1090 } catch(PluginException e) { 1100 e.printStackTrace();1091 Main.error(e); 1101 1092 } 1102 1093 } -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r6615 r6643 248 248 } 249 249 } 250 catch(Exception e) { e.printStackTrace(); }250 catch(Exception e) { Main.error(e); } 251 251 } 252 252 } -
trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java
r6552 r6643 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.plugins; 3 4 import org.openstreetmap.josm.tools.Utils;5 3 6 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 13 11 import java.util.LinkedList; 14 12 import java.util.List; 13 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.tools.Utils; 15 16 16 17 /** … … 104 105 } 105 106 } catch (PluginListParseException ex) { 106 ex.printStackTrace();107 Main.error(ex); 107 108 } 108 109 } -
trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
r6248 r6643 92 92 } catch(PluginListParseException e) { 93 93 Main.warn(tr("Failed to scan file ''{0}'' for plugin information. Skipping.", fname)); 94 e.printStackTrace();94 Main.error(e); 95 95 } 96 96 monitor.worked(1); -
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r6552 r6643 181 181 } catch (MalformedURLException e) { 182 182 if (canceled) return null; 183 e.printStackTrace();183 Main.error(e); 184 184 return null; 185 185 } catch (IOException e) { … … 234 234 JosmTextArea area = new JosmTextArea(details); 235 235 area.setEditable(false); 236 area.setLineWrap(true); 237 area.setWrapStyleWord(true); 236 area.setLineWrap(true); 237 area.setWrapStyleWord(true); 238 238 JScrollPane scrollPane = new JScrollPane(area); 239 239 scrollPane.setPreferredSize(new Dimension(500, 300)); … … 273 273 } catch (MalformedURLException e) { 274 274 if (canceled) return; 275 e.printStackTrace();275 Main.error(e); 276 276 return; 277 277 } catch (IOException e) { … … 322 322 } catch(IOException e) { 323 323 // just failed to write the cache file. No big deal, but log the exception anyway 324 e.printStackTrace();324 Main.error(e); 325 325 } finally { 326 326 if (writer != null) { … … 367 367 } catch (PluginListParseException e) { 368 368 Main.error(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString())); 369 e.printStackTrace();369 Main.error(e); 370 370 } 371 371 } -
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r6552 r6643 66 66 exceptionCounter++; 67 67 try { 68 e.printStackTrace();68 Main.error(e); 69 69 if (Main.parent != null) { 70 70 if (e instanceof OutOfMemoryError) { … … 166 166 JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE); 167 167 } catch (Exception e1) { 168 e1.printStackTrace();168 Main.error(e1); 169 169 } 170 170 } … … 200 200 "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true)); 201 201 } catch (IOException e) { 202 e.printStackTrace();202 Main.error(e); 203 203 return null; 204 204 } -
trunk/src/org/openstreetmap/josm/tools/DateUtils.java
r6380 r6643 12 12 import javax.xml.datatype.DatatypeFactory; 13 13 import javax.xml.datatype.XMLGregorianCalendar; 14 15 import org.openstreetmap.josm.Main; 14 16 15 17 /** … … 37 39 fact = DatatypeFactory.newInstance(); 38 40 } catch(DatatypeConfigurationException ce) { 39 ce.printStackTrace();41 Main.error(ce); 40 42 } 41 43 XML_DATE = fact; -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r6582 r6643 49 49 */ 50 50 public static String explainOsmApiInitializationException(OsmApiInitializationException e) { 51 e.printStackTrace();51 Main.error(e); 52 52 String msg = tr( 53 53 "<html>Failed to initialize communication with the OSM server {0}.<br>" … … 64 64 */ 65 65 public static String explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) { 66 e.printStackTrace();66 Main.error(e); 67 67 String msg = tr( 68 68 "<html>Failed to authenticate at the OSM server ''{0}''.<br>" … … 129 129 */ 130 130 public static String explainPreconditionFailed(OsmApiException e) { 131 e.printStackTrace();131 Main.error(e); 132 132 Pair<OsmPrimitive, Collection<OsmPrimitive>> conflict = parsePreconditionFailed(e.getErrorHeader()); 133 133 if (conflict != null) { … … 247 247 248 248 public static String explainFailedBasicAuthentication(OsmApiException e) { 249 e.printStackTrace();249 Main.error(e); 250 250 return tr("<html>" 251 251 + "Authentication at the OSM server with the username ''{0}'' failed.<br>" … … 257 257 258 258 public static String explainFailedOAuthAuthentication(OsmApiException e) { 259 e.printStackTrace();259 Main.error(e); 260 260 return tr("<html>" 261 261 + "Authentication at the OSM server with the OAuth token ''{0}'' failed.<br>" … … 267 267 268 268 public static String explainFailedAuthorisation(OsmApiException e) { 269 e.printStackTrace();269 Main.error(e); 270 270 String header = e.getErrorHeader(); 271 271 String body = e.getErrorBody(); … … 298 298 299 299 public static String explainFailedOAuthAuthorisation(OsmApiException e) { 300 e.printStackTrace();300 Main.error(e); 301 301 return tr("<html>" 302 302 + "Authorisation at the OSM server with the OAuth token ''{0}'' failed.<br>" … … 317 317 */ 318 318 public static String explainClientTimeout(OsmApiException e) { 319 e.printStackTrace();319 Main.error(e); 320 320 return tr("<html>" 321 321 + "Communication with the OSM server ''{0}'' timed out. Please retry later." … … 332 332 */ 333 333 public static String explainGenericOsmApiException(OsmApiException e) { 334 e.printStackTrace();334 Main.error(e); 335 335 String errMsg = e.getErrorHeader(); 336 336 if (errMsg == null) { … … 358 358 */ 359 359 public static String explainConflict(OsmApiException e) { 360 e.printStackTrace();360 Main.error(e); 361 361 String msg = e.getErrorHeader(); 362 362 if (msg != null) { … … 374 374 } catch (ParseException ex) { 375 375 Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2))); 376 ex.printStackTrace();376 Main.error(ex); 377 377 } 378 378 if (closeDate == null) { … … 419 419 e.getClosedOn() == null ? "?" : dateFormat.format(e.getClosedOn()) 420 420 ); 421 e.printStackTrace();421 Main.error(e); 422 422 return msg; 423 423 } … … 433 433 msg = e.toString(); 434 434 } 435 e.printStackTrace();435 Main.error(e); 436 436 return escapeReservedCharactersHTML(msg); 437 437 } … … 472 472 String message = tr("<html>Failed to open a connection to the remote server<br>" + "''{0}''.<br>" 473 473 + "Please check your internet connection.", apiUrl); 474 e.printStackTrace();474 Main.error(e); 475 475 return message; 476 476 } … … 491 491 + "Details (untranslated): {1}</html>", apiUrl, ioe 492 492 .getMessage()); 493 e.printStackTrace();493 Main.error(e); 494 494 return message; 495 495 } … … 506 506 + "Its format is either unsupported, ill-formed, and/or inconsistent.<br>" 507 507 + "<br>Details (untranslated): {0}</html>", ide.getMessage()); 508 e.printStackTrace();508 Main.error(e); 509 509 return message; 510 510 } … … 521 521 String message = tr("<html>The OSM server<br>" + "''{0}''<br>" + "reported an internal server error.<br>" 522 522 + "This is most likely a temporary problem. Please try again later.", apiUrl); 523 e.printStackTrace();523 Main.error(e); 524 524 return message; 525 525 } … … 544 544 } 545 545 message = "<html>" + message + "</html>"; 546 e.printStackTrace();546 Main.error(e); 547 547 return message; 548 548 } … … 557 557 // TODO: Write a proper error message 558 558 String message = explainGenericOsmApiException(e); 559 e.printStackTrace();559 Main.error(e); 560 560 return message; 561 561 } … … 575 575 , apiUrl); 576 576 message = "<html>" + message + "</html>"; 577 e.printStackTrace();577 Main.error(e); 578 578 return message; 579 579 } … … 599 599 + "Host name ''{1}'' could not be resolved. <br>" 600 600 + "Please check the API URL in your preferences and your internet connection.", apiUrl, host); 601 e.printStackTrace();601 Main.error(e); 602 602 return message; 603 603 } … … 692 692 msg = explainGeneric(e); 693 693 } 694 e.printStackTrace();694 Main.error(e); 695 695 return msg; 696 696 } -
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r6380 r6643 7 7 import java.util.Date; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.coor.LatLon; 10 11 … … 61 62 throw e; 62 63 } catch (Exception e) { 63 e.printStackTrace();64 Main.error(e); 64 65 } 65 66 return null; … … 87 88 return dir.getInt(ExifIFD0Directory.TAG_ORIENTATION); 88 89 } catch (JpegProcessingException e) { 89 e.printStackTrace();90 Main.error(e); 90 91 } catch (MetadataException e) { 91 e.printStackTrace();92 Main.error(e); 92 93 } catch (IOException e) { 93 e.printStackTrace();94 Main.error(e); 94 95 } 95 96 return null; … … 108 109 return readLatLon(dirGps); 109 110 } catch (JpegProcessingException e) { 110 e.printStackTrace();111 Main.error(e); 111 112 } catch (IOException e) { 112 e.printStackTrace();113 Main.error(e); 113 114 } catch (MetadataException e) { 114 e.printStackTrace();115 Main.error(e); 115 116 } 116 117 return null; … … 121 122 * @param dirGps The EXIF GPS directory 122 123 * @return The lat/lon read in the EXIF section, or {@code null} if {@code dirGps} is null 123 * @throws MetadataException 124 * @throws MetadataException 124 125 * @since 6209 125 126 */ … … 145 146 return readDirection(dirGps); 146 147 } catch (JpegProcessingException e) { 147 e.printStackTrace();148 Main.error(e); 148 149 } catch (IOException e) { 149 e.printStackTrace();150 Main.error(e); 150 151 } 151 152 return null; -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r6514 r6643 73 73 } 74 74 } catch (NumberFormatException x) { 75 x.printStackTrace();75 Main.error(x); 76 76 } catch (NullPointerException x) { 77 x.printStackTrace();77 Main.error(x); 78 78 } catch (ArrayIndexOutOfBoundsException x) { 79 x.printStackTrace();79 Main.error(x); 80 80 } 81 81 return b; -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r6380 r6643 204 204 } 205 205 } catch (Exception e) { 206 e.printStackTrace(); // SAXException does not dump inner exceptions.206 Main.error(e); // SAXException does not dump inner exceptions. 207 207 throwException(e); 208 208 } -
trunk/test/functional/org/openstreetmap/josm/gui/history/HistoryBrowserTest.java
r6289 r6643 82 82 ds = reader.parseHistory(NullProgressMonitor.INSTANCE); 83 83 } catch(OsmTransferException e) { 84 e.printStackTrace();84 Main.error(e); 85 85 return; 86 86 } -
trunk/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java
r4311 r6643 12 12 import javax.swing.JTextField; 13 13 14 import org.openstreetmap.josm.Main; 14 15 import org.openstreetmap.josm.gui.io.UploadStrategySelectionPanel; 15 16 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 40 41 n = Integer.parseInt(tf.getText()); 41 42 } catch(NumberFormatException e) { 42 e.printStackTrace();43 Main.error(e); 43 44 return; 44 45 } … … 49 50 return pnl; 50 51 } 52 53 /** 54 * Constructs a new {@code UploadStrategySelectionPanelTest}. 55 */ 51 56 public UploadStrategySelectionPanelTest() { 52 57 build();
Note:
See TracChangeset
for help on using the changeset viewer.