Ignore:
Timestamp:
2015-06-03T14:05:30+02:00 (11 years ago)
Author:
Don-vip
Message:

global use of String.isEmpty()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r8444 r8461  
    218218                    skip('=');
    219219                    String paramValue = readTillChar(',',')');
    220                     if (paramName.length() > 0 && paramValue.length() > 0) {
     220                    if (!paramName.isEmpty() && !paramValue.isEmpty()) {
    221221                        ActionParameter<?> actionParam = actionParams.get(paramName);
    222222                        if (actionParam != null) {
     
    235235                    skip('=');
    236236                    String paramValue = readTillChar(',','}');
    237                     if ("icon".equals(paramName) && paramValue.length() > 0) {
     237                    if ("icon".equals(paramName) && !paramValue.isEmpty()) {
    238238                        result.setIcon(paramValue);
    239                     } else if("name".equals(paramName) && paramValue.length() > 0) {
     239                    } else if("name".equals(paramName) && !paramValue.isEmpty()) {
    240240                        result.setName(paramValue);
    241241                    }
     
    289289                boolean first = true;
    290290                String tmp = action.getName();
    291                 if(tmp.length() != 0) {
     291                if (!tmp.isEmpty()) {
    292292                    result.append(first ? "{" : ",");
    293293                    result.append("name=");
     
    296296                }
    297297                tmp = action.getIcon();
    298                 if(tmp.length() != 0) {
     298                if (!tmp.isEmpty()) {
    299299                    result.append(first ? "{" : ",");
    300300                    result.append("icon=");
     
    385385            ActionParameter<Object> param = getParam(paramIndex);
    386386
    387             if (param != null && val.length() > 0) {
     387            if (param != null && !val.isEmpty()) {
    388388                currentAction.getParameters().put(param.getName(), param.readFromString((String)aValue));
    389389            }
Note: See TracChangeset for help on using the changeset viewer.