replaced array sharing by array copying to remove a findbugs warning
(this is used only for exception, so there should be no performance problems here) git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@611498 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0b3bfc1d4a
commit
bf393abf70
|
@ -150,7 +150,7 @@ public class MathException extends Exception {
|
|||
public MathException(String pattern, Object[] arguments) {
|
||||
super(buildMessage(pattern, arguments, Locale.US));
|
||||
this.pattern = pattern;
|
||||
this.arguments = arguments;
|
||||
this.arguments = (Object[]) arguments.clone();
|
||||
this.rootCause = null;
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ public class MathException extends Exception {
|
|||
public MathException(String pattern, Object[] arguments, Throwable rootCause) {
|
||||
super(buildMessage(pattern, arguments, Locale.US));
|
||||
this.pattern = pattern;
|
||||
this.arguments = arguments;
|
||||
this.arguments = (Object[]) arguments.clone();
|
||||
this.rootCause = rootCause;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class MathException extends Exception {
|
|||
* @return the arguments used to build the message of this throwable
|
||||
*/
|
||||
public Object[] getArguments() {
|
||||
return arguments;
|
||||
return (Object[]) arguments.clone();
|
||||
}
|
||||
|
||||
/** Gets the message in a specified locale.
|
||||
|
|
Loading…
Reference in New Issue