Changeset 6642 in josm for trunk/src/org/openstreetmap/josm/tools/Utils.java
- Timestamp:
- 2014-01-06T15:57:41+01:00 (12 years ago)
- File:
-
- 1 edited
-
trunk/src/org/openstreetmap/josm/tools/Utils.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6623 r6642 419 419 return true; 420 420 } catch (IllegalStateException ex) { 421 ex.printStackTrace();421 Main.error(ex); 422 422 return false; 423 423 } … … 449 449 } 450 450 } catch (UnsupportedFlavorException ex) { 451 ex.printStackTrace();451 Main.error(ex); 452 452 return null; 453 453 } catch (IOException ex) { 454 ex.printStackTrace();454 Main.error(ex); 455 455 return null; 456 456 } … … 895 895 } 896 896 897 /** 898 * Returns the root cause of a throwable object. 899 * @param t The object to get root cause for 900 * @return the root cause of {@code t} 901 * @since 6639 902 */ 903 public static Throwable getRootCause(Throwable t) { 904 Throwable result = t; 905 if (result != null) { 906 Throwable cause = result.getCause(); 907 while (cause != null && cause != result) { 908 result = cause; 909 cause = result.getCause(); 910 } 911 } 912 return result; 913 } 897 914 }
Note:
See TracChangeset
for help on using the changeset viewer.
