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

global use of String.isEmpty()

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
11 edited

Legend:

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

    r8443 r8461  
    525525              .append("</strong>=");
    526526            String value = tags.get(key);
    527             while(value.length() != 0) {
     527            while (!value.isEmpty()) {
    528528                sb.append(value.substring(0,Math.min(50, value.length())));
    529529                if (value.length() > 50) {
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r8441 r8461  
    492492
    493493        // Ensure all required variables are available
    494         if(rememberSizePref.length() != 0 && defaultWindowGeometry != null) {
     494        if (!rememberSizePref.isEmpty() && defaultWindowGeometry != null) {
    495495            if(visible) {
    496496                initWindowGeometry().applySafe(this);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java

    r8444 r8461  
    10251025        @Override
    10261026        public boolean isValid() {
    1027             return getComponent().getText().trim().length() > 0;
     1027            return !getComponent().getText().trim().isEmpty();
    10281028        }
    10291029
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r8394 r8461  
    305305
    306306        protected final void updateEnabledState() {
    307             setEnabled(cbSearchExpression.getText().trim().length() > 0);
     307            setEnabled(!cbSearchExpression.getText().trim().isEmpty());
    308308        }
    309309
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r8444 r8461  
    117117                String commentText = comment.getText();
    118118                //closing a note creates an empty comment that we don't want to show
    119                 if (commentText != null && commentText.trim().length() > 0) {
     119                if (commentText != null && !commentText.trim().isEmpty()) {
    120120                    sb.append("<hr/>");
    121121                    String userName = XmlWriter.encode(comment.getUser().getName());
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r8442 r8461  
    408408        @Override
    409409        public boolean isValid() {
    410             return getComponent().getText().trim().length() > 0;
     410            return !getComponent().getText().trim().isEmpty();
    411411        }
    412412
     
    429429        @Override
    430430        public boolean isValid() {
    431             return getComponent().getText().trim().length() > 0;
     431            return !getComponent().getText().trim().isEmpty();
    432432        }
    433433
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java

    r6890 r8461  
    8282        @Override
    8383        public boolean isValid() {
    84             return getComponent().getText().trim().length() > 0;
     84            return !getComponent().getText().trim().isEmpty();
    8585        }
    8686
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r8444 r8461  
    489489                    // Get icon
    490490                    String iconName = tps.getIconName();
    491                     ImageIcon icon = iconName != null && iconName.length() > 0 ? ImageProvider.get("preferences", iconName) : null;
     491                    ImageIcon icon = iconName != null && !iconName.isEmpty() ? ImageProvider.get("preferences", iconName) : null;
    492492                    // See #6985 - Force icons to be 48x48 pixels
    493493                    if (icon != null && (icon.getIconHeight() != 48 || icon.getIconWidth() != 48)) {
  • 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            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/UserNameValidator.java

    r6529 r8461  
    2323    @Override
    2424    public boolean isValid() {
    25         return getComponent().getText().trim().length() > 0;
     25        return !getComponent().getText().trim().isEmpty();
    2626    }
    2727
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r8441 r8461  
    104104                try {
    105105                    Long.parseLong(str);
    106                     if (curText.length() != 0)
     106                    if (!curText.isEmpty())
    107107                        Long.parseLong(curText);
    108108                    item = lookupItem(curText, true);
Note: See TracChangeset for help on using the changeset viewer.