Ignore:
Timestamp:
2016-06-01T23:17:40+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - squid:S1854 - Dead stores should be removed

Location:
trunk/src/org/openstreetmap/josm/io
Files:
6 edited

Legend:

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

    r8510 r10308  
    140140            List<RelationMember> relationMembers = new ArrayList<>();
    141141            for (RelationMemberData rm : entry.getValue()) {
    142                 OsmPrimitive primitive = null;
    143 
    144142                // lookup the member from the map of already created primitives
    145                 primitive = externalIdMap.get(new SimplePrimitiveId(rm.getMemberId(), rm.getMemberType()));
     143                OsmPrimitive primitive = externalIdMap.get(new SimplePrimitiveId(rm.getMemberId(), rm.getMemberType()));
    146144
    147145                if (primitive == null) {
  • trunk/src/org/openstreetmap/josm/io/OsmConnection.java

    r10237 r10308  
    1111import java.nio.CharBuffer;
    1212import java.nio.charset.CharacterCodingException;
    13 import java.nio.charset.CharsetEncoder;
    1413import java.nio.charset.StandardCharsets;
    1514import java.util.Objects;
     
    6362     */
    6463    protected void addBasicAuthorizationHeader(HttpClient con) throws OsmTransferException {
    65         CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();
    6664        CredentialsAgentResponse response;
    67         String token;
    6865        try {
    6966            synchronized (CredentialsManager.getInstance()) {
     
    7471            throw new OsmTransferException(e);
    7572        }
     73        String token;
    7674        if (response == null) {
    7775            token = ":";
     
    8482            token = username + ':' + password;
    8583            try {
    86                 ByteBuffer bytes = encoder.encode(CharBuffer.wrap(token));
     84                ByteBuffer bytes = StandardCharsets.UTF_8.newEncoder().encode(CharBuffer.wrap(token));
    8785                con.setHeader("Authorization", "Basic "+Base64.encode(bytes));
    8886            } catch (CharacterCodingException e) {
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r10235 r10308  
    316316
    317317    private RelationMemberData parseRelationMember(Relation r) throws XMLStreamException {
    318         String role = null;
    319318        OsmPrimitiveType type = null;
    320319        long id = 0;
     
    339338                    Long.toString(id), Long.toString(r.getUniqueId()), value), e);
    340339        }
    341         value = parser.getAttributeValue(null, "role");
    342         role = value;
     340        String role = parser.getAttributeValue(null, "role");
    343341
    344342        if (id == 0) {
  • trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java

    r8929 r10308  
    4949                    @Override
    5050                    public void run() {
    51                         CredentialDialog dialog = null;
     51                        CredentialDialog dialog;
    5252                        if (requestorType.equals(RequestorType.PROXY))
    5353                            dialog = CredentialDialog.getHttpProxyCredentialDialog(
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r10242 r10308  
    272272                @Override
    273273                public void run() {
    274                     String[] tags = null;
    275                     tags = Utils.decodeUrl(args.get("addtags")).split("\\|");
    276274                    Set<String> tagSet = new HashSet<>();
    277                     for (String tag : tags) {
     275                    for (String tag : Utils.decodeUrl(args.get("addtags")).split("\\|")) {
    278276                        if (!tag.trim().isEmpty() && tag.contains("=")) {
    279277                            tagSet.add(tag.trim());
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r10212 r10308  
    216216    public static Path setupJosmKeystore() throws IOException, GeneralSecurityException {
    217217
    218         char[] storePassword = KEYSTORE_PASSWORD.get().toCharArray();
    219         char[] entryPassword = KEYENTRY_PASSWORD.get().toCharArray();
    220 
    221218        Path dir = Paths.get(RemoteControl.getRemoteControlDir());
    222219        Path path = dir.resolve(KEYSTORE_FILENAME);
     
    249246            KEYENTRY_PASSWORD.put(new BigInteger(130, random).toString(32));
    250247
    251             storePassword = KEYSTORE_PASSWORD.get().toCharArray();
    252             entryPassword = KEYENTRY_PASSWORD.get().toCharArray();
     248            char[] storePassword = KEYSTORE_PASSWORD.get().toCharArray();
     249            char[] entryPassword = KEYENTRY_PASSWORD.get().toCharArray();
    253250
    254251            ks.setKeyEntry(ENTRY_ALIAS, pair.getPrivate(), entryPassword, new Certificate[]{cert});
Note: See TracChangeset for help on using the changeset viewer.