8339017: Make a couple of fields in DoubleByte static

Reviewed-by: bpb, naoto
This commit is contained in:
Andrey Turbanov 2024-08-29 09:57:52 +00:00
parent 723588a4e7
commit d35ffa4f6a

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -402,7 +402,7 @@ public class DoubleByte {
else else
currentState = SBCS; currentState = SBCS;
} else { } else {
char c = UNMAPPABLE_DECODING; char c;
if (currentState == SBCS) { if (currentState == SBCS) {
c = b2cSB[b1]; c = b2cSB[b1];
if (c == UNMAPPABLE_DECODING) if (c == UNMAPPABLE_DECODING)
@ -452,7 +452,7 @@ public class DoubleByte {
else else
currentState = SBCS; currentState = SBCS;
} else { } else {
char c = UNMAPPABLE_DECODING; char c;
if (currentState == SBCS) { if (currentState == SBCS) {
c = b2cSB[b1]; c = b2cSB[b1];
if (c == UNMAPPABLE_DECODING) if (c == UNMAPPABLE_DECODING)
@ -503,8 +503,8 @@ public class DoubleByte {
// The only thing we need to "override" is to check SS2/SS3 and // The only thing we need to "override" is to check SS2/SS3 and
// return "malformed" if found // return "malformed" if found
public static class Decoder_EUC_SIM extends Decoder { public static class Decoder_EUC_SIM extends Decoder {
private final int SS2 = 0x8E; private static final int SS2 = 0x8E;
private final int SS3 = 0x8F; private static final int SS3 = 0x8F;
public Decoder_EUC_SIM(Charset cs, public Decoder_EUC_SIM(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max, char[][] b2c, char[] b2cSB, int b2Min, int b2Max,
@ -556,7 +556,7 @@ public class DoubleByte {
public static class Encoder extends CharsetEncoder public static class Encoder extends CharsetEncoder
implements ArrayEncoder implements ArrayEncoder
{ {
protected final int MAX_SINGLEBYTE = 0xff; protected static final int MAX_SINGLEBYTE = 0xff;
private final char[] c2b; private final char[] c2b;
private final char[] c2bIndex; private final char[] c2bIndex;
protected Surrogate.Parser sgp; protected Surrogate.Parser sgp;
@ -659,7 +659,7 @@ public class DoubleByte {
dst.put((byte)(bb)); dst.put((byte)(bb));
} else { } else {
if (dst.remaining() < 1) if (dst.remaining() < 1)
return CoderResult.OVERFLOW; return CoderResult.OVERFLOW;
dst.put((byte)bb); dst.put((byte)bb);
} }
mark++; mark++;