Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263754: HexFormat 'fromHex' methods should be static #3205

Closed
Closed
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -815,7 +815,6 @@ private void checkOCSP(X509Certificate cert,
* Removes any non-hexadecimal characters from a string.
*/
private static String stripOutSeparators(String value) {
HexFormat hex = HexFormat.of();
char[] chars = value.toCharArray();
StringBuilder hexNumber = new StringBuilder();
for (int i = 0; i < chars.length; i++) {
@@ -4573,7 +4573,6 @@ private CertificateExtensions createV3Extensions(
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];
@@ -250,7 +250,6 @@ public String getValueString() {

private static DerValue parseHexString
(Reader in, int format) throws IOException {
HexFormat hex = HexFormat.of();
int c;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte b = 0;
@@ -501,7 +500,6 @@ public String getValueString() {
private static Byte getEmbeddedHexPair(int c1, Reader in)
throws IOException {

HexFormat hex = HexFormat.of();
if (HexFormat.isHexDigit(c1)) {
int c2 = readChar(in, "unexpected EOF - " +
"escaped hex value must include two valid digits");
@@ -164,7 +164,6 @@ static void testToHexDigits() {

@Test
static void testIsHexDigit() {
HexFormat hex = HexFormat.of();
for (int i = 0; i < 0x3ff; i++) {
boolean actual = HexFormat.isHexDigit(i);
boolean expected = Character.digit(i, 16) >= 0;
@@ -174,7 +173,6 @@ static void testIsHexDigit() {

@Test
static void testFromHexDigit() {
HexFormat hex = HexFormat.of();
String chars = "0123456789ABCDEF0123456789abcdef";
for (int i = 0; i < chars.length(); i++) {
int v = HexFormat.fromHexDigit(chars.charAt(i));
@@ -184,7 +182,6 @@ static void testFromHexDigit() {

@Test
static void testFromHexInvalid() {
HexFormat hex = HexFormat.of();
for (int i = 0; i < 65536; i++) {
char ch = (char)i;
if (ch > 0xff || Character.digit(ch, 16) < 0) {
ProTip! Use n and p to navigate between commits in a pull request.