Summary
HexFormat methods for converting from strings to numbers should be static methods instead of instance methods.
Problem
The isHexDigit
and fromHex
methods were specified as instance methods though their specification did not depend on any of the instance method parameters.
The delimiter, prefix, suffix, and uppercase parameters are not used.
As static methods they are more useful in contexts where no instance of java.util.HexFormat is available or none is desired.
Solution
Add the static
modifier to the methods and remove references to instance parameters that are not relevant.
Specification
Add the static
modifier to the following java.util.HexFormat methods.
public static boolean isHexDigit(int);
public static int fromHexDigit(int);
public static int fromHexDigits(java.lang.CharSequence);
public static int fromHexDigits(java.lang.CharSequence, int, int);
public static long fromHexDigitsToLong(java.lang.CharSequence);
public static long fromHexDigitsToLong(java.lang.CharSequence, int, int);
SpecDiff is attached.
- csr of
-
JDK-8263754 HexFormat 'fromHex' methods should be static
-
- Resolved
-