Ignore:
Timestamp:
2016-11-27T17:06:21+01:00 (7 years ago)
Author:
Don-vip
Message:

sonar - fix recent issues

File:
1 edited

Legend:

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

    r11320 r11330  
    13661366     *
    13671367     * @param stream input stream
    1368      * @return byte array of data in input stream or null if stream is null
     1368     * @return byte array of data in input stream (empty if stream is null)
    13691369     * @throws IOException if any I/O error occurs
    13701370     */
    13711371    public static byte[] readBytesFromStream(InputStream stream) throws IOException {
    13721372        if (stream == null) {
    1373             return null;
     1373            return new byte[0];
    13741374        }
    13751375        try {
     
    13861386            } while (!finished);
    13871387            if (bout.size() == 0)
    1388                 return null;
     1388                return new byte[0];
    13891389            return bout.toByteArray();
    13901390        } finally {
    1391             if (stream != null) {
    1392                 stream.close();
    1393             }
     1391            stream.close();
    13941392        }
    13951393    }
Note: See TracChangeset for help on using the changeset viewer.