From bf393abf7032fff17ae1a2af5305f9fa48877aac Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sat, 12 Jan 2008 22:09:36 +0000 Subject: [PATCH] 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 --- src/java/org/apache/commons/math/MathException.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/commons/math/MathException.java b/src/java/org/apache/commons/math/MathException.java index 1221f9d34..0bca27ea5 100644 --- a/src/java/org/apache/commons/math/MathException.java +++ b/src/java/org/apache/commons/math/MathException.java @@ -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.