Ignore:
Timestamp:
2017-02-09T00:54:57+01:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S1854 - Dead stores should be removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmConnection.java

    r10618 r11544  
    6767            throw new OsmTransferException(e);
    6868        }
    69         String token;
    70         if (response == null) {
    71             token = ":";
    72         } else if (response.isCanceled()) {
    73             cancel = true;
    74             return;
    75         } else {
    76             String username = response.getUsername() == null ? "" : response.getUsername();
    77             String password = response.getPassword() == null ? "" : String.valueOf(response.getPassword());
    78             token = username + ':' + password;
    79             con.setHeader("Authorization", "Basic "+Base64.getEncoder().encodeToString(token.getBytes(StandardCharsets.UTF_8)));
     69        if (response != null) {
     70            if (response.isCanceled()) {
     71                cancel = true;
     72                return;
     73            } else {
     74                String username = response.getUsername() == null ? "" : response.getUsername();
     75                String password = response.getPassword() == null ? "" : String.valueOf(response.getPassword());
     76                String token = username + ':' + password;
     77                con.setHeader("Authorization", "Basic "+Base64.getEncoder().encodeToString(token.getBytes(StandardCharsets.UTF_8)));
     78            }
    8079        }
    8180    }
Note: See TracChangeset for help on using the changeset viewer.