diff --git a/src/java.base/share/classes/sun/nio/cs/DoubleByte.java b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java index d832d236d1c..2978a6f5dec 100644 --- a/src/java.base/share/classes/sun/nio/cs/DoubleByte.java +++ b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -402,7 +402,7 @@ public class DoubleByte { else currentState = SBCS; } else { - char c = UNMAPPABLE_DECODING; + char c; if (currentState == SBCS) { c = b2cSB[b1]; if (c == UNMAPPABLE_DECODING) @@ -452,7 +452,7 @@ public class DoubleByte { else currentState = SBCS; } else { - char c = UNMAPPABLE_DECODING; + char c; if (currentState == SBCS) { c = b2cSB[b1]; if (c == UNMAPPABLE_DECODING) @@ -503,8 +503,8 @@ public class DoubleByte { // The only thing we need to "override" is to check SS2/SS3 and // return "malformed" if found public static class Decoder_EUC_SIM extends Decoder { - private final int SS2 = 0x8E; - private final int SS3 = 0x8F; + private static final int SS2 = 0x8E; + private static final int SS3 = 0x8F; public Decoder_EUC_SIM(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max, @@ -556,7 +556,7 @@ public class DoubleByte { public static class Encoder extends CharsetEncoder implements ArrayEncoder { - protected final int MAX_SINGLEBYTE = 0xff; + protected static final int MAX_SINGLEBYTE = 0xff; private final char[] c2b; private final char[] c2bIndex; protected Surrogate.Parser sgp; @@ -659,7 +659,7 @@ public class DoubleByte { dst.put((byte)(bb)); } else { if (dst.remaining() < 1) - return CoderResult.OVERFLOW; + return CoderResult.OVERFLOW; dst.put((byte)bb); } mark++;