From 5d8ba938bef162b74816147eb1002a0620a419ba Mon Sep 17 00:00:00 2001 From: Ichiroh Takiguchi Date: Tue, 23 May 2023 00:41:59 +0000 Subject: [PATCH] 8308046: Move Solaris related charsets from java.base to jdk.charsets module Reviewed-by: naoto --- .../data/charsetmapping/DoubleByte-X.java.template | 14 +++++++------- make/data/charsetmapping/stdcs-linux | 5 ----- .../sun/nio/cs/ext/Big5_Solaris.java.template | 5 ++--- .../classes/sun/nio/cs/ext/EUC_JP.java.template | 12 ++++++------ 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/make/data/charsetmapping/DoubleByte-X.java.template b/make/data/charsetmapping/DoubleByte-X.java.template index 20bc9fdc8de..38f1d1be5fd 100644 --- a/make/data/charsetmapping/DoubleByte-X.java.template +++ b/make/data/charsetmapping/DoubleByte-X.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2023, 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 @@ -56,10 +56,10 @@ public class $NAME_CLZ$ extends Charset return new DoubleByte.Encoder$ENCTYPE$(this, $ENC_REPLACEMENT$ EncodeHolder.c2b, EncodeHolder.c2bIndex, $ASCIICOMPATIBLE$); } - static class DecodeHolder { + public static class DecodeHolder { $B2C$ - static final char[][] b2c = new char[b2cStr.length][]; - static final char[] b2cSB; + public static final char[][] b2c = new char[b2cStr.length][]; + public static final char[] b2cSB; static { for (int i = 0; i < b2cStr.length; i++) { @@ -72,9 +72,9 @@ public class $NAME_CLZ$ extends Charset } } - static class EncodeHolder { - static final char[] c2b = new char[$C2BLENGTH$]; - static final char[] c2bIndex = new char[0x100]; + public static class EncodeHolder { + public static final char[] c2b = new char[$C2BLENGTH$]; + public static final char[] c2bIndex = new char[0x100]; static { $NONROUNDTRIP_B2C$ diff --git a/make/data/charsetmapping/stdcs-linux b/make/data/charsetmapping/stdcs-linux index b9e80ca6455..25f46489710 100644 --- a/make/data/charsetmapping/stdcs-linux +++ b/make/data/charsetmapping/stdcs-linux @@ -2,13 +2,11 @@ # generate these charsets into sun.nio.cs # Big5 -Big5_Solaris Big5_HKSCS EUC_CN EUC_KR EUC_JP EUC_JP_LINUX -EUC_JP_Open EUC_TW GBK ISO_8859_11 @@ -16,12 +14,9 @@ ISO_8859_3 ISO_8859_6 ISO_8859_8 Johab -PCK TIS_620 JIS_X_0201 JIS_X_0208 JIS_X_0212 -JIS_X_0208_Solaris -JIS_X_0212_Solaris MS932 SJIS diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template b/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template index 2c88b15f29b..e283b9bca43 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -28,8 +28,7 @@ package $PACKAGE$; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; -import sun.nio.cs.DoubleByte; -import sun.nio.cs.HistoricallyNamedCharset; +import sun.nio.cs.*; import java.util.Arrays; import static sun.nio.cs.CharsetMapping.*; diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template b/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template index 0ade0e9459d..56fd7741c5a 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, 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 @@ -72,16 +72,16 @@ public class EUC_JP return new Encoder(this); } - static class Decoder extends CharsetDecoder + public static class Decoder extends CharsetDecoder implements DelegatableDecoder { - static final SingleByte.Decoder DEC0201 = + public static final SingleByte.Decoder DEC0201 = (SingleByte.Decoder)new JIS_X_0201().newDecoder(); - static final DoubleByte.Decoder DEC0208 = + public static final DoubleByte.Decoder DEC0208 = (DoubleByte.Decoder)new JIS_X_0208().newDecoder(); - static final DoubleByte.Decoder DEC0212 = + public static final DoubleByte.Decoder DEC0212 = (DoubleByte.Decoder)new JIS_X_0212().newDecoder(); private final SingleByte.Decoder dec0201; @@ -228,7 +228,7 @@ public class EUC_JP } - static class Encoder extends CharsetEncoder { + public static class Encoder extends CharsetEncoder { static final SingleByte.Encoder ENC0201 = (SingleByte.Encoder)new JIS_X_0201().newEncoder();