Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
21df5611
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
21df5611
编写于
6月 23, 2009
作者:
T
tbell
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
bc34fed8
495ed286
变更
78
展开全部
隐藏空白更改
内联
并排
Showing
78 changed file
with
130453 addition
and
626 deletion
+130453
-626
make/common/Release.gmk
make/common/Release.gmk
+23
-29
make/sun/nio/FILES_java.gmk
make/sun/nio/FILES_java.gmk
+9
-3
make/sun/nio/Makefile
make/sun/nio/Makefile
+1
-1
make/tools/CharsetMapping/EUC_CN.map
make/tools/CharsetMapping/EUC_CN.map
+7578
-0
make/tools/CharsetMapping/EUC_KR.map
make/tools/CharsetMapping/EUC_KR.map
+8365
-0
make/tools/CharsetMapping/GBK.map
make/tools/CharsetMapping/GBK.map
+24074
-0
make/tools/CharsetMapping/Johab.map
make/tools/CharsetMapping/Johab.map
+17196
-0
make/tools/CharsetMapping/MS932.c2b
make/tools/CharsetMapping/MS932.c2b
+21
-0
make/tools/CharsetMapping/MS932.map
make/tools/CharsetMapping/MS932.map
+9809
-0
make/tools/CharsetMapping/MS932.nr
make/tools/CharsetMapping/MS932.nr
+402
-0
make/tools/CharsetMapping/MS936.map
make/tools/CharsetMapping/MS936.map
+24099
-0
make/tools/CharsetMapping/MS949.map
make/tools/CharsetMapping/MS949.map
+17384
-0
make/tools/CharsetMapping/MS950.map
make/tools/CharsetMapping/MS950.map
+19886
-0
make/tools/CharsetMapping/MS950.nr
make/tools/CharsetMapping/MS950.nr
+18
-0
make/tools/CharsetMapping/dbcs
make/tools/CharsetMapping/dbcs
+8
-0
make/tools/src/build/tools/charsetmapping/GenerateDBCS.java
make/tools/src/build/tools/charsetmapping/GenerateDBCS.java
+7
-5
src/share/bin/java.c
src/share/bin/java.c
+8
-2
src/share/classes/java/math/BigDecimal.java
src/share/classes/java/math/BigDecimal.java
+4
-4
src/share/classes/java/net/SocksSocketImpl.java
src/share/classes/java/net/SocksSocketImpl.java
+25
-55
src/share/classes/sun/io/ByteToCharEUC_CN.java
src/share/classes/sun/io/ByteToCharEUC_CN.java
+5
-13
src/share/classes/sun/io/ByteToCharEUC_KR.java
src/share/classes/sun/io/ByteToCharEUC_KR.java
+5
-13
src/share/classes/sun/io/ByteToCharGBK.java
src/share/classes/sun/io/ByteToCharGBK.java
+5
-13
src/share/classes/sun/io/ByteToCharJohab.java
src/share/classes/sun/io/ByteToCharJohab.java
+5
-13
src/share/classes/sun/io/ByteToCharMS932.java
src/share/classes/sun/io/ByteToCharMS932.java
+7
-17
src/share/classes/sun/io/ByteToCharMS936.java
src/share/classes/sun/io/ByteToCharMS936.java
+5
-13
src/share/classes/sun/io/ByteToCharMS949.java
src/share/classes/sun/io/ByteToCharMS949.java
+6
-12
src/share/classes/sun/io/ByteToCharMS950.java
src/share/classes/sun/io/ByteToCharMS950.java
+5
-13
src/share/classes/sun/io/ByteToCharMS950_HKSCS.java
src/share/classes/sun/io/ByteToCharMS950_HKSCS.java
+1
-1
src/share/classes/sun/io/CharToByteEUC_CN.java
src/share/classes/sun/io/CharToByteEUC_CN.java
+5
-11
src/share/classes/sun/io/CharToByteEUC_KR.java
src/share/classes/sun/io/CharToByteEUC_KR.java
+5
-12
src/share/classes/sun/io/CharToByteGBK.java
src/share/classes/sun/io/CharToByteGBK.java
+5
-11
src/share/classes/sun/io/CharToByteJohab.java
src/share/classes/sun/io/CharToByteJohab.java
+5
-11
src/share/classes/sun/io/CharToByteMS932.java
src/share/classes/sun/io/CharToByteMS932.java
+7
-21
src/share/classes/sun/io/CharToByteMS936.java
src/share/classes/sun/io/CharToByteMS936.java
+5
-11
src/share/classes/sun/io/CharToByteMS949.java
src/share/classes/sun/io/CharToByteMS949.java
+5
-11
src/share/classes/sun/io/CharToByteMS950.java
src/share/classes/sun/io/CharToByteMS950.java
+5
-11
src/share/classes/sun/io/CharToByteMS950_HKSCS.java
src/share/classes/sun/io/CharToByteMS950_HKSCS.java
+1
-1
src/share/classes/sun/nio/cs/ISO_8859_1.java
src/share/classes/sun/nio/cs/ISO_8859_1.java
+1
-1
src/share/classes/sun/nio/cs/US_ASCII.java
src/share/classes/sun/nio/cs/US_ASCII.java
+2
-1
src/share/classes/sun/nio/cs/ext/DoubleByte.java
src/share/classes/sun/nio/cs/ext/DoubleByte.java
+17
-4
src/share/classes/sun/nio/cs/ext/ISO2022_CN.java
src/share/classes/sun/nio/cs/ext/ISO2022_CN.java
+2
-2
src/share/classes/sun/nio/cs/ext/MS932_0213.java
src/share/classes/sun/nio/cs/ext/MS932_0213.java
+9
-7
src/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
src/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
+7
-10
src/share/classes/sun/security/jgss/krb5/InitialToken.java
src/share/classes/sun/security/jgss/krb5/InitialToken.java
+23
-30
src/share/classes/sun/security/tools/JarSigner.java
src/share/classes/sun/security/tools/JarSigner.java
+6
-1
src/share/classes/sun/security/util/ManifestDigester.java
src/share/classes/sun/security/util/ManifestDigester.java
+2
-2
src/share/classes/sun/security/x509/CertificateVersion.java
src/share/classes/sun/security/x509/CertificateVersion.java
+0
-1
src/share/classes/sun/security/x509/InvalidityDateExtension.java
...re/classes/sun/security/x509/InvalidityDateExtension.java
+5
-1
src/share/classes/sun/tools/jar/Main.java
src/share/classes/sun/tools/jar/Main.java
+1
-1
src/solaris/classes/sun/awt/motif/X11GB2312.java
src/solaris/classes/sun/awt/motif/X11GB2312.java
+20
-7
src/solaris/classes/sun/awt/motif/X11GBK.java
src/solaris/classes/sun/awt/motif/X11GBK.java
+18
-9
src/solaris/classes/sun/awt/motif/X11KSC5601.java
src/solaris/classes/sun/awt/motif/X11KSC5601.java
+20
-7
test/java/math/BigDecimal/MultiplyTests.java
test/java/math/BigDecimal/MultiplyTests.java
+11
-1
test/sun/nio/cs/FindASCIIReplBugs.java
test/sun/nio/cs/FindASCIIReplBugs.java
+59
-0
test/sun/nio/cs/OLD/DoubleByteDecoder.java
test/sun/nio/cs/OLD/DoubleByteDecoder.java
+182
-0
test/sun/nio/cs/OLD/DoubleByteEncoder.java
test/sun/nio/cs/OLD/DoubleByteEncoder.java
+241
-0
test/sun/nio/cs/OLD/EUC_CN_OLD.java
test/sun/nio/cs/OLD/EUC_CN_OLD.java
+8
-13
test/sun/nio/cs/OLD/EUC_KR_OLD.java
test/sun/nio/cs/OLD/EUC_KR_OLD.java
+5
-5
test/sun/nio/cs/OLD/GBK_OLD.java
test/sun/nio/cs/OLD/GBK_OLD.java
+4
-6
test/sun/nio/cs/OLD/Johab_OLD.java
test/sun/nio/cs/OLD/Johab_OLD.java
+5
-7
test/sun/nio/cs/OLD/MS932DB.java
test/sun/nio/cs/OLD/MS932DB.java
+0
-1
test/sun/nio/cs/OLD/MS932_OLD.java
test/sun/nio/cs/OLD/MS932_OLD.java
+7
-7
test/sun/nio/cs/OLD/MS936_OLD.java
test/sun/nio/cs/OLD/MS936_OLD.java
+9
-10
test/sun/nio/cs/OLD/MS949_OLD.java
test/sun/nio/cs/OLD/MS949_OLD.java
+8
-10
test/sun/nio/cs/OLD/MS950_OLD.java
test/sun/nio/cs/OLD/MS950_OLD.java
+8
-11
test/sun/nio/cs/OLD/TestIBMDB.java
test/sun/nio/cs/OLD/TestIBMDB.java
+42
-14
test/sun/nio/cs/OLD/TestX11CS.java
test/sun/nio/cs/OLD/TestX11CS.java
+133
-0
test/sun/nio/cs/OLD/X11GB2312_OLD.java
test/sun/nio/cs/OLD/X11GB2312_OLD.java
+134
-0
test/sun/nio/cs/OLD/X11GBK_OLD.java
test/sun/nio/cs/OLD/X11GBK_OLD.java
+26
-14
test/sun/nio/cs/OLD/X11KSC5601_OLD.java
test/sun/nio/cs/OLD/X11KSC5601_OLD.java
+133
-0
test/sun/security/krb5/auto/CrossRealm.java
test/sun/security/krb5/auto/CrossRealm.java
+8
-3
test/sun/security/krb5/auto/HttpNegotiateServer.java
test/sun/security/krb5/auto/HttpNegotiateServer.java
+3
-39
test/sun/security/krb5/auto/IgnoreChannelBinding.java
test/sun/security/krb5/auto/IgnoreChannelBinding.java
+113
-0
test/sun/security/krb5/auto/KDC.java
test/sun/security/krb5/auto/KDC.java
+90
-66
test/sun/security/krb5/auto/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
...NF/services/sun.net.spi.nameservice.NameServiceDescriptor
+1
-1
test/sun/security/krb5/auto/OneKDC.java
test/sun/security/krb5/auto/OneKDC.java
+5
-18
test/sun/security/krb5/auto/basic.sh
test/sun/security/krb5/auto/basic.sh
+15
-9
test/sun/security/tools/jarsigner/emptymanifest.sh
test/sun/security/tools/jarsigner/emptymanifest.sh
+66
-0
未找到文件。
make/common/Release.gmk
浏览文件 @
21df5611
...
...
@@ -97,7 +97,7 @@ else
ifeq ($(PLATFORM), windows)
LICENSE_DOCLIST_JDK = $(subst $(LICENSE_VERSION),,\
$(shell $(CD) $(SHARE_JDK_DOC_SRC) && \
$(LS) *LICENSE*$(LICENSE_VERSION)))
$(LS) *LICENSE*$(LICENSE_VERSION)))
LICENSE_DOCLIST_JRE = $(subst $(LICENSE_VERSION),,\
$(shell $(CD) $(SHARE_JRE_DOC_SRC) && \
$(LS) *LICENSE*$(LICENSE_VERSION)))
...
...
@@ -401,7 +401,7 @@ TOOLS = \
sun/tools/jstack \
sun/tools/jinfo \
sun/tools/jmap
# classes that go into jsse.jar
JSSE_CLASSES_DIRS = \
sun/security/provider/Sun.class \
...
...
@@ -645,7 +645,7 @@ $(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \
@$(java-vm-cleanup)
# Create the manifest file.
JAR_MANIFEST_FILE=$(TEMPDIR)/manifest.tmp
JAR_MANIFEST_FILE=$(
ABS_
TEMPDIR)/manifest.tmp
$(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
$(prep-target)
$(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) >> $@
...
...
@@ -653,25 +653,22 @@ $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
$(CAT) $(BEANMANIFEST) >> $@
# Create resources.jar containing non-class files
RESOURCES_JAR=$(TEMPDIR)/resources-orig.jar
RES_JAR_ARGLIST=$(RES_JAR_FILELIST)_args
$(RES_JAR_ARGLIST): $(RES_JAR_FILELIST)
RESOURCES_JAR=$(ABS_TEMPDIR)/resources-orig.jar
$(RESOURCES_JAR): $(RES_JAR_FILELIST) $(JAR_MANIFEST_FILE)
$(prep-target)
$(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
$(RESOURCES_JAR): $(RES_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
$(prep-target)
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
@$(RES_JAR_ARGLIST) $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
$(CD) $(CLASSBINDIR) && \
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
@$(RES_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
# Create jsse.jar containing SunJSSE implementation classes
JSSE_JAR=$(TEMPDIR)/jsse-orig.jar
JSSE_JAR=$(
ABS_
TEMPDIR)/jsse-orig.jar
$(JSSE_JAR): $(JAR_MANIFEST_FILE)
$(prep-target)
$(
BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@
\
$(JSSE_CLASSES_DIRS:%=-C $(CLASSBINDIR) %)
\
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
$(
CD) $(CLASSBINDIR) &&
\
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@
\
$(
JSSE_CLASSES_DIRS) $(
BOOT_JAR_JFLAGS)
@$(
CD) $(CLASSBINDIR) && $(
java-vm-cleanup)
# Create sec-bin.zip
SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip
...
...
@@ -713,15 +710,12 @@ endif
# Create rt.jar
RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
RT_JAR_ARGLIST=$(RT_JAR_FILELIST)_args
$(RT_JAR_ARGLIST): $(RT_JAR_FILELIST)
$(prep-target)
$(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
$(RT_JAR): $(RT_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
$(RT_JAR): $(RT_JAR_FILELIST) $(JAR_MANIFEST_FILE)
$(prep-target)
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
@$(RT_JAR_ARGLIST) $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
$(CD) $(CLASSBINDIR) && \
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
@$(RT_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
# Meta-index construction to make core class loaders lazier
...
...
@@ -944,10 +938,10 @@ initial-image-jdk:: initial-image-jdk-setup \
@#
@# lib/tools.jar
@#
$(
BOOT_JAR_CMD) c0f $(LIBDIR)/tools.jar $(addprefix
\
-C $(CLASSBINDIR) , $(TOOLS))
\
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
$(
CD) $(CLASSBINDIR) &&
\
$(BOOT_JAR_CMD) c0f $(ABS_LIBDIR)/tools.jar
\
$(
TOOLS) $(
BOOT_JAR_JFLAGS)
@$(
CD) $(CLASSBINDIR) && $(
java-vm-cleanup)
$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
@#
@# lib/ct.sym
...
...
make/sun/nio/FILES_java.gmk
浏览文件 @
21df5611
...
...
@@ -151,7 +151,6 @@ FILES_src = \
sun/io/ByteToCharJISAutoDetect.java \
sun/io/ByteToCharJohab.java \
sun/io/ByteToCharMS874.java \
sun/io/ByteToCharMS932DB.java \
sun/io/ByteToCharMS932.java \
sun/io/ByteToCharMS936.java \
sun/io/ByteToCharMS949.java \
...
...
@@ -283,7 +282,6 @@ FILES_src = \
sun/io/CharToByteISO8859_8.java \
sun/io/CharToByteJohab.java \
sun/io/CharToByteMS874.java \
sun/io/CharToByteMS932DB.java \
sun/io/CharToByteMS932.java \
sun/io/CharToByteMS936.java \
sun/io/CharToByteMS949.java \
...
...
@@ -388,7 +386,15 @@ FILES_gen_extcs = \
sun/nio/cs/ext/IBM948.java \
sun/nio/cs/ext/IBM949.java \
sun/nio/cs/ext/IBM950.java \
sun/nio/cs/ext/IBM970.java
sun/nio/cs/ext/IBM970.java \
sun/nio/cs/ext/EUC_CN.java \
sun/nio/cs/ext/EUC_KR.java \
sun/nio/cs/ext/Johab.java \
sun/nio/cs/ext/MS932.java \
sun/nio/cs/ext/MS936.java \
sun/nio/cs/ext/MS949.java \
sun/nio/cs/ext/MS950.java \
sun/nio/cs/ext/GBK.java
FILES_java = $(FILES_src) $(FILES_gen_extcs)
make/sun/nio/Makefile
浏览文件 @
21df5611
...
...
@@ -105,7 +105,7 @@ $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
$
(
install-file
)
$(CHARSETS_JAR)
:
$(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
$(BOOT_JAR_CMD)
cf
$(CHARSETS_JAR)
\
$(BOOT_JAR_CMD)
cf
0
$(CHARSETS_JAR)
\
-C
$(CLASSDESTDIR)
sun
\
-C
$(CLASSDESTDIR)
$(SERVICE_DESCRIPTION_PATH)
\
$(BOOT_JAR_JFLAGS)
...
...
make/tools/CharsetMapping/EUC_CN.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/EUC_KR.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/GBK.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/Johab.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/MS932.c2b
0 → 100644
浏览文件 @
21df5611
#
# (1)entries that exist only in MS932DB.c2b.private
# (diff result of MS932DB.b2c.private and MS932DB.c2b.private)
# (2)added the jis0201 c->b only entries
# u+203e -> 0x7e
# u+00a5 -> 0x5c
#
0x7e 0x203e
0x5c 0x00a5
#
0x8143 0x00b8 # CEDILLA
0x8145 0x00b7 # MIDDLE DOT
0x8150 0x00af # MACRON
0x8191 0x00a2 # CENT SIGN
0x8192 0x00a3 # POUND SIGN
0x81ca 0x00ac # NOT SIGN
0x81e1 0x00ab # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
0x81e2 0x00bb # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
0x8394 0x3094 # HIRAGANA LETTER VU
0x83ca 0x00b5 # MICRO SIGN
make/tools/CharsetMapping/MS932.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/MS932.nr
0 → 100644
浏览文件 @
21df5611
#
# These are the entries exist only in MS932DB.b2c.private
# (diff result of MS932DB.b2c.private and MS932DB.c2b.private)
#
0x8790 0x2252 # APPROXIMATELY EQUAL TO OR THE IMAGE OF
0x8791 0x2261 # IDENTICAL TO
0x8792 0x222b # INTEGRAL
0x8795 0x221a # SQUARE ROOT
0x8796 0x22a5 # UP TACK
0x8797 0x2220 # ANGLE
0x879a 0x2235 # BECAUSE
0x879b 0x2229 # INTERSECTION
0x879c 0x222a # UNION
0xed40 0x7e8a # CJK UNIFIED IDEOGRAPH-7E8A
0xed41 0x891c # CJK UNIFIED IDEOGRAPH-891C
0xed42 0x9348 # CJK UNIFIED IDEOGRAPH-9348
0xed43 0x9288 # CJK UNIFIED IDEOGRAPH-9288
0xed44 0x84dc # CJK UNIFIED IDEOGRAPH-84DC
0xed45 0x4fc9 # CJK UNIFIED IDEOGRAPH-4FC9
0xed46 0x70bb # CJK UNIFIED IDEOGRAPH-70BB
0xed47 0x6631 # CJK UNIFIED IDEOGRAPH-6631
0xed48 0x68c8 # CJK UNIFIED IDEOGRAPH-68C8
0xed49 0x92f9 # CJK UNIFIED IDEOGRAPH-92F9
0xed4a 0x66fb # CJK UNIFIED IDEOGRAPH-66FB
0xed4b 0x5f45 # CJK UNIFIED IDEOGRAPH-5F45
0xed4c 0x4e28 # CJK UNIFIED IDEOGRAPH-4E28
0xed4d 0x4ee1 # CJK UNIFIED IDEOGRAPH-4EE1
0xed4e 0x4efc # CJK UNIFIED IDEOGRAPH-4EFC
0xed4f 0x4f00 # CJK UNIFIED IDEOGRAPH-4F00
0xed50 0x4f03 # CJK UNIFIED IDEOGRAPH-4F03
0xed51 0x4f39 # CJK UNIFIED IDEOGRAPH-4F39
0xed52 0x4f56 # CJK UNIFIED IDEOGRAPH-4F56
0xed53 0x4f92 # CJK UNIFIED IDEOGRAPH-4F92
0xed54 0x4f8a # CJK UNIFIED IDEOGRAPH-4F8A
0xed55 0x4f9a # CJK UNIFIED IDEOGRAPH-4F9A
0xed56 0x4f94 # CJK UNIFIED IDEOGRAPH-4F94
0xed57 0x4fcd # CJK UNIFIED IDEOGRAPH-4FCD
0xed58 0x5040 # CJK UNIFIED IDEOGRAPH-5040
0xed59 0x5022 # CJK UNIFIED IDEOGRAPH-5022
0xed5a 0x4fff # CJK UNIFIED IDEOGRAPH-4FFF
0xed5b 0x501e # CJK UNIFIED IDEOGRAPH-501E
0xed5c 0x5046 # CJK UNIFIED IDEOGRAPH-5046
0xed5d 0x5070 # CJK UNIFIED IDEOGRAPH-5070
0xed5e 0x5042 # CJK UNIFIED IDEOGRAPH-5042
0xed5f 0x5094 # CJK UNIFIED IDEOGRAPH-5094
0xed60 0x50f4 # CJK UNIFIED IDEOGRAPH-50F4
0xed61 0x50d8 # CJK UNIFIED IDEOGRAPH-50D8
0xed62 0x514a # CJK UNIFIED IDEOGRAPH-514A
0xed63 0x5164 # CJK UNIFIED IDEOGRAPH-5164
0xed64 0x519d # CJK UNIFIED IDEOGRAPH-519D
0xed65 0x51be # CJK UNIFIED IDEOGRAPH-51BE
0xed66 0x51ec # CJK UNIFIED IDEOGRAPH-51EC
0xed67 0x5215 # CJK UNIFIED IDEOGRAPH-5215
0xed68 0x529c # CJK UNIFIED IDEOGRAPH-529C
0xed69 0x52a6 # CJK UNIFIED IDEOGRAPH-52A6
0xed6a 0x52c0 # CJK UNIFIED IDEOGRAPH-52C0
0xed6b 0x52db # CJK UNIFIED IDEOGRAPH-52DB
0xed6c 0x5300 # CJK UNIFIED IDEOGRAPH-5300
0xed6d 0x5307 # CJK UNIFIED IDEOGRAPH-5307
0xed6e 0x5324 # CJK UNIFIED IDEOGRAPH-5324
0xed6f 0x5372 # CJK UNIFIED IDEOGRAPH-5372
0xed70 0x5393 # CJK UNIFIED IDEOGRAPH-5393
0xed71 0x53b2 # CJK UNIFIED IDEOGRAPH-53B2
0xed72 0x53dd # CJK UNIFIED IDEOGRAPH-53DD
0xed73 0xfa0e # CJK COMPATIBILITY IDEOGRAPH-FA0E
0xed74 0x549c # CJK UNIFIED IDEOGRAPH-549C
0xed75 0x548a # CJK UNIFIED IDEOGRAPH-548A
0xed76 0x54a9 # CJK UNIFIED IDEOGRAPH-54A9
0xed77 0x54ff # CJK UNIFIED IDEOGRAPH-54FF
0xed78 0x5586 # CJK UNIFIED IDEOGRAPH-5586
0xed79 0x5759 # CJK UNIFIED IDEOGRAPH-5759
0xed7a 0x5765 # CJK UNIFIED IDEOGRAPH-5765
0xed7b 0x57ac # CJK UNIFIED IDEOGRAPH-57AC
0xed7c 0x57c8 # CJK UNIFIED IDEOGRAPH-57C8
0xed7d 0x57c7 # CJK UNIFIED IDEOGRAPH-57C7
0xed7e 0xfa0f # CJK COMPATIBILITY IDEOGRAPH-FA0F
0xed80 0xfa10 # CJK COMPATIBILITY IDEOGRAPH-FA10
0xed81 0x589e # CJK UNIFIED IDEOGRAPH-589E
0xed82 0x58b2 # CJK UNIFIED IDEOGRAPH-58B2
0xed83 0x590b # CJK UNIFIED IDEOGRAPH-590B
0xed84 0x5953 # CJK UNIFIED IDEOGRAPH-5953
0xed85 0x595b # CJK UNIFIED IDEOGRAPH-595B
0xed86 0x595d # CJK UNIFIED IDEOGRAPH-595D
0xed87 0x5963 # CJK UNIFIED IDEOGRAPH-5963
0xed88 0x59a4 # CJK UNIFIED IDEOGRAPH-59A4
0xed89 0x59ba # CJK UNIFIED IDEOGRAPH-59BA
0xed8a 0x5b56 # CJK UNIFIED IDEOGRAPH-5B56
0xed8b 0x5bc0 # CJK UNIFIED IDEOGRAPH-5BC0
0xed8c 0x752f # CJK UNIFIED IDEOGRAPH-752F
0xed8d 0x5bd8 # CJK UNIFIED IDEOGRAPH-5BD8
0xed8e 0x5bec # CJK UNIFIED IDEOGRAPH-5BEC
0xed8f 0x5c1e # CJK UNIFIED IDEOGRAPH-5C1E
0xed90 0x5ca6 # CJK UNIFIED IDEOGRAPH-5CA6
0xed91 0x5cba # CJK UNIFIED IDEOGRAPH-5CBA
0xed92 0x5cf5 # CJK UNIFIED IDEOGRAPH-5CF5
0xed93 0x5d27 # CJK UNIFIED IDEOGRAPH-5D27
0xed94 0x5d53 # CJK UNIFIED IDEOGRAPH-5D53
0xed95 0xfa11 # CJK COMPATIBILITY IDEOGRAPH-FA11
0xed96 0x5d42 # CJK UNIFIED IDEOGRAPH-5D42
0xed97 0x5d6d # CJK UNIFIED IDEOGRAPH-5D6D
0xed98 0x5db8 # CJK UNIFIED IDEOGRAPH-5DB8
0xed99 0x5db9 # CJK UNIFIED IDEOGRAPH-5DB9
0xed9a 0x5dd0 # CJK UNIFIED IDEOGRAPH-5DD0
0xed9b 0x5f21 # CJK UNIFIED IDEOGRAPH-5F21
0xed9c 0x5f34 # CJK UNIFIED IDEOGRAPH-5F34
0xed9d 0x5f67 # CJK UNIFIED IDEOGRAPH-5F67
0xed9e 0x5fb7 # CJK UNIFIED IDEOGRAPH-5FB7
0xed9f 0x5fde # CJK UNIFIED IDEOGRAPH-5FDE
0xeda0 0x605d # CJK UNIFIED IDEOGRAPH-605D
0xeda1 0x6085 # CJK UNIFIED IDEOGRAPH-6085
0xeda2 0x608a # CJK UNIFIED IDEOGRAPH-608A
0xeda3 0x60de # CJK UNIFIED IDEOGRAPH-60DE
0xeda4 0x60d5 # CJK UNIFIED IDEOGRAPH-60D5
0xeda5 0x6120 # CJK UNIFIED IDEOGRAPH-6120
0xeda6 0x60f2 # CJK UNIFIED IDEOGRAPH-60F2
0xeda7 0x6111 # CJK UNIFIED IDEOGRAPH-6111
0xeda8 0x6137 # CJK UNIFIED IDEOGRAPH-6137
0xeda9 0x6130 # CJK UNIFIED IDEOGRAPH-6130
0xedaa 0x6198 # CJK UNIFIED IDEOGRAPH-6198
0xedab 0x6213 # CJK UNIFIED IDEOGRAPH-6213
0xedac 0x62a6 # CJK UNIFIED IDEOGRAPH-62A6
0xedad 0x63f5 # CJK UNIFIED IDEOGRAPH-63F5
0xedae 0x6460 # CJK UNIFIED IDEOGRAPH-6460
0xedaf 0x649d # CJK UNIFIED IDEOGRAPH-649D
0xedb0 0x64ce # CJK UNIFIED IDEOGRAPH-64CE
0xedb1 0x654e # CJK UNIFIED IDEOGRAPH-654E
0xedb2 0x6600 # CJK UNIFIED IDEOGRAPH-6600
0xedb3 0x6615 # CJK UNIFIED IDEOGRAPH-6615
0xedb4 0x663b # CJK UNIFIED IDEOGRAPH-663B
0xedb5 0x6609 # CJK UNIFIED IDEOGRAPH-6609
0xedb6 0x662e # CJK UNIFIED IDEOGRAPH-662E
0xedb7 0x661e # CJK UNIFIED IDEOGRAPH-661E
0xedb8 0x6624 # CJK UNIFIED IDEOGRAPH-6624
0xedb9 0x6665 # CJK UNIFIED IDEOGRAPH-6665
0xedba 0x6657 # CJK UNIFIED IDEOGRAPH-6657
0xedbb 0x6659 # CJK UNIFIED IDEOGRAPH-6659
0xedbc 0xfa12 # CJK COMPATIBILITY IDEOGRAPH-FA12
0xedbd 0x6673 # CJK UNIFIED IDEOGRAPH-6673
0xedbe 0x6699 # CJK UNIFIED IDEOGRAPH-6699
0xedbf 0x66a0 # CJK UNIFIED IDEOGRAPH-66A0
0xedc0 0x66b2 # CJK UNIFIED IDEOGRAPH-66B2
0xedc1 0x66bf # CJK UNIFIED IDEOGRAPH-66BF
0xedc2 0x66fa # CJK UNIFIED IDEOGRAPH-66FA
0xedc3 0x670e # CJK UNIFIED IDEOGRAPH-670E
0xedc4 0xf929 # CJK COMPATIBILITY IDEOGRAPH-F929
0xedc5 0x6766 # CJK UNIFIED IDEOGRAPH-6766
0xedc6 0x67bb # CJK UNIFIED IDEOGRAPH-67BB
0xedc7 0x6852 # CJK UNIFIED IDEOGRAPH-6852
0xedc8 0x67c0 # CJK UNIFIED IDEOGRAPH-67C0
0xedc9 0x6801 # CJK UNIFIED IDEOGRAPH-6801
0xedca 0x6844 # CJK UNIFIED IDEOGRAPH-6844
0xedcb 0x68cf # CJK UNIFIED IDEOGRAPH-68CF
0xedcc 0xfa13 # CJK COMPATIBILITY IDEOGRAPH-FA13
0xedcd 0x6968 # CJK UNIFIED IDEOGRAPH-6968
0xedce 0xfa14 # CJK COMPATIBILITY IDEOGRAPH-FA14
0xedcf 0x6998 # CJK UNIFIED IDEOGRAPH-6998
0xedd0 0x69e2 # CJK UNIFIED IDEOGRAPH-69E2
0xedd1 0x6a30 # CJK UNIFIED IDEOGRAPH-6A30
0xedd2 0x6a6b # CJK UNIFIED IDEOGRAPH-6A6B
0xedd3 0x6a46 # CJK UNIFIED IDEOGRAPH-6A46
0xedd4 0x6a73 # CJK UNIFIED IDEOGRAPH-6A73
0xedd5 0x6a7e # CJK UNIFIED IDEOGRAPH-6A7E
0xedd6 0x6ae2 # CJK UNIFIED IDEOGRAPH-6AE2
0xedd7 0x6ae4 # CJK UNIFIED IDEOGRAPH-6AE4
0xedd8 0x6bd6 # CJK UNIFIED IDEOGRAPH-6BD6
0xedd9 0x6c3f # CJK UNIFIED IDEOGRAPH-6C3F
0xedda 0x6c5c # CJK UNIFIED IDEOGRAPH-6C5C
0xeddb 0x6c86 # CJK UNIFIED IDEOGRAPH-6C86
0xeddc 0x6c6f # CJK UNIFIED IDEOGRAPH-6C6F
0xeddd 0x6cda # CJK UNIFIED IDEOGRAPH-6CDA
0xedde 0x6d04 # CJK UNIFIED IDEOGRAPH-6D04
0xeddf 0x6d87 # CJK UNIFIED IDEOGRAPH-6D87
0xede0 0x6d6f # CJK UNIFIED IDEOGRAPH-6D6F
0xede1 0x6d96 # CJK UNIFIED IDEOGRAPH-6D96
0xede2 0x6dac # CJK UNIFIED IDEOGRAPH-6DAC
0xede3 0x6dcf # CJK UNIFIED IDEOGRAPH-6DCF
0xede4 0x6df8 # CJK UNIFIED IDEOGRAPH-6DF8
0xede5 0x6df2 # CJK UNIFIED IDEOGRAPH-6DF2
0xede6 0x6dfc # CJK UNIFIED IDEOGRAPH-6DFC
0xede7 0x6e39 # CJK UNIFIED IDEOGRAPH-6E39
0xede8 0x6e5c # CJK UNIFIED IDEOGRAPH-6E5C
0xede9 0x6e27 # CJK UNIFIED IDEOGRAPH-6E27
0xedea 0x6e3c # CJK UNIFIED IDEOGRAPH-6E3C
0xedeb 0x6ebf # CJK UNIFIED IDEOGRAPH-6EBF
0xedec 0x6f88 # CJK UNIFIED IDEOGRAPH-6F88
0xeded 0x6fb5 # CJK UNIFIED IDEOGRAPH-6FB5
0xedee 0x6ff5 # CJK UNIFIED IDEOGRAPH-6FF5
0xedef 0x7005 # CJK UNIFIED IDEOGRAPH-7005
0xedf0 0x7007 # CJK UNIFIED IDEOGRAPH-7007
0xedf1 0x7028 # CJK UNIFIED IDEOGRAPH-7028
0xedf2 0x7085 # CJK UNIFIED IDEOGRAPH-7085
0xedf3 0x70ab # CJK UNIFIED IDEOGRAPH-70AB
0xedf4 0x710f # CJK UNIFIED IDEOGRAPH-710F
0xedf5 0x7104 # CJK UNIFIED IDEOGRAPH-7104
0xedf6 0x715c # CJK UNIFIED IDEOGRAPH-715C
0xedf7 0x7146 # CJK UNIFIED IDEOGRAPH-7146
0xedf8 0x7147 # CJK UNIFIED IDEOGRAPH-7147
0xedf9 0xfa15 # CJK COMPATIBILITY IDEOGRAPH-FA15
0xedfa 0x71c1 # CJK UNIFIED IDEOGRAPH-71C1
0xedfb 0x71fe # CJK UNIFIED IDEOGRAPH-71FE
0xedfc 0x72b1 # CJK UNIFIED IDEOGRAPH-72B1
0xee40 0x72be # CJK UNIFIED IDEOGRAPH-72BE
0xee41 0x7324 # CJK UNIFIED IDEOGRAPH-7324
0xee42 0xfa16 # CJK COMPATIBILITY IDEOGRAPH-FA16
0xee43 0x7377 # CJK UNIFIED IDEOGRAPH-7377
0xee44 0x73bd # CJK UNIFIED IDEOGRAPH-73BD
0xee45 0x73c9 # CJK UNIFIED IDEOGRAPH-73C9
0xee46 0x73d6 # CJK UNIFIED IDEOGRAPH-73D6
0xee47 0x73e3 # CJK UNIFIED IDEOGRAPH-73E3
0xee48 0x73d2 # CJK UNIFIED IDEOGRAPH-73D2
0xee49 0x7407 # CJK UNIFIED IDEOGRAPH-7407
0xee4a 0x73f5 # CJK UNIFIED IDEOGRAPH-73F5
0xee4b 0x7426 # CJK UNIFIED IDEOGRAPH-7426
0xee4c 0x742a # CJK UNIFIED IDEOGRAPH-742A
0xee4d 0x7429 # CJK UNIFIED IDEOGRAPH-7429
0xee4e 0x742e # CJK UNIFIED IDEOGRAPH-742E
0xee4f 0x7462 # CJK UNIFIED IDEOGRAPH-7462
0xee50 0x7489 # CJK UNIFIED IDEOGRAPH-7489
0xee51 0x749f # CJK UNIFIED IDEOGRAPH-749F
0xee52 0x7501 # CJK UNIFIED IDEOGRAPH-7501
0xee53 0x756f # CJK UNIFIED IDEOGRAPH-756F
0xee54 0x7682 # CJK UNIFIED IDEOGRAPH-7682
0xee55 0x769c # CJK UNIFIED IDEOGRAPH-769C
0xee56 0x769e # CJK UNIFIED IDEOGRAPH-769E
0xee57 0x769b # CJK UNIFIED IDEOGRAPH-769B
0xee58 0x76a6 # CJK UNIFIED IDEOGRAPH-76A6
0xee59 0xfa17 # CJK COMPATIBILITY IDEOGRAPH-FA17
0xee5a 0x7746 # CJK UNIFIED IDEOGRAPH-7746
0xee5b 0x52af # CJK UNIFIED IDEOGRAPH-52AF
0xee5c 0x7821 # CJK UNIFIED IDEOGRAPH-7821
0xee5d 0x784e # CJK UNIFIED IDEOGRAPH-784E
0xee5e 0x7864 # CJK UNIFIED IDEOGRAPH-7864
0xee5f 0x787a # CJK UNIFIED IDEOGRAPH-787A
0xee60 0x7930 # CJK UNIFIED IDEOGRAPH-7930
0xee61 0xfa18 # CJK COMPATIBILITY IDEOGRAPH-FA18
0xee62 0xfa19 # CJK COMPATIBILITY IDEOGRAPH-FA19
0xee63 0xfa1a # CJK COMPATIBILITY IDEOGRAPH-FA1A
0xee64 0x7994 # CJK UNIFIED IDEOGRAPH-7994
0xee65 0xfa1b # CJK COMPATIBILITY IDEOGRAPH-FA1B
0xee66 0x799b # CJK UNIFIED IDEOGRAPH-799B
0xee67 0x7ad1 # CJK UNIFIED IDEOGRAPH-7AD1
0xee68 0x7ae7 # CJK UNIFIED IDEOGRAPH-7AE7
0xee69 0xfa1c # CJK COMPATIBILITY IDEOGRAPH-FA1C
0xee6a 0x7aeb # CJK UNIFIED IDEOGRAPH-7AEB
0xee6b 0x7b9e # CJK UNIFIED IDEOGRAPH-7B9E
0xee6c 0xfa1d # CJK COMPATIBILITY IDEOGRAPH-FA1D
0xee6d 0x7d48 # CJK UNIFIED IDEOGRAPH-7D48
0xee6e 0x7d5c # CJK UNIFIED IDEOGRAPH-7D5C
0xee6f 0x7db7 # CJK UNIFIED IDEOGRAPH-7DB7
0xee70 0x7da0 # CJK UNIFIED IDEOGRAPH-7DA0
0xee71 0x7dd6 # CJK UNIFIED IDEOGRAPH-7DD6
0xee72 0x7e52 # CJK UNIFIED IDEOGRAPH-7E52
0xee73 0x7f47 # CJK UNIFIED IDEOGRAPH-7F47
0xee74 0x7fa1 # CJK UNIFIED IDEOGRAPH-7FA1
0xee75 0xfa1e # CJK COMPATIBILITY IDEOGRAPH-FA1E
0xee76 0x8301 # CJK UNIFIED IDEOGRAPH-8301
0xee77 0x8362 # CJK UNIFIED IDEOGRAPH-8362
0xee78 0x837f # CJK UNIFIED IDEOGRAPH-837F
0xee79 0x83c7 # CJK UNIFIED IDEOGRAPH-83C7
0xee7a 0x83f6 # CJK UNIFIED IDEOGRAPH-83F6
0xee7b 0x8448 # CJK UNIFIED IDEOGRAPH-8448
0xee7c 0x84b4 # CJK UNIFIED IDEOGRAPH-84B4
0xee7d 0x8553 # CJK UNIFIED IDEOGRAPH-8553
0xee7e 0x8559 # CJK UNIFIED IDEOGRAPH-8559
0xee80 0x856b # CJK UNIFIED IDEOGRAPH-856B
0xee81 0xfa1f # CJK COMPATIBILITY IDEOGRAPH-FA1F
0xee82 0x85b0 # CJK UNIFIED IDEOGRAPH-85B0
0xee83 0xfa20 # CJK COMPATIBILITY IDEOGRAPH-FA20
0xee84 0xfa21 # CJK COMPATIBILITY IDEOGRAPH-FA21
0xee85 0x8807 # CJK UNIFIED IDEOGRAPH-8807
0xee86 0x88f5 # CJK UNIFIED IDEOGRAPH-88F5
0xee87 0x8a12 # CJK UNIFIED IDEOGRAPH-8A12
0xee88 0x8a37 # CJK UNIFIED IDEOGRAPH-8A37
0xee89 0x8a79 # CJK UNIFIED IDEOGRAPH-8A79
0xee8a 0x8aa7 # CJK UNIFIED IDEOGRAPH-8AA7
0xee8b 0x8abe # CJK UNIFIED IDEOGRAPH-8ABE
0xee8c 0x8adf # CJK UNIFIED IDEOGRAPH-8ADF
0xee8d 0xfa22 # CJK COMPATIBILITY IDEOGRAPH-FA22
0xee8e 0x8af6 # CJK UNIFIED IDEOGRAPH-8AF6
0xee8f 0x8b53 # CJK UNIFIED IDEOGRAPH-8B53
0xee90 0x8b7f # CJK UNIFIED IDEOGRAPH-8B7F
0xee91 0x8cf0 # CJK UNIFIED IDEOGRAPH-8CF0
0xee92 0x8cf4 # CJK UNIFIED IDEOGRAPH-8CF4
0xee93 0x8d12 # CJK UNIFIED IDEOGRAPH-8D12
0xee94 0x8d76 # CJK UNIFIED IDEOGRAPH-8D76
0xee95 0xfa23 # CJK COMPATIBILITY IDEOGRAPH-FA23
0xee96 0x8ecf # CJK UNIFIED IDEOGRAPH-8ECF
0xee97 0xfa24 # CJK COMPATIBILITY IDEOGRAPH-FA24
0xee98 0xfa25 # CJK COMPATIBILITY IDEOGRAPH-FA25
0xee99 0x9067 # CJK UNIFIED IDEOGRAPH-9067
0xee9a 0x90de # CJK UNIFIED IDEOGRAPH-90DE
0xee9b 0xfa26 # CJK COMPATIBILITY IDEOGRAPH-FA26
0xee9c 0x9115 # CJK UNIFIED IDEOGRAPH-9115
0xee9d 0x9127 # CJK UNIFIED IDEOGRAPH-9127
0xee9e 0x91da # CJK UNIFIED IDEOGRAPH-91DA
0xee9f 0x91d7 # CJK UNIFIED IDEOGRAPH-91D7
0xeea0 0x91de # CJK UNIFIED IDEOGRAPH-91DE
0xeea1 0x91ed # CJK UNIFIED IDEOGRAPH-91ED
0xeea2 0x91ee # CJK UNIFIED IDEOGRAPH-91EE
0xeea3 0x91e4 # CJK UNIFIED IDEOGRAPH-91E4
0xeea4 0x91e5 # CJK UNIFIED IDEOGRAPH-91E5
0xeea5 0x9206 # CJK UNIFIED IDEOGRAPH-9206
0xeea6 0x9210 # CJK UNIFIED IDEOGRAPH-9210
0xeea7 0x920a # CJK UNIFIED IDEOGRAPH-920A
0xeea8 0x923a # CJK UNIFIED IDEOGRAPH-923A
0xeea9 0x9240 # CJK UNIFIED IDEOGRAPH-9240
0xeeaa 0x923c # CJK UNIFIED IDEOGRAPH-923C
0xeeab 0x924e # CJK UNIFIED IDEOGRAPH-924E
0xeeac 0x9259 # CJK UNIFIED IDEOGRAPH-9259
0xeead 0x9251 # CJK UNIFIED IDEOGRAPH-9251
0xeeae 0x9239 # CJK UNIFIED IDEOGRAPH-9239
0xeeaf 0x9267 # CJK UNIFIED IDEOGRAPH-9267
0xeeb0 0x92a7 # CJK UNIFIED IDEOGRAPH-92A7
0xeeb1 0x9277 # CJK UNIFIED IDEOGRAPH-9277
0xeeb2 0x9278 # CJK UNIFIED IDEOGRAPH-9278
0xeeb3 0x92e7 # CJK UNIFIED IDEOGRAPH-92E7
0xeeb4 0x92d7 # CJK UNIFIED IDEOGRAPH-92D7
0xeeb5 0x92d9 # CJK UNIFIED IDEOGRAPH-92D9
0xeeb6 0x92d0 # CJK UNIFIED IDEOGRAPH-92D0
0xeeb7 0xfa27 # CJK COMPATIBILITY IDEOGRAPH-FA27
0xeeb8 0x92d5 # CJK UNIFIED IDEOGRAPH-92D5
0xeeb9 0x92e0 # CJK UNIFIED IDEOGRAPH-92E0
0xeeba 0x92d3 # CJK UNIFIED IDEOGRAPH-92D3
0xeebb 0x9325 # CJK UNIFIED IDEOGRAPH-9325
0xeebc 0x9321 # CJK UNIFIED IDEOGRAPH-9321
0xeebd 0x92fb # CJK UNIFIED IDEOGRAPH-92FB
0xeebe 0xfa28 # CJK COMPATIBILITY IDEOGRAPH-FA28
0xeebf 0x931e # CJK UNIFIED IDEOGRAPH-931E
0xeec0 0x92ff # CJK UNIFIED IDEOGRAPH-92FF
0xeec1 0x931d # CJK UNIFIED IDEOGRAPH-931D
0xeec2 0x9302 # CJK UNIFIED IDEOGRAPH-9302
0xeec3 0x9370 # CJK UNIFIED IDEOGRAPH-9370
0xeec4 0x9357 # CJK UNIFIED IDEOGRAPH-9357
0xeec5 0x93a4 # CJK UNIFIED IDEOGRAPH-93A4
0xeec6 0x93c6 # CJK UNIFIED IDEOGRAPH-93C6
0xeec7 0x93de # CJK UNIFIED IDEOGRAPH-93DE
0xeec8 0x93f8 # CJK UNIFIED IDEOGRAPH-93F8
0xeec9 0x9431 # CJK UNIFIED IDEOGRAPH-9431
0xeeca 0x9445 # CJK UNIFIED IDEOGRAPH-9445
0xeecb 0x9448 # CJK UNIFIED IDEOGRAPH-9448
0xeecc 0x9592 # CJK UNIFIED IDEOGRAPH-9592
0xeecd 0xf9dc # CJK COMPATIBILITY IDEOGRAPH-F9DC
0xeece 0xfa29 # CJK COMPATIBILITY IDEOGRAPH-FA29
0xeecf 0x969d # CJK UNIFIED IDEOGRAPH-969D
0xeed0 0x96af # CJK UNIFIED IDEOGRAPH-96AF
0xeed1 0x9733 # CJK UNIFIED IDEOGRAPH-9733
0xeed2 0x973b # CJK UNIFIED IDEOGRAPH-973B
0xeed3 0x9743 # CJK UNIFIED IDEOGRAPH-9743
0xeed4 0x974d # CJK UNIFIED IDEOGRAPH-974D
0xeed5 0x974f # CJK UNIFIED IDEOGRAPH-974F
0xeed6 0x9751 # CJK UNIFIED IDEOGRAPH-9751
0xeed7 0x9755 # CJK UNIFIED IDEOGRAPH-9755
0xeed8 0x9857 # CJK UNIFIED IDEOGRAPH-9857
0xeed9 0x9865 # CJK UNIFIED IDEOGRAPH-9865
0xeeda 0xfa2a # CJK COMPATIBILITY IDEOGRAPH-FA2A
0xeedb 0xfa2b # CJK COMPATIBILITY IDEOGRAPH-FA2B
0xeedc 0x9927 # CJK UNIFIED IDEOGRAPH-9927
0xeedd 0xfa2c # CJK COMPATIBILITY IDEOGRAPH-FA2C
0xeede 0x999e # CJK UNIFIED IDEOGRAPH-999E
0xeedf 0x9a4e # CJK UNIFIED IDEOGRAPH-9A4E
0xeee0 0x9ad9 # CJK UNIFIED IDEOGRAPH-9AD9
0xeee1 0x9adc # CJK UNIFIED IDEOGRAPH-9ADC
0xeee2 0x9b75 # CJK UNIFIED IDEOGRAPH-9B75
0xeee3 0x9b72 # CJK UNIFIED IDEOGRAPH-9B72
0xeee4 0x9b8f # CJK UNIFIED IDEOGRAPH-9B8F
0xeee5 0x9bb1 # CJK UNIFIED IDEOGRAPH-9BB1
0xeee6 0x9bbb # CJK UNIFIED IDEOGRAPH-9BBB
0xeee7 0x9c00 # CJK UNIFIED IDEOGRAPH-9C00
0xeee8 0x9d70 # CJK UNIFIED IDEOGRAPH-9D70
0xeee9 0x9d6b # CJK UNIFIED IDEOGRAPH-9D6B
0xeeea 0xfa2d # CJK COMPATIBILITY IDEOGRAPH-FA2D
0xeeeb 0x9e19 # CJK UNIFIED IDEOGRAPH-9E19
0xeeec 0x9ed1 # CJK UNIFIED IDEOGRAPH-9ED1
0xeeef 0x2170 # SMALL ROMAN NUMERAL ONE
0xeef0 0x2171 # SMALL ROMAN NUMERAL TWO
0xeef1 0x2172 # SMALL ROMAN NUMERAL THREE
0xeef2 0x2173 # SMALL ROMAN NUMERAL FOUR
0xeef3 0x2174 # SMALL ROMAN NUMERAL FIVE
0xeef4 0x2175 # SMALL ROMAN NUMERAL SIX
0xeef5 0x2176 # SMALL ROMAN NUMERAL SEVEN
0xeef6 0x2177 # SMALL ROMAN NUMERAL EIGHT
0xeef7 0x2178 # SMALL ROMAN NUMERAL NINE
0xeef8 0x2179 # SMALL ROMAN NUMERAL TEN
0xeef9 0xffe2 # FULLWIDTH NOT SIGN
0xeefa 0xffe4 # FULLWIDTH BROKEN BAR
0xeefb 0xff07 # FULLWIDTH APOSTROPHE
0xeefc 0xff02 # FULLWIDTH QUOTATION MARK
0xfa4a 0x2160 # ROMAN NUMERAL ONE
0xfa4b 0x2161 # ROMAN NUMERAL TWO
0xfa4c 0x2162 # ROMAN NUMERAL THREE
0xfa4d 0x2163 # ROMAN NUMERAL FOUR
0xfa4e 0x2164 # ROMAN NUMERAL FIVE
0xfa4f 0x2165 # ROMAN NUMERAL SIX
0xfa50 0x2166 # ROMAN NUMERAL SEVEN
0xfa51 0x2167 # ROMAN NUMERAL EIGHT
0xfa52 0x2168 # ROMAN NUMERAL NINE
0xfa53 0x2169 # ROMAN NUMERAL TEN
0xfa54 0xffe2 # FULLWIDTH NOT SIGN
0xfa58 0x3231 # PARENTHESIZED IDEOGRAPH STOCK
0xfa59 0x2116 # NUMERO SIGN
0xfa5a 0x2121 # TELEPHONE SIGN
0xfa5b 0x2235 # BECAUSE
make/tools/CharsetMapping/MS936.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/MS949.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/MS950.map
0 → 100644
浏览文件 @
21df5611
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/MS950.nr
0 → 100644
浏览文件 @
21df5611
#
# copy/paste of MS950.b2c-irreversible
#
# removed the entries of MS950.c2b-irreversible etries, this .nr
# table only includes "b->c only" entries
# (we don't need a MS950.c2b, the entries of MS950.c2b-irreversible
# are added in MS950.b2c already)
#
0xF9FA 0x256D
0xF9FB 0x256E
0xF9FC 0x2570
0xF9FD 0x256F
0xA2CC 0x5341
0xA2CE 0x5345
0xF9F9 0x2550
0xF9E9 0x255E
0xF9EA 0x256A
0xF9EB 0x2561
make/tools/CharsetMapping/dbcs
浏览文件 @
21df5611
#
#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
#
Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
MS932 windows-31j MS932 basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
...
...
make/tools/src/build/tools/charsetmapping/GenerateDBCS.java
浏览文件 @
21df5611
...
...
@@ -35,7 +35,7 @@ import static build.tools.charsetmapping.CharsetMapping.*;
public
class
GenerateDBCS
{
// pattern used by this class to read in mapping table
static
Pattern
mPattern
=
Pattern
.
compile
(
"(
\\p{XDigit}++)\\s++(\\p{XDigit}++)(
\\s++#.*)?"
);
static
Pattern
mPattern
=
Pattern
.
compile
(
"(
?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:
\\s++#.*)?"
);
public
static
void
genDBCS
(
String
args
[])
throws
Exception
{
Scanner
s
=
new
Scanner
(
new
File
(
args
[
0
],
args
[
2
]));
...
...
@@ -260,10 +260,12 @@ public class GenerateDBCS {
"StandardCharsets.aliases_"
+
clzName
:
"ExtendedCharsets.aliasesFor(\""
+
csName
+
"\")"
)
.
replace
(
"$NAME_CS$"
,
csName
)
.
replace
(
"$CONTAINS$"
,
isASCII
?
" return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof "
+
clzName
+
"));"
:
" return (cs instanceof "
+
clzName
+
");"
)
.
replace
(
"$CONTAINS$"
,
"MS932"
.
equals
(
clzName
)?
"return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof JIS_X_0201) || (cs instanceof "
+
clzName
+
"));"
:
(
isASCII
?
"return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof "
+
clzName
+
"));"
:
"return (cs instanceof "
+
clzName
+
");"
))
.
replace
(
"$HISTORICALNAME$"
,
(
hisName
==
null
)?
""
:
" public String historicalName() { return \""
+
hisName
+
"\"; }"
)
...
...
src/share/bin/java.c
浏览文件 @
21df5611
...
...
@@ -683,10 +683,16 @@ static void
SetClassPath
(
const
char
*
s
)
{
char
*
def
;
const
char
*
orig
=
s
;
static
const
char
format
[]
=
"-Djava.class.path=%s"
;
s
=
JLI_WildcardExpandClasspath
(
s
);
def
=
JLI_MemAlloc
(
JLI_StrLen
(
s
)
+
40
);
sprintf
(
def
,
"-Djava.class.path=%s"
,
s
);
def
=
JLI_MemAlloc
(
sizeof
(
format
)
-
2
/* strlen("%s") */
+
JLI_StrLen
(
s
));
sprintf
(
def
,
format
,
s
);
AddOption
(
def
,
NULL
);
if
(
s
!=
orig
)
JLI_MemFree
((
char
*
)
s
);
}
/*
...
...
src/share/classes/java/math/BigDecimal.java
浏览文件 @
21df5611
...
...
@@ -1101,7 +1101,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
// See "Hacker's Delight" section 2-12 for explanation of
// the overflow test.
if
(
(((
sum
^
xs
)
&
(
sum
^
ys
)))
>=
0L
)
// not overflowed
return
new
BigDecimal
(
null
,
sum
,
rscale
,
0
);
return
BigDecimal
.
valueOf
(
sum
,
rscale
);
}
if
(
fst
==
null
)
fst
=
BigInteger
.
valueOf
(
xs
);
...
...
@@ -1311,9 +1311,9 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* would occur since division is expensive on most CPUs.
*/
long
product
=
x
*
y
;
int
prec
=
this
.
precision
()
+
multiplicand
.
precision
();
long
prec
=
this
.
precision
()
+
multiplicand
.
precision
();
if
(
prec
<
19
||
(
prec
<
21
&&
(
y
==
0
||
product
/
y
==
x
)))
return
new
BigDecimal
(
null
,
product
,
productScale
,
0
);
return
BigDecimal
.
valueOf
(
product
,
productScale
);
return
new
BigDecimal
(
BigInteger
.
valueOf
(
x
).
multiply
(
y
),
INFLATED
,
productScale
,
0
);
}
...
...
@@ -1584,7 +1584,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
return
(
preferredScale
>=
0
&&
preferredScale
<
ZERO_SCALED_BY
.
length
)
?
ZERO_SCALED_BY
[
preferredScale
]
:
new
BigDecimal
(
null
,
0
,
preferredScale
,
1
);
BigDecimal
.
valueOf
(
0
,
preferredScale
);
else
{
this
.
inflate
();
divisor
.
inflate
();
...
...
src/share/classes/java/net/SocksSocketImpl.java
浏览文件 @
21df5611
...
...
@@ -29,7 +29,6 @@ import java.io.OutputStream;
import
java.io.BufferedOutputStream
;
import
java.security.AccessController
;
import
java.security.PrivilegedExceptionAction
;
import
java.util.prefs.Preferences
;
import
sun.net.www.ParseUtil
;
/* import org.ietf.jgss.*; */
...
...
@@ -41,7 +40,7 @@ import sun.net.www.ParseUtil;
class
SocksSocketImpl
extends
PlainSocketImpl
implements
SocksConsts
{
private
String
server
=
null
;
private
int
p
ort
=
DEFAULT_PORT
;
private
int
serverP
ort
=
DEFAULT_PORT
;
private
InetSocketAddress
external_address
;
private
boolean
useV4
=
false
;
private
Socket
cmdsock
=
null
;
...
...
@@ -54,7 +53,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
SocksSocketImpl
(
String
server
,
int
port
)
{
this
.
server
=
server
;
this
.
p
ort
=
(
port
==
-
1
?
DEFAULT_PORT
:
port
);
this
.
serverP
ort
=
(
port
==
-
1
?
DEFAULT_PORT
:
port
);
}
SocksSocketImpl
(
Proxy
proxy
)
{
...
...
@@ -63,7 +62,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
InetSocketAddress
ad
=
(
InetSocketAddress
)
a
;
// Use getHostString() to avoid reverse lookups
server
=
ad
.
getHostString
();
p
ort
=
ad
.
getPort
();
serverP
ort
=
ad
.
getPort
();
}
}
...
...
@@ -113,16 +112,12 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
*/
private
boolean
authenticate
(
byte
method
,
InputStream
in
,
BufferedOutputStream
out
)
throws
IOException
{
byte
[]
data
=
null
;
int
i
;
// No Authentication required. We're done then!
if
(
method
==
NO_AUTH
)
return
true
;
/**
* User/Password authentication. Try, in that order :
* - The application provided Authenticator, if any
* - The user preferences java.net.socks.username &
* java.net.socks.password
* - the user.name & no password (backward compatibility behavior).
*/
if
(
method
==
USER_PASSW
)
{
...
...
@@ -134,40 +129,15 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
new
java
.
security
.
PrivilegedAction
<
PasswordAuthentication
>()
{
public
PasswordAuthentication
run
()
{
return
Authenticator
.
requestPasswordAuthentication
(
server
,
addr
,
p
ort
,
"SOCKS5"
,
"SOCKS authentication"
,
null
);
server
,
addr
,
serverP
ort
,
"SOCKS5"
,
"SOCKS authentication"
,
null
);
}
});
if
(
pw
!=
null
)
{
userName
=
pw
.
getUserName
();
password
=
new
String
(
pw
.
getPassword
());
}
else
{
final
Preferences
prefs
=
Preferences
.
userRoot
().
node
(
"/java/net/socks"
);
try
{
userName
=
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedExceptionAction
<
String
>()
{
public
String
run
()
throws
IOException
{
return
prefs
.
get
(
"username"
,
null
);
}
});
}
catch
(
java
.
security
.
PrivilegedActionException
pae
)
{
throw
(
IOException
)
pae
.
getException
();
}
if
(
userName
!=
null
)
{
try
{
password
=
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedExceptionAction
<
String
>()
{
public
String
run
()
throws
IOException
{
return
prefs
.
get
(
"password"
,
null
);
}
});
}
catch
(
java
.
security
.
PrivilegedActionException
pae
)
{
throw
(
IOException
)
pae
.
getException
();
}
}
else
{
userName
=
java
.
security
.
AccessController
.
doPrivileged
(
userName
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"user.name"
));
}
}
if
(
userName
==
null
)
return
false
;
...
...
@@ -188,8 +158,8 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
}
else
out
.
write
(
0
);
out
.
flush
();
data
=
new
byte
[
2
];
i
=
readSocksReply
(
in
,
data
);
byte
[]
data
=
new
byte
[
2
];
i
nt
i
=
readSocksReply
(
in
,
data
);
if
(
i
!=
2
||
data
[
1
]
!=
0
)
{
/* RFC 1929 specifies that the connection MUST be closed if
authentication fails */
...
...
@@ -322,6 +292,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
* @throws IllegalArgumentException if endpoint is null or a
* SocketAddress subclass not supported by this socket
*/
@Override
protected
void
connect
(
SocketAddress
endpoint
,
int
timeout
)
throws
IOException
{
SecurityManager
security
=
System
.
getSecurityManager
();
if
(
endpoint
==
null
||
!(
endpoint
instanceof
InetSocketAddress
))
...
...
@@ -352,7 +323,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
super
.
connect
(
epoint
,
timeout
);
return
;
}
URI
uri
=
null
;
URI
uri
;
// Use getHostString() to avoid reverse lookups
String
host
=
epoint
.
getHostString
();
// IPv6 litteral?
...
...
@@ -365,6 +336,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
}
catch
(
URISyntaxException
e
)
{
// This shouldn't happen
assert
false
:
e
;
uri
=
null
;
}
Proxy
p
=
null
;
IOException
savedExc
=
null
;
...
...
@@ -386,18 +358,18 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
throw
new
SocketException
(
"Unknow address type for proxy: "
+
p
);
// Use getHostString() to avoid reverse lookups
server
=
((
InetSocketAddress
)
p
.
address
()).
getHostString
();
p
ort
=
((
InetSocketAddress
)
p
.
address
()).
getPort
();
serverP
ort
=
((
InetSocketAddress
)
p
.
address
()).
getPort
();
// Connects to the SOCKS server
try
{
privilegedConnect
(
server
,
p
ort
,
timeout
);
privilegedConnect
(
server
,
serverP
ort
,
timeout
);
// Worked, let's get outta here
break
;
}
catch
(
IOException
e
)
{
// Ooops, let's notify the ProxySelector
sel
.
connectFailed
(
uri
,
p
.
address
(),
e
);
server
=
null
;
p
ort
=
-
1
;
serverP
ort
=
-
1
;
savedExc
=
e
;
// Will continue the while loop and try the next proxy
}
...
...
@@ -414,7 +386,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
}
else
{
// Connects to the SOCKS server
try
{
privilegedConnect
(
server
,
p
ort
,
timeout
);
privilegedConnect
(
server
,
serverP
ort
,
timeout
);
}
catch
(
IOException
e
)
{
throw
new
SocketException
(
e
.
getMessage
());
}
...
...
@@ -487,7 +459,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
if
(
i
!=
4
)
throw
new
SocketException
(
"Reply from SOCKS server has bad length"
);
SocketException
ex
=
null
;
int
nport
,
len
;
int
len
;
byte
[]
addr
;
switch
(
data
[
1
])
{
case
REQUEST_OK:
...
...
@@ -502,8 +474,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
i
=
readSocksReply
(
in
,
data
);
if
(
i
!=
2
)
throw
new
SocketException
(
"Reply from SOCKS server badly formatted"
);
nport
=
((
int
)
data
[
0
]
&
0xff
)
<<
8
;
nport
+=
((
int
)
data
[
1
]
&
0xff
);
break
;
case
DOMAIN_NAME:
len
=
data
[
1
];
...
...
@@ -515,8 +485,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
i
=
readSocksReply
(
in
,
data
);
if
(
i
!=
2
)
throw
new
SocketException
(
"Reply from SOCKS server badly formatted"
);
nport
=
((
int
)
data
[
0
]
&
0xff
)
<<
8
;
nport
+=
((
int
)
data
[
1
]
&
0xff
);
break
;
case
IPV6:
len
=
data
[
1
];
...
...
@@ -528,8 +496,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
i
=
readSocksReply
(
in
,
data
);
if
(
i
!=
2
)
throw
new
SocketException
(
"Reply from SOCKS server badly formatted"
);
nport
=
((
int
)
data
[
0
]
&
0xff
)
<<
8
;
nport
+=
((
int
)
data
[
1
]
&
0xff
);
break
;
default
:
ex
=
new
SocketException
(
"Reply from SOCKS server contains wrong code"
);
...
...
@@ -663,7 +629,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
*/
return
;
}
URI
uri
=
null
;
URI
uri
;
// Use getHostString() to avoid reverse lookups
String
host
=
saddr
.
getHostString
();
// IPv6 litteral?
...
...
@@ -676,6 +642,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
}
catch
(
URISyntaxException
e
)
{
// This shouldn't happen
assert
false
:
e
;
uri
=
null
;
}
Proxy
p
=
null
;
Exception
savedExc
=
null
;
...
...
@@ -695,7 +662,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
throw
new
SocketException
(
"Unknow address type for proxy: "
+
p
);
// Use getHostString() to avoid reverse lookups
server
=
((
InetSocketAddress
)
p
.
address
()).
getHostString
();
p
ort
=
((
InetSocketAddress
)
p
.
address
()).
getPort
();
serverP
ort
=
((
InetSocketAddress
)
p
.
address
()).
getPort
();
// Connects to the SOCKS server
try
{
...
...
@@ -703,7 +670,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
new
PrivilegedExceptionAction
<
Void
>()
{
public
Void
run
()
throws
Exception
{
cmdsock
=
new
Socket
(
new
PlainSocketImpl
());
cmdsock
.
connect
(
new
InetSocketAddress
(
server
,
p
ort
));
cmdsock
.
connect
(
new
InetSocketAddress
(
server
,
serverP
ort
));
cmdIn
=
cmdsock
.
getInputStream
();
cmdOut
=
cmdsock
.
getOutputStream
();
return
null
;
...
...
@@ -713,7 +680,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
// Ooops, let's notify the ProxySelector
sel
.
connectFailed
(
uri
,
p
.
address
(),
new
SocketException
(
e
.
getMessage
()));
server
=
null
;
p
ort
=
-
1
;
serverP
ort
=
-
1
;
cmdsock
=
null
;
savedExc
=
e
;
// Will continue the while loop and try the next proxy
...
...
@@ -734,7 +701,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
new
PrivilegedExceptionAction
<
Void
>()
{
public
Void
run
()
throws
Exception
{
cmdsock
=
new
Socket
(
new
PlainSocketImpl
());
cmdsock
.
connect
(
new
InetSocketAddress
(
server
,
p
ort
));
cmdsock
.
connect
(
new
InetSocketAddress
(
server
,
serverP
ort
));
cmdIn
=
cmdsock
.
getInputStream
();
cmdOut
=
cmdsock
.
getOutputStream
();
return
null
;
...
...
@@ -809,7 +776,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
switch
(
data
[
1
])
{
case
REQUEST_OK:
// success!
InetSocketAddress
real_end
=
null
;
switch
(
data
[
3
])
{
case
IPV4:
addr
=
new
byte
[
4
];
...
...
@@ -1016,6 +982,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
* @return the value of this socket's <code>address</code> field.
* @see java.net.SocketImpl#address
*/
@Override
protected
InetAddress
getInetAddress
()
{
if
(
external_address
!=
null
)
return
external_address
.
getAddress
();
...
...
@@ -1029,6 +996,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
* @return the value of this socket's <code>port</code> field.
* @see java.net.SocketImpl#port
*/
@Override
protected
int
getPort
()
{
if
(
external_address
!=
null
)
return
external_address
.
getPort
();
...
...
@@ -1036,6 +1004,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
return
super
.
getPort
();
}
@Override
protected
int
getLocalPort
()
{
if
(
socket
!=
null
)
return
super
.
getLocalPort
();
...
...
@@ -1045,6 +1014,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
return
super
.
getLocalPort
();
}
@Override
protected
void
close
()
throws
IOException
{
if
(
cmdsock
!=
null
)
cmdsock
.
close
();
...
...
src/share/classes/sun/io/ByteToCharEUC_CN.java
浏览文件 @
21df5611
...
...
@@ -25,26 +25,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
EUC_CN
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert EUC_CN to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharEUC_CN
extends
ByteToCharDoubleByte
{
public
class
ByteToCharEUC_CN
extends
ByteToCharDBCS_ASCII
{
private
EUC_CN
nioCoder
=
new
EUC_CN
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
EUC_CN
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"EUC_CN"
;
}
public
ByteToCharEUC_CN
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0xA1
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharEUC_KR.java
浏览文件 @
21df5611
...
...
@@ -26,26 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
EUC_KR
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert EUC_KR to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharEUC_KR
extends
ByteToCharDoubleByte
{
public
class
ByteToCharEUC_KR
extends
ByteToCharDBCS_ASCII
{
private
final
static
EUC_KR
nioCoder
=
new
EUC_KR
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
EUC_KR
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"EUC_KR"
;
}
public
ByteToCharEUC_KR
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0xA1
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharGBK.java
浏览文件 @
21df5611
...
...
@@ -26,26 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
GBK
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert GBK to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharGBK
extends
ByteToCharDoubleByte
{
public
class
ByteToCharGBK
extends
ByteToCharDBCS_ASCII
{
private
final
static
GBK
nioCoder
=
new
GBK
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
GBK
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"GBK"
;
}
public
ByteToCharGBK
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0x40
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharJohab.java
浏览文件 @
21df5611
...
...
@@ -26,26 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
Johab
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Johab to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharJohab
extends
ByteToCharDoubleByte
{
public
class
ByteToCharJohab
extends
ByteToCharDBCS_ASCII
{
private
final
static
Johab
nioCoder
=
new
Johab
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
Johab
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"Johab"
;
}
public
ByteToCharJohab
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0x20
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharMS932.java
浏览文件 @
21df5611
...
...
@@ -25,29 +25,19 @@
package
sun.io
;
/**
* Tables and data to convert MS932 to Unicode
*
* @author Limin Shi
* @author Mark Son-Bell
*/
import
sun.nio.cs.ext.*
;
public
class
ByteToCharMS932
extends
ByteToCharMS932DB
{
ByteToCharJIS0201
bcJIS0201
=
new
ByteToCharJIS0201
();
public
class
ByteToCharMS932
extends
ByteToCharDBCS_ASCII
{
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
MS932
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"MS932"
;
}
protected
char
convSingleByte
(
int
b
)
{
// If the high bits are all off, it's ASCII == Unicode
if
((
b
&
0xFF80
)
==
0
)
{
return
(
char
)
b
;
}
return
bcJIS0201
.
getUnicode
(
b
);
public
ByteToCharMS932
()
{
super
(
dec
);
}
String
prt
(
int
i
)
{
return
Integer
.
toString
(
i
,
16
);
}
}
src/share/classes/sun/io/ByteToCharMS936.java
浏览文件 @
21df5611
...
...
@@ -25,26 +25,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
MS936
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert MS936 to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharMS936
extends
ByteToCharDoubleByte
{
public
class
ByteToCharMS936
extends
ByteToCharDBCS_ASCII
{
private
final
static
MS936
nioCoder
=
new
MS936
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
MS936
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"MS936"
;
}
public
ByteToCharMS936
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0x40
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharMS949.java
浏览文件 @
21df5611
...
...
@@ -26,25 +26,19 @@
package
sun.io
;
import
sun.nio.cs.ext.
MS949
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert MS949 to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharMS949
extends
ByteToCharDBCS_ASCII
{
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
MS949
().
newDecoder
();
public
class
ByteToCharMS949
extends
ByteToCharDoubleByte
{
private
static
final
MS949
nioCoder
=
new
MS949
();
public
String
getCharacterEncoding
()
{
return
"MS949"
;
}
public
ByteToCharMS949
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0x41
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharMS950.java
浏览文件 @
21df5611
...
...
@@ -26,26 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
MS950
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert MS950 to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharMS950
extends
ByteToCharDoubleByte
{
public
class
ByteToCharMS950
extends
ByteToCharDBCS_ASCII
{
private
final
static
MS950
nioCoder
=
new
MS950
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
MS950
().
newDecoder
();
public
String
getCharacterEncoding
()
{
return
"MS950"
;
}
public
ByteToCharMS950
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0x40
;
end
=
0xFE
;
super
(
dec
);
}
}
src/share/classes/sun/io/ByteToCharMS950_HKSCS.java
浏览文件 @
21df5611
...
...
@@ -34,6 +34,6 @@ public class ByteToCharMS950_HKSCS extends ByteToCharHKSCS {
protected
char
getUnicode
(
int
byte1
,
int
byte2
)
{
char
c
=
super
.
getUnicode
(
byte1
,
byte2
);
return
(
c
!=
REPLACE_CHAR
)
?
c
:
bcMS950
.
getUnicod
e
(
byte1
,
byte2
);
return
(
c
!=
REPLACE_CHAR
)
?
c
:
bcMS950
.
decodeDoubl
e
(
byte1
,
byte2
);
}
}
src/share/classes/sun/io/CharToByteEUC_CN.java
浏览文件 @
21df5611
...
...
@@ -25,24 +25,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
EUC_CN
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Unicode to EUC_CN
*
* @author ConverterGenerator tool
*/
public
class
CharToByteEUC_CN
extends
CharToByteDoubleByte
{
public
class
CharToByteEUC_CN
extends
CharToByteDBCS_ASCII
{
private
final
static
EUC_CN
nioCoder
=
new
EUC_CN
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
EUC_CN
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"EUC_CN"
;
}
public
CharToByteEUC_CN
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteEUC_KR.java
浏览文件 @
21df5611
...
...
@@ -23,27 +23,20 @@
* have any questions.
*/
package
sun.io
;
import
sun.nio.cs.ext.EUC_KR
;
/**
* Tables and data to convert Unicode to EUC_KR
*
* @author ConverterGenerator tool
*/
import
sun.nio.cs.ext.*
;
public
class
CharToByteEUC_KR
extends
CharToByteD
oubleByte
{
public
class
CharToByteEUC_KR
extends
CharToByteD
BCS_ASCII
{
private
final
static
EUC_KR
nioCoder
=
new
EUC_KR
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
EUC_KR
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"EUC_KR"
;
}
public
CharToByteEUC_KR
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteGBK.java
浏览文件 @
21df5611
...
...
@@ -26,24 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
GBK
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Unicode to GBK
*
* @author ConverterGenerator tool
*/
public
class
CharToByteGBK
extends
CharToByteDoubleByte
{
public
class
CharToByteGBK
extends
CharToByteDBCS_ASCII
{
private
final
static
GBK
nioCoder
=
new
GBK
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
GBK
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"GBK"
;
}
public
CharToByteGBK
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteJohab.java
浏览文件 @
21df5611
...
...
@@ -26,24 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
Johab
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Unicode to Johab
*
* @author ConverterGenerator tool
*/
public
class
CharToByteJohab
extends
CharToByteDoubleByte
{
public
class
CharToByteJohab
extends
CharToByteDBCS_ASCII
{
private
final
static
Johab
nioCoder
=
new
Johab
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
Johab
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"Johab"
;
}
public
CharToByteJohab
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteMS932.java
浏览文件 @
21df5611
...
...
@@ -25,32 +25,18 @@
package
sun.io
;
/**
* Tables and data to convert Unicode to MS932
*
* @author ConverterGenerator tool
*/
import
sun.nio.cs.ext.*
;
public
class
CharToByteMS932
extends
CharToByteDBCS_ASCII
{
public
class
CharToByteMS932
extends
CharToByteMS932DB
{
CharToByteJIS0201
cbJIS0201
=
new
CharToByteJIS0201
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
MS932
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"MS932"
;
}
protected
int
convSingleByte
(
char
inputChar
,
byte
[]
outputByte
)
{
byte
b
;
// \u0000 - \u007F map straight through
if
((
inputChar
&
0xFF80
)
==
0
)
{
outputByte
[
0
]
=
(
byte
)
inputChar
;
return
1
;
}
if
((
b
=
cbJIS0201
.
getNative
(
inputChar
))
==
0
)
return
0
;
outputByte
[
0
]
=
b
;
return
1
;
public
CharToByteMS932
()
{
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteMS936.java
浏览文件 @
21df5611
...
...
@@ -25,24 +25,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
MS936
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Unicode to MS936
*
* @author ConverterGenerator tool
*/
public
class
CharToByteMS936
extends
CharToByteDoubleByte
{
public
class
CharToByteMS936
extends
CharToByteDBCS_ASCII
{
private
final
static
MS936
nioCoder
=
new
MS936
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
MS936
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"MS936"
;
}
public
CharToByteMS936
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteMS949.java
浏览文件 @
21df5611
...
...
@@ -26,24 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
MS949
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Unicode to MS949
*
* @author ConverterGenerator tool
*/
public
class
CharToByteMS949
extends
CharToByteDoubleByte
{
public
class
CharToByteMS949
extends
CharToByteDBCS_ASCII
{
private
final
static
MS949
nioCoder
=
new
MS949
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
MS949
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"MS949"
;
}
public
CharToByteMS949
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteMS950.java
浏览文件 @
21df5611
...
...
@@ -26,24 +26,18 @@
package
sun.io
;
import
sun.nio.cs.ext.
MS950
;
import
sun.nio.cs.ext.
*
;
/**
* Tables and data to convert Unicode to MS950
*
* @author ConverterGenerator tool
*/
public
class
CharToByteMS950
extends
CharToByteDoubleByte
{
public
class
CharToByteMS950
extends
CharToByteDBCS_ASCII
{
private
final
static
MS950
nioCoder
=
new
MS950
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
MS950
().
newEncoder
();
public
String
getCharacterEncoding
()
{
return
"MS950"
;
}
public
CharToByteMS950
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
super
(
enc
);
}
}
src/share/classes/sun/io/CharToByteMS950_HKSCS.java
浏览文件 @
21df5611
...
...
@@ -34,6 +34,6 @@ public class CharToByteMS950_HKSCS extends CharToByteHKSCS {
protected
int
getNative
(
char
ch
)
{
int
r
=
super
.
getNative
(
ch
);
return
(
r
!=
0
)
?
r
:
cbMS950
.
getNative
(
ch
);
return
(
r
!=
0
)
?
r
:
cbMS950
.
encodeChar
(
ch
);
}
}
src/share/classes/sun/nio/cs/ISO_8859_1.java
浏览文件 @
21df5611
...
...
@@ -142,7 +142,7 @@ class ISO_8859_1
}
public
boolean
isLegalReplacement
(
byte
[]
repl
)
{
return
(
repl
.
length
==
1
)
;
// we accept any byte value
return
true
;
// we accept any byte value
}
private
final
Surrogate
.
Parser
sgp
=
new
Surrogate
.
Parser
();
...
...
src/share/classes/sun/nio/cs/US_ASCII.java
浏览文件 @
21df5611
...
...
@@ -160,7 +160,8 @@ public class US_ASCII
}
public
boolean
isLegalReplacement
(
byte
[]
repl
)
{
return
(
repl
.
length
==
1
&&
repl
[
0
]
>=
0
);
return
(
repl
.
length
==
1
&&
repl
[
0
]
>=
0
)
||
super
.
isLegalReplacement
(
repl
);
}
private
final
Surrogate
.
Parser
sgp
=
new
Surrogate
.
Parser
();
...
...
src/share/classes/sun/nio/cs/ext/DoubleByte.java
浏览文件 @
21df5611
...
...
@@ -106,7 +106,10 @@ public class DoubleByte {
Arrays
.
fill
(
B2C_UNMAPPABLE
,
(
char
)
UNMAPPABLE_DECODING
);
}
public
static
class
Decoder
extends
CharsetDecoder
{
public
static
class
Decoder
extends
CharsetDecoder
implements
DelegatableDecoder
{
final
char
[][]
b2c
;
final
char
[]
b2cSB
;
final
int
b2Min
;
...
...
@@ -174,6 +177,7 @@ public class DoubleByte {
protected
CoderResult
decodeBufferLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
int
mark
=
src
.
position
();
try
{
while
(
src
.
hasRemaining
()
&&
dst
.
hasRemaining
())
{
int
b1
=
src
.
get
()
&
0xff
;
char
c
=
b2cSB
[
b1
];
...
...
@@ -197,13 +201,22 @@ public class DoubleByte {
}
}
protected
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
// Make some protected methods public for use by JISAutoDetect
public
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
if
(
src
.
hasArray
()
&&
dst
.
hasArray
())
return
decodeArrayLoop
(
src
,
dst
);
else
return
decodeBufferLoop
(
src
,
dst
);
}
public
void
implReset
()
{
super
.
implReset
();
}
public
CoderResult
implFlush
(
CharBuffer
out
)
{
return
super
.
implFlush
(
out
);
}
// decode loops are not using decodeSingle/Double() for performance
// reason.
public
char
decodeSingle
(
int
b
)
{
...
...
@@ -230,7 +243,7 @@ public class DoubleByte {
super
(
cs
,
b2c
,
b2cSB
,
b2Min
,
b2Max
);
}
p
rotected
void
implReset
()
{
p
ublic
void
implReset
()
{
currentState
=
SBCS
;
}
...
...
@@ -400,7 +413,7 @@ public class DoubleByte {
private
final
char
[]
c2bIndex
;
Surrogate
.
Parser
sgp
;
Encoder
(
Charset
cs
,
char
[]
c2b
,
char
[]
c2bIndex
)
{
protected
Encoder
(
Charset
cs
,
char
[]
c2b
,
char
[]
c2bIndex
)
{
super
(
cs
,
2.0f
,
2.0f
);
this
.
c2b
=
c2b
;
this
.
c2bIndex
=
c2bIndex
;
...
...
src/share/classes/sun/nio/cs/ext/ISO2022_CN.java
浏览文件 @
21df5611
...
...
@@ -86,14 +86,14 @@ public class ISO2022_CN
private
static
final
Charset
gb2312
=
new
EUC_CN
();
private
static
final
Charset
cns
=
new
EUC_TW
();
private
final
EUC_CN
.
Decoder
gb2312Decoder
;
private
final
DoubleByte
.
Decoder
gb2312Decoder
;
private
final
EUC_TW
.
Decoder
cnsDecoder
;
Decoder
(
Charset
cs
)
{
super
(
cs
,
1.0f
,
1.0f
);
shiftOut
=
false
;
currentSODesig
=
SODesigGB
;
gb2312Decoder
=
(
EUC_CN
.
Decoder
)
gb2312
.
newDecoder
();
gb2312Decoder
=
(
DoubleByte
.
Decoder
)
gb2312
.
newDecoder
();
cnsDecoder
=
(
EUC_TW
.
Decoder
)
cns
.
newDecoder
();
}
...
...
src/share/classes/sun/nio/cs/ext/MS932_0213.java
浏览文件 @
21df5611
...
...
@@ -28,6 +28,7 @@ package sun.nio.cs.ext;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharsetDecoder
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
MS932_0213
extends
Charset
{
public
MS932_0213
()
{
...
...
@@ -49,30 +50,31 @@ public class MS932_0213 extends Charset {
}
protected
static
class
Decoder
extends
SJIS_0213
.
Decoder
{
MS932DB
.
Decoder
decMS932
;
static
DoubleByte
.
Decoder
decMS932
=
(
DoubleByte
.
Decoder
)
new
MS932
().
newDecoder
();
protected
Decoder
(
Charset
cs
)
{
super
(
cs
);
decMS932
=
new
MS932DB
.
Decoder
(
cs
);
}
protected
char
decodeDouble
(
int
b1
,
int
b2
)
{
char
c
=
decMS932
.
decodeDouble
(
b1
,
b2
);
if
(
c
==
DoubleByteDecoder
.
REPLACE_CHAR
)
if
(
c
==
UNMAPPABLE_DECODING
)
return
super
.
decodeDouble
(
b1
,
b2
);
return
c
;
}
}
protected
static
class
Encoder
extends
SJIS_0213
.
Encoder
{
MS932DB
.
Encoder
encMS932
;
// we only use its encodeChar() method
static
DoubleByte
.
Encoder
encMS932
=
(
DoubleByte
.
Encoder
)
new
MS932
().
newEncoder
();
protected
Encoder
(
Charset
cs
)
{
super
(
cs
);
encMS932
=
new
MS932DB
.
Encoder
(
cs
);
}
protected
int
encodeChar
(
char
ch
)
{
int
db
=
encMS932
.
encode
Double
(
ch
);
if
(
db
==
0
)
int
db
=
encMS932
.
encode
Char
(
ch
);
if
(
db
==
UNMAPPABLE_ENCODING
)
return
super
.
encodeChar
(
ch
);
return
db
;
}
...
...
src/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
浏览文件 @
21df5611
...
...
@@ -23,15 +23,13 @@
* have any questions.
*/
/*
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
MS950_HKSCS
extends
Charset
implements
HistoricallyNamedCharset
{
...
...
@@ -59,8 +57,8 @@ public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
private
static
class
Decoder
extends
HKSCS
.
Decoder
{
private
MS950
.
Decoder
ms950Dec
;
private
static
DoubleByte
.
Decoder
ms950Dec
=
(
DoubleByte
.
Decoder
)
new
MS950
().
newDecoder
();
/*
* Note current decoder decodes 0x8BC2 --> U+F53A
...
...
@@ -73,18 +71,18 @@ public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
char
c
=
super
.
decodeDouble
(
byte1
,
byte2
);
return
(
c
!=
REPLACE_CHAR
)
?
c
:
ms950Dec
.
decodeDouble
(
byte1
,
byte2
);
return
(
c
!=
UNMAPPABLE_DECODING
)
?
c
:
ms950Dec
.
decodeDouble
(
byte1
,
byte2
);
}
private
Decoder
(
Charset
cs
)
{
super
(
cs
);
ms950Dec
=
new
MS950
.
Decoder
(
cs
);
}
}
private
static
class
Encoder
extends
HKSCS
.
Encoder
{
private
MS950
.
Encoder
ms950Enc
;
private
static
DoubleByte
.
Encoder
ms950Enc
=
(
DoubleByte
.
Encoder
)
new
MS950
().
newEncoder
();
/*
* Note current encoder encodes U+F53A --> 0x8BC2
...
...
@@ -93,12 +91,11 @@ public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
*/
protected
int
encodeDouble
(
char
ch
)
{
int
r
=
super
.
encodeDouble
(
ch
);
return
(
r
!=
0
)
?
r
:
ms950Enc
.
encodeDouble
(
ch
);
return
(
r
!=
UNMAPPABLE_ENCODING
)
?
r
:
ms950Enc
.
encodeChar
(
ch
);
}
private
Encoder
(
Charset
cs
)
{
super
(
cs
);
ms950Enc
=
new
MS950
.
Encoder
(
cs
);
}
}
}
src/share/classes/sun/security/jgss/krb5/InitialToken.java
浏览文件 @
21df5611
...
...
@@ -33,6 +33,7 @@ import java.net.Inet4Address;
import
java.net.Inet6Address
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Arrays
;
import
sun.security.krb5.*
;
import
sun.security.jgss.HttpCaller
;
import
sun.security.krb5.internal.Krb5
;
...
...
@@ -219,43 +220,35 @@ abstract class InitialToken extends Krb5Token {
"Incorrect checksum"
);
}
byte
[]
remoteBindingBytes
=
new
byte
[
CHECKSUM_BINDINGS_SIZE
];
System
.
arraycopy
(
checksumBytes
,
4
,
remoteBindingBytes
,
0
,
CHECKSUM_BINDINGS_SIZE
);
byte
[]
noBindings
=
new
byte
[
CHECKSUM_BINDINGS_SIZE
];
boolean
tokenContainsBindings
=
(!
java
.
util
.
Arrays
.
equals
(
noBindings
,
remoteBindingBytes
));
ChannelBinding
localBindings
=
context
.
getChannelBinding
();
if
(
tokenContainsBindings
||
localBindings
!=
null
)
{
boolean
badBindings
=
false
;
String
errorMessage
=
null
;
// Ignore remote channel binding info when not requested at
// local side (RFC 4121 4.1.1.2: the acceptor MAY ignore...).
//
// All major krb5 implementors implement this "MAY",
// and some applications depend on it as a workaround
// for not having a way to negotiate the use of channel
// binding -- the initiator application always uses CB
// and hopes the acceptor will ignore the CB if the
// acceptor doesn't support CB.
if
(
localBindings
!=
null
)
{
byte
[]
remoteBindingBytes
=
new
byte
[
CHECKSUM_BINDINGS_SIZE
];
System
.
arraycopy
(
checksumBytes
,
4
,
remoteBindingBytes
,
0
,
CHECKSUM_BINDINGS_SIZE
);
if
(
tokenContainsBindings
&&
localBindings
!=
null
)
{
byte
[]
noBindings
=
new
byte
[
CHECKSUM_BINDINGS_SIZE
];
if
(!
Arrays
.
equals
(
noBindings
,
remoteBindingBytes
)
)
{
byte
[]
localBindingsBytes
=
computeChannelBinding
(
localBindings
);
// System.out.println("ChannelBinding hash: "
// + getHexBytes(localBindingsBytes));
badBindings
=
(!
java
.
util
.
Arrays
.
equals
(
localBindingsBytes
,
remoteBindingBytes
));
errorMessage
=
"Bytes mismatch!"
;
}
else
if
(
localBindings
==
null
)
{
errorMessage
=
"ChannelBinding not provided!"
;
badBindings
=
true
;
if
(!
Arrays
.
equals
(
localBindingsBytes
,
remoteBindingBytes
))
{
throw
new
GSSException
(
GSSException
.
BAD_BINDINGS
,
-
1
,
"Bytes mismatch!"
);
}
}
else
{
errorMessage
=
"Token missing ChannelBinding!"
;
badBindings
=
true
;
}
if
(
badBindings
)
throw
new
GSSException
(
GSSException
.
BAD_BINDINGS
,
-
1
,
errorMessage
);
"Token missing ChannelBinding!"
);
}
}
flags
=
readLittleEndian
(
checksumBytes
,
20
,
4
);
...
...
src/share/classes/sun/security/tools/JarSigner.java
浏览文件 @
21df5611
...
...
@@ -1402,9 +1402,14 @@ public class JarSigner {
}
/**
* Find the position of
\r\n\r\n
inside bs
* Find the position of
an empty line
inside bs
*/
private
int
findHeaderEnd
(
byte
[]
bs
)
{
// An empty line can be at the beginning...
if
(
bs
.
length
>
1
&&
bs
[
0
]
==
'\r'
&&
bs
[
1
]
==
'\n'
)
{
return
0
;
}
// ... or after another line
for
(
int
i
=
0
;
i
<
bs
.
length
-
3
;
i
++)
{
if
(
bs
[
i
]
==
'\r'
&&
bs
[
i
+
1
]
==
'\n'
&&
bs
[
i
+
2
]
==
'\r'
&&
bs
[
i
+
3
]
==
'\n'
)
{
...
...
src/share/classes/sun/security/util/ManifestDigester.java
浏览文件 @
21df5611
/*
* Copyright 1997-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-200
9
Sun Microsystems, Inc. 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
...
...
@@ -129,7 +129,7 @@ public class ManifestDigester {
if
(
len
>
6
)
{
if
(
isNameAttr
(
bytes
,
start
))
{
StringBuilder
nameBuf
=
new
StringBuilder
();
StringBuilder
nameBuf
=
new
StringBuilder
(
sectionLen
);
try
{
nameBuf
.
append
(
...
...
src/share/classes/sun/security/x509/CertificateVersion.java
浏览文件 @
21df5611
...
...
@@ -28,7 +28,6 @@ package sun.security.x509;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.util.Date
;
import
java.util.Enumeration
;
import
sun.security.util.*
;
...
...
src/share/classes/sun/security/x509/InvalidityDateExtension.java
浏览文件 @
21df5611
...
...
@@ -140,7 +140,11 @@ public class InvalidityDateExtension extends Extension
*/
public
Object
get
(
String
name
)
throws
IOException
{
if
(
name
.
equalsIgnoreCase
(
DATE
))
{
return
date
;
if
(
date
==
null
)
{
return
null
;
}
else
{
return
(
new
Date
(
date
.
getTime
()));
// clone
}
}
else
{
throw
new
IOException
(
"Name not supported by InvalidityDateExtension"
);
...
...
src/share/classes/sun/tools/jar/Main.java
浏览文件 @
21df5611
...
...
@@ -56,7 +56,7 @@ class Main {
Set
<
File
>
entries
=
new
LinkedHashSet
<
File
>();
// Directories specified by "-C" operation.
List
<
String
>
paths
=
new
ArrayLis
t
<
String
>();
Set
<
String
>
paths
=
new
HashSe
t
<
String
>();
CRC32
crc32
=
new
CRC32
();
/*
...
...
src/solaris/classes/sun/awt/motif/X11GB2312.java
浏览文件 @
21df5611
...
...
@@ -28,7 +28,8 @@ package sun.awt.motif;
import
java.nio.CharBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.charset.*
;
import
sun.nio.cs.ext.EUC_CN
;
import
sun.nio.cs.ext.*
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
X11GB2312
extends
Charset
{
public
X11GB2312
()
{
...
...
@@ -45,16 +46,22 @@ public class X11GB2312 extends Charset {
return
cs
instanceof
X11GB2312
;
}
private
class
Encoder
extends
EUC_CN
.
Encoder
{
private
class
Encoder
extends
CharsetEncoder
{
private
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
EUC_CN
().
newEncoder
();
public
Encoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
2.0f
,
2.0f
);
}
public
boolean
canEncode
(
char
c
)
{
if
(
c
<=
0x7F
)
{
return
false
;
}
return
super
.
canEncode
(
c
);
return
enc
.
canEncode
(
c
);
}
protected
int
encodeDouble
(
char
c
)
{
return
enc
.
encodeChar
(
c
);
}
protected
CoderResult
encodeLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
...
...
@@ -91,9 +98,15 @@ public class X11GB2312 extends Charset {
}
}
private
class
Decoder
extends
EUC_CN
.
Decoder
{
private
class
Decoder
extends
CharsetDecoder
{
private
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
EUC_CN
().
newDecoder
();
public
Decoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
0.5f
,
1.0f
);
}
protected
char
decodeDouble
(
int
b1
,
int
b2
)
{
return
dec
.
decodeDouble
(
b1
,
b2
);
}
protected
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
...
...
@@ -116,7 +129,7 @@ public class X11GB2312 extends Charset {
int
b1
=
sa
[
sp
]
&
0xFF
|
0x80
;
int
b2
=
sa
[
sp
+
1
]
&
0xFF
|
0x80
;
char
c
=
decodeDouble
(
b1
,
b2
);
if
(
c
==
replacement
().
charAt
(
0
)
)
{
if
(
c
==
UNMAPPABLE_DECODING
)
{
return
CoderResult
.
unmappableForLength
(
2
);
}
if
(
dl
-
dp
<
1
)
...
...
src/solaris/classes/sun/awt/motif/X11GBK.java
浏览文件 @
21df5611
...
...
@@ -25,10 +25,9 @@
package
sun.awt.motif
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharsetDecoder
;
import
sun.nio.cs.ext.GBK
;
import
java.nio.charset.*
;
import
sun.nio.cs.ext.*
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
X11GBK
extends
Charset
{
public
X11GBK
()
{
...
...
@@ -38,20 +37,30 @@ public class X11GBK extends Charset {
return
new
Encoder
(
this
);
}
public
CharsetDecoder
newDecoder
()
{
return
new
GBK
.
Decoder
(
this
);
return
new
GBK
().
newDecoder
(
);
}
public
boolean
contains
(
Charset
cs
)
{
return
cs
instanceof
X11GBK
;
}
private
class
Encoder
extends
GBK
.
Encoder
{
public
Encoder
(
Charset
cs
)
{
super
(
cs
);
private
class
Encoder
extends
DoubleByte
.
Encoder
{
private
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
GBK
().
newEncoder
();
Encoder
(
Charset
cs
)
{
super
(
cs
,
(
char
[])
null
,
(
char
[])
null
);
}
public
boolean
canEncode
(
char
ch
){
if
(
ch
<
0x80
)
return
false
;
return
super
.
canEncode
(
ch
);
return
enc
.
canEncode
(
ch
);
}
public
int
encodeChar
(
char
ch
)
{
if
(
ch
<
0x80
)
return
UNMAPPABLE_ENCODING
;
return
enc
.
encodeChar
(
ch
);
}
}
}
src/solaris/classes/sun/awt/motif/X11KSC5601.java
浏览文件 @
21df5611
...
...
@@ -28,7 +28,8 @@ package sun.awt.motif;
import
java.nio.CharBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.charset.*
;
import
sun.nio.cs.ext.EUC_KR
;
import
sun.nio.cs.ext.*
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
X11KSC5601
extends
Charset
{
public
X11KSC5601
()
{
...
...
@@ -45,16 +46,22 @@ public class X11KSC5601 extends Charset {
return
cs
instanceof
X11KSC5601
;
}
private
class
Encoder
extends
EUC_KR
.
Encoder
{
private
class
Encoder
extends
CharsetEncoder
{
private
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
EUC_KR
().
newEncoder
();
public
Encoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
2.0f
,
2.0f
);
}
public
boolean
canEncode
(
char
c
)
{
if
(
c
<=
0x7F
)
{
return
false
;
}
return
super
.
canEncode
(
c
);
return
enc
.
canEncode
(
c
);
}
protected
int
encodeDouble
(
char
c
)
{
return
enc
.
encodeChar
(
c
);
}
protected
CoderResult
encodeLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
...
...
@@ -90,9 +97,15 @@ public class X11KSC5601 extends Charset {
}
}
private
class
Decoder
extends
EUC_KR
.
Decoder
{
private
class
Decoder
extends
CharsetDecoder
{
private
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
EUC_KR
().
newDecoder
();
public
Decoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
0.5f
,
1.0f
);
}
protected
char
decodeDouble
(
int
b1
,
int
b2
)
{
return
dec
.
decodeDouble
(
b1
,
b2
);
}
protected
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
...
...
@@ -116,7 +129,7 @@ public class X11KSC5601 extends Charset {
int
b1
=
sa
[
sp
]
&
0xFF
|
0x80
;
int
b2
=
sa
[
sp
+
1
]
&
0xFF
|
0x80
;
char
c
=
decodeDouble
(
b1
,
b2
);
if
(
c
==
replacement
().
charAt
(
0
)
)
{
if
(
c
==
UNMAPPABLE_DECODING
)
{
return
CoderResult
.
unmappableForLength
(
2
);
}
if
(
dl
-
dp
<
1
)
...
...
test/java/math/BigDecimal/MultiplyTests.java
浏览文件 @
21df5611
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug
1234567
* @bug
6850606
* @summary Test BigDecimal.multiply(BigDecimal)
* @author xlu
*/
...
...
@@ -72,6 +72,16 @@ public class MultiplyTests {
}
}
}
BigDecimal
x
=
BigDecimal
.
valueOf
(
8L
,
1
);
BigDecimal
xPower
=
BigDecimal
.
valueOf
(-
1L
);
try
{
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
xPower
=
xPower
.
multiply
(
x
);
}
}
catch
(
Exception
ex
)
{
failures
++;
}
return
failures
;
}
...
...
src/share/classes/sun/io/CharToByteMS932DB
.java
→
test/sun/nio/cs/FindASCIIReplBugs
.java
浏览文件 @
21df5611
/*
* Copyright
1998-2003
Sun Microsystems, Inc. All Rights Reserved.
* Copyright
2009
Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
...
...
@@ -23,20 +21,39 @@
* have any questions.
*/
package
sun.io
;
/* @test
* @bug 6847092
* @summary test if isLegalReplacement() works correctly for ascii charsets
*/
import
sun.nio.cs.ext.MS932DB
;
import
java.util.*
;
import
java.nio.*
;
import
java.nio.charset.*
;
/**
* Tables and data to convert Unicode to MS932
*
* @author ConverterGenerator tool
*/
public
class
FindASCIIReplBugs
{
private
static
int
failures
=
0
;
abstract
class
CharToByteMS932DB
extends
CharToByteDoubleByte
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Charset
ascii
=
Charset
.
forName
(
"ASCII"
);
for
(
Map
.
Entry
<
String
,
Charset
>
e
:
Charset
.
availableCharsets
().
entrySet
())
{
String
csn
=
e
.
getKey
();
Charset
cs
=
e
.
getValue
();
if
(!
cs
.
contains
(
ascii
)
||
csn
.
matches
(
".*2022.*"
)
||
//iso2022 family
csn
.
matches
(
".*UTF-[16|32].*"
))
//multi-bytes
continue
;
if
(!
cs
.
canEncode
())
continue
;
public
CharToByteMS932DB
()
{
super
.
index1
=
MS932DB
.
Encoder
.
index1
;
super
.
index2
=
MS932DB
.
Encoder
.
index2
;
byte
[]
sc_subs
=
{
'A'
};
byte
[]
mc_subs
=
{
'A'
,
'S'
};
if
(!
cs
.
newEncoder
().
isLegalReplacement
(
sc_subs
)
||
!
cs
.
newEncoder
().
isLegalReplacement
(
mc_subs
))
{
System
.
out
.
printf
(
" %s: isLegalReplacement failed!%n"
,
csn
);
failures
++;
}
}
if
(
failures
>
0
)
throw
new
Exception
(
failures
+
"tests failed"
);
}
}
test/sun/nio/cs/OLD/DoubleByteDecoder.java
0 → 100644
浏览文件 @
21df5611
/*
* Copyright 2002-2005 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
*/
//package sun.nio.cs.ext;
import
java.nio.ByteBuffer
;
import
java.nio.CharBuffer
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CoderResult
;
abstract
class
DoubleByteDecoder
extends
CharsetDecoder
{
private
short
index1
[];
/*
* 2nd level index, provided by subclass
* every string has 0x10*(end-start+1) characters.
*/
private
String
index2
[];
protected
int
start
;
protected
int
end
;
protected
static
final
char
REPLACE_CHAR
=
'\
uFFFD
'
;
protected
char
highSurrogate
;
protected
char
lowSurrogate
;
protected
DoubleByteDecoder
(
Charset
cs
,
short
[]
index1
,
String
[]
index2
,
int
start
,
int
end
)
{
super
(
cs
,
0.5f
,
1.0f
);
this
.
index1
=
index1
;
this
.
index2
=
index2
;
this
.
start
=
start
;
this
.
end
=
end
;
}
private
CoderResult
decodeArrayLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
byte
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
assert
(
sp
<=
sl
);
sp
=
(
sp
<=
sl
?
sp
:
sl
);
char
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
assert
(
dp
<=
dl
);
dp
=
(
dp
<=
dl
?
dp
:
dl
);
try
{
while
(
sp
<
sl
)
{
int
b1
,
b2
;
b1
=
sa
[
sp
];
int
inputSize
=
1
;
int
outputSize
=
1
;
highSurrogate
=
lowSurrogate
=
0
;
char
c
=
decodeSingle
(
b1
);
if
(
c
==
REPLACE_CHAR
)
{
b1
&=
0xff
;
if
(
sl
-
sp
<
2
)
return
CoderResult
.
UNDERFLOW
;
b2
=
sa
[
sp
+
1
]
&
0xff
;
c
=
decodeDouble
(
b1
,
b2
);
inputSize
=
2
;
if
(
c
==
REPLACE_CHAR
)
return
CoderResult
.
unmappableForLength
(
inputSize
);
outputSize
=
(
highSurrogate
>
0
)
?
2
:
1
;
}
if
(
dl
-
dp
<
outputSize
)
return
CoderResult
.
OVERFLOW
;
if
(
outputSize
==
2
)
{
da
[
dp
++]
=
highSurrogate
;
da
[
dp
++]
=
lowSurrogate
;
}
else
{
da
[
dp
++]
=
c
;
}
sp
+=
inputSize
;
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
src
.
arrayOffset
());
dst
.
position
(
dp
-
dst
.
arrayOffset
());
}
}
private
CoderResult
decodeBufferLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
int
mark
=
src
.
position
();
int
inputSize
=
0
;
int
outputSize
=
0
;
try
{
while
(
src
.
hasRemaining
())
{
int
b1
=
src
.
get
();
inputSize
=
1
;
outputSize
=
1
;
highSurrogate
=
lowSurrogate
=
0
;
char
c
=
decodeSingle
(
b1
);
if
(
c
==
REPLACE_CHAR
)
{
if
(
src
.
remaining
()
<
1
)
return
CoderResult
.
UNDERFLOW
;
b1
&=
0xff
;
int
b2
=
src
.
get
()
&
0xff
;
inputSize
=
2
;
c
=
decodeDouble
(
b1
,
b2
);
if
(
c
==
REPLACE_CHAR
)
return
CoderResult
.
unmappableForLength
(
2
);
outputSize
=
(
highSurrogate
>
0
)
?
2
:
1
;
}
if
(
dst
.
remaining
()
<
outputSize
)
return
CoderResult
.
OVERFLOW
;
mark
+=
inputSize
;
if
(
outputSize
==
2
)
{
dst
.
put
(
highSurrogate
);
dst
.
put
(
lowSurrogate
);
}
else
{
dst
.
put
(
c
);
}
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
mark
);
}
}
protected
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
if
(
src
.
hasArray
()
&&
dst
.
hasArray
())
return
decodeArrayLoop
(
src
,
dst
);
else
return
decodeBufferLoop
(
src
,
dst
);
}
/*
* Can be changed by subclass
*/
protected
char
decodeSingle
(
int
b
)
{
if
(
b
>=
0
)
return
(
char
)
b
;
return
REPLACE_CHAR
;
}
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
if
(((
byte1
<
0
)
||
(
byte1
>
index1
.
length
))
||
((
byte2
<
start
)
||
(
byte2
>
end
)))
return
REPLACE_CHAR
;
int
n
=
(
index1
[
byte1
]
&
0xf
)
*
(
end
-
start
+
1
)
+
(
byte2
-
start
);
return
index2
[
index1
[
byte1
]
>>
4
].
charAt
(
n
);
}
}
test/sun/nio/cs/OLD/DoubleByteEncoder.java
0 → 100644
浏览文件 @
21df5611
/*
* Copyright 2002-2006 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
*/
//package sun.nio.cs.ext;
import
java.nio.ByteBuffer
;
import
java.nio.CharBuffer
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CoderResult
;
import
sun.nio.cs.Surrogate
;
public
abstract
class
DoubleByteEncoder
extends
CharsetEncoder
{
private
short
index1
[];
private
String
index2
[];
private
final
Surrogate
.
Parser
sgp
=
new
Surrogate
.
Parser
();
protected
DoubleByteEncoder
(
Charset
cs
,
short
[]
index1
,
String
[]
index2
)
{
super
(
cs
,
2.0f
,
2.0f
);
this
.
index1
=
index1
;
this
.
index2
=
index2
;
}
protected
DoubleByteEncoder
(
Charset
cs
,
short
[]
index1
,
String
[]
index2
,
float
avg
,
float
max
)
{
super
(
cs
,
avg
,
max
);
this
.
index1
=
index1
;
this
.
index2
=
index2
;
}
protected
DoubleByteEncoder
(
Charset
cs
,
short
[]
index1
,
String
[]
index2
,
byte
[]
repl
)
{
super
(
cs
,
2.0f
,
2.0f
,
repl
);
this
.
index1
=
index1
;
this
.
index2
=
index2
;
}
protected
DoubleByteEncoder
(
Charset
cs
,
short
[]
index1
,
String
[]
index2
,
byte
[]
repl
,
float
avg
,
float
max
)
{
super
(
cs
,
avg
,
max
,
repl
);
this
.
index1
=
index1
;
this
.
index2
=
index2
;
}
public
boolean
canEncode
(
char
c
)
{
return
(
encodeSingle
(
c
)
!=
-
1
||
encodeDouble
(
c
)
!=
0
);
}
private
CoderResult
encodeArrayLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
char
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
byte
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
try
{
while
(
sp
<
sl
)
{
char
c
=
sa
[
sp
];
if
(
Surrogate
.
is
(
c
))
{
if
(
sgp
.
parse
(
c
,
sa
,
sp
,
sl
)
<
0
)
return
sgp
.
error
();
if
(
sl
-
sp
<
2
)
return
CoderResult
.
UNDERFLOW
;
char
c2
=
sa
[
sp
+
1
];
byte
[]
outputBytes
=
new
byte
[
2
];
outputBytes
=
encodeSurrogate
(
c
,
c2
);
if
(
outputBytes
==
null
)
{
return
sgp
.
unmappableResult
();
}
else
{
if
(
dl
-
dp
<
2
)
return
CoderResult
.
OVERFLOW
;
da
[
dp
++]
=
outputBytes
[
0
];
da
[
dp
++]
=
outputBytes
[
1
];
sp
+=
2
;
continue
;
}
}
if
(
c
>=
'\
uFFFE
'
)
return
CoderResult
.
unmappableForLength
(
1
);
int
b
=
encodeSingle
(
c
);
if
(
b
!=
-
1
)
{
// Single Byte
if
(
dl
-
dp
<
1
)
return
CoderResult
.
OVERFLOW
;
da
[
dp
++]
=
(
byte
)
b
;
sp
++;
continue
;
}
int
ncode
=
encodeDouble
(
c
);
if
(
ncode
!=
0
&&
c
!=
'\u0000'
)
{
if
(
dl
-
dp
<
2
)
return
CoderResult
.
OVERFLOW
;
da
[
dp
++]
=
(
byte
)
((
ncode
&
0xff00
)
>>
8
);
da
[
dp
++]
=
(
byte
)
(
ncode
&
0xff
);
sp
++;
continue
;
}
return
CoderResult
.
unmappableForLength
(
1
);
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
src
.
arrayOffset
());
dst
.
position
(
dp
-
dst
.
arrayOffset
());
}
}
private
CoderResult
encodeBufferLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
int
mark
=
src
.
position
();
try
{
while
(
src
.
hasRemaining
())
{
char
c
=
src
.
get
();
if
(
Surrogate
.
is
(
c
))
{
int
surr
;
if
((
surr
=
sgp
.
parse
(
c
,
src
))
<
0
)
return
sgp
.
error
();
char
c2
=
Surrogate
.
low
(
surr
);
byte
[]
outputBytes
=
new
byte
[
2
];
outputBytes
=
encodeSurrogate
(
c
,
c2
);
if
(
outputBytes
==
null
)
{
return
sgp
.
unmappableResult
();
}
else
{
if
(
dst
.
remaining
()
<
2
)
return
CoderResult
.
OVERFLOW
;
mark
+=
2
;
dst
.
put
(
outputBytes
[
0
]);
dst
.
put
(
outputBytes
[
1
]);
continue
;
}
}
if
(
c
>=
'\
uFFFE
'
)
return
CoderResult
.
unmappableForLength
(
1
);
int
b
=
encodeSingle
(
c
);
if
(
b
!=
-
1
)
{
// Single-byte character
if
(
dst
.
remaining
()
<
1
)
return
CoderResult
.
OVERFLOW
;
mark
++;
dst
.
put
((
byte
)
b
);
continue
;
}
// Double Byte character
int
ncode
=
encodeDouble
(
c
);
if
(
ncode
!=
0
&&
c
!=
'\u0000'
)
{
if
(
dst
.
remaining
()
<
2
)
return
CoderResult
.
OVERFLOW
;
mark
++;
dst
.
put
((
byte
)
((
ncode
&
0xff00
)
>>
8
));
dst
.
put
((
byte
)
ncode
);
continue
;
}
return
CoderResult
.
unmappableForLength
(
1
);
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
mark
);
}
}
protected
CoderResult
encodeLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
if
(
true
&&
src
.
hasArray
()
&&
dst
.
hasArray
())
return
encodeArrayLoop
(
src
,
dst
);
else
return
encodeBufferLoop
(
src
,
dst
);
}
/*
* Can be changed by subclass
*/
protected
int
encodeDouble
(
char
ch
)
{
int
offset
=
index1
[((
ch
&
0xff00
)
>>
8
)]
<<
8
;
return
index2
[
offset
>>
12
].
charAt
((
offset
&
0xfff
)
+
(
ch
&
0xff
));
}
/*
* Can be changed by subclass
*/
protected
int
encodeSingle
(
char
inputChar
)
{
if
(
inputChar
<
0x80
)
return
(
byte
)
inputChar
;
else
return
-
1
;
}
/**
* Protected method which should be overridden by concrete DBCS
* CharsetEncoder classes which included supplementary characters
* within their mapping coverage.
* null return value indicates surrogate values could not be
* handled or encoded.
*/
protected
byte
[]
encodeSurrogate
(
char
highSurrogate
,
char
lowSurrogate
)
{
return
null
;
}
}
src/share/classes/sun/nio/cs/ext/EUC_CN
.java
→
test/sun/nio/cs/OLD/EUC_CN_OLD
.java
浏览文件 @
21df5611
...
...
@@ -23,23 +23,18 @@
* have any questions.
*/
/*
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
public
class
EUC_CN
public
class
EUC_CN
_OLD
extends
Charset
implements
HistoricallyNamedCharset
{
public
EUC_CN
()
{
super
(
"GB2312
"
,
ExtendedCharsets
.
aliasesFor
(
"GB2312"
)
);
public
EUC_CN
_OLD
()
{
super
(
"GB2312
-OLD"
,
null
);
}
public
String
historicalName
()
{
...
...
@@ -47,7 +42,7 @@ public class EUC_CN
}
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
instanceof
EUC_CN
)
return
((
cs
instanceof
EUC_CN
_OLD
)
||
(
cs
.
name
().
equals
(
"US-ASCII"
)));
}
...
...
@@ -60,16 +55,16 @@ public class EUC_CN
}
public
short
[]
getDecoderIndex1
()
{
return
EUC_CN
.
Decoder
.
index1
;
return
Decoder
.
index1
;
}
public
String
[]
getDecoderIndex2
()
{
return
EUC_CN
.
Decoder
.
index2
;
return
Decoder
.
index2
;
}
public
short
[]
getEncoderIndex1
()
{
return
E
UC_CN
.
E
ncoder
.
index1
;
return
Encoder
.
index1
;
}
public
String
[]
getEncoderIndex2
()
{
return
E
UC_CN
.
E
ncoder
.
index2
;
return
Encoder
.
index2
;
}
public
static
class
Decoder
extends
DoubleByteDecoder
{
...
...
src/share/classes/sun/nio/cs/ext/EUC_KR
.java
→
test/sun/nio/cs/OLD/EUC_KR_OLD
.java
浏览文件 @
21df5611
...
...
@@ -27,7 +27,7 @@
/*
*/
package
sun.nio.cs.ext
;
//
package sun.nio.cs.ext;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
...
...
@@ -35,12 +35,12 @@ import java.nio.charset.CharsetEncoder;
import
java.nio.charset.CharacterCodingException
;
import
sun.nio.cs.HistoricallyNamedCharset
;
public
class
EUC_KR
public
class
EUC_KR
_OLD
extends
Charset
implements
HistoricallyNamedCharset
{
public
EUC_KR
()
{
super
(
"EUC-KR
"
,
ExtendedCharsets
.
aliasesFor
(
"EUC-KR"
)
);
public
EUC_KR
_OLD
()
{
super
(
"EUC-KR
-OLD"
,
null
);
}
public
String
historicalName
()
{
...
...
@@ -48,7 +48,7 @@ public class EUC_KR
}
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
instanceof
EUC_KR
)
return
((
cs
instanceof
EUC_KR
_OLD
)
||
(
cs
.
name
().
equals
(
"US-ASCII"
)));
}
...
...
src/share/classes/sun/nio/cs/ext/GBK
.java
→
test/sun/nio/cs/OLD/GBK_OLD
.java
浏览文件 @
21df5611
...
...
@@ -27,24 +27,22 @@
/*
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharacterCodingException
;
public
class
GBK
public
class
GBK
_OLD
extends
Charset
{
public
GBK
()
{
super
(
"GBK
"
,
ExtendedCharsets
.
aliasesFor
(
"GBK"
)
);
public
GBK
_OLD
()
{
super
(
"GBK
-OLD"
,
null
);
}
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
GBK
));
||
(
cs
instanceof
GBK
_OLD
));
}
public
CharsetDecoder
newDecoder
()
{
...
...
src/share/classes/sun/nio/cs/ext/Johab
.java
→
test/sun/nio/cs/OLD/Johab_OLD
.java
浏览文件 @
21df5611
/*
* Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
...
...
@@ -27,24 +26,23 @@
/*
*/
package
sun.nio.cs.ext
;
//
package sun.nio.cs.ext;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharacterCodingException
;
public
class
Johab
extends
Charset
public
class
Johab_OLD
extends
Charset
{
public
Johab
()
{
super
(
"x-Johab
"
,
ExtendedCharsets
.
aliasesFor
(
"x-Johab"
)
);
public
Johab
_OLD
()
{
super
(
"x-Johab
-OLD"
,
null
);
}
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
Johab
));
||
(
cs
instanceof
Johab
_OLD
));
}
public
CharsetDecoder
newDecoder
()
{
...
...
src/share/classes/sun/nio/cs/ext
/MS932DB.java
→
test/sun/nio/cs/OLD
/MS932DB.java
浏览文件 @
21df5611
...
...
@@ -26,7 +26,6 @@
/*
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
...
...
src/share/classes/sun/nio/cs/ext/MS932
.java
→
test/sun/nio/cs/OLD/MS932_OLD
.java
浏览文件 @
21df5611
...
...
@@ -24,8 +24,6 @@
*/
package
sun.nio.cs.ext
;
import
java.nio.ByteBuffer
;
import
java.nio.CharBuffer
;
import
java.nio.charset.Charset
;
...
...
@@ -33,11 +31,12 @@ import java.nio.charset.CharsetDecoder;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CoderResult
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
sun.nio.cs.ext.*
;
public
class
MS932
extends
Charset
implements
HistoricallyNamedCharset
public
class
MS932
_OLD
extends
Charset
implements
HistoricallyNamedCharset
{
public
MS932
()
{
super
(
"windows-31j
"
,
ExtendedCharsets
.
aliasesFor
(
"windows-31j"
)
);
public
MS932
_OLD
()
{
super
(
"windows-31j
-OLD"
,
null
);
}
public
String
historicalName
()
{
...
...
@@ -47,7 +46,7 @@ public class MS932 extends Charset implements HistoricallyNamedCharset
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
JIS_X_0201
)
||
(
cs
instanceof
MS932
));
||
(
cs
instanceof
MS932
_OLD
));
}
public
CharsetDecoder
newDecoder
()
{
...
...
@@ -59,7 +58,8 @@ public class MS932 extends Charset implements HistoricallyNamedCharset
}
private
static
class
Decoder
extends
MS932DB
.
Decoder
implements
DelegatableDecoder
{
// implements DelegatableDecoder
{
JIS_X_0201
.
Decoder
jisDec0201
;
...
...
src/share/classes/sun/nio/cs/ext/MS936
.java
→
test/sun/nio/cs/OLD/MS936_OLD
.java
浏览文件 @
21df5611
...
...
@@ -27,20 +27,19 @@
/*
*/
package
sun.nio.cs.ext
;
//
package sun.nio.cs.ext;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
public
class
MS936
extends
Charset
public
class
MS936_OLD
extends
Charset
implements
HistoricallyNamedCharset
{
public
MS936
()
{
super
(
"x-mswin-936
"
,
ExtendedCharsets
.
aliasesFor
(
"x-mswin-936"
)
);
public
MS936
_OLD
()
{
super
(
"x-mswin-936
-OLD"
,
null
);
}
public
String
historicalName
()
{
...
...
@@ -49,7 +48,7 @@ public class MS936
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
MS936
));
||
(
cs
instanceof
MS936
_OLD
));
}
public
CharsetDecoder
newDecoder
()
{
...
...
@@ -70,16 +69,16 @@ public class MS936
*/
public
short
[]
getDecoderIndex1
()
{
return
MS936
.
Decoder
.
index1
;
return
Decoder
.
index1
;
}
public
String
[]
getDecoderIndex2
()
{
return
MS936
.
Decoder
.
index2
;
return
Decoder
.
index2
;
}
public
short
[]
getEncoderIndex1
()
{
return
MS936
.
Encoder
.
index1
;
return
Encoder
.
index1
;
}
public
String
[]
getEncoderIndex2
()
{
return
MS936
.
Encoder
.
index2
;
return
Encoder
.
index2
;
}
private
static
class
Decoder
extends
DoubleByteDecoder
{
...
...
src/share/classes/sun/nio/cs/ext/MS949
.java
→
test/sun/nio/cs/OLD/MS949_OLD
.java
浏览文件 @
21df5611
...
...
@@ -27,20 +27,18 @@
/*
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
sun.nio.cs.HistoricallyNamedCharset
;
public
class
MS949
public
class
MS949
_OLD
extends
Charset
implements
HistoricallyNamedCharset
{
public
MS949
()
{
super
(
"x-windows-949
"
,
ExtendedCharsets
.
aliasesFor
(
"x-windows-949"
)
);
public
MS949
_OLD
()
{
super
(
"x-windows-949
-OLD"
,
null
);
}
public
String
historicalName
()
{
...
...
@@ -49,7 +47,7 @@ public class MS949
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
MS949
));
||
(
cs
instanceof
MS949
_OLD
));
}
public
CharsetDecoder
newDecoder
()
{
...
...
@@ -70,16 +68,16 @@ public class MS949
*/
public
short
[]
getDecoderIndex1
()
{
return
MS949
.
Decoder
.
index1
;
return
Decoder
.
index1
;
}
public
String
[]
getDecoderIndex2
()
{
return
MS949
.
Decoder
.
index2
;
return
Decoder
.
index2
;
}
public
short
[]
getEncoderIndex1
()
{
return
MS949
.
Encoder
.
index1
;
return
Encoder
.
index1
;
}
public
String
[]
getEncoderIndex2
()
{
return
MS949
.
Encoder
.
index2
;
return
Encoder
.
index2
;
}
...
...
src/share/classes/sun/nio/cs/ext/MS950
.java
→
test/sun/nio/cs/OLD/MS950_OLD
.java
浏览文件 @
21df5611
/*
* Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
...
...
@@ -27,20 +26,18 @@
/*
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
public
class
MS950
public
class
MS950
_OLD
extends
Charset
implements
HistoricallyNamedCharset
{
public
MS950
()
{
super
(
"x-windows-950
"
,
ExtendedCharsets
.
aliasesFor
(
"x-windows-950"
)
);
public
MS950
_OLD
()
{
super
(
"x-windows-950
-OLD"
,
null
);
}
public
String
historicalName
()
{
...
...
@@ -49,7 +46,7 @@ public class MS950
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
MS950
));
||
(
cs
instanceof
MS950
_OLD
));
}
public
CharsetDecoder
newDecoder
()
{
...
...
@@ -70,19 +67,19 @@ public class MS950
*/
public
short
[]
getDecoderIndex1
()
{
return
MS950
.
Decoder
.
index1
;
return
Decoder
.
index1
;
}
public
String
[]
getDecoderIndex2
()
{
return
MS950
.
Decoder
.
index2
;
return
Decoder
.
index2
;
}
public
short
[]
getEncoderIndex1
()
{
return
MS950
.
Encoder
.
index1
;
return
Encoder
.
index1
;
}
public
String
[]
getEncoderIndex2
()
{
return
MS950
.
Encoder
.
index2
;
return
Encoder
.
index2
;
}
protected
static
class
Decoder
extends
DoubleByteDecoder
{
...
...
test/sun/nio/cs/OLD/TestIBMDB.java
浏览文件 @
21df5611
...
...
@@ -25,7 +25,7 @@
* @test
* @bug 6843578
* @summary Test IBM DB charsets
* @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD
* @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD
EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD
*/
import
java.nio.charset.*
;
...
...
@@ -36,7 +36,7 @@ public class TestIBMDB {
static
class
Time
{
long
t
;
}
static
int
iteration
=
1
00
;
static
int
iteration
=
2
00
;
static
char
[]
decode
(
byte
[]
bb
,
Charset
cs
,
boolean
testDirect
,
Time
t
)
throws
Exception
{
...
...
@@ -181,20 +181,21 @@ public class TestIBMDB {
boolean
canOld
=
encOLD
.
canEncode
(
c
);
boolean
canNew
=
encNew
.
canEncode
(
c
);
if
(
is970
&&
c
==
0x2299
)
continue
;
if
(
is970
&&
c
==
0x2299
)
continue
;
if
(
canOld
!=
canNew
)
{
if
(
canNew
)
{
System
.
out
.
printf
(
" NEW(only): "
);
printEntry
(
c
,
newCS
);
}
else
{
if
(
is970
)
{
byte
[]
bb
=
new
String
(
new
char
[]
{
c
}).
getBytes
(
oldCS
);
if
(
bb
.
length
==
2
&&
bb
[
0
]
==
(
byte
)
0xa2
&&
bb
[
1
]
==
(
byte
)
0xc1
)
{
// we know 970 has bogus nnnn -> a2c1 -> 2299
continue
;
}
}
if
(
is970
)
{
byte
[]
bb
=
new
String
(
new
char
[]
{
c
}).
getBytes
(
oldCS
);
if
(
bb
.
length
==
2
&&
bb
[
0
]
==
(
byte
)
0xa2
&&
bb
[
1
]
==
(
byte
)
0xc1
)
{
// we know 970 has bogus nnnn -> a2c1 -> 2299
continue
;
}
}
System
.
out
.
printf
(
" OLD(only): "
);
printEntry
(
c
,
oldCS
);
}
...
...
@@ -240,8 +241,10 @@ if (is970) {
String
sOld
=
new
String
(
bb
,
oldCS
);
String
sNew
=
new
String
(
bb
,
newCS
);
if
(!
sOld
.
equals
(
sNew
))
{
System
.
out
.
printf
(
" b=%x: %x %x%n"
,
b
&
0xff
,
sOld
.
charAt
(
0
)
&
0xffff
,
sNew
.
charAt
(
0
)
&
0xffff
);
System
.
out
.
printf
(
" b=%x: %x/%d(old) %x/%d(new)%n"
,
b
&
0xff
,
sOld
.
charAt
(
0
)
&
0xffff
,
sOld
.
length
(),
sNew
.
charAt
(
0
)
&
0xffff
,
sNew
.
length
());
}
}
...
...
@@ -250,6 +253,22 @@ if (is970) {
int
b1Min
=
0x40
;
int
b1Max
=
0xfe
;
for
(
int
b1
=
0x40
;
b1
<
0xff
;
b1
++)
{
if
(!
isEBCDIC
)
{
// decodable singlebyte b1
bb
[
0
]
=
(
byte
)
b1
;
String
sOld
=
new
String
(
bb
,
oldCS
);
String
sNew
=
new
String
(
bb
,
newCS
);
if
(!
sOld
.
equals
(
sNew
))
{
if
(
sOld
.
length
()
!=
2
&&
sOld
.
charAt
(
0
)
!=
0
)
{
// only prints we are NOT expected. above two are known issue
System
.
out
.
printf
(
" b1=%x: %x/%d(old) %x/%d(new)%n"
,
b1
&
0xff
,
sOld
.
charAt
(
0
)
&
0xffff
,
sOld
.
length
(),
sNew
.
charAt
(
0
)
&
0xffff
,
sNew
.
length
());
continue
;
}
}
}
for
(
int
b2
=
0x40
;
b2
<
0xff
;
b2
++)
{
if
(
isEBCDIC
)
{
bb
[
0
]
=
0x0e
;
...
...
@@ -268,7 +287,7 @@ if (is970) {
if
(
sOld
.
charAt
(
0
)
==
0
&&
sNew
.
charAt
(
0
)
==
0xfffd
)
continue
;
// known issude in old implementation
System
.
out
.
printf
(
" bb=<%x,%x>
%x,
%x%n"
,
System
.
out
.
printf
(
" bb=<%x,%x>
c(old)=%x, c(new)=
%x%n"
,
b1
,
b2
,
sOld
.
charAt
(
0
)
&
0xffff
,
sNew
.
charAt
(
0
)
&
0xffff
);
}
}
...
...
@@ -486,6 +505,15 @@ if (sOld.charAt(0) == 0 && sNew.charAt(0) == 0xfffd)
"IBM949C"
,
"IBM1381"
,
"IBM1383"
,
"EUC_CN"
,
"EUC_KR"
,
"GBK"
,
"Johab"
,
"MS932"
,
"MS936"
,
"MS949"
,
"MS950"
,
};
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
test/sun/nio/cs/OLD/TestX11CS.java
0 → 100644
浏览文件 @
21df5611
/*
* Copyright 2009 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 1234567
* @summary Test updated X11 charsets
* @build X11GB2312_OLD X11GBK_OLD X11KSC5601_OLD
*/
import
java.nio.charset.*
;
import
java.nio.*
;
import
java.util.*
;
public
class
TestX11CS
{
static
char
[]
decode
(
byte
[]
bb
,
Charset
cs
)
throws
Exception
{
CharsetDecoder
dec
=
cs
.
newDecoder
();
ByteBuffer
bbf
=
ByteBuffer
.
wrap
(
bb
);
CharBuffer
cbf
=
CharBuffer
.
allocate
(
bb
.
length
);
CoderResult
cr
=
dec
.
decode
(
bbf
,
cbf
,
true
);
if
(
cr
!=
CoderResult
.
UNDERFLOW
)
{
System
.
out
.
println
(
"DEC-----------------"
);
int
pos
=
bbf
.
position
();
System
.
out
.
printf
(
" cr=%s, bbf.pos=%d, bb[pos]=%x,%x,%x,%x%n"
,
cr
.
toString
(),
pos
,
bb
[
pos
++]&
0xff
,
bb
[
pos
++]&
0xff
,
bb
[
pos
++]&
0xff
,
bb
[
pos
++]&
0xff
);
throw
new
RuntimeException
(
"Decoding err: "
+
cs
.
name
());
}
char
[]
cc
=
new
char
[
cbf
.
position
()];
cbf
.
flip
();
cbf
.
get
(
cc
);
return
cc
;
}
static
byte
[]
encode
(
char
[]
cc
,
Charset
cs
)
throws
Exception
{
ByteBuffer
bbf
=
ByteBuffer
.
allocate
(
cc
.
length
*
4
);
CharBuffer
cbf
=
CharBuffer
.
wrap
(
cc
);
CharsetEncoder
enc
=
cs
.
newEncoder
();
CoderResult
cr
=
enc
.
encode
(
cbf
,
bbf
,
true
);
if
(
cr
!=
CoderResult
.
UNDERFLOW
)
{
System
.
out
.
println
(
"ENC-----------------"
);
int
pos
=
cbf
.
position
();
System
.
out
.
printf
(
" cr=%s, cbf.pos=%d, cc[pos]=%x%n"
,
cr
.
toString
(),
pos
,
cc
[
pos
]&
0xffff
);
throw
new
RuntimeException
(
"Encoding err: "
+
cs
.
name
());
}
byte
[]
bb
=
new
byte
[
bbf
.
position
()];
bbf
.
flip
();
bbf
.
get
(
bb
);
return
bb
;
}
static
char
[]
getChars
(
Charset
newCS
,
Charset
oldCS
)
{
CharsetEncoder
enc
=
oldCS
.
newEncoder
();
CharsetEncoder
encNew
=
newCS
.
newEncoder
();
char
[]
cc
=
new
char
[
0x10000
];
int
pos
=
0
;
int
i
=
0
;
while
(
i
<
0x10000
)
{
if
(
enc
.
canEncode
((
char
)
i
)
!=
encNew
.
canEncode
((
char
)
i
))
{
System
.
out
.
printf
(
" Err i=%x%n"
,
i
);
//throw new RuntimeException("canEncode() err!");
}
if
(
enc
.
canEncode
((
char
)
i
))
{
cc
[
pos
++]
=
(
char
)
i
;
}
i
++;
}
return
Arrays
.
copyOf
(
cc
,
pos
);
}
static
void
compare
(
Charset
newCS
,
Charset
oldCS
)
throws
Exception
{
System
.
out
.
printf
(
" Diff <%s> <%s>...%n"
,
newCS
.
name
(),
oldCS
.
name
());
char
[]
cc
=
getChars
(
newCS
,
oldCS
);
byte
[]
bb1
=
encode
(
cc
,
newCS
);
byte
[]
bb2
=
encode
(
cc
,
oldCS
);
if
(!
Arrays
.
equals
(
bb1
,
bb2
))
{
System
.
out
.
printf
(
" encoding failed!%n"
);
}
char
[]
cc1
=
decode
(
bb1
,
newCS
);
char
[]
cc2
=
decode
(
bb1
,
oldCS
);
if
(!
Arrays
.
equals
(
cc1
,
cc2
))
{
for
(
int
i
=
0
;
i
<
cc1
.
length
;
i
++)
{
if
(
cc1
[
i
]
!=
cc2
[
i
])
{
System
.
out
.
printf
(
"i=%d, cc1=%x cc2=%x, bb=<%x%x>%n"
,
i
,
cc1
[
i
]&
0xffff
,
cc2
[
i
]&
0xffff
,
bb1
[
i
*
2
]&
0xff
,
bb1
[
i
*
2
+
1
]&
0xff
);
}
}
System
.
out
.
printf
(
" decoding failed%n"
);
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
compare
(
new
sun
.
awt
.
motif
.
X11GBK
(),
new
X11GBK_OLD
());
compare
(
new
sun
.
awt
.
motif
.
X11GB2312
(),
new
X11GB2312_OLD
());
compare
(
new
sun
.
awt
.
motif
.
X11KSC5601
(),
new
X11KSC5601_OLD
());
}
}
test/sun/nio/cs/OLD/X11GB2312_OLD.java
0 → 100644
浏览文件 @
21df5611
/*
* Copyright 1996-2005 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import
java.nio.CharBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.charset.*
;
import
sun.nio.cs.ext.EUC_CN
;
public
class
X11GB2312_OLD
extends
Charset
{
public
X11GB2312_OLD
()
{
super
(
"X11GB2312-OLD"
,
null
);
}
public
CharsetEncoder
newEncoder
()
{
return
new
Encoder
(
this
);
}
public
CharsetDecoder
newDecoder
()
{
return
new
Decoder
(
this
);
}
public
boolean
contains
(
Charset
cs
)
{
return
cs
instanceof
X11GB2312_OLD
;
}
private
class
Encoder
extends
EUC_CN_OLD
.
Encoder
{
public
Encoder
(
Charset
cs
)
{
super
(
cs
);
}
public
boolean
canEncode
(
char
c
)
{
if
(
c
<=
0x7F
)
{
return
false
;
}
return
super
.
canEncode
(
c
);
}
protected
CoderResult
encodeLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
char
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
byte
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
try
{
while
(
sp
<
sl
)
{
char
c
=
sa
[
sp
];
if
(
c
<=
'\u007f'
)
return
CoderResult
.
unmappableForLength
(
1
);
int
ncode
=
encodeDouble
(
c
);
if
(
ncode
!=
0
&&
c
!=
'\u0000'
)
{
da
[
dp
++]
=
(
byte
)
((
ncode
>>
8
)
&
0x7f
);
da
[
dp
++]
=
(
byte
)
(
ncode
&
0x7f
);
sp
++;
continue
;
}
return
CoderResult
.
unmappableForLength
(
1
);
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
src
.
arrayOffset
());
dst
.
position
(
dp
-
dst
.
arrayOffset
());
}
}
public
boolean
isLegalReplacement
(
byte
[]
repl
)
{
return
true
;
}
}
private
class
Decoder
extends
EUC_CN_OLD
.
Decoder
{
public
Decoder
(
Charset
cs
)
{
super
(
cs
);
}
protected
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
byte
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
assert
(
sp
<=
sl
);
sp
=
(
sp
<=
sl
?
sp
:
sl
);
char
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
assert
(
dp
<=
dl
);
dp
=
(
dp
<=
dl
?
dp
:
dl
);
try
{
while
(
sp
<
sl
)
{
if
(
sl
-
sp
<
2
)
{
return
CoderResult
.
UNDERFLOW
;
}
int
b1
=
sa
[
sp
]
&
0xFF
|
0x80
;
int
b2
=
sa
[
sp
+
1
]
&
0xFF
|
0x80
;
char
c
=
decodeDouble
(
b1
,
b2
);
if
(
c
==
replacement
().
charAt
(
0
))
{
return
CoderResult
.
unmappableForLength
(
2
);
}
if
(
dl
-
dp
<
1
)
return
CoderResult
.
OVERFLOW
;
da
[
dp
++]
=
c
;
sp
+=
2
;
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
src
.
arrayOffset
());
dst
.
position
(
dp
-
dst
.
arrayOffset
());
}
}
}
}
src/share/classes/sun/io/ByteToCharMS932DB
.java
→
test/sun/nio/cs/OLD/X11GBK_OLD
.java
浏览文件 @
21df5611
/*
* Copyright 199
8-2003
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 199
9-2005
Sun Microsystems, Inc. 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
...
...
@@ -23,22 +23,34 @@
* have any questions.
*/
package
sun.io
;
import
sun.nio.cs.ext.MS932DB
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharsetDecoder
;
import
sun.nio.cs.ext.GBK
;
/**
* Tables and data to convert MS932 to Unicode
*
* @author ConverterGenerator tool
*/
public
class
X11GBK_OLD
extends
Charset
{
public
X11GBK_OLD
()
{
super
(
"X11GBK-OLD"
,
null
);
}
public
CharsetEncoder
newEncoder
()
{
return
new
Encoder
(
this
);
}
public
CharsetDecoder
newDecoder
()
{
return
new
GBK_OLD
.
Decoder
(
this
);
}
abstract
class
ByteToCharMS932DB
extends
ByteToCharDoubleByte
{
public
boolean
contains
(
Charset
cs
)
{
return
cs
instanceof
X11GBK_OLD
;
}
public
ByteToCharMS932DB
()
{
super
.
index1
=
MS932DB
.
Decoder
.
index1
;
super
.
index2
=
MS932DB
.
Decoder
.
index2
;
start
=
0x40
;
end
=
0xFC
;
private
class
Encoder
extends
GBK_OLD
.
Encoder
{
public
Encoder
(
Charset
cs
)
{
super
(
cs
);
}
public
boolean
canEncode
(
char
ch
){
if
(
ch
<
0x80
)
return
false
;
return
super
.
canEncode
(
ch
);
}
}
}
test/sun/nio/cs/OLD/X11KSC5601_OLD.java
0 → 100644
浏览文件 @
21df5611
/*
* Copyright 1996-2005 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import
java.nio.CharBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.charset.*
;
import
sun.nio.cs.ext.EUC_KR
;
public
class
X11KSC5601_OLD
extends
Charset
{
public
X11KSC5601_OLD
()
{
super
(
"X11KSC5601-OLD"
,
null
);
}
public
CharsetEncoder
newEncoder
()
{
return
new
Encoder
(
this
);
}
public
CharsetDecoder
newDecoder
()
{
return
new
Decoder
(
this
);
}
public
boolean
contains
(
Charset
cs
)
{
return
cs
instanceof
X11KSC5601_OLD
;
}
private
class
Encoder
extends
EUC_KR_OLD
.
Encoder
{
public
Encoder
(
Charset
cs
)
{
super
(
cs
);
}
public
boolean
canEncode
(
char
c
)
{
if
(
c
<=
0x7F
)
{
return
false
;
}
return
super
.
canEncode
(
c
);
}
protected
CoderResult
encodeLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
char
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
byte
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
try
{
while
(
sp
<
sl
)
{
char
c
=
sa
[
sp
];
if
(
c
<=
'\u007f'
)
return
CoderResult
.
unmappableForLength
(
1
);
int
ncode
=
encodeDouble
(
c
);
if
(
ncode
!=
0
&&
c
!=
'\u0000'
)
{
da
[
dp
++]
=
(
byte
)
((
ncode
>>
8
)
&
0x7f
);
da
[
dp
++]
=
(
byte
)
(
ncode
&
0x7f
);
sp
++;
continue
;
}
return
CoderResult
.
unmappableForLength
(
1
);
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
src
.
arrayOffset
());
dst
.
position
(
dp
-
dst
.
arrayOffset
());
}
}
public
boolean
isLegalReplacement
(
byte
[]
repl
)
{
return
true
;
}
}
private
class
Decoder
extends
EUC_KR_OLD
.
Decoder
{
public
Decoder
(
Charset
cs
)
{
super
(
cs
);
}
protected
CoderResult
decodeLoop
(
ByteBuffer
src
,
CharBuffer
dst
)
{
byte
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
assert
(
sp
<=
sl
);
sp
=
(
sp
<=
sl
?
sp
:
sl
);
char
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
assert
(
dp
<=
dl
);
dp
=
(
dp
<=
dl
?
dp
:
dl
);
try
{
while
(
sp
<
sl
)
{
if
(
sl
-
sp
<
2
)
{
return
CoderResult
.
UNDERFLOW
;
}
int
b1
=
sa
[
sp
]
&
0xFF
|
0x80
;
int
b2
=
sa
[
sp
+
1
]
&
0xFF
|
0x80
;
char
c
=
decodeDouble
(
b1
,
b2
);
if
(
c
==
replacement
().
charAt
(
0
))
{
return
CoderResult
.
unmappableForLength
(
2
);
}
if
(
dl
-
dp
<
1
)
return
CoderResult
.
OVERFLOW
;
da
[
dp
++]
=
c
;
sp
+=
2
;
}
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
src
.
arrayOffset
());
dst
.
position
(
dp
-
dst
.
arrayOffset
());
}
}
}
}
test/sun/security/krb5/auto/CrossRealm.java
浏览文件 @
21df5611
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008
-2009
Sun Microsystems, Inc. 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
...
...
@@ -26,6 +26,7 @@
* @bug 6706974
* @summary Add krb5 test infrastructure
*/
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.security.Security
;
...
...
@@ -50,17 +51,20 @@ public class CrossRealm implements CallbackHandler {
KDC
kdc1
=
KDC
.
create
(
"RABBIT.HOLE"
);
kdc1
.
addPrincipal
(
"dummy"
,
"bogus"
.
toCharArray
());
kdc1
.
addPrincipalRandKey
(
"krbtgt/RABBIT.HOLE"
);
kdc1
.
addPrincipal
(
"krbtgt/SNAKE.HOLE"
,
"sharedsec"
.
toCharArray
());
kdc1
.
addPrincipal
(
"krbtgt/SNAKE.HOLE@RABBIT.HOLE"
,
"rabbit->snake"
.
toCharArray
());
KDC
kdc2
=
KDC
.
create
(
"SNAKE.HOLE"
);
kdc2
.
addPrincipalRandKey
(
"krbtgt/SNAKE.HOLE"
);
kdc2
.
addPrincipal
(
"krbtgt/RABBIT.HOLE"
,
"sharedsec"
.
toCharArray
());
kdc2
.
addPrincipal
(
"krbtgt/SNAKE.HOLE@RABBIT.HOLE"
,
"rabbit->snake"
.
toCharArray
());
kdc2
.
addPrincipalRandKey
(
"host/www.snake.hole"
);
KDC
.
saveConfig
(
"krb5-localkdc.conf"
,
kdc1
,
kdc2
,
"forwardable=true"
,
"[domain_realm]"
,
".snake.hole=SNAKE.HOLE"
);
new
File
(
"krb5-localkdc.conf"
).
deleteOnExit
();
System
.
setProperty
(
"java.security.krb5.conf"
,
"krb5-localkdc.conf"
);
}
...
...
@@ -68,6 +72,7 @@ public class CrossRealm implements CallbackHandler {
Security
.
setProperty
(
"auth.login.defaultCallbackHandler"
,
"CrossRealm"
);
System
.
setProperty
(
"java.security.auth.login.config"
,
"jaas-localkdc.conf"
);
System
.
setProperty
(
"javax.security.auth.useSubjectCredsOnly"
,
"false"
);
new
File
(
"jaas-localkdc.conf"
).
deleteOnExit
();
FileOutputStream
fos
=
new
FileOutputStream
(
"jaas-localkdc.conf"
);
fos
.
write
((
"com.sun.security.jgss.krb5.initiate {\n"
+
" com.sun.security.auth.module.Krb5LoginModule\n"
+
...
...
test/sun/security/krb5/auto/HttpNegotiateServer.java
浏览文件 @
21df5611
...
...
@@ -25,7 +25,6 @@
* @test
* @bug 6578647
* @summary Undefined requesting URL in java.net.Authenticator.getPasswordAuthentication()
* @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock HttpNegotiateServer
*/
import
com.sun.net.httpserver.Headers
;
...
...
@@ -40,12 +39,10 @@ import java.io.IOException;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
import
java.net.InetSocketAddress
;
import
java.net.InetAddress
;
import
java.net.PasswordAuthentication
;
import
java.net.Proxy
;
import
java.net.URL
;
import
java.security.PrivilegedExceptionAction
;
import
java.net.UnknownHostException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.security.auth.Subject
;
...
...
@@ -53,8 +50,6 @@ import org.ietf.jgss.GSSContext;
import
org.ietf.jgss.GSSCredential
;
import
org.ietf.jgss.GSSManager
;
import
sun.security.jgss.GSSUtil
;
import
sun.net.spi.nameservice.NameService
;
import
sun.net.spi.nameservice.NameServiceDescriptor
;
import
sun.security.krb5.Config
;
/**
...
...
@@ -62,7 +57,7 @@ import sun.security.krb5.Config;
* party uses JAAS login to get subjects and executes JGSS calls using
* Subject.doAs.
*/
public
class
HttpNegotiateServer
implements
NameServiceDescriptor
{
public
class
HttpNegotiateServer
{
// Two realm, web server in one, proxy server in another
final
static
String
REALM_WEB
=
"WEB.DOMAIN"
;
...
...
@@ -142,12 +137,12 @@ public class HttpNegotiateServer implements NameServiceDescriptor {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
KDC
kdcw
=
new
KDC
(
REALM_WEB
,
0
,
true
);
KDC
kdcw
=
KDC
.
create
(
REALM_WEB
);
kdcw
.
addPrincipal
(
WEB_USER
,
WEB_PASS
);
kdcw
.
addPrincipalRandKey
(
"krbtgt/"
+
REALM_WEB
);
kdcw
.
addPrincipalRandKey
(
"HTTP/"
+
WEB_HOST
);
KDC
kdcp
=
new
KDC
(
REALM_PROXY
,
0
,
true
);
KDC
kdcp
=
KDC
.
create
(
REALM_PROXY
);
kdcp
.
addPrincipal
(
PROXY_USER
,
PROXY_PASS
);
kdcp
.
addPrincipalRandKey
(
"krbtgt/"
+
REALM_PROXY
);
kdcp
.
addPrincipalRandKey
(
"HTTP/"
+
PROXY_HOST
);
...
...
@@ -306,36 +301,5 @@ public class HttpNegotiateServer implements NameServiceDescriptor {
}
}
}
@Override
public
NameService
createNameService
()
throws
Exception
{
NameService
ns
=
new
NameService
()
{
@Override
public
InetAddress
[]
lookupAllHostAddr
(
String
host
)
throws
UnknownHostException
{
// Everything is localhost
return
new
InetAddress
[]{
InetAddress
.
getByAddress
(
host
,
new
byte
[]{
127
,
0
,
0
,
1
})
};
}
@Override
public
String
getHostByAddr
(
byte
[]
addr
)
throws
UnknownHostException
{
// No reverse lookup
throw
new
UnknownHostException
();
}
};
return
ns
;
}
@Override
public
String
getProviderName
()
{
return
"mock"
;
}
@Override
public
String
getType
()
{
return
"ns"
;
}
}
test/sun/security/krb5/auto/IgnoreChannelBinding.java
0 → 100644
浏览文件 @
21df5611
/*
* Copyright 2009 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6851973
* @summary ignore incoming channel binding if acceptor does not set one
*/
import
java.net.InetAddress
;
import
org.ietf.jgss.ChannelBinding
;
import
org.ietf.jgss.GSSException
;
import
sun.security.jgss.GSSUtil
;
public
class
IgnoreChannelBinding
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
new
OneKDC
(
null
).
writeJAASConf
();
Context
c
=
Context
.
fromJAAS
(
"client"
);
Context
s
=
Context
.
fromJAAS
(
"server"
);
// All silent
c
.
startAsClient
(
OneKDC
.
SERVER
,
GSSUtil
.
GSS_KRB5_MECH_OID
);
s
.
startAsServer
(
GSSUtil
.
GSS_KRB5_MECH_OID
);
Context
.
handshake
(
c
,
s
);
// Initiator req, acceptor ignore
c
.
startAsClient
(
OneKDC
.
SERVER
,
GSSUtil
.
GSS_KRB5_MECH_OID
);
c
.
x
().
setChannelBinding
(
new
ChannelBinding
(
InetAddress
.
getByName
(
"client.rabbit.hole"
),
InetAddress
.
getByName
(
"host.rabbit.hole"
),
new
byte
[
0
]
));
s
.
startAsServer
(
GSSUtil
.
GSS_KRB5_MECH_OID
);
Context
.
handshake
(
c
,
s
);
// Both req, and match
c
.
startAsClient
(
OneKDC
.
SERVER
,
GSSUtil
.
GSS_KRB5_MECH_OID
);
c
.
x
().
setChannelBinding
(
new
ChannelBinding
(
InetAddress
.
getByName
(
"client.rabbit.hole"
),
InetAddress
.
getByName
(
"host.rabbit.hole"
),
new
byte
[
0
]
));
s
.
startAsServer
(
GSSUtil
.
GSS_KRB5_MECH_OID
);
s
.
x
().
setChannelBinding
(
new
ChannelBinding
(
InetAddress
.
getByName
(
"client.rabbit.hole"
),
InetAddress
.
getByName
(
"host.rabbit.hole"
),
new
byte
[
0
]
));
Context
.
handshake
(
c
,
s
);
// Both req, NOT match
c
.
startAsClient
(
OneKDC
.
SERVER
,
GSSUtil
.
GSS_KRB5_MECH_OID
);
c
.
x
().
setChannelBinding
(
new
ChannelBinding
(
InetAddress
.
getByName
(
"client.rabbit.hole"
),
InetAddress
.
getByName
(
"host.rabbit.hole"
),
new
byte
[
0
]
));
s
.
startAsServer
(
GSSUtil
.
GSS_KRB5_MECH_OID
);
s
.
x
().
setChannelBinding
(
new
ChannelBinding
(
InetAddress
.
getByName
(
"client.rabbit.hole"
),
InetAddress
.
getByName
(
"host.rabbit.hole"
),
new
byte
[
1
]
// 0 -> 1
));
try
{
Context
.
handshake
(
c
,
s
);
throw
new
Exception
(
"Acceptor should reject initiator"
);
}
catch
(
GSSException
ge
)
{
// Expected bahavior
}
// Acceptor req, reject
c
.
startAsClient
(
OneKDC
.
SERVER
,
GSSUtil
.
GSS_KRB5_MECH_OID
);
s
.
startAsServer
(
GSSUtil
.
GSS_KRB5_MECH_OID
);
s
.
x
().
setChannelBinding
(
new
ChannelBinding
(
InetAddress
.
getByName
(
"client.rabbit.hole"
),
InetAddress
.
getByName
(
"host.rabbit.hole"
),
new
byte
[
0
]
));
try
{
Context
.
handshake
(
c
,
s
);
throw
new
Exception
(
"Acceptor should reject initiator"
);
}
catch
(
GSSException
ge
)
{
// Expected bahavior
if
(
ge
.
getMajor
()
!=
GSSException
.
BAD_BINDINGS
)
{
throw
ge
;
}
}
}
}
test/sun/security/krb5/auto/KDC.java
浏览文件 @
21df5611
...
...
@@ -30,6 +30,8 @@ import java.lang.reflect.Method;
import
java.security.SecureRandom
;
import
java.util.*
;
import
java.util.concurrent.*
;
import
sun.net.spi.nameservice.NameService
;
import
sun.net.spi.nameservice.NameServiceDescriptor
;
import
sun.security.krb5.*
;
import
sun.security.krb5.internal.*
;
import
sun.security.krb5.internal.ccache.CredentialsCache
;
...
...
@@ -118,14 +120,16 @@ public class KDC {
// The random generator to generate random keys (including session keys)
private
static
SecureRandom
secureRandom
=
new
SecureRandom
();
// Principal db
// Principal db
. principal -> pass
private
Map
<
String
,
char
[]>
passwords
=
new
HashMap
<
String
,
char
[]>();
// Realm name
private
String
realm
;
//
The request/response job queue
private
BlockingQueue
<
Job
>
q
=
new
ArrayBlockingQueue
<
Job
>(
100
)
;
//
KDC
private
String
kdc
;
// Service port number
private
int
port
;
// The request/response job queue
private
BlockingQueue
<
Job
>
q
=
new
ArrayBlockingQueue
<
Job
>(
100
);
// Options
private
Map
<
Option
,
Object
>
options
=
new
HashMap
<
Option
,
Object
>();
...
...
@@ -139,33 +143,21 @@ public class KDC {
PREAUTH_REQUIRED
,
};
static
{
System
.
setProperty
(
"sun.net.spi.nameservice.provider.1"
,
"ns,mock"
);
}
/**
* A standalone KDC server.
* @param args
* @throws java.lang.Exception
*/
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
args
.
length
>
0
)
{
if
(
args
[
0
].
equals
(
"-help"
)
||
args
[
0
].
equals
(
"--help"
))
{
System
.
out
.
println
(
"Usage:"
);
System
.
out
.
println
(
" java "
+
KDC
.
class
+
" "
+
"Start KDC on port 8888"
);
return
;
}
}
String
localhost
=
"localhost"
;
try
{
localhost
=
InetAddress
.
getByName
(
localhost
)
.
getCanonicalHostName
();
}
catch
(
UnknownHostException
uhe
)
{
;
// Ignore, localhost is still "localhost"
}
KDC
kdc
=
create
(
"RABBIT.HOLE"
,
8888
,
false
);
KDC
kdc
=
create
(
"RABBIT.HOLE"
,
"kdc.rabbit,hole"
,
0
,
false
);
kdc
.
addPrincipal
(
"dummy"
,
"bogus"
.
toCharArray
());
kdc
.
addPrincipal
(
"foo"
,
"bar"
.
toCharArray
());
kdc
.
addPrincipalRandKey
(
"krbtgt/"
+
kdc
.
realm
);
kdc
.
addPrincipalRandKey
(
"server/"
+
localhost
);
kdc
.
addPrincipalRandKey
(
"backend/"
+
localhost
);
kdc
.
addPrincipalRandKey
(
"krbtgt/RABBIT.HOLE"
);
kdc
.
addPrincipalRandKey
(
"server/host.rabbit.hole"
);
kdc
.
addPrincipalRandKey
(
"backend/host.rabbit.hole"
);
KDC
.
saveConfig
(
"krb5.conf"
,
kdc
,
"forwardable = true"
);
}
/**
...
...
@@ -175,7 +167,7 @@ public class KDC {
* @throws java.io.IOException for any socket creation error
*/
public
static
KDC
create
(
String
realm
)
throws
IOException
{
return
create
(
realm
,
0
,
true
);
return
create
(
realm
,
"kdc."
+
realm
.
toLowerCase
(),
0
,
true
);
}
/**
...
...
@@ -187,8 +179,8 @@ public class KDC {
* @return the running KDC instance
* @throws java.io.IOException for any socket creation error
*/
public
static
KDC
create
(
String
realm
,
int
port
,
boolean
asDaemon
)
throws
IOException
{
return
new
KDC
(
realm
,
port
,
asDaemon
);
public
static
KDC
create
(
String
realm
,
String
kdc
,
int
port
,
boolean
asDaemon
)
throws
IOException
{
return
new
KDC
(
realm
,
kdc
,
port
,
asDaemon
);
}
/**
...
...
@@ -228,10 +220,7 @@ public class KDC {
KeyTab
ktab
=
KeyTab
.
create
(
tab
);
for
(
KDC
kdc:
kdcs
)
{
for
(
String
name
:
kdc
.
passwords
.
keySet
())
{
if
(
name
.
equals
(
"krbtgt/"
+
kdc
.
realm
))
{
continue
;
}
ktab
.
addEntry
(
new
PrincipalName
(
name
+
"@"
+
kdc
.
realm
,
ktab
.
addEntry
(
new
PrincipalName
(
name
,
name
.
indexOf
(
'/'
)
<
0
?
PrincipalName
.
KRB_NT_UNKNOWN
:
PrincipalName
.
KRB_NT_SRV_HST
),
...
...
@@ -255,6 +244,9 @@ public class KDC {
* @param pass the password for the principal
*/
public
void
addPrincipal
(
String
user
,
char
[]
pass
)
{
if
(
user
.
indexOf
(
'@'
)
<
0
)
{
user
=
user
+
"@"
+
realm
;
}
passwords
.
put
(
user
,
pass
);
}
...
...
@@ -264,7 +256,7 @@ public class KDC {
* form of host/f.q.d.n
*/
public
void
addPrincipalRandKey
(
String
user
)
{
passwords
.
put
(
user
,
randomPassword
());
addPrincipal
(
user
,
randomPassword
());
}
/**
...
...
@@ -275,6 +267,14 @@ public class KDC {
return
realm
;
}
/**
* Returns the name of kdc
* @return the name of kdc
*/
public
String
getKDC
()
{
return
kdc
;
}
/**
* Writes a krb5.conf for one or more KDC that includes KDC locations for
* each realm and the default realm name. You can also add extra strings
...
...
@@ -299,7 +299,7 @@ public class KDC {
*
* [realms]
* REALM.NAME = {
* kdc =
local
host:port_number
* kdc = host:port_number
* }
* </pre>
*
...
...
@@ -320,10 +320,10 @@ public class KDC {
*
* [realms]
* KDC1.NAME = {
* kdc =
local
host:port1
* kdc = host:port1
* }
* KDC2.NAME = {
* kdc =
local
host:port2
* kdc = host:port2
* }
* </pre>
* @param file the name of the file to write into
...
...
@@ -372,16 +372,17 @@ public class KDC {
* Private constructor, cannot be called outside.
* @param realm
*/
private
KDC
(
String
realm
)
{
private
KDC
(
String
realm
,
String
kdc
)
{
this
.
realm
=
realm
;
this
.
kdc
=
kdc
;
}
/**
* A constructor that starts the KDC service also.
*/
protected
KDC
(
String
realm
,
int
port
,
boolean
asDaemon
)
protected
KDC
(
String
realm
,
String
kdc
,
int
port
,
boolean
asDaemon
)
throws
IOException
{
this
(
realm
);
this
(
realm
,
kdc
);
startServer
(
port
,
asDaemon
);
}
/**
...
...
@@ -426,7 +427,11 @@ public class KDC {
* the database.
*/
private
char
[]
getPassword
(
PrincipalName
p
)
throws
KrbException
{
char
[]
pass
=
passwords
.
get
(
p
.
getNameString
());
String
pn
=
p
.
toString
();
if
(
p
.
getRealmString
()
==
null
)
{
pn
=
pn
+
"@"
+
getRealm
();
}
char
[]
pass
=
passwords
.
get
(
pn
);
if
(
pass
==
null
)
{
throw
new
KrbException
(
Krb5
.
KDC_ERR_C_PRINCIPAL_UNKNOWN
);
}
...
...
@@ -434,29 +439,18 @@ public class KDC {
}
/**
* Returns the salt string for the principal. For normal users, the
* concatenation for the realm name and the sections of the principal;
* for krgtgt/A@B and krbtgt/B@A, always return AB (so that inter-realm
* principals have the same key).
* Returns the salt string for the principal.
* @param p principal
* @return the salt
*/
private
String
getSalt
(
PrincipalName
p
)
{
String
[]
ns
=
p
.
getNameStrings
();
if
(
ns
[
0
].
equals
(
"krbtgt"
)
&&
ns
.
length
>
1
)
{
// Shared cross-realm keys must be the same
if
(
ns
[
1
].
compareTo
(
realm
)
<
0
)
{
return
ns
[
1
]
+
realm
;
}
else
{
return
realm
+
ns
[
1
];
}
}
else
{
String
s
=
getRealm
();
for
(
String
n:
p
.
getNameStrings
())
{
s
+=
n
;
}
return
s
;
String
s
=
p
.
getRealmString
();
if
(
s
==
null
)
s
=
getRealm
();
for
(
String
n:
p
.
getNameStrings
())
{
s
+=
n
;
}
return
s
;
}
/**
...
...
@@ -525,14 +519,8 @@ public class KDC {
EncryptedData
ed
=
apReq
.
authenticator
;
tkt
=
apReq
.
ticket
;
etype
=
tkt
.
encPart
.
getEType
();
EncryptionKey
kkey
=
null
;
if
(!
tkt
.
realm
.
toString
().
equals
(
realm
))
{
if
(
tkt
.
sname
.
getNameString
().
equals
(
"krbtgt/"
+
realm
))
{
kkey
=
keyForUser
(
new
PrincipalName
(
"krbtgt/"
+
tkt
.
realm
.
toString
(),
realm
),
etype
);
}
}
else
{
kkey
=
keyForUser
(
tkt
.
sname
,
etype
);
}
tkt
.
sname
.
setRealm
(
tkt
.
realm
);
EncryptionKey
kkey
=
keyForUser
(
tkt
.
sname
,
etype
);
byte
[]
bb
=
tkt
.
encPart
.
decrypt
(
kkey
,
KeyUsage
.
KU_TICKET
);
DerInputStream
derIn
=
new
DerInputStream
(
bb
);
DerValue
der
=
derIn
.
getDerValue
();
...
...
@@ -857,10 +845,13 @@ public class KDC {
/**
* Generates a line for a KDC to put inside [realms] of krb5.conf
* @param kdc the KDC
* @return REALM.NAME = { kdc =
local
host:port }
* @return REALM.NAME = { kdc = host:port }
*/
private
static
String
realmLineForKDC
(
KDC
kdc
)
{
return
String
.
format
(
" %s = {\n kdc = localhost:%d\n }\n"
,
kdc
.
realm
,
kdc
.
port
);
return
String
.
format
(
" %s = {\n kdc = %s:%d\n }\n"
,
kdc
.
realm
,
kdc
.
kdc
,
kdc
.
port
);
}
/**
...
...
@@ -1000,4 +991,37 @@ public class KDC {
}
}
}
public
static
class
KDCNameService
implements
NameServiceDescriptor
{
@Override
public
NameService
createNameService
()
throws
Exception
{
NameService
ns
=
new
NameService
()
{
@Override
public
InetAddress
[]
lookupAllHostAddr
(
String
host
)
throws
UnknownHostException
{
// Everything is localhost
return
new
InetAddress
[]{
InetAddress
.
getByAddress
(
host
,
new
byte
[]{
127
,
0
,
0
,
1
})
};
}
@Override
public
String
getHostByAddr
(
byte
[]
addr
)
throws
UnknownHostException
{
// No reverse lookup, PrincipalName use original string
throw
new
UnknownHostException
();
}
};
return
ns
;
}
@Override
public
String
getProviderName
()
{
return
"mock"
;
}
@Override
public
String
getType
()
{
return
"ns"
;
}
}
}
test/sun/security/krb5/auto/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
浏览文件 @
21df5611
HttpNegotiateServer
KDC$KDCNameService
test/sun/security/krb5/auto/OneKDC.java
浏览文件 @
21df5611
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008
-2009
Sun Microsystems, Inc. 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
...
...
@@ -46,35 +46,22 @@ import sun.security.krb5.Config;
*/
public
class
OneKDC
extends
KDC
{
// The krb5 codes would try to canonicalize hostnames before creating
// a service principal name, so let's find out the canonicalized form
// of localhost first. The following codes mimic the process inside
// PrincipalName.java.
static
String
localhost
=
"localhost"
;
static
{
try
{
localhost
=
InetAddress
.
getByName
(
localhost
)
.
getCanonicalHostName
();
}
catch
(
UnknownHostException
uhe
)
{
;
// Ignore, localhost is still "localhost"
}
}
public
static
final
String
USER
=
"dummy"
;
public
static
final
char
[]
PASS
=
"bogus"
.
toCharArray
();
public
static
String
SERVER
=
"server/"
+
localhost
;
public
static
String
BACKEND
=
"backend/"
+
localhost
;
public
static
final
String
KRB5_CONF
=
"localkdc-krb5.conf"
;
public
static
final
String
KTAB
=
"localkdc.ktab"
;
public
static
final
String
JAAS_CONF
=
"localkdc-jaas.conf"
;
public
static
final
String
REALM
=
"RABBIT.HOLE"
;
public
static
String
SERVER
=
"server/host."
+
REALM
.
toLowerCase
();
public
static
String
BACKEND
=
"backend/host."
+
REALM
.
toLowerCase
();
public
static
String
KDCHOST
=
"kdc."
+
REALM
.
toLowerCase
();
/**
* Creates the KDC and starts it.
* @param etype Encryption type, null if not specified
* @throws java.lang.Exception if there's anything wrong
*/
public
OneKDC
(
String
etype
)
throws
Exception
{
super
(
REALM
,
0
,
true
);
super
(
REALM
,
KDCHOST
,
0
,
true
);
addPrincipal
(
USER
,
PASS
);
addPrincipalRandKey
(
"krbtgt/"
+
REALM
);
addPrincipalRandKey
(
SERVER
);
...
...
test/sun/security/krb5/auto/basic.sh
浏览文件 @
21df5611
#
# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2008
-2009
Sun Microsystems, Inc. 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
...
...
@@ -41,25 +41,31 @@ OS=`uname -s`
case
"
$OS
"
in
Windows_
*
)
FS
=
"
\\
"
SEP
=
";"
;;
*
)
FS
=
"/"
SEP
=
":"
;;
esac
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
\
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-
XDignore
.symbol.file
-
d
.
\
${
TESTSRC
}${
FS
}
BasicKrb5Test.java
\
${
TESTSRC
}${
FS
}
KDC.java
\
${
TESTSRC
}${
FS
}
OneKDC.java
\
${
TESTSRC
}${
FS
}
Action.java
\
${
TESTSRC
}${
FS
}
Context.java
\
||
exit
10
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test
||
exit
100
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test des-cbc-crc
||
exit
1
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test des-cbc-md5
||
exit
3
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test des3-cbc-sha1
||
exit
16
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test aes128-cts
||
exit
17
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test aes256-cts
||
exit
18
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dtest
.src
=
$TESTSRC
BasicKrb5Test rc4-hmac
||
exit
23
# Add $TESTSRC to classpath so that customized nameservice can be used
J
=
"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java -cp
$TESTSRC
${
SEP
}
. BasicKrb5Test"
$J
||
exit
100
$J
des-cbc-crc
||
exit
1
$J
des-cbc-md5
||
exit
3
$J
des3-cbc-sha1
||
exit
16
$J
aes128-cts
||
exit
17
$J
aes256-cts
||
exit
18
$J
rc4-hmac
||
exit
23
exit
0
test/sun/security/tools/jarsigner/emptymanifest.sh
0 → 100644
浏览文件 @
21df5611
#
# Copyright 2009 Sun Microsystems, Inc. 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# @test
# @bug 6712755
# @summary jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
#
# @run shell emptymanifest.sh
#
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
JAVAC_CMD
=
`
which javac
`
TESTJAVA
=
`
dirname
$JAVAC_CMD
`
/..
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
Windows_
*
)
FS
=
"
\\
"
;;
*
)
FS
=
"/"
;;
esac
KS
=
emptymanifest.jks
JFILE
=
em.jar
KT
=
"
$TESTJAVA
${
FS
}
bin
${
FS
}
keytool -storepass changeit -keypass changeit -keystore
$KS
"
JAR
=
$TESTJAVA
${
FS
}
bin
${
FS
}
jar
JARSIGNER
=
$TESTJAVA
${
FS
}
bin
${
FS
}
jarsigner
rm
$KS
$JFILE
echo
A
>
A
echo
B
>
B
mkdir
META-INF
printf
"
\r\n
"
>
META-INF
${
FS
}
MANIFEST.MF
zip
$JFILE
META-INF
${
FS
}
MANIFEST.MF A B
$KT
-alias
a
-dname
CN
=
a
-keyalg
rsa
-genkey
-validity
300
$JARSIGNER
-keystore
$KS
-storepass
changeit
$JFILE
a
||
exit
1
$JARSIGNER
-keystore
$KS
-verify
-debug
-strict
$JFILE
||
exit
2
exit
0
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录