Ignore:
Timestamp:
2017-04-12T22:22:52+02:00 (7 years ago)
Author:
Don-vip
Message:

PMD - fix some InefficientEmptyStringCheck (new in PMD 5.5.5)

File:
1 edited

Legend:

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

    r11419 r11889  
    1010import java.util.LinkedList;
    1111import java.util.List;
     12import java.util.Optional;
    1213
    1314import javax.swing.JLabel;
     
    6162        }
    6263
    63         String searchTerm = searchTermBox.getText();
    64         if (searchTerm == null || searchTerm.trim().isEmpty()) {
     64        String searchTerm = Optional.ofNullable(searchTermBox.getText()).orElse("").trim();
     65        if (searchTerm.isEmpty()) {
    6566            Notification notification = new Notification(tr("You must enter a search term"));
    6667            notification.setIcon(JOptionPane.WARNING_MESSAGE);
Note: See TracChangeset for help on using the changeset viewer.