Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ public MethodInvocation invocableClone() {
Object[] cloneArguments = this.arguments;
if (this.arguments.length > 0) {
// Build an independent copy of the arguments array.
cloneArguments = new Object[this.arguments.length];
System.arraycopy(this.arguments, 0, cloneArguments, 0, this.arguments.length);
cloneArguments = this.arguments.clone();
}
return invocableClone(cloneArguments);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ private static String[] copyOrNull(@Nullable String[] state) {
}

private static String[] copy(String[] state) {
String[] copy = new String[state.length];
System.arraycopy(state, 0, copy, 0, state.length);
return copy;
return state.clone();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public class SimpleKey implements Serializable {
*/
public SimpleKey(Object... elements) {
Assert.notNull(elements, "Elements must not be null");
this.params = new Object[elements.length];
System.arraycopy(elements, 0, this.params, 0, elements.length);
this.params = elements.clone();
this.hashCode = Arrays.deepHashCode(this.params);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ public byte[] toByteArrayUnsafe() {
*/
public byte[] toByteArray() {
byte[] bytesUnsafe = toByteArrayUnsafe();
byte[] ret = new byte[bytesUnsafe.length];
System.arraycopy(bytesUnsafe, 0, ret, 0, bytesUnsafe.length);
return ret;
return bytesUnsafe.clone();
}

/**
Expand Down