提交 7912d106 编写于 作者: J jgodinez

Merge

......@@ -35,3 +35,4 @@ d5a1223e961891564de25c39fba6f2442d0fb045 jdk7-b57
9ba256e2e5c161b89e638390f998baa175ec9abe jdk7-b58
2a5a1b269e89f27ebe419ef4cf6e66a3face0df1 jdk7-b59
0c3ef2d612a47667829eb17a192decef23f1c536 jdk7-b60
f72c0dc047b9b2e797beee68ae0b50decb1f020d jdk7-b61
......@@ -345,7 +345,6 @@ TOOLS = \
sun/tools/jar \
sun/tools/java \
sun/tools/javac \
sun/tools/javap \
sun/tools/jps \
sun/tools/jstat \
sun/tools/jstatd \
......@@ -570,7 +569,6 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "sun/tools/asm/" >> $@
$(ECHO) "sun/tools/java/" >> $@
$(ECHO) "sun/tools/javac/" >> $@
$(ECHO) "sun/tools/javap/" >> $@
$(ECHO) "com/sun/tools/classfile/" >> $@
$(ECHO) "com/sun/tools/javap/" >> $@
$(ECHO) "sun/tools/jconsole/" >> $@
......
......@@ -40,6 +40,5 @@ IMPORT_TOOLS_PACKAGES += \
com/sun/tools/javac \
com/sun/tools/javadoc \
com/sun/tools/javah \
com/sun/tools/javap \
sun/tools/javap
com/sun/tools/javap
......@@ -91,6 +91,8 @@ ABS_TEMP_DIR = $(ABS_OUTPUTDIR)/tmp
dummy := $(shell $(MKDIR) -p $(TEMP_DIR))
# The language version we want for this jdk build
SOURCE_LANGUAGE_VERSION=5
# The class version we want for this jdk build
TARGET_CLASS_VERSION=5
......
......@@ -123,7 +123,8 @@ ifeq ($(JAVAC_WARNINGS_FATAL), true)
endif
# Add the source level (currently all source is 1.5, should this be 1.6?)
LANGUAGE_VERSION = -source 1.5
SOURCE_LANGUAGE_VERSION = 5
LANGUAGE_VERSION = -source $(SOURCE_LANGUAGE_VERSION)
JAVACFLAGS += $(LANGUAGE_VERSION)
# Add the class version we want (currently this is 5, should it be 6 or even 7?)
......
......@@ -645,7 +645,7 @@ tracingdocs:
@# ######## api-tracing ############################
$(RM) -r $(TRACING_DOCDIR)
$(MKDIR) -p $(TRACING_DOCDIR)
$(JAVADOC) $(TRACING_JAVADOCFLAGS) \
$(JAVADOC_CMD) $(TRACING_JAVADOCFLAGS) \
$(TRACING_PKGS)
.PHONY: httpserverdocs
......
......@@ -827,8 +827,7 @@ CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar
$(FILES_gensbcs_out): $(GENCSSRC)/SingleByte-X.java $(GENCSSRC)/sbcs
@$(prep-target)
$(BOOT_JAVA_CMD) -cp $(CHARSETMAPPING_JARFILE) build.tools.charsetmapping.GenerateSBCS \
$(GENCSSRC) $(SCS_GEN) sbcs
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSSRC) $(SCS_GEN) sbcs
#
# Generated file system implementation classes (Unix only)
......
......@@ -76,6 +76,10 @@ FILES_java = \
sun/text/Normalizer.java \
sun/text/SupplementaryCharacterData.java \
sun/text/UCompactIntArray.java \
sun/text/bidi/BidiBase.java \
sun/text/bidi/BidiLine.java \
sun/text/bidi/BidiRun.java \
\
sun/text/normalizer/CharTrie.java \
sun/text/normalizer/CharacterIteratorWrapper.java \
sun/text/normalizer/ICUBinary.java \
......
......@@ -50,6 +50,8 @@ PREFIX = 1.2
JAVADOCFLAGS = $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION)
SWINGPKG = javax/swing
LOCAL_JAVAC_FLAGS = $(OTHER_JAVACFLAGS)
# since LOCAL_JAVADOC runs on ALT_BOOTDIR, the doclet and all its classes must be compiled to match
DOCLET_JAVAC_FLAGS = -source 6 -target 6
include FILES.gmk
include $(BUILDDIR)/common/Release.gmk
......@@ -86,7 +88,7 @@ $(OBJDIR) $(BEANCLASSDIR) $(BEANSRCDIR) $(DOCLETDST)::
@$(MKDIR) -p $@
$(DOCLETDST)/%.class: $(DOCLETSRC)/%.java
$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath "$(CLASSBINDIR)$(CLASSPATH_SEPARATOR)$(DOCLETSRC)" -d $(DOCLETDST) $?
$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) $(DOCLET_JAVAC_FLAGS) -classpath "$(CLASSBINDIR)$(CLASSPATH_SEPARATOR)$(DOCLETSRC)" -d $(DOCLETDST) $?
@$(java-vm-cleanup)
# To run, the doclet needs SwingBeanInfoBase class. Also Notice the lie
......@@ -95,11 +97,11 @@ $(DOCLETDST)/%.class: $(DOCLETSRC)/%.java
.SwingBeanInfo: $(OBJDIR) $(BEANCLASSDIR) $(BEANSRCDIR) $(SWINGPKG)/BeanInfoUtils.class $(SWINGPKG)/SwingBeanInfoBase.class
$(SWINGPKG)/BeanInfoUtils.class: $(BEANSRCDIR)/BeanInfoUtils.java
$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -d $(BEANCLASSDIR) $<
$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) $(DOCLET_JAVAC_FLAGS) -d $(BEANCLASSDIR) $<
@$(java-vm-cleanup)
$(SWINGPKG)/SwingBeanInfoBase.class: $(BEANSRCDIR)/SwingBeanInfoBase.java $(BEANSRCDIR)/BeanInfoUtils.java
$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath $(BEANCLASSDIR) -d $(BEANCLASSDIR) $<
$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) $(DOCLET_JAVAC_FLAGS) -classpath $(BEANCLASSDIR) -d $(BEANCLASSDIR) $<
@$(java-vm-cleanup)
#
......
......@@ -66,7 +66,7 @@ $(call make-launcher, jarsigner, sun.security.tools.JarSigner, , )
$(call make-launcher, javac, com.sun.tools.javac.Main, , )
$(call make-launcher, javadoc, com.sun.tools.javadoc.Main, , )
$(call make-launcher, javah, com.sun.tools.javah.Main, , )
$(call make-launcher, javap, sun.tools.javap.Main, , )
$(call make-launcher, javap, com.sun.tools.javap.Main, , )
$(call make-launcher, jconsole, sun.tools.jconsole.JConsole, \
-J-Djconsole.showOutputViewer, )
$(call make-launcher, jdb, com.sun.tools.example.debug.tty.TTY, , )
......
......@@ -58,11 +58,12 @@ ifdef OPENJDK
else
RENDER_SUBDIR = dcpr
endif
# nio need to be compiled before awt to have all charsets ready
SUBDIRS = jar security javazic misc net audio $(RENDER_SUBDIR) image \
awt splashscreen $(XAWT_SUBDIR) \
nio awt splashscreen $(XAWT_SUBDIR) \
$(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
jawt text nio launcher management $(ORG_SUBDIR) \
jawt text launcher management $(ORG_SUBDIR) \
native2ascii serialver tools jconsole tracing
all build clean clobber::
......
......@@ -24,10 +24,6 @@
#
FILES_c_shared = \
jbidi.c \
ubidi.c \
ubidiln.c \
uchardir.c \
DrawGlyphList.c \
sunFont.c
......
......@@ -145,7 +145,6 @@ include $(BUILDDIR)/common/Library.gmk
# Add to the ambient vpath to pick up files in subdirectories
#
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/bidi
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
......@@ -187,7 +186,6 @@ endif # PLATFORM
CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
-I$(SHARE_SRC)/native/$(PKGDIR)/layout \
-I$(SHARE_SRC)/native/$(PKGDIR)/bidi \
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
-I$(PLATFORM_SRC)/native/sun/awt \
-I$(SHARE_SRC)/native/sun/awt/debug \
......
......@@ -31,8 +31,6 @@ SUNWprivate_1.1 {
newLayoutTableCache;
freeLayoutTableCache;
isNullScalerContext;
Java_java_text_Bidi_nativeBidiChars;
Java_java_text_Bidi_nativeGetDirectionCode;
Java_sun_font_NullFontScaler_getNullScalerContext;
Java_sun_font_NullFontScaler_getGlyphImage;
Java_sun_font_FontManager_getPlatformFontVar;
......
......@@ -33,8 +33,6 @@ SUNWprivate_1.1 {
newLayoutTableCache;
freeLayoutTableCache;
isNullScalerContext;
Java_java_text_Bidi_nativeBidiChars;
Java_java_text_Bidi_nativeGetDirectionCode;
Java_sun_font_NullFontScaler_getNullScalerContext;
Java_sun_font_NullFontScaler_getGlyphImage;
Java_sun_font_FontManager_getPlatformFontVar;
......
......@@ -304,7 +304,7 @@ FILES_src = \
sun/io/CharToByteMacUkraine.java \
sun/io/CharToByteTIS620.java
FILES_gen_extsbcs = \
FILES_gen_extcs = \
sun/nio/cs/ext/IBM037.java \
sun/nio/cs/ext/IBM1006.java \
sun/nio/cs/ext/IBM1025.java \
......@@ -374,6 +374,21 @@ FILES_gen_extsbcs = \
sun/nio/cs/ext/MacThai.java \
sun/nio/cs/ext/MacTurkish.java \
sun/nio/cs/ext/MacUkraine.java \
sun/nio/cs/ext/TIS_620.java
sun/nio/cs/ext/TIS_620.java \
sun/nio/cs/ext/EUC_TWMapping.java \
sun/nio/cs/ext/IBM1381.java \
sun/nio/cs/ext/IBM1383.java \
sun/nio/cs/ext/IBM930.java \
sun/nio/cs/ext/IBM933.java \
sun/nio/cs/ext/IBM935.java \
sun/nio/cs/ext/IBM937.java \
sun/nio/cs/ext/IBM939.java \
sun/nio/cs/ext/IBM942.java \
sun/nio/cs/ext/IBM943.java \
sun/nio/cs/ext/IBM948.java \
sun/nio/cs/ext/IBM949.java \
sun/nio/cs/ext/IBM950.java \
sun/nio/cs/ext/IBM970.java
FILES_java = $(FILES_src) $(FILES_gen_extcs)
FILES_java = $(FILES_src) $(FILES_gen_extsbcs)
\ No newline at end of file
......@@ -60,15 +60,15 @@ endif # PLATFORM
# this define is for the rule:
CHARSETS_JAR = $(LIBDIR)/charsets.jar
# extsbcs
FILES_genout_extsbcs = $(FILES_gen_extsbcs:%.java=$(GENSRCDIR)/%.java)
# extcs
FILES_genout_extcs = $(FILES_gen_extcs:%.java=$(GENSRCDIR)/%.java)
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
build: $(FILES_genout_extsbcs) $(CHARSETS_JAR)
build: $(FILES_genout_extcs) $(CHARSETS_JAR)
#
# Extra rules to build character converters.
......@@ -77,6 +77,7 @@ SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)
GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping
GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext
FILES_MAP = $(GENCSDATASRC)/sjis0213.map
......@@ -86,16 +87,18 @@ CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar
$(FILES_DAT): $(FILES_MAP)
@$(prep-target)
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \
$(FILES_MAP) $(FILES_DAT)
$(FILES_MAP) $(FILES_DAT) sjis0213
$(FILES_genout_extsbcs): $(GENCSDATASRC)/SingleByte-X.java $(GENCSDATASRC)/extsbcs
$(FILES_genout_extcs): $(GENCSDATASRC)/SingleByte-X.java $(GENCSDATASRC)/DoubleByte-X.java \
$(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs
@$(prep-target)
$(RM) -r $(GENCSEXT)
$(MKDIR) -p $(GENCSEXT)
$(BOOT_JAVA_CMD) -cp $(CHARSETMAPPING_JARFILE) build.tools.charsetmapping.GenerateSBCS \
$(GENCSDATASRC) $(GENCSEXT) extsbcs
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) extsbcs
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \
$(GENCSSRCDIR)/GenerateEUC_TW.java
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs
$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
$(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
......
/*
* 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.
*
* 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.
*/
// -- This file was mechanically generated: Do not edit! -- //
package $PACKAGE$;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.ext.DoubleByte;
public class $NAME_CLZ$ extends Charset
$IMPLEMENTS$
{
public $NAME_CLZ$() {
super("$NAME_CS$", $NAME_ALIASES$);
}
$HISTORICALNAME$
public boolean contains(Charset cs) {
$CONTAINS$
}
public CharsetDecoder newDecoder() {
initb2c();
return new DoubleByte.Decoder$DECTYPE$(this, b2c, b2cSB, $B2MIN$, $B2MAX$);
}
public CharsetEncoder newEncoder() {
initc2b();
return new DoubleByte.Encoder$ENCTYPE$(this, c2b, c2bIndex);
}
$B2C$
static char[][] b2c = new char[b2cStr.length][];
static char[] b2cSB;
private static volatile boolean b2cInitialized = false;
static void initb2c() {
if (b2cInitialized)
return;
synchronized (b2c) {
if (b2cInitialized)
return;
for (int i = 0; i < b2cStr.length; i++) {
if (b2cStr[i] == null)
b2c[i] = DoubleByte.B2C_UNMAPPABLE;
else
b2c[i] = b2cStr[i].toCharArray();
}
b2cSB = b2cSBStr.toCharArray();
b2cInitialized = true;
}
}
static char[] c2b = new char[$C2BLENGTH$];
static char[] c2bIndex = new char[0x100];
private static volatile boolean c2bInitialized = false;
static void initc2b() {
if (c2bInitialized)
return;
synchronized (c2b) {
if (c2bInitialized)
return;
$NONROUNDTRIP_B2C$
$NONROUNDTRIP_C2B$
DoubleByte.Encoder.initC2B(b2cStr, b2cSBStr, b2cNR, c2bNR,
$B2MIN$, $B2MAX$,
c2b, c2bIndex);
c2bInitialized = true;
}
}
}
# See 4201529/4296969
A1AA 2014
A1A4 00B7
A1A4 7AC2
\ No newline at end of file
此差异已折叠。
# See 4201529/4296969
A1AA 2014
A1A4 00B7
A1A4 8EA2
FEEE F83D
FEF4 F83E
此差异已折叠。
#
# diff result of 03A234B0.TPMAP12A & 03A234B0.UXMAP120, with
#
# (1)added following entries from existing Cp930.java's c->b only
# encoding result.
#
# 6be1 -> 54d4 -> 5516
# 6d00 -> 5550 -> 6d9c
# 70ff -> 52ec -> 4fa0
# 841d -> 53e8 -> 8749
# 841f -> 52a1 -> 874b
# 8f91 -> 446e -> 2116
# 92ca -> 547d -> 565b
# 9b7e -> 53da -> 9a28
# f86f -> 446e -> 2116
#
# (2)entries does not exist in "old"
#
# 51F1 6805
# 53B3 8346
#
# (3)the 0x15 U+0085 entries for ebcdic
#
15 0085
#
54d4 6be1
5550 6d00
52ec 70ff
53e8 841d
52a1 841f
446e 8f91
547d 92ca
53da 9b7e
446e f86f
#
# we should use this one instead of the 4260<-ff0d
#4260 2212
4260 ff0d
#
426A 00A6
43A1 301C
444A 2014
447C 2016
4C7D 9E7C
4EB3 9830
4F5E 5861
507F 91AC
5190 56CA
51F1 6805
51FA 91B1
5261 9EB4
52A1 881F
52C9 840A
52DA 7E61
52EC 4FE0
5353 8EC0
5373 7E6B
53DA 9A52
53E8 87EC
53EE 7130
53F8 8523
5443 5C5B
5464 9DD7
547D 5699
5481 525D
54A3 6414
54A4 7626
54CA 7C1E
54CD 6451
54D4 555E
54FA 6F51
5550 7006
5553 79B1
555F 9EB5
55C0 5C62
55C1 985A
5B72 6522
5BFE 688E
60F1 7E48
61B0 8141
66C8 9839
此差异已折叠。
此差异已折叠。
此差异已折叠。
15 0085
#
# see .map for more info regarding the following 5 entries
#445C F83E
#46A8 F83F
#46A9 F840
#46AA F841
#46AB F842
\ No newline at end of file
此差异已折叠。
#
25 000a
#
# following are from Cp937.nr
454A 5341
454C 5345
4841 4E00
4845 4E59
4847 4E8C
4849 4EBA
484A 513F
484B 5165
484C 516B
4850 51E0
4851 51F5
4852 5200
4853 529B
4855 5315
4856 531A
4858 5341
4859 535C
485B 5382
485D 53C8
485E 53E3
485F 56D7
4860 571F
4861 58EB
4863 5915
4864 5927
4865 5973
4866 5B50
4868 5BF8
4869 5C0F
486A 5C22
486B 5C38
486C 5C6E
486D 5C71
486F 5DE5
4870 5DF1
4871 5DFE
4872 5E72
4876 5EFE
4877 5F0B
4878 5F13
487B 5F73
487C 5FC3
487D 6208
487E 6236
487F 624B
4881 652F
4883 6587
4884 6597
4885 65A4
4886 65B9
4888 65E5
4889 66F0
488A 6708
488B 6728
488C 6B20
488D 6B62
488E 6B79
488F 6BB3
4890 6BCB
4891 6BD4
4892 6BDB
4893 6C0F
4894 6C14
4895 6C34
4896 706B
4897 722A
4898 7236
4899 723B
489A 723F
489B 7247
489C 7259
489D 725B
489E 72AC
489F 7384
48A0 7389
48A1 74DC
48A2 74E6
48A3 7518
48A4 751F
48A5 7528
48A6 7530
48A7 758B
48AA 767D
48AB 76AE
48AC 76BF
48AD 76EE
48AE 77DB
48AF 77E2
48B0 77F3
48B1 793A
48B2 79B8
48B3 79BE
48B4 7A74
48B5 7ACB
48B6 7AF9
48B7 7C73
48B8 7CF8
48B9 7F36
48BA 7F51
48BB 7F8A
48BC 7FBD
48BD 8001
48BE 800C
48BF 8012
48C0 8033
48C1 807F
48C2 8089
48C3 81E3
48C4 81EA
48C5 81F3
48C6 81FC
48C7 820C
48C8 821B
48C9 821F
48CA 826E
48CB 8272
48CC 8278
48CD 864D
48CE 866B
48CF 8840
48D0 884C
48D1 8863
48D2 897E
48D3 898B
48D4 89D2
48D5 8A00
48D6 8C37
48D7 8C46
48D8 8C55
48D9 8C78
48DA 8C9D
48DB 8D64
48DC 8D70
48DD 8DB3
48DE 8EAB
48DF 8ECA
48E0 8F9B
48E1 8FB0
48E3 9091
48E4 9149
48E5 91C6
48E6 91CC
48E7 91D1
48E8 9577
48E9 9580
48EA 961C
48EC 96B9
48ED 96E8
48EE 9752
48EF 975E
48F0 9762
48F1 9769
48F2 97CB
48F3 97ED
48F4 97F3
48F5 9801
48F6 98A8
48F7 98DB
48F8 98DF
48F9 9996
48FA 9999
48FB 99AC
48FC 9AA8
48FD 9AD8
4941 9ADF
4942 9B25
4943 9B2F
4944 9B32
4945 9B3C
4946 9B5A
4947 9CE5
4948 9E75
4949 9E7F
494A 9EA5
494B 9EBB
494C 9EC3
494D 9ECD
494E 9ED1
494F 9EF9
4950 9EFD
4951 9F0E
4952 9F13
4953 9F20
4954 9F3B
4955 9F4A
4956 9F52
4957 9F8D
4958 9F9C
4959 9FA0
#
15 0085
#
# diff of:
# package2/939/03AB34B0.TPMAP12A
# package2/939/03AB34B0.UPMAP13A
#
4260 2212
426A 00A6
43A1 301C
444A 2014
446E F86F
447C 2016
4C7D 9E7C
4EB3 9830
4F5E 5861
507F 91AC
5190 56CA
51F1 6805
51FA 91B1
5261 9EB4
52A1 881F
52C9 840A
52DA 7E61
52EC 4FE0
5353 8EC0
5373 7E6B
53B3 8346
53DA 9A52
53E8 87EC
53EE 7130
53F8 8523
5443 5C5B
5464 9DD7
547D 5699
5481 525D
54A3 6414
54A4 7626
54CA 7C1E
54CD 6451
54D4 555E
54FA 6F51
5550 7006
5553 79B1
555F 9EB5
55C0 5C62
55C1 985A
5B72 6522
5BFE 688E
60F1 7E48
61B0 8141
66C8 9839
#
# see .map for details for following entries
54d4 6be1
5550 6d00
52ec 70ff
53e8 841d
52a1 841f
446e 8f91
547d 92ca
53da 9b7e
\ No newline at end of file
此差异已折叠。
# diff of
# 03AE34B0.TPMAP110 (b2c)
# 03AE34B0.UPMAP120 (c2b)
# (1) removed "redundant" entries
# 5C 005C
# 7E 007E
# (2) have following "incompatible" entries compared
# to existing/old mappings
#
# (a) c->b only don't exist in old table
# 2015 815c 2014
# 2225 8161 2016
# 6805 8df2 67f5
# 8346 8c74 834a
# ff0d 817c 2212
# ff5e 8160 301c
# ffe4 fa55 a6
#
# (b) c->b only don't exist in new table
# 551e 90e4 8749
# 6d00 93c0 6d9c
# 6f1e 91cb 9a28
# 70ff 8ba0 4fa0
# 8741 88a0 5516
# 8f91 fa59 2116
# 92ca 8a9a 565b
#
# Warning: to compatible, added (b) into c2b table
#
90e4 551e
93c0 6d00
91cb 6f1e
8ba0 70ff
88a0 8741
fa59 8f91
8a9a 92ca
#
#
#
815C 2015
8160 FF5E
8161 2225
817C FF0D
88A0 555E
898B 7130
89A8 9DD7
8A9A 5699
8BA0 4FE0
8BEB 8EC0
8C71 7E6B
8C74 8346
8CB2 9E7C
8D8D 9EB4
8DF2 6805
8EC6 5C62
8F4A 7E61
8FD3 8523
8FDD 91AC
90E4 87EC
917E 6414
9189 7626
91CB 9A52
925C 7C1E
92CD 6451
9355 5861
935E 985A
9398 79B1
93C0 7006
9458 56CA
948D 525D
94AC 6F51
94AE 91B1
966A 9830
96CB 9EB5
9789 840A
9858 881F
9BA0 5C5B
9DB7 6522
9E94 688E
E379 7E48
E445 8141
E8F6 9839
FA55 FFE4
FA59 F86F
此差异已折叠。
此差异已折叠。
#
# b->c only entries
#
8754 2160
8755 2161
8756 2162
8757 2163
8758 2164
8759 2165
875A 2166
875B 2167
875C 2168
875D 2169
8782 2116
8784 2121
878A 3231
8790 2252
8791 2261
8792 222B
8795 221A
8796 22A5
8797 2220
879A 2235
879B 2229
879C 222A
ED40 7E8A
ED41 891C
ED42 9348
ED43 9288
ED44 84DC
ED45 4FC9
ED46 70BB
ED47 6631
ED48 68C8
ED49 92F9
ED4A 66FB
ED4B 5F45
ED4C 4E28
ED4D 4EE1
ED4E 4EFC
ED4F 4F00
ED50 4F03
ED51 4F39
ED52 4F56
ED53 4F92
ED54 4F8A
ED55 4F9A
ED56 4F94
ED57 4FCD
ED58 5040
ED59 5022
ED5A 4FFF
ED5B 501E
ED5C 5046
ED5D 5070
ED5E 5042
ED5F 5094
ED60 50F4
ED61 50D8
ED62 514A
ED63 5164
ED64 519D
ED65 51BE
ED66 51EC
ED67 5215
ED68 529C
ED69 52A6
ED6A 52C0
ED6B 52DB
ED6C 5300
ED6D 5307
ED6E 5324
ED6F 5372
ED70 5393
ED71 53B2
ED72 53DD
ED73 FA0E
ED74 549C
ED75 548A
ED76 54A9
ED77 54FF
ED78 5586
ED79 5759
ED7A 5765
ED7B 57AC
ED7C 57C8
ED7D 57C7
ED7E FA0F
ED80 FA10
ED81 589E
ED82 58B2
ED83 590B
ED84 5953
ED85 595B
ED86 595D
ED87 5963
ED88 59A4
ED89 59BA
ED8A 5B56
ED8B 5BC0
ED8C 752F
ED8D 5BD8
ED8E 5BEC
ED8F 5C1E
ED90 5CA6
ED91 5CBA
ED92 5CF5
ED93 5D27
ED94 5D53
ED95 FA11
ED96 5D42
ED97 5D6D
ED98 5DB8
ED99 5DB9
ED9A 5DD0
ED9B 5F21
ED9C 5F34
ED9D 5F67
ED9E 5FB7
ED9F 5FDE
EDA0 605D
EDA1 6085
EDA2 608A
EDA3 60DE
EDA4 60D5
EDA5 6120
EDA6 60F2
EDA7 6111
EDA8 6137
EDA9 6130
EDAA 6198
EDAB 6213
EDAC 62A6
EDAD 63F5
EDAE 6460
EDAF 649D
EDB0 64CE
EDB1 654E
EDB2 6600
EDB3 6615
EDB4 663B
EDB5 6609
EDB6 662E
EDB7 661E
EDB8 6624
EDB9 6665
EDBA 6657
EDBB 6659
EDBC FA12
EDBD 6673
EDBE 6699
EDBF 66A0
EDC0 66B2
EDC1 66BF
EDC2 66FA
EDC3 670E
EDC4 F929
EDC5 6766
EDC6 67BB
EDC7 6852
EDC8 67C0
EDC9 6801
EDCA 6844
EDCB 68CF
EDCC FA13
EDCD 6968
EDCE FA14
EDCF 6998
EDD0 69E2
EDD1 6A30
EDD2 6A6B
EDD3 6A46
EDD4 6A73
EDD5 6A7E
EDD6 6AE2
EDD7 6AE4
EDD8 6BD6
EDD9 6C3F
EDDA 6C5C
EDDB 6C86
EDDC 6C6F
EDDD 6CDA
EDDE 6D04
EDDF 6D87
EDE0 6D6F
EDE1 6D96
EDE2 6DAC
EDE3 6DCF
EDE4 6DF8
EDE5 6DF2
EDE6 6DFC
EDE7 6E39
EDE8 6E5C
EDE9 6E27
EDEA 6E3C
EDEB 6EBF
EDEC 6F88
EDED 6FB5
EDEE 6FF5
EDEF 7005
EDF0 7007
EDF1 7028
EDF2 7085
EDF3 70AB
EDF4 710F
EDF5 7104
EDF6 715C
EDF7 7146
EDF8 7147
EDF9 FA15
EDFA 71C1
EDFB 71FE
EDFC 72B1
EE40 72BE
EE41 7324
EE42 FA16
EE43 7377
EE44 73BD
EE45 73C9
EE46 73D6
EE47 73E3
EE48 73D2
EE49 7407
EE4A 73F5
EE4B 7426
EE4C 742A
EE4D 7429
EE4E 742E
EE4F 7462
EE50 7489
EE51 749F
EE52 7501
EE53 756F
EE54 7682
EE55 769C
EE56 769E
EE57 769B
EE58 76A6
EE59 FA17
EE5A 7746
EE5B 52AF
EE5C 7821
EE5D 784E
EE5E 7864
EE5F 787A
EE60 7930
EE61 FA18
EE62 FA19
EE63 FA1A
EE64 7994
EE65 FA1B
EE66 799B
EE67 7AD1
EE68 7AE7
EE69 FA1C
EE6A 7AEB
EE6B 7B9E
EE6C FA1D
EE6D 7D48
EE6E 7D5C
EE6F 7DB7
EE70 7DA0
EE71 7DD6
EE72 7E52
EE73 7F47
EE74 7FA1
EE75 FA1E
EE76 8301
EE77 8362
EE78 837F
EE79 83C7
EE7A 83F6
EE7B 8448
EE7C 84B4
EE7D 8553
EE7E 8559
EE80 856B
EE81 FA1F
EE82 85B0
EE83 FA20
EE84 FA21
EE85 8807
EE86 88F5
EE87 8A12
EE88 8A37
EE89 8A79
EE8A 8AA7
EE8B 8ABE
EE8C 8ADF
EE8D FA22
EE8E 8AF6
EE8F 8B53
EE90 8B7F
EE91 8CF0
EE92 8CF4
EE93 8D12
EE94 8D76
EE95 FA23
EE96 8ECF
EE97 FA24
EE98 FA25
EE99 9067
EE9A 90DE
EE9B FA26
EE9C 9115
EE9D 9127
EE9E 91DA
EE9F 91D7
EEA0 91DE
EEA1 91ED
EEA2 91EE
EEA3 91E4
EEA4 91E5
EEA5 9206
EEA6 9210
EEA7 920A
EEA8 923A
EEA9 9240
EEAA 923C
EEAB 924E
EEAC 9259
EEAD 9251
EEAE 9239
EEAF 9267
EEB0 92A7
EEB1 9277
EEB2 9278
EEB3 92E7
EEB4 92D7
EEB5 92D9
EEB6 92D0
EEB7 FA27
EEB8 92D5
EEB9 92E0
EEBA 92D3
EEBB 9325
EEBC 9321
EEBD 92FB
EEBE FA28
EEBF 931E
EEC0 92FF
EEC1 931D
EEC2 9302
EEC3 9370
EEC4 9357
EEC5 93A4
EEC6 93C6
EEC7 93DE
EEC8 93F8
EEC9 9431
EECA 9445
EECB 9448
EECC 9592
EECD F9DC
EECE FA29
EECF 969D
EED0 96AF
EED1 9733
EED2 973B
EED3 9743
EED4 974D
EED5 974F
EED6 9751
EED7 9755
EED8 9857
EED9 9865
EEDA FA2A
EEDB FA2B
EEDC 9927
EEDD FA2C
EEDE 999E
EEDF 9A4E
EEE0 9AD9
EEE1 9ADC
EEE2 9B75
EEE3 9B72
EEE4 9B8F
EEE5 9BB1
EEE6 9BBB
EEE7 9C00
EEE8 9D70
EEE9 9D6B
EEEA FA2D
EEEB 9E19
EEEC 9ED1
EEEF 2170
EEF0 2171
EEF1 2172
EEF2 2173
EEF3 2174
EEF4 2175
EEF5 2176
EEF6 2177
EEF7 2178
EEF8 2179
EEF9 FFE2
EEFA 00A6
EEFB FF07
EEFC FF02
FA54 FFE2
FA5B 2235
8C40 4E00
8C41 4E59
8C47 4E8C
8C48 4EBA
8C49 513F
8C4A 5165
8C4B 516B
8C4C 51E0
8C4D 5200
8C4F 529B
8C50 5315
8C51 5341
8C52 535C
8C53 53C8
8C66 53E3
8C67 571F
8C68 58EB
8C69 5915
8C6A 5927
8C6B 5973
8C6C 5B50
8C6F 5BF8
8C70 5C0F
8C71 5C22
8C72 5C38
8C73 5C71
8C75 5DE5
8C76 5DF1
8C79 5DFE
8C7A 5E72
8C7B 5EFE
8C7C 5F0B
8C7D 5F13
8CA9 5345
8CBE 5FC3
8CBF 6208
8CC0 6236
8CC1 624B
8CC3 652F
8CC4 6587
8CC5 6597
8CC6 65A4
8CC7 65B9
8CC8 65E5
8CC9 66F0
8CCA 6708
8CCB 6728
8CCC 6B20
8CCD 6B62
8CCE 6B79
8CCF 6BCB
8CD0 6BD4
8CD1 6BDB
8CD2 6C0F
8CD3 6C34
8CD4 706B
8CD5 722A
8CD6 7236
8CD7 723B
8CD8 7247
8CD9 7259
8CDA 725B
8CDB 72AC
8D88 7384
8D89 7389
8D8A 74DC
8D8B 74E6
8D8C 7518
8D8D 751F
8D8E 7528
8D90 7530
8D94 758B
8D95 767D
8D96 76AE
8D97 76BF
8D98 76EE
8D99 77DB
8D9A 77E2
8D9B 77F3
8D9C 793A
8D9D 79BE
8D9E 7A74
8D9F 7ACB
8E6B 7AF9
8E6C 7C73
8E6D 7CF8
8E6E 7F36
8E6F 7F8A
8E70 7FBD
8E71 8001
8E73 800C
8E74 8012
8E75 8033
8E76 807F
8E77 8089
8E7A 81E3
8E7B 81EA
8E7C 81F3
8E7D 81FC
8E7E 820C
8E80 821B
8E81 821F
8E82 826E
8E83 8272
8E85 866B
8E86 8840
8E87 884C
8E88 8863
8FC2 898B
8FC3 89D2
8FC4 8A00
8FC5 8C37
8FC6 8C46
8FC7 8C55
8FC8 8C9D
8FC9 8D64
8FCA 8D70
8FCB 8DB3
8FCC 8EAB
8FCD 8ECA
8FCE 8F9B
8FCF 8FB0
8FD5 9091
8FDA 9149
8FDB 91C6
8FDC 91CC
91D8 91D1
91D9 9577
91DA 9580
91DB 961C
91E1 96B9
91E2 96E8
91E3 9752
91E4 975E
93F1 9762
93F2 9769
93F3 97CB
93F4 97ED
93F5 97F3
93F6 9801
93F7 98A8
93F8 98DB
93F9 98DF
93FA 9996
93FB 9999
968B 99AC
968C 9AA8
968D 9AD8
968E 9B25
968F 9B32
9690 9B3C
9942 9B5A
9943 9CE5
9944 9E75
9945 9E7F
9946 9EA5
9947 9EBB
9BA5 9EC3
9BA6 9ECD
9BA7 9ED1
9DED 9F0E
9DEE 9F13
9DEF 9F20
9FF9 9F3B
9FFA 9F4A
A24E 9F52
A3BC 9F8D
A3BD 9F9C
A942 51F5
A943 531A
A944 5382
A949 56D7
A94B 5C6E
A94C 5F73
A95F 6BB3
A961 6C14
A962 723F
A987 79B8
A9E7 7F51
A9E8 8278
A9ED 864D
A9EE 897E
AB44 8C78
B26C 9ADF
B26D 9B2F
B975 9EF9
BCF5 9EFD
C962 9FA0
此差异已折叠。
此差异已折叠。
A440 4E00
A441 4E59
A447 4E8C
A448 4EBA
A449 513F
A44A 5165
A44B 516B
A44C 51E0
A44D 5200
A44F 529B
A450 5315
A451 5341
A452 535C
A453 53C8
A466 53E3
A467 571F
A468 58EB
A469 5915
A46A 5927
A46B 5973
A46C 5B50
A46F 5BF8
A470 5C0F
A471 5C22
A472 5C38
A473 5C71
A475 5DE5
A476 5DF1
A479 5DFE
A47A 5E72
A47B 5EFE
A47C 5F0B
A47D 5F13
A4CA 5345
A4DF 5FC3
A4E0 6208
A4E1 6236
A4E2 624B
A4E4 652F
A4E5 6587
A4E6 6597
A4E7 65A4
A4E8 65B9
A4E9 65E5
A4EA 66F0
A4EB 6708
A4EC 6728
A4ED 6B20
A4EE 6B62
A4EF 6B79
A4F0 6BCB
A4F1 6BD4
A4F2 6BDB
A4F3 6C0F
A4F4 6C34
A4F5 706B
A4F6 722A
A4F7 7236
A4F8 723B
A4F9 7247
A4FA 7259
A4FB 725B
A4FC 72AC
A5C8 7384
A5C9 7389
A5CA 74DC
A5CB 74E6
A5CC 7518
A5CD 751F
A5CE 7528
A5D0 7530
A5D4 758B
A5D5 767D
A5D6 76AE
A5D7 76BF
A5D8 76EE
A5D9 77DB
A5DA 77E2
A5DB 77F3
A5DC 793A
A5DD 79BE
A5DE 7A74
A5DF 7ACB
A6CB 7AF9
A6CC 7C73
A6CD 7CF8
A6CE 7F36
A6CF 7F8A
A6D0 7FBD
A6D1 8001
A6D3 800C
A6D4 8012
A6D5 8033
A6D6 807F
A6D7 8089
A6DA 81E3
A6DB 81EA
A6DC 81F3
A6DD 81FC
A6DE 820C
A6DF 821B
A6E0 821F
A6E1 826E
A6E2 8272
A6E4 866B
A6E5 8840
A6E6 884C
A6E7 8863
A8A3 898B
A8A4 89D2
A8A5 8A00
A8A6 8C37
A8A7 8C46
A8A8 8C55
A8A9 8C9D
A8AA 8D64
A8AB 8D70
A8AC 8DB3
A8AD 8EAB
A8AE 8ECA
A8AF 8F9B
A8B0 8FB0
A8B6 9091
A8BB 9149
A8BC 91C6
A8BD 91CC
AAF7 91D1
AAF8 9577
AAF9 9580
AAFA 961C
AB41 96B9
AB42 96E8
AB43 9752
AB44 975E
ADB1 9762
ADB2 9769
ADB3 97CB
ADB4 97ED
ADB5 97F3
ADB6 9801
ADB7 98A8
ADB8 98DB
ADB9 98DF
ADBA 9996
ADBB 9999
B0A8 99AC
B0A9 9AA8
B0AA 9AD8
B0AB 9B25
B0AC 9B32
B0AD 9B3C
B3BD 9B5A
B3BE 9CE5
B3BF 9E75
B3C0 9E7F
B3C1 9EA5
B3C2 9EBB
B6C0 9EC3
B6C1 9ECD
B6C2 9ED1
B9A9 9F0E
B9AA 9F13
B9AB 9F20
BBF3 9F3B
BBF4 9F4A
BEA6 9F52
C073 9F8D
C074 9F9C
C942 51F5
C943 531A
C944 5382
C949 56D7
C94B 5C6E
C94C 5F73
C95F 6BB3
C961 6C14
C962 723F
C9A8 79B8
CA49 7F51
CA4A 8278
CA4F 864D
CA50 897E
CBA4 8C78
D449 9ADF
D44A 9B2F
DCB0 9EF9
E0EF 9EFD
EFB6 9FA0
此差异已折叠。
A1A4 00B7
A1A9 00AD
A1AA 2015
A1AD 223C
A2A6 FF5E
A2C1 2299
A3DC 20A9
#
# see .map file for the info regarding following 3 entries
#
a1aa 6950
a1a9 84f1
a1ad cf7f
此差异已折叠。
......@@ -34,7 +34,7 @@ PROGRAM = charsetmapping
include $(BUILDDIR)/common/Defs.gmk
BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src
BUILDTOOL_MAIN = $(PKGDIR)/GenerateMapping.java
BUILDTOOL_MAIN = $(PKGDIR)/Main.java
#
# Build tool jar rules.
......
#
#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
#
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
IBM933 x-IBM933 Cp933 ebcdic sun.nio.cs.ext false 0x40 0xdd 0x40 0xfe
IBM935 x-IBM935 Cp935 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
IBM937 x-IBM937 Cp937 ebcdic sun.nio.cs.ext false 0x40 0xe2 0x40 0xfe
IBM939 x-IBM939 Cp939 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
IBM942 x-IBM942 Cp942 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
IBM943 x-IBM943 Cp943 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
IBM948 x-IBM948 Cp948 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfc
IBM949 x-IBM949 Cp949 basic sun.nio.cs.ext false 0x8f 0xfe 0xa1 0xfe
IBM950 x-IBM950 Cp950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
IBM970 x-IBM970 Cp970 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
此差异已折叠。
......@@ -36,7 +36,7 @@ import java.util.*;
public class CharsetMapping {
public final static char UNMAPPABLE_DECODING = '\uFFFD';
public final static int UNMAPPABLE_ENCODING = -1;
public final static int UNMAPPABLE_ENCODING = 0xFFFD;
public static class Entry {
public int bs; //byte sequence reps
......
/*
* 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.
*
* 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 build.tools.charsetmapping;
import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Formatter;
import java.util.regex.*;
import java.nio.charset.*;
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++#.*)?");
public static void genDBCS(String args[]) throws Exception {
Scanner s = new Scanner(new File(args[0], args[2]));
while (s.hasNextLine()) {
String line = s.nextLine();
if (line.startsWith("#") || line.length() == 0)
continue;
String[] fields = line.split("\\s+");
if (fields.length < 10) {
System.err.println("Misconfiged sbcs line <" + line + ">?");
continue;
}
String clzName = fields[0];
String csName = fields[1];
String hisName = ("null".equals(fields[2]))?null:fields[2];
String type = fields[3].toUpperCase();
if ("BASIC".equals(type))
type = "";
else
type = "_" + type;
String pkgName = fields[4];
boolean isASCII = Boolean.valueOf(fields[5]);
int b1Min = toInteger(fields[6]);
int b1Max = toInteger(fields[7]);
int b2Min = toInteger(fields[8]);
int b2Max = toInteger(fields[9]);
System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
genClass(args[0], args[1], "DoubleByte-X.java",
clzName, csName, hisName, pkgName,
isASCII, type,
b1Min, b1Max, b2Min, b2Max);
}
}
private static int toInteger(String s) {
if (s.startsWith("0x") || s.startsWith("0X"))
return Integer.valueOf(s.substring(2), 16);
else
return Integer.valueOf(s);
}
private static void outString(Formatter out,
char[] cc, int off, int end,
String closure)
{
while (off < end) {
out.format(" \"");
for (int j = 0; j < 8; j++) {
if (off == end)
break;
char c = cc[off++];
switch (c) {
case '\b':
out.format("\\b"); break;
case '\t':
out.format("\\t"); break;
case '\n':
out.format("\\n"); break;
case '\f':
out.format("\\f"); break;
case '\r':
out.format("\\r"); break;
case '\"':
out.format("\\\""); break;
case '\'':
out.format("\\'"); break;
case '\\':
out.format("\\\\"); break;
default:
out.format("\\u%04X", c & 0xffff);
}
}
if (off == end)
out.format("\" %s%n", closure);
else
out.format("\" + %n");
}
}
private static void outString(Formatter out,
char[] db,
int b1,
int b2Min, int b2Max,
String closure)
{
char[] cc = new char[b2Max - b2Min + 1];
int off = 0;
for (int b2 = b2Min; b2 <= b2Max; b2++) {
cc[off++] = db[(b1 << 8) | b2];
}
outString(out, cc, 0, cc.length, closure);
}
private static void genClass(String srcDir, String dstDir, String template,
String clzName,
String csName,
String hisName,
String pkgName,
boolean isASCII,
String type,
int b1Min, int b1Max,
int b2Min, int b2Max)
throws Exception
{
StringBuilder b2cSB = new StringBuilder();
StringBuilder b2cNRSB = new StringBuilder();
StringBuilder c2bNRSB = new StringBuilder();
char[] db = new char[0x10000];
char[] c2bIndex = new char[0x100];
int c2bOff = 0x100; // first 0x100 for unmappable segs
Arrays.fill(db, UNMAPPABLE_DECODING);
Arrays.fill(c2bIndex, UNMAPPABLE_DECODING);
char[] b2cIndex = new char[0x100];
Arrays.fill(b2cIndex, UNMAPPABLE_DECODING);
// (1)read in .map to parse all b->c entries
FileInputStream in = new FileInputStream(new File(srcDir, clzName + ".map"));
Parser p = new Parser(in, mPattern);
Entry e = null;
while ((e = p.next()) != null) {
db[e.bs] = (char)e.cp;
if (e.bs > 0x100 && // db
b2cIndex[e.bs>>8] == UNMAPPABLE_DECODING) {
b2cIndex[e.bs>>8] = 1;
}
if (c2bIndex[e.cp>>8] == UNMAPPABLE_DECODING) {
c2bOff += 0x100;
c2bIndex[e.cp>>8] = 1;
}
}
Formatter fm = new Formatter(b2cSB);
fm.format("%n static final String b2cSBStr =%n");
outString(fm, db, 0x00, 0x100, ";");
fm.format("%n static final String[] b2cStr = {%n");
for (int i = 0; i < 0x100; i++) {
if (b2cIndex[i] == UNMAPPABLE_DECODING) {
fm.format(" null,%n"); //unmappable segments
} else {
outString(fm, db, i, b2Min, b2Max, ",");
}
}
fm.format(" };%n");
fm.close();
// (2)now parse the .nr file which includes "b->c" non-roundtrip entries
File f = new File(srcDir, clzName + ".nr");
if (f.exists()) {
StringBuilder sb = new StringBuilder();
in = new FileInputStream(f);
p = new Parser(in, mPattern);
e = null;
while ((e = p.next()) != null) {
// A <b,c> pair
sb.append((char)e.bs);
sb.append((char)e.cp);
}
char[] nr = sb.toString().toCharArray();
fm = new Formatter(b2cNRSB);
fm.format("String b2cNR =%n");
outString(fm, nr, 0, nr.length, ";");
fm.close();
} else {
b2cNRSB.append("String b2cNR = null;");
}
// (3)finally the .c2b file which includes c->b non-roundtrip entries
f = new File(srcDir, clzName + ".c2b");
if (f.exists()) {
StringBuilder sb = new StringBuilder();
in = new FileInputStream(f);
p = new Parser(in, mPattern);
e = null;
while ((e = p.next()) != null) {
// A <b,c> pair
if (c2bIndex[e.cp>>8] == UNMAPPABLE_DECODING) {
c2bOff += 0x100;
c2bIndex[e.cp>>8] = 1;
}
sb.append((char)e.bs);
sb.append((char)e.cp);
}
char[] nr = sb.toString().toCharArray();
fm = new Formatter(c2bNRSB);
fm.format("String c2bNR =%n");
outString(fm, nr, 0, nr.length, ";");
fm.close();
} else {
c2bNRSB.append("String c2bNR = null;");
}
// (4)it's time to generate the source file
String b2c = b2cSB.toString();
String b2cNR = b2cNRSB.toString();
String c2bNR = c2bNRSB.toString();
Scanner s = new Scanner(new File(srcDir, template));
PrintStream out = new PrintStream(new FileOutputStream(
new File(dstDir, clzName + ".java")));
if (hisName == null)
hisName = "";
while (s.hasNextLine()) {
String line = s.nextLine();
if (line.indexOf("$") == -1) {
out.println(line);
continue;
}
line = line.replace("$PACKAGE$" , pkgName)
.replace("$IMPLEMENTS$", (hisName == null)?
"" : "implements HistoricallyNamedCharset")
.replace("$NAME_CLZ$", clzName)
.replace("$NAME_ALIASES$",
"sun.nio.cs".equals(pkgName) ?
"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("$HISTORICALNAME$",
(hisName == null)? "" :
" public String historicalName() { return \"" + hisName + "\"; }")
.replace("$DECTYPE$", type)
.replace("$ENCTYPE$", type)
.replace("$B1MIN$" , "0x" + Integer.toString(b1Min, 16))
.replace("$B1MAX$" , "0x" + Integer.toString(b1Max, 16))
.replace("$B2MIN$" , "0x" + Integer.toString(b2Min, 16))
.replace("$B2MAX$" , "0x" + Integer.toString(b2Max, 16))
.replace("$B2C$", b2c)
.replace("$C2BLENGTH$", "0x" + Integer.toString(c2bOff, 16))
.replace("$NONROUNDTRIP_B2C$", b2cNR)
.replace("$NONROUNDTRIP_C2B$", c2bNR);
out.println(line);
}
out.close();
}
}
/*
* 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.
*
* 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 build.tools.charsetmapping;
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Formatter;
import java.util.regex.*;
import java.nio.charset.*;
import static build.tools.charsetmapping.CharsetMapping.*;
public class GenerateEUC_TW {
public static void genEUC_TW(String args[]) throws Exception {
genClass(new FileInputStream(new File(args[0], "euc_tw.map")),
new PrintStream(new File(args[1], "EUC_TWMapping.java"), "ISO-8859-1"),
getCopyright(new File(args[3])));
}
private static String getCopyright(File f) throws IOException {
Scanner s = new Scanner(f, "ISO-8859-1");
StringBuilder sb = new StringBuilder();
while (s.hasNextLine()) {
String ln = s.nextLine();
sb.append(ln + "\n");
// assume we have the copyright as the first comment
if (ln.matches("^\\s\\*\\/$"))
break;
}
s.close();
return sb.toString();
}
private static char[] toCharArray(int[] db,
int b1Min, int b1Max,
int b2Min, int b2Max)
{
char[] ca = new char[(b1Max - b1Min + 1) * (b2Max - b2Min + 1)];
int off = 0;
for (int b1 = b1Min; b1 <= b1Max; b1++) {
for (int b2 = b2Min; b2 <= b2Max; b2++) {
ca[off++] = (char)(db[b1 * 256 + b2] & 0xffff);
}
}
return ca;
}
private static void toChar(Formatter out, String fmt, char c) {
switch (c) {
case '\b':
out.format("\\b"); break;
case '\t':
out.format("\\t"); break;
case '\n':
out.format("\\n"); break;
case '\f':
out.format("\\f"); break;
case '\r':
out.format("\\r"); break;
case '\"':
out.format("\\\""); break;
case '\'':
out.format("\\'"); break;
case '\\':
out.format("\\\\"); break;
default:
out.format(fmt, c & 0xffff);
}
}
private static void toString(Formatter out, char[] date, String endStr)
{
int off = 0;
int end = date.length;
while (off < end) {
out.format(" \"");
for (int j = 0; j < 8 && off < end; j++) {
toChar(out, "\\u%04X", date[off++]);
}
if (off == end)
out.format("\"%s%n", endStr);
else
out.format("\" +%n");
}
}
private static char[] toCharArray(byte[] ba,
int b1Min, int b1Max,
int b2Min, int b2Max)
{
char[] ca = new char[(b1Max - b1Min + 1) * (b2Max - b2Min + 1)];
int off = 0;
for (int b1 = b1Min; b1 <= b1Max; b1++) {
int b2 = b2Min;
while (b2 <= b2Max) {
ca[off++] = (char)(((ba[b1 * 256 + b2++] & 0xff) << 8) |
(ba[b1 * 256 + b2++] & 0xff));
}
}
return ca;
}
private static void toCharArray(Formatter out, char[] date) {
int off = 0;
int end = date.length;
while (off < end) {
out.format(" ");
for (int j = 0; j < 8 && off < end; j++) {
toChar(out, "'\\u%04X',", date[off++]);
}
out.format("%n");
}
}
private static int initC2BIndex(char[] index) {
int off = 0;
for (int i = 0; i < index.length; i++) {
if (index[i] != 0) {
index[i] = (char)off;
off += 0x100;
} else {
index[i] = CharsetMapping.UNMAPPABLE_ENCODING;
}
}
return off;
}
private static Pattern euctw = Pattern.compile("(?:8ea)?(\\p{XDigit}++)\\s++(\\p{XDigit}++)?\\s*+.*");
private static void genClass(InputStream is, PrintStream ps, String copyright)
throws Exception
{
// ranges of byte1 and byte2, something should come from a "config" file
int b1Min = 0xa1;
int b1Max = 0xfe;
int b2Min = 0xa1;
int b2Max = 0xfe;
try {
int[][] db = new int[8][0x10000]; // doublebyte
byte[] suppFlag = new byte[0x10000]; // doublebyte
char[] indexC2B = new char[256];
char[] indexC2BSupp = new char[256];
for (int i = 0; i < 8; i++)
for (int j = 0; j < 0x10000; j++)
db[i][j] = CharsetMapping.UNMAPPABLE_DECODING;
CharsetMapping.Parser p = new CharsetMapping.Parser(is, euctw);
CharsetMapping.Entry e = null;
while ((e = p.next()) != null) {
int plane = 0;
if (e.bs >= 0x10000) {
plane = ((e.bs >> 16) & 0xff) - 1;
if (plane >= 14)
plane = 7;
e.bs = e.bs & 0xffff;
}
db[plane][e.bs] = e.cp;
if (e.cp < 0x10000) {
indexC2B[e.cp>>8] = 1;
} else {
indexC2BSupp[(e.cp&0xffff)>>8] = 1;
suppFlag[e.bs] |= (1 << plane);
}
}
StringBuilder out = new StringBuilder();
Formatter fm = new Formatter(out);
fm.format(copyright);
fm.format("%n// -- This file was mechanically generated: Do not edit! -- //%n");
fm.format("package sun.nio.cs.ext;%n%n");
fm.format("class EUC_TWMapping {%n%n");
// boundaries
fm.format(" final static int b1Min = 0x%x;%n", b1Min);
fm.format(" final static int b1Max = 0x%x;%n", b1Max);
fm.format(" final static int b2Min = 0x%x;%n", b2Min);
fm.format(" final static int b2Max = 0x%x;%n", b2Max);
// b2c tables
fm.format("%n final static String[] b2c = {%n");
for (int plane = 0; plane < 8; plane++) {
fm.format(" // Plane %d%n", plane);
toString(fm, toCharArray(db[plane],
b1Min, b1Max, b2Min, b2Max),
",");
fm.format("%n");
}
fm.format(" };%n");
// c2bIndex
fm.format("%n static final int C2BSIZE = 0x%x;%n",
initC2BIndex(indexC2B));
fm.format("%n static char[] c2bIndex = new char[] {%n");
toCharArray(fm, indexC2B);
fm.format(" };%n");
// c2bIndexSupp
fm.format("%n static final int C2BSUPPSIZE = 0x%x;%n",
initC2BIndex(indexC2BSupp));
fm.format("%n static char[] c2bSuppIndex = new char[] {%n");
toCharArray(fm, indexC2BSupp);
fm.format(" };%n");
// suppFlags
fm.format("%n static String b2cIsSuppStr =%n");
toString(fm, toCharArray(suppFlag,
b1Min, b1Max, b2Min, b2Max),
";");
fm.format("}");
fm.close();
ps.println(out.toString());
ps.close();
} catch (Exception x) {
x.printStackTrace();
}
}
}
......@@ -27,15 +27,11 @@ package build.tools.charsetmapping;
import java.io.*;
import java.util.regex.*;
import build.tools.charsetmapping.GenerateSBCS;
import static build.tools.charsetmapping.CharsetMapping.*;
public class GenerateMapping {
public static void main(String argv[]) throws IOException {
if (argv.length < 2) {
System.out.println("Usage: java GenerateMapping fMap fDat");
System.exit(1);
}
public static void genMapping(String argv[]) throws IOException {
genDataJIS0213(new FileInputStream(argv[0]),
new FileOutputStream(argv[1]));
}
......
......@@ -34,11 +34,8 @@ import java.nio.charset.*;
import static build.tools.charsetmapping.CharsetMapping.*;
public class GenerateSBCS {
public static void main(String args[]) throws Exception {
if (args.length < 3) {
System.err.println("Usage: java GenSBCS srcDir dstDir config");
System.exit(1);
}
public static void genSBCS(String args[]) throws Exception {
Scanner s = new Scanner(new File(args[0], args[2]));
while (s.hasNextLine()) {
......
/*
* 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.
*
* 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 build.tools.charsetmapping;
import java.io.*;
import java.util.Scanner;
public class Main {
public static void main(String args[]) throws Exception {
if (args.length < 3 ) {
System.out.println("Usage: java -jar charsetmapping.jar src dst mType...");
System.exit(1);
}
if ("sbcs".equals(args[2]) || "extsbcs".equals(args[2])) {
GenerateSBCS.genSBCS(args);
} else if ("dbcs".equals(args[2])) {
GenerateDBCS.genDBCS(args);
} else if ("euctw".equals(args[2])) {
if (args.length != 4) {
System.out.println("Usage: java -jar charsetmapping.jar srcDir dstDir euctw copyrightSrc");
System.exit(1);
}
GenerateEUC_TW.genEUC_TW(args);
} else if ("sjis0213".equals(args[2])) {
GenerateMapping.genMapping(args);
}
}
}
/*
* Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-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
......@@ -148,8 +148,12 @@ public class TextCallbackHandler implements CallbackHandler {
/* Reads a line of input */
private String readLine() throws IOException {
return new BufferedReader
String result = new BufferedReader
(new InputStreamReader(System.in)).readLine();
if (result == null) {
throw new IOException("Cannot read from System.in");
}
return result;
}
private void doConfirmation(ConfirmationCallback confirmation)
......
/*
* Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-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
......@@ -1516,11 +1516,6 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
// ---------------- DES and 3 DES key manipulation routines
/* Mask used to check for parity adjustment */
private static final byte[] PARITY_BIT_MASK = {
(byte)0x80, (byte)0x40, (byte)0x20, (byte)0x10,
(byte)0x08, (byte)0x04, (byte)0x02
};
private static final BigInteger MASK = new BigInteger("7f", 16);
/**
......@@ -1529,21 +1524,9 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
*/
private static void setParityBit(byte[] key) {
for (int i = 0; i < key.length; i++) {
int bitCount = 0;
for (int maskIndex = 0;
maskIndex < PARITY_BIT_MASK.length; maskIndex++) {
if ((key[i] & PARITY_BIT_MASK[maskIndex])
== PARITY_BIT_MASK[maskIndex]) {
bitCount++;
}
}
if ((bitCount & 0x01) == 1) {
// Odd number of 1 bits in the top 7 bits. Set parity bit to 0
key[i] = (byte)(key[i] & (byte)0xfe);
} else {
// Even number of 1 bits in the top 7 bits. Set parity bit to 1
key[i] = (byte)(key[i] | 1);
}
int b = key[i] & 0xfe;
b |= (Integer.bitCount(b) & 1) ^ 1;
key[i] = (byte) b;
}
}
......
......@@ -1174,6 +1174,12 @@ public final class System {
public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
Shutdown.add(slot, registerShutdownInProgress, hook);
}
public int getStackTraceDepth(Throwable t) {
return t.getStackTraceDepth();
}
public StackTraceElement getStackTraceElement(Throwable t, int i) {
return t.getStackTraceElement(i);
}
});
}
......
......@@ -645,17 +645,21 @@ public class Throwable implements Serializable {
/**
* Returns the number of elements in the stack trace (or 0 if the stack
* trace is unavailable).
*
* package-protection for use by SharedSecrets.
*/
private native int getStackTraceDepth();
native int getStackTraceDepth();
/**
* Returns the specified element of the stack trace.
*
* package-protection for use by SharedSecrets.
*
* @param index index of the element to return.
* @throws IndexOutOfBoundsException if <tt>index &lt; 0 ||
* index &gt;= getStackTraceDepth() </tt>
*/
private native StackTraceElement getStackTraceElement(int index);
native StackTraceElement getStackTraceElement(int index);
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws IOException
......
......@@ -110,13 +110,11 @@ class BitSieve {
int convertedStep = (step *2) + 1;
// Construct the large sieve at an even offset specified by base
MutableBigInteger r = new MutableBigInteger();
MutableBigInteger b = new MutableBigInteger(base);
MutableBigInteger q = new MutableBigInteger();
do {
// Calculate base mod convertedStep
r.copyValue(base.mag);
r.divideOneWord(convertedStep, q);
start = r.value[r.offset];
start = b.divideOneWord(convertedStep, q);
// Take each multiple of step out of sieve
start = convertedStep - start;
......
......@@ -126,19 +126,6 @@ public final class MathContext implements Serializable {
*/
final RoundingMode roundingMode;
/**
* Lookaside for the rounding points (the numbers which determine
* whether the coefficient of a number will require rounding).
* These will be present if {@code precision > 0} and
* {@code precision <= MAX_LOOKASIDE}. In this case they will share the
* {@code BigInteger int[]} array. Note that the transients
* cannot be {@code final} because they are reconstructed on
* deserialization.
*/
transient BigInteger roundingMax = null;
transient BigInteger roundingMin = null;
private static final int MAX_LOOKASIDE = 1000;
/* ----- Constructors ----- */
/**
......@@ -173,11 +160,6 @@ public final class MathContext implements Serializable {
throw new NullPointerException("null RoundingMode");
precision = setPrecision;
if (precision > 0 && precision <= MAX_LOOKASIDE) {
roundingMax = BigInteger.TEN.pow(precision);
roundingMin = roundingMax.negate();
}
roundingMode = setRoundingMode;
return;
}
......@@ -221,10 +203,6 @@ public final class MathContext implements Serializable {
throw new IllegalArgumentException("Digits < 0");
// the other parameters cannot be invalid if we got here
precision = setPrecision;
if (precision > 0 && precision <= MAX_LOOKASIDE) {
roundingMax = BigInteger.TEN.pow(precision);
roundingMin = roundingMax.negate();
}
}
/**
......@@ -343,11 +321,6 @@ public final class MathContext implements Serializable {
String message = "MathContext: null roundingMode in stream";
throw new java.io.StreamCorruptedException(message);
}
// Set the lookaside, if applicable
if (precision <= MAX_LOOKASIDE) {
roundingMax = BigInteger.TEN.pow(precision);
roundingMin = roundingMax.negate();
}
}
}
......@@ -129,9 +129,7 @@ class SignedMutableBigInteger extends MutableBigInteger {
* array starting at offset.
*/
public String toString() {
BigInteger b = new BigInteger(this, sign);
return
b.toString();
return this.toBigInteger(sign).toString();
}
}
......@@ -286,6 +286,14 @@ public class CookieManager extends CookieHandler
}
cookie.setPath(path);
}
// As per RFC 2965, section 3.3.1:
// Domain Defaults to the effective request-host. (Note that because
// there is no dot at the beginning of effective request-host,
// the default Domain can only domain-match itself.)
if (cookie.getDomain() == null) {
cookie.setDomain(uri.getHost());
}
String ports = cookie.getPortlist();
if (ports != null) {
int port = uri.getPort();
......
......@@ -1237,7 +1237,6 @@ public abstract class URLConnection {
}
private static Hashtable handlers = new Hashtable();
private static final ContentHandler UnknownContentHandlerP = new UnknownContentHandler();
/**
* Gets the Content Handler appropriate for this connection.
......@@ -1264,7 +1263,7 @@ public abstract class URLConnection {
handler = lookupContentHandlerClassFor(contentType);
} catch(Exception e) {
e.printStackTrace();
handler = UnknownContentHandlerP;
handler = UnknownContentHandler.INSTANCE;
}
handlers.put(contentType, handler);
}
......@@ -1335,7 +1334,7 @@ public abstract class URLConnection {
}
}
return UnknownContentHandlerP;
return UnknownContentHandler.INSTANCE;
}
/**
......@@ -1761,6 +1760,8 @@ public abstract class URLConnection {
class UnknownContentHandler extends ContentHandler {
static final ContentHandler INSTANCE = new UnknownContentHandler();
public Object getContent(URLConnection uc) throws IOException {
return uc.getInputStream();
}
......
......@@ -29,6 +29,9 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.io.*;
import sun.misc.JavaLangAccess;
import sun.misc.SharedSecrets;
/**
* LogRecord objects are used to pass logging requests between
* the logging framework and individual log Handlers.
......@@ -522,29 +525,31 @@ public class LogRecord implements java.io.Serializable {
// Private method to infer the caller's class and method names
private void inferCaller() {
needToInferCaller = false;
// Get the stack trace.
StackTraceElement stack[] = (new Throwable()).getStackTrace();
// First, search back to a method in the Logger class.
int ix = 0;
while (ix < stack.length) {
StackTraceElement frame = stack[ix];
JavaLangAccess access = SharedSecrets.getJavaLangAccess();
Throwable throwable = new Throwable();
int depth = access.getStackTraceDepth(throwable);
String logClassName = "java.util.logging.Logger";
boolean lookingForLogger = true;
for (int ix = 0; ix < depth; ix++) {
// Calling getStackTraceElement directly prevents the VM
// from paying the cost of building the entire stack frame.
StackTraceElement frame =
access.getStackTraceElement(throwable, ix);
String cname = frame.getClassName();
if (cname.equals("java.util.logging.Logger")) {
break;
}
ix++;
}
// Now search for the first frame before the "Logger" class.
while (ix < stack.length) {
StackTraceElement frame = stack[ix];
String cname = frame.getClassName();
if (!cname.equals("java.util.logging.Logger")) {
// We've found the relevant frame.
setSourceClassName(cname);
setSourceMethodName(frame.getMethodName());
return;
if (lookingForLogger) {
// Skip all frames until we have found the first logger frame.
if (cname.equals(logClassName)) {
lookingForLogger = false;
}
} else {
if (!cname.equals(logClassName)) {
// We've found the relevant frame.
setSourceClassName(cname);
setSourceMethodName(frame.getMethodName());
return;
}
}
ix++;
}
// We haven't found a suitable frame, so just punt. This is
// OK as we are only committed to making a "best effort" here.
......
......@@ -49,6 +49,7 @@ package java.util.zip;
* compresser.setInput(input);
* compresser.finish();
* int compressedDataLength = compresser.deflate(output);
* compresser.end();
*
* // Decompress the bytes
* Inflater decompresser = new Inflater();
......
......@@ -32,6 +32,8 @@ import java.io.File;
import java.nio.charset.Charset;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Set;
import java.util.HashSet;
import java.util.NoSuchElementException;
import static java.util.zip.ZipConstants64.*;
......@@ -277,6 +279,9 @@ class ZipFile implements ZipConstants {
// freeEntry releases the C jzentry struct.
private static native void freeEntry(long jzfile, long jzentry);
// the outstanding inputstreams that need to be closed.
private Set<ZipFileInputStream> streams = new HashSet<ZipFileInputStream>();
/**
* Returns an input stream for reading the contents of the specified
* zip file entry.
......@@ -308,6 +313,7 @@ class ZipFile implements ZipConstants {
return null;
}
in = new ZipFileInputStream(jzentry);
streams.add(in);
}
final ZipFileInputStream zfin = in;
switch (getEntryMethod(jzentry)) {
......@@ -323,7 +329,7 @@ class ZipFile implements ZipConstants {
public void close() throws IOException {
if (!isClosed) {
releaseInflater(inf);
releaseInflater(inf);
this.in.close();
isClosed = true;
}
......@@ -497,6 +503,13 @@ class ZipFile implements ZipConstants {
synchronized (this) {
closeRequested = true;
if (streams.size() !=0) {
Set<ZipFileInputStream> copy = streams;
streams = new HashSet<ZipFileInputStream>();
for (ZipFileInputStream is: copy)
is.close();
}
if (jzfile != 0) {
// Close the zip file
long zf = this.jzfile;
......@@ -631,9 +644,9 @@ class ZipFile implements ZipConstants {
freeEntry(ZipFile.this.jzfile, jzentry);
jzentry = 0;
}
streams.remove(this);
}
}
}
......
/*
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1998-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
......@@ -234,56 +234,58 @@ public abstract class Configuration {
*
* @see #setConfiguration
*/
public static synchronized Configuration getConfiguration() {
public static Configuration getConfiguration() {
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPermission(new AuthPermission("getLoginConfiguration"));
if (configuration == null) {
String config_class = null;
config_class = AccessController.doPrivileged
(new PrivilegedAction<String>() {
public String run() {
return java.security.Security.getProperty
("login.configuration.provider");
synchronized (Configuration.class) {
if (configuration == null) {
String config_class = null;
config_class = AccessController.doPrivileged
(new PrivilegedAction<String>() {
public String run() {
return java.security.Security.getProperty
("login.configuration.provider");
}
});
if (config_class == null) {
config_class = "com.sun.security.auth.login.ConfigFile";
}
});
if (config_class == null) {
config_class = "com.sun.security.auth.login.ConfigFile";
}
try {
final String finalClass = config_class;
configuration = AccessController.doPrivileged
(new PrivilegedExceptionAction<Configuration>() {
public Configuration run() throws ClassNotFoundException,
InstantiationException,
IllegalAccessException {
return (Configuration)Class.forName
(finalClass,
true,
contextClassLoader).newInstance();
try {
final String finalClass = config_class;
configuration = AccessController.doPrivileged
(new PrivilegedExceptionAction<Configuration>() {
public Configuration run() throws ClassNotFoundException,
InstantiationException,
IllegalAccessException {
return (Configuration)Class.forName
(finalClass,
true,
contextClassLoader).newInstance();
}
});
} catch (PrivilegedActionException e) {
Exception ee = e.getException();
if (ee instanceof InstantiationException) {
throw (SecurityException) new
SecurityException
("Configuration error:" +
ee.getCause().getMessage() +
"\n").initCause(ee.getCause());
} else {
throw (SecurityException) new
SecurityException
("Configuration error: " +
ee.toString() +
"\n").initCause(ee);
}
});
} catch (PrivilegedActionException e) {
Exception ee = e.getException();
if (ee instanceof InstantiationException) {
throw (SecurityException) new
SecurityException
("Configuration error:" +
ee.getCause().getMessage() +
"\n").initCause(ee.getCause());
} else {
throw (SecurityException) new
SecurityException
("Configuration error: " +
ee.toString() +
"\n").initCause(ee);
}
}
return configuration;
}
return configuration;
}
/**
......
......@@ -24,70 +24,16 @@
*/
package sun.io;
import sun.nio.cs.ext.IBM1381;
import sun.nio.cs.ext.*;
/**
* Tables and data to convert Cp1381 to Unicode.
*
* @author Malcolm Ayres, assisted by UniMap program
*/
public class ByteToCharCp1381
extends ByteToCharDBCS_ASCII
public class ByteToCharCp1381 extends ByteToCharDBCS_ASCII {
{
// Return the character set id
public String getCharacterEncoding() {
return "Cp1381";
}
private final static IBM1381 nioCoder = new IBM1381();
// Return the character set id
public String getCharacterEncoding()
{
return "Cp1381";
}
private static final boolean leadByte[] = {
false, false, false, false, false, false, false, false, // 00 - 07
false, false, false, false, false, false, false, false, // 08 - 0F
false, false, false, false, false, false, false, false, // 10 - 17
false, false, false, false, false, false, false, false, // 18 - 1F
false, false, false, false, false, false, false, false, // 20 - 27
false, false, false, false, false, false, false, false, // 28 - 2F
false, false, false, false, false, false, false, false, // 30 - 37
false, false, false, false, false, false, false, false, // 38 - 3F
false, false, false, false, false, false, false, false, // 40 - 47
false, false, false, false, false, false, false, false, // 48 - 4F
false, false, false, false, false, false, false, false, // 50 - 57
false, false, false, false, false, false, false, false, // 58 - 5F
false, false, false, false, false, false, false, false, // 60 - 67
false, false, false, false, false, false, false, false, // 68 - 6F
false, false, false, false, false, false, false, false, // 70 - 77
false, false, false, false, false, false, false, false, // 78 - 7F
false, false, false, false, false, false, false, false, // 80 - 87
false, false, false, false, true, true, true, true, // 88 - 8F
true, true, true, true, true, true, true, true, // 90 - 97
true, true, true, true, true, true, true, true, // 98 - 9F
true, true, true, true, true, true, true, true, // A0 - A7
true, true, false, false, false, false, false, false, // A8 - AF
true, true, true, true, true, true, true, true, // B0 - B7
true, true, true, true, true, true, true, true, // B8 - BF
true, true, true, true, true, true, true, true, // C0 - C7
true, true, true, true, true, true, true, true, // C8 - CF
true, true, true, true, true, true, true, true, // D0 - D7
true, true, true, true, true, true, true, true, // D8 - DF
true, true, true, true, true, true, true, true, // E0 - E7
true, true, true, true, true, true, true, true, // E8 - EF
true, true, true, true, true, true, true, true, // F0 - F7
false, false, false, false, false, false, false, false, // F8 - FF
};
public ByteToCharCp1381() {
super();
super.mask1 = 0xFFE0;
super.mask2 = 0x001F;
super.shift = 5;
super.leadByte = this.leadByte;
super.singleByteToChar = nioCoder.getDecoderSingleByteMappings();
super.index1 = nioCoder.getDecoderIndex1();
super.index2 = nioCoder.getDecoderIndex2();
}
public ByteToCharCp1381() {
super((DoubleByte.Decoder)new IBM1381().newDecoder());
}
}
......@@ -24,31 +24,16 @@
*/
package sun.io;
import sun.nio.cs.ext.IBM1383;
import sun.nio.cs.ext.*;
/**
* A table to convert Cp1383 to Unicode
*
* @author Malcolm Ayres, assisted by UniMap program
*/
public class ByteToCharCp1383
extends ByteToCharEUC
public class ByteToCharCp1383 extends ByteToCharEUC2 {
{
// Return the character set id
public String getCharacterEncoding() {
return "Cp1383";
}
private final static IBM1383 nioCoder = new IBM1383();
// Return the character set id
public String getCharacterEncoding()
{
return "Cp1383";
}
public ByteToCharCp1383()
{
// Set the correct mapping table
super();
super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
super.mappingTableG1 = nioCoder.getDecoderMappingTableG1();
}
public ByteToCharCp1383() {
super((DoubleByte.Decoder)new IBM1383().newDecoder());
}
}
......@@ -24,32 +24,16 @@
*/
package sun.io;
import sun.nio.cs.ext.IBM930;
import sun.nio.cs.ext.*;
/**
* Tables and data to convert Cp930 to Unicode.
*
* @author Malcolm Ayres, assisted by UniMap program
*/
public class ByteToCharCp930
extends ByteToCharDBCS_EBCDIC
public class ByteToCharCp930 extends ByteToCharDBCS_EBCDIC {
{
private static IBM930 nioCoder = new IBM930();
// Return the character set id
// Return the character set id
public String getCharacterEncoding() {
return "Cp930";
}
public String getCharacterEncoding()
{
return "Cp930";
}
public ByteToCharCp930() {
super();
super.mask1 = 0xFFC0;
super.mask2 = 0x003F;
super.shift = 6;
super.singleByteToChar = nioCoder.getDecoderSingleByteMappings();
super.index1 = nioCoder.getDecoderIndex1();
super.index2 = nioCoder.getDecoderIndex2();
}
public ByteToCharCp930() {
super((DoubleByte.Decoder)new IBM930().newDecoder());
}
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册