8151691: [Findbugs]jdk.internal.math.FormattedFloatingDecimal.getExponent() may expose internal rep
The reference to the internal array is never leaked via the public API but some internal API clarification is added. Reviewed-by: rriggs
This commit is contained in:
parent
1a08d0a1d9
commit
f876e4bbd2
@ -106,10 +106,28 @@ public class FormattedFloatingDecimal{
|
|||||||
return decExponentRounded - 1;
|
return decExponentRounded - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the mantissa as a {@code char[]}. Note that the returned value
|
||||||
|
* is a reference to the internal {@code char[]} containing the mantissa,
|
||||||
|
* therefore code invoking this method should not pass the return value to
|
||||||
|
* external code but should in that case make a copy.
|
||||||
|
*
|
||||||
|
* @return a reference to the internal {@code char[]} representing the
|
||||||
|
* mantissa.
|
||||||
|
*/
|
||||||
public char[] getMantissa(){
|
public char[] getMantissa(){
|
||||||
return mantissa;
|
return mantissa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the exponent as a {@code char[]}. Note that the returned value
|
||||||
|
* is a reference to the internal {@code char[]} containing the exponent,
|
||||||
|
* therefore code invoking this method should not pass the return value to
|
||||||
|
* external code but should in that case make a copy.
|
||||||
|
*
|
||||||
|
* @return a reference to the internal {@code char[]} representing the
|
||||||
|
* exponent.
|
||||||
|
*/
|
||||||
public char[] getExponent(){
|
public char[] getExponent(){
|
||||||
return exponent;
|
return exponent;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user