Ignore:
Timestamp:
2015-05-18T23:34:11+02:00 (9 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/actions/search
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8379 r8394  
    625625
    626626        public static SearchSetting readFromString(String s) {
    627             if (s.length() == 0)
     627            if (s.isEmpty())
    628628                return null;
    629629
     
    664664
    665665        public String writeToString() {
    666             if (text == null || text.length() == 0)
     666            if (text == null || text.isEmpty())
    667667                return "";
    668668
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r8250 r8394  
    619619                    keyPattern = Pattern.compile(key, regexFlags(false));
    620620                } catch (PatternSyntaxException e) {
    621                     throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
     621                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
    622622                } catch (Exception e) {
    623                     throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()));
     623                    throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()), e);
    624624                }
    625625            } else {
     
    630630                    valuePattern = Pattern.compile(this.value, regexFlags(false));
    631631                } catch (PatternSyntaxException e) {
    632                     throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
     632                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
    633633                } catch (Exception e) {
    634                     throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()));
     634                    throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()), e);
    635635                }
    636636            } else {
Note: See TracChangeset for help on using the changeset viewer.