Ignore:
Timestamp:
2021-12-20T14:12:10+01:00 (3 years ago)
Author:
Don-vip
Message:

see #21596 - Update dependencies in ivy.xml and tools/ivy.xml (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r18211 r18332  
    379379         * @see HttpURLConnection#getErrorStream()
    380380         */
    381         @SuppressWarnings("resource")
     381        @SuppressWarnings({"resource",
     382                /* All 4 `InputStream in` reassignments would close the original when the returned stream is closed */
     383                "PMD.CloseResource"})
    382384        public final InputStream getContent() throws IOException {
    383             InputStream in = getInputStream();
    384             in = new ProgressInputStream(in, getContentLength(), monitor);
    385             in = "gzip".equalsIgnoreCase(getContentEncoding())
    386                     ? new GZIPInputStream(in)
    387                     : "deflate".equalsIgnoreCase(getContentEncoding())
    388                     ? new InflaterInputStream(in)
    389                     : in;
     385            InputStream in = new ProgressInputStream(getInputStream(), getContentLength(), monitor);
     386            if ("gzip".equalsIgnoreCase(getContentEncoding())) {
     387                in = new GZIPInputStream(in);
     388            } else if ("deflate".equalsIgnoreCase(getContentEncoding())) {
     389                in = new InflaterInputStream(in);
     390            }
    390391            Compression compression = Compression.NONE;
    391392            if (uncompress) {
Note: See TracChangeset for help on using the changeset viewer.