Changeset 11879 in josm
- Timestamp:
- 2017-04-10T03:28:15+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
r11747 r11879 10 10 /** 11 11 * Enumeration of the possible comparison pairs 12 * 12 * @since 1650 13 13 */ 14 14 public enum ComparePairType { … … 48 48 49 49 /** 50 * replies true, if <code>role</code> is participating in this comparison 51 * pair 50 * replies true, if <code>role</code> is participating in this comparison pair 52 51 * 53 52 * @param role the list role 54 * @return true, if <code>role</code> is participating in this comparison 55 * pair; false, otherwise 53 * @return true, if <code>role</code> is participating in this comparison pair; false, otherwise 56 54 */ 57 55 public boolean isParticipatingIn(ListRole role) { … … 63 61 64 62 /** 65 * replies the pair of {@link ListRole}s participating in this comparison 66 * pair 63 * replies the pair of {@link ListRole}s participating in this comparison pair 67 64 * 68 65 * @return the pair of list roles 69 66 */ 70 67 public ListRole[] getParticipatingRoles() { 71 return participatingRoles;68 return Utils.copyArray(participatingRoles); 72 69 } 73 70 74 71 /** 75 * replies the opposite role of <code>role</code> participating in this comparison 76 * pair 72 * replies the opposite role of <code>role</code> participating in this comparison pair 77 73 * 78 74 * @param role one of the two roles in this pair -
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r11510 r11879 12 12 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.tools.Utils; 14 15 15 16 /** … … 136 137 * @throws T if an error occurs 137 138 */ 138 p ublicbyte[] updateForce() throws T {139 private byte[] updateForce() throws T { 139 140 this.data = updateData(); 140 141 saveToDisk(); … … 162 163 loadFromDisk(); 163 164 } 164 return data;165 return Utils.copyArray(data); 165 166 } 166 167 -
trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgentResponse.java
r9059 r11879 40 40 */ 41 41 public char[] getPassword() { 42 return password;42 return Utils.copyArray(password); 43 43 } 44 44 -
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r11878 r11879 14 14 import java.net.HttpURLConnection; 15 15 import java.net.URL; 16 import java.util.Arrays;17 16 import java.util.Collections; 18 17 import java.util.List; … … 559 558 */ 560 559 public HttpClient setRequestBody(byte[] requestBody) { 561 this.requestBody = Arrays.copyOf(requestBody, requestBody.length);560 this.requestBody = Utils.copyArray(requestBody); 562 561 return this; 563 562 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r11747 r11879 357 357 358 358 /** 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 /** 359 372 * Simple file copy function that will overwrite the target file. 360 373 * @param in The source file
Note:
See TracChangeset
for help on using the changeset viewer.