MATH-650 FastMath has static code which slows the first access to FastMath

Protect array entries against malicious or accidental corruption by returning a clone

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1235784 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-01-25 14:56:50 +00:00
parent 58133c8612
commit 7dc0c33e7c
1 changed files with 10 additions and 10 deletions

View File

@ -6136,41 +6136,41 @@ class FastMathLiteralArrays {
/**
* Load "EXP_INT_A".
*
* @return the data array.
* @return a clone of the data array.
*/
static double[] loadExpIntA() {
return EXP_INT_A;
return EXP_INT_A.clone();
}
/**
* Load "EXP_INT_B".
*
* @return the data array.
* @return a clone of the data array.
*/
static double[] loadExpIntB() {
return EXP_INT_B;
return EXP_INT_B.clone();
}
/**
* Load "EXP_FRAC_A".
*
* @return the data array.
* @return a clone of the data array.
*/
static double[] loadExpFracA() {
return EXP_FRAC_A;
return EXP_FRAC_A.clone();
}
/**
* Load "EXP_FRAC_B".
*
* @return the data array.
* @return a clone of the data array.
*/
static double[] loadExpFracB() {
return EXP_FRAC_B;
return EXP_FRAC_B.clone();
}
/**
* Load "LN_MANT".
*
* @return the data array.
* @return a clone of the data array.
*/
static double[][] loadLnMant() {
return LN_MANT;
return LN_MANT.clone();
}
}