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:
Luc Maisonobe 2008-01-12 22:09:36 +00:00
parent 0b3bfc1d4a
commit bf393abf70
1 changed files with 3 additions and 3 deletions

View File

@ -150,7 +150,7 @@ public class MathException extends Exception {
public MathException(String pattern, Object[] arguments) { public MathException(String pattern, Object[] arguments) {
super(buildMessage(pattern, arguments, Locale.US)); super(buildMessage(pattern, arguments, Locale.US));
this.pattern = pattern; this.pattern = pattern;
this.arguments = arguments; this.arguments = (Object[]) arguments.clone();
this.rootCause = null; this.rootCause = null;
} }
@ -196,7 +196,7 @@ public class MathException extends Exception {
public MathException(String pattern, Object[] arguments, Throwable rootCause) { public MathException(String pattern, Object[] arguments, Throwable rootCause) {
super(buildMessage(pattern, arguments, Locale.US)); super(buildMessage(pattern, arguments, Locale.US));
this.pattern = pattern; this.pattern = pattern;
this.arguments = arguments; this.arguments = (Object[]) arguments.clone();
this.rootCause = rootCause; this.rootCause = rootCause;
} }
@ -213,7 +213,7 @@ public class MathException extends Exception {
* @return the arguments used to build the message of this throwable * @return the arguments used to build the message of this throwable
*/ */
public Object[] getArguments() { public Object[] getArguments() {
return arguments; return (Object[]) arguments.clone();
} }
/** Gets the message in a specified locale. /** Gets the message in a specified locale.