Ignore:
Timestamp:
2015-05-18T23:34:11+02:00 (7 years ago)
Author:
Don-vip
Message:
  • global use of String.isEmpty()
  • Correctness - Method throws alternative exception from catch block without history
Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/CopyList.java

    r8285 r8394  
    178178            } catch (IndexOutOfBoundsException e) {
    179179                checkForComodification();
    180                 throw new NoSuchElementException();
     180                throw new NoSuchElementException(e.getMessage());
    181181            }
    182182        }
     
    196196                expectedModCount = modCount;
    197197            } catch (IndexOutOfBoundsException e) {
    198                 throw new ConcurrentModificationException();
     198                throw new ConcurrentModificationException(e);
    199199            }
    200200        }
  • trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java

    r8390 r8394  
    153153            Matcher m = p.matcher(preferenceValue);
    154154            if (!m.find())
    155                 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not include ''{1}''. Cannot restore window geometry from preferences.", preferenceKey, field));
     155                throw new WindowGeometryException(
     156                        tr("Preference with key ''{0}'' does not include ''{1}''. Cannot restore window geometry from preferences.",
     157                                preferenceKey, field));
    156158            v = m.group(1);
    157159            return Integer.parseInt(v);
     
    159161            throw e;
    160162        } catch(NumberFormatException e) {
    161             throw new WindowGeometryException(tr("Preference with key ''{0}'' does not provide an int value for ''{1}''. Got {2}. Cannot restore window geometry from preferences.", preferenceKey, field, v));
     163            throw new WindowGeometryException(
     164                    tr("Preference with key ''{0}'' does not provide an int value for ''{1}''. Got {2}. Cannot restore window geometry from preferences.",
     165                            preferenceKey, field, v), e);
    162166        } catch(Exception e) {
    163             throw new WindowGeometryException(tr("Failed to parse field ''{1}'' in preference with key ''{0}''. Exception was: {2}. Cannot restore window geometry from preferences.", preferenceKey, field, e.toString()), e);
     167            throw new WindowGeometryException(
     168                    tr("Failed to parse field ''{1}'' in preference with key ''{0}''. Exception was: {2}. Cannot restore window geometry from preferences.",
     169                            preferenceKey, field, e.toString()), e);
    164170        }
    165171    }
     
    168174        String value = Main.pref.get(preferenceKey);
    169175        if (value == null || value.isEmpty())
    170             throw new WindowGeometryException(tr("Preference with key ''{0}'' does not exist. Cannot restore window geometry from preferences.", preferenceKey));
     176            throw new WindowGeometryException(
     177                    tr("Preference with key ''{0}'' does not exist. Cannot restore window geometry from preferences.", preferenceKey));
    171178        topLeft = new Point();
    172179        extent = new Dimension();
Note: See TracChangeset for help on using the changeset viewer.