mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8263754: HexFormat 'fromHex' methods should be static
Reviewed-by: redestad, naoto, chegar
This commit is contained in:
parent
a5d7de2351
commit
8cf1c62c34
5 changed files with 39 additions and 54 deletions
|
@ -40,7 +40,6 @@ import java.security.cert.URICertStoreParameters;
|
|||
|
||||
import java.security.interfaces.ECKey;
|
||||
import java.security.interfaces.EdECKey;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.ECParameterSpec;
|
||||
import java.text.Collator;
|
||||
import java.text.MessageFormat;
|
||||
|
@ -4574,16 +4573,15 @@ public final class Main {
|
|||
break;
|
||||
case -1:
|
||||
ObjectIdentifier oid = ObjectIdentifier.of(name);
|
||||
HexFormat hexFmt = HexFormat.of();
|
||||
byte[] data = null;
|
||||
if (value != null) {
|
||||
data = new byte[value.length() / 2 + 1];
|
||||
int pos = 0;
|
||||
for (char c: value.toCharArray()) {
|
||||
if (!hexFmt.isHexDigit(c)) {
|
||||
if (!HexFormat.isHexDigit(c)) {
|
||||
continue;
|
||||
}
|
||||
int hex = hexFmt.fromHexDigit(c);
|
||||
int hex = HexFormat.fromHexDigit(c);
|
||||
if (pos % 2 == 0) {
|
||||
data[pos/2] = (byte)(hex << 4);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue