Skip to content

Commit d35ffa4

Browse files
author
Andrey Turbanov
committed
8339017: Make a couple of fields in DoubleByte static
Reviewed-by: bpb, naoto
1 parent 723588a commit d35ffa4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/java.base/share/classes/sun/nio/cs/DoubleByte.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -402,7 +402,7 @@ protected CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
402402
else
403403
currentState = SBCS;
404404
} else {
405-
char c = UNMAPPABLE_DECODING;
405+
char c;
406406
if (currentState == SBCS) {
407407
c = b2cSB[b1];
408408
if (c == UNMAPPABLE_DECODING)
@@ -452,7 +452,7 @@ public int decode(byte[] src, int sp, int len, char[] dst) {
452452
else
453453
currentState = SBCS;
454454
} else {
455-
char c = UNMAPPABLE_DECODING;
455+
char c;
456456
if (currentState == SBCS) {
457457
c = b2cSB[b1];
458458
if (c == UNMAPPABLE_DECODING)
@@ -503,8 +503,8 @@ public Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b
503503
// The only thing we need to "override" is to check SS2/SS3 and
504504
// return "malformed" if found
505505
public static class Decoder_EUC_SIM extends Decoder {
506-
private final int SS2 = 0x8E;
507-
private final int SS3 = 0x8F;
506+
private static final int SS2 = 0x8E;
507+
private static final int SS3 = 0x8F;
508508

509509
public Decoder_EUC_SIM(Charset cs,
510510
char[][] b2c, char[] b2cSB, int b2Min, int b2Max,
@@ -556,7 +556,7 @@ public int decode(byte[] src, int sp, int len, char[] dst) {
556556
public static class Encoder extends CharsetEncoder
557557
implements ArrayEncoder
558558
{
559-
protected final int MAX_SINGLEBYTE = 0xff;
559+
protected static final int MAX_SINGLEBYTE = 0xff;
560560
private final char[] c2b;
561561
private final char[] c2bIndex;
562562
protected Surrogate.Parser sgp;
@@ -659,7 +659,7 @@ protected CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
659659
dst.put((byte)(bb));
660660
} else {
661661
if (dst.remaining() < 1)
662-
return CoderResult.OVERFLOW;
662+
return CoderResult.OVERFLOW;
663663
dst.put((byte)bb);
664664
}
665665
mark++;

0 commit comments

Comments
 (0)