Ignore:
Timestamp:
2017-04-10T03:28:15+02:00 (3 years ago)
Author:
Don-vip
Message:

findbugs - EI_EXPOSE_REP

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

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

    r11878 r11879  
    1414import java.net.HttpURLConnection;
    1515import java.net.URL;
    16 import java.util.Arrays;
    1716import java.util.Collections;
    1817import java.util.List;
     
    559558     */
    560559    public HttpClient setRequestBody(byte[] requestBody) {
    561         this.requestBody = Arrays.copyOf(requestBody, requestBody.length);
     560        this.requestBody = Utils.copyArray(requestBody);
    562561        return this;
    563562    }
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r11747 r11879  
    357357
    358358    /**
     359     * Copies the given array. Unlike {@link Arrays#copyOf}, this method is null-safe.
     360     * @param array The array to copy
     361     * @return A copy of the original array, or {@code null} if {@code array} is null
     362     * @since 11879
     363     */
     364    public static byte[] copyArray(byte... array) {
     365        if (array != null) {
     366            return Arrays.copyOf(array, array.length);
     367        }
     368        return array;
     369    }
     370
     371    /**
    359372     * Simple file copy function that will overwrite the target file.
    360373     * @param in The source file
Note: See TracChangeset for help on using the changeset viewer.