Changeset 10182 in josm


Ignore:
Timestamp:
2016-05-11T04:51:06+02:00 (4 years ago)
Author:
Don-vip
Message:

sonar - squid:S1943 - Classes and methods that rely on the default system encoding should not be used

File:
1 edited

Legend:

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

    r9231 r10182  
    99
    1010/**
    11  * Detects the different UTF encodings from byte order mark
     11 * Detects the different UTF encodings from byte order mark.
     12 * @since 3372
    1213 */
    1314public final class UTFInputStreamReader extends InputStreamReader {
     15
     16    private UTFInputStreamReader(InputStream in, String cs) throws UnsupportedEncodingException {
     17        super(in, cs);
     18    }
    1419
    1520    /**
     
    6469
    6570        if (encoding == null) {
    66             return new UTFInputStreamReader(pushbackStream);
    67         } else {
    68             return new UTFInputStreamReader(pushbackStream, encoding);
     71            encoding = "UTF-8";
    6972        }
    70     }
    71 
    72     private UTFInputStreamReader(InputStream in) {
    73         super(in);
    74     }
    75 
    76     private UTFInputStreamReader(InputStream in, String cs) throws UnsupportedEncodingException {
    77         super(in, cs);
     73        return new UTFInputStreamReader(pushbackStream, encoding);
    7874    }
    7975}
Note: See TracChangeset for help on using the changeset viewer.