diff --git a/make/docs/Makefile b/make/docs/Makefile index 567f796bbcedb87c628ad6b0b5831c5934123a58..9a5a1aa29b7579ff5618c7885d65fcebeafa0c56 100644 --- a/make/docs/Makefile +++ b/make/docs/Makefile @@ -51,6 +51,7 @@ DEV_DOCS_URL-5 = http://java.sun.com/j2se/1.5.0/docs/index.html DEV_DOCS_URL-6 = http://download.oracle.com/javase/6/docs/index.html DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION)) +DOCS_BASE_URL = http://download.oracle.com/javase/7/docs # Url to Java Language Spec #JLS3_URL = http://java.sun.com/docs/books/jls/ @@ -205,7 +206,13 @@ COMMON_JAVADOCFLAGS = \ -use \ -keywords \ $(ADDITIONAL_JAVADOCFLAGS) -ADDITIONAL_JAVADOCFLAGS = + +ifdef OPENJDK + ADDITIONAL_JAVADOCFLAGS = \ + -Xdocrootparent $(DOCS_BASE_URL) +else + ADDITIONAL_JAVADOCFLAGS = +endif # Draft used for non-fcs documents JDK_IS_FCS = false @@ -1142,56 +1149,6 @@ $(SCTPAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SCTPAP $(prep-target) $(call PackageFilter,$(SCTPAPI_PKGS)) -############################################################# -# -# tracingdocs -# - -ALL_OTHER_TARGETS += tracingdocs - -TRACING_DOCDIR := $(JRE_API_DOCSDIR)/tracing -TRACING2COREAPI := ../$(JDKJRE2COREAPI) -TRACING_DOCTITLE := Java$(TRADEMARK) Platform Tracing -TRACING_WINDOWTITLE := Platform Tracing -TRACING_HEADER := Platform Tracing -TRACING_BOTTOM := $(call CommonBottom,$(TRACING_FIRST_COPYRIGHT_YEAR)) -# TRACING_PKGS is located in NON_CORE_PKGS.gmk - -TRACING_INDEX_HTML = $(TRACING_DOCDIR)/index.html -TRACING_OPTIONS_FILE = $(DOCSTMPDIR)/tracing.options -TRACING_PACKAGES_FILE = $(DOCSTMPDIR)/tracing.packages - -tracingdocs: $(TRACING_INDEX_HTML) - -# Set relative location to core api document root -$(TRACING_INDEX_HTML): GET2DOCSDIR=$(TRACING2COREAPI)/.. - -# Run javadoc if the index file is out of date or missing -$(TRACING_INDEX_HTML): $(TRACING_OPTIONS_FILE) $(TRACING_PACKAGES_FILE) - $(prep-javadoc) - $(call JavadocSummary,$(TRACING_OPTIONS_FILE),$(TRACING_PACKAGES_FILE)) - $(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \ - @$(TRACING_OPTIONS_FILE) @$(TRACING_PACKAGES_FILE) - -# Create file with javadoc options in it -$(TRACING_OPTIONS_FILE): - $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-doctitle,$(TRACING_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(TRACING_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(TRACING_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(TRACING_BOTTOM)$(DRAFT_BOTTOM)) ; \ - $(call OptionTrip,-linkoffline,$(TRACING2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ - -# Create a file with the package names in it -$(TRACING_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TRACING_PKGS)) - $(prep-target) - $(call PackageFilter,$(TRACING_PKGS)) - ############################################################# # # Get a cache of all the directories diff --git a/make/docs/NON_CORE_PKGS.gmk b/make/docs/NON_CORE_PKGS.gmk index 25c79408bdb9a6c1893c0138eebf6f5d8df9ac3b..e8eda9dfd927b9d96eed4fe88971ead26fdfe77c 100644 --- a/make/docs/NON_CORE_PKGS.gmk +++ b/make/docs/NON_CORE_PKGS.gmk @@ -88,9 +88,6 @@ SMARTCARDIO_PKGS = javax.smartcardio SCTPAPI_PKGS = com.sun.nio.sctp -TRACING_PKGS = com.sun.tracing \ - com.sun.tracing.dtrace - # non-core packages in rt.jar NON_CORE_PKGS = $(DOMAPI_PKGS) \ $(MGMT_PKGS) \ @@ -100,6 +97,5 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \ $(OLD_JSSE_PKGS) \ $(HTTPSERVER_PKGS) \ $(SMARTCARDIO_PKGS) \ - $(TRACING_PKGS) \ $(SCTPAPI_PKGS) diff --git a/make/java/java/FILES_java.gmk b/make/java/java/FILES_java.gmk index b5449106cd7855131df288ba8bbde39fa0576f8f..58c763a3fe5b394e92d887bd15ad9ffb5b877e13 100644 --- a/make/java/java/FILES_java.gmk +++ b/make/java/java/FILES_java.gmk @@ -356,6 +356,7 @@ JAVA_JAVA_java = \ java/util/regex/Matcher.java \ java/util/regex/MatchResult.java \ java/util/regex/ASCII.java \ + java/util/regex/UnicodeProp.java \ java/util/regex/PatternSyntaxException.java \ java/util/prefs/Preferences.java \ java/util/prefs/AbstractPreferences.java \ diff --git a/make/java/java/Makefile b/make/java/java/Makefile index a51082614d309561949abd04b35f01860f2fe9c5..787d881b6ee05a52d2c59d7d559c39942da51c1f 100644 --- a/make/java/java/Makefile +++ b/make/java/java/Makefile @@ -345,30 +345,35 @@ $(GENSRCDIR)/java/lang/CharacterDataLatin1.java \ -template $(CHARACTERDATA)/CharacterDataLatin1.java.template \ -spec $(UNICODEDATA)/UnicodeData.txt \ -specialcasing $(UNICODEDATA)/SpecialCasing.txt \ + -proplist $(UNICODEDATA)/PropList.txt \ -o $(GENSRCDIR)/java/lang/CharacterDataLatin1.java -string \ -usecharforbyte -latin1 8 $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 0 \ -template $(CHARACTERDATA)/CharacterData00.java.template \ -spec $(UNICODEDATA)/UnicodeData.txt \ -specialcasing $(UNICODEDATA)/SpecialCasing.txt \ + -proplist $(UNICODEDATA)/PropList.txt \ -o $(GENSRCDIR)/java/lang/CharacterData00.java -string \ -usecharforbyte 11 4 1 $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 1 \ -template $(CHARACTERDATA)/CharacterData01.java.template \ -spec $(UNICODEDATA)/UnicodeData.txt \ -specialcasing $(UNICODEDATA)/SpecialCasing.txt \ + -proplist $(UNICODEDATA)/PropList.txt \ -o $(GENSRCDIR)/java/lang/CharacterData01.java -string \ -usecharforbyte 11 4 1 $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 2 \ -template $(CHARACTERDATA)/CharacterData02.java.template \ -spec $(UNICODEDATA)/UnicodeData.txt \ -specialcasing $(UNICODEDATA)/SpecialCasing.txt \ + -proplist $(UNICODEDATA)/PropList.txt \ -o $(GENSRCDIR)/java/lang/CharacterData02.java -string \ -usecharforbyte 11 4 1 $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 14 \ -template $(CHARACTERDATA)/CharacterData0E.java.template \ -spec $(UNICODEDATA)/UnicodeData.txt \ -specialcasing $(UNICODEDATA)/SpecialCasing.txt \ + -proplist $(UNICODEDATA)/PropList.txt \ -o $(GENSRCDIR)/java/lang/CharacterData0E.java -string \ -usecharforbyte 11 4 1 diff --git a/make/java/nio/FILES_java.gmk b/make/java/nio/FILES_java.gmk index 34b41d5db380dfab39236afc2c7da79d72ae4e89..d09a966db3802d72e9eb34c67cc06fca8a0772ec 100644 --- a/make/java/nio/FILES_java.gmk +++ b/make/java/nio/FILES_java.gmk @@ -71,6 +71,7 @@ FILES_src = \ java/nio/charset/CoderMalfunctionError.java \ java/nio/charset/CodingErrorAction.java \ java/nio/charset/MalformedInputException.java \ + java/nio/charset/StandardCharset.java \ java/nio/charset/UnmappableCharacterException.java \ \ java/nio/charset/spi/CharsetProvider.java \ diff --git a/make/java/nio/mapfile-linux b/make/java/nio/mapfile-linux index 7af5388de961e9ec8e2c668fb272581300ed050c..d72244170b9efb8832be07a51a292f7eaf00e7ad 100644 --- a/make/java/nio/mapfile-linux +++ b/make/java/nio/mapfile-linux @@ -44,7 +44,6 @@ SUNWprivate_1.1 { Java_sun_nio_ch_EPollArrayWrapper_interrupt; Java_sun_nio_ch_EPollArrayWrapper_offsetofData; Java_sun_nio_ch_EPollArrayWrapper_sizeofEPollEvent; - Java_sun_nio_ch_EPoll_init; Java_sun_nio_ch_EPoll_eventSize; Java_sun_nio_ch_EPoll_eventsOffset; Java_sun_nio_ch_EPoll_dataOffset; @@ -129,7 +128,6 @@ SUNWprivate_1.1 { Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio; Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs; Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs; - Java_sun_nio_fs_LinuxWatchService_init; Java_sun_nio_fs_LinuxWatchService_eventSize; Java_sun_nio_fs_LinuxWatchService_eventOffsets; Java_sun_nio_fs_LinuxWatchService_inotifyInit; diff --git a/make/java/security/Makefile b/make/java/security/Makefile index fa87a586468c1f4036b587f2c5a27a0b5816ccc3..d06fc91404e79dcddcaee9d60e6690d4f11680a0 100644 --- a/make/java/security/Makefile +++ b/make/java/security/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2011 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,11 +44,9 @@ PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-solaris else # PLATFORM -# Register Microsoft CryptoAPI provider only on (non-64-bit) Windows platform. +# Register Microsoft CryptoAPI provider only on Windows platform. ifeq ($(PLATFORM), windows) - ifneq ($(ARCH_DATA_MODEL), 64) - PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-windows - endif + PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-windows endif endif # PLATFORM diff --git a/make/jpda/jdwp/jdwp.spec b/make/jpda/jdwp/jdwp.spec index 86bce315226d5b41663250b592f990999c0c1b62..3f28a918ef4c2dc2f3acb537345d49e0155d293b 100644 --- a/make/jpda/jdwp/jdwp.spec +++ b/make/jpda/jdwp/jdwp.spec @@ -2190,7 +2190,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Out (byte eventKind "Event kind to request. " "See JDWP.EventKind " - "for a complete list of events that can be requested. " + "for a complete list of events that can be requested; " + "some events may require a capability in order to be requested. " ) (byte suspendPolicy "What threads are suspended when this event occurs? " @@ -2732,6 +2733,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Alt MonitorContendedEnter=JDWP.EventKind.MONITOR_CONTENDED_ENTER "Notification that a thread in the target VM is attempting " "to enter a monitor that is already acquired by another thread. " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " "

Since JDWP version 1.6. " (int requestID @@ -2743,6 +2746,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Alt MonitorContendedEntered=JDWP.EventKind.MONITOR_CONTENDED_ENTERED "Notification of a thread in the target VM is entering a monitor " "after waiting for it to be released by another thread. " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " "

Since JDWP version 1.6. " (int requestID @@ -2753,6 +2758,8 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Alt MonitorWait=JDWP.EventKind.MONITOR_WAIT "Notification of a thread about to wait on a monitor object. " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " "

Since JDWP version 1.6. " (int requestID @@ -2764,6 +2771,8 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Alt MonitorWaited=JDWP.EventKind.MONITOR_WAITED "Notification that a thread in the target VM has finished waiting on " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " "a monitor object. " "

Since JDWP version 1.6. " @@ -3050,9 +3059,9 @@ JDWP "Java(tm) Debug Wire Protocol" (Constant METHOD_EXIT =41 ) (Constant METHOD_EXIT_WITH_RETURN_VALUE =42 ) (Constant MONITOR_CONTENDED_ENTER =43 ) - (Constant MONITOR_CONTENDED_ENTERED =44 ) - (Constant MONITOR_WAIT =45 ) - (Constant MONITOR_WAITED =46 ) + (Constant MONITOR_CONTENDED_ENTERED =44 ) + (Constant MONITOR_WAIT =45 ) + (Constant MONITOR_WAITED =46 ) (Constant VM_START =90 ) (Constant VM_INIT =90 "obsolete - was used in jvmdi") (Constant VM_DEATH =99 ) diff --git a/make/sun/javazic/tzdata/VERSION b/make/sun/javazic/tzdata/VERSION index c19847f5a1183da27fcd45bc6f23451a0e1bfa1f..c52096254ae06c306773c7b3c1030a2d956feeb5 100644 --- a/make/sun/javazic/tzdata/VERSION +++ b/make/sun/javazic/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2011e +tzdata2011g diff --git a/make/sun/javazic/tzdata/africa b/make/sun/javazic/tzdata/africa index bea5f8157bba583b77f67a6a0377d5da4758e3b0..a43e73ce10b129e6a202fc3eac7704a465086c47 100644 --- a/make/sun/javazic/tzdata/africa +++ b/make/sun/javazic/tzdata/africa @@ -234,7 +234,21 @@ Rule Egypt 1989 only - May 6 1:00 1:00 S Rule Egypt 1990 1994 - May 1 1:00 1:00 S # IATA (after 1990) says transitions are at 0:00. # Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29. -Rule Egypt 1995 max - Apr lastFri 0:00s 1:00 S + +# From Alexander Krivenyshev (2011-04-20): +# "...Egypt's interim cabinet decided on Wednesday to cancel daylight +# saving time after a poll posted on its website showed the majority of +# Egyptians would approve the cancellation." +# +# Egypt to cancel daylight saving time +# +# http://www.almasryalyoum.com/en/node/407168 +# +# or +# +# http://www.worldtimezone.com/dst_news/dst_news_egypt04.html +# +Rule Egypt 1995 2010 - Apr lastFri 0:00s 1:00 S Rule Egypt 1995 2005 - Sep lastThu 23:00s 0 - # From Steffen Thorsen (2006-09-19): # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports: @@ -335,7 +349,7 @@ Rule Egypt 2008 only - Aug lastThu 23:00s 0 - Rule Egypt 2009 only - Aug 20 23:00s 0 - Rule Egypt 2010 only - Aug 11 0:00 0 - Rule Egypt 2010 only - Sep 10 0:00 1:00 S -Rule Egypt 2010 max - Sep lastThu 23:00s 0 - +Rule Egypt 2010 only - Sep lastThu 23:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Cairo 2:05:00 - LMT 1900 Oct diff --git a/make/sun/javazic/tzdata/europe b/make/sun/javazic/tzdata/europe index 5b11dfb5122c8304f9974196e755e757a358391b..89bf6c5d3dc7d49481b57bd56ea4f7a15aae8ffe 100644 --- a/make/sun/javazic/tzdata/europe +++ b/make/sun/javazic/tzdata/europe @@ -168,7 +168,7 @@ # A monument to Willett was unveiled on 1927-05-21, in an open space in # a 45-acre wood near Chislehurst, Kent that was purchased by popular # subscription and open to the public. On the south face of the monolith, -# designed by G. W. Miller, is the the William Willett Memorial Sundial, +# designed by G. W. Miller, is the...William Willett Memorial Sundial, # which is permanently set to Summer Time. # From Winston Churchill (1934-04-28): @@ -1808,7 +1808,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # # All these events predate our cutoff date of 1970. Unless we can # come up with more definitive info about the timekeeping during the -# war years it's probably best just do do the following for now: +# war years it's probably best just do...the following for now: Link Europe/Oslo Arctic/Longyearbyen # Poland diff --git a/make/sun/javazic/tzdata/southamerica b/make/sun/javazic/tzdata/southamerica index 7afec35d69685225b80e55dadef20ceaaf2df7a4..7717d12d17a4f1ed8d7e63bab9abcab34fece1c2 100644 --- a/make/sun/javazic/tzdata/southamerica +++ b/make/sun/javazic/tzdata/southamerica @@ -767,7 +767,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890 # # As a result of the above Decree I believe the America/Rio_Branco # timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall -# be created to represent the the west side of the Para State. I +# be created to represent the...west side of the Para State. I # suggest this new timezone be called Santarem as the most # important/populated city in the affected area. # @@ -1365,6 +1365,24 @@ Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno # For now, we'll just record the time in Stanley, since we have no # better info. +# From Steffen Thorsen (2011-04-01): +# The Falkland Islands will not turn back clocks this winter, but stay on +# daylight saving time. +# +# One source: +# +# http://www.falklandnews.com/public/story.cfm?get=5914&source=3 +# +# +# We have gotten this confirmed by a clerk of the legislative assembly: +# Normally the clocks revert to Local Mean Time (UTC/GMT -4 hours) on the +# third Sunday of April at 0200hrs and advance to Summer Time (UTC/GMT -3 +# hours) on the first Sunday of September at 0200hrs. +# +# IMPORTANT NOTE: During 2011, on a trial basis, the Falkland Islands +# will not revert to local mean time, but clocks will remain on Summer +# time (UTC/GMT - 3 hours) throughout the whole of 2011. Any long term +# change to local time following the trial period will be notified. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Falk 1937 1938 - Sep lastSun 0:00 1:00 S Rule Falk 1938 1942 - Mar Sun>=19 0:00 0 - @@ -1376,7 +1394,8 @@ Rule Falk 1984 1985 - Apr lastSun 0:00 0 - Rule Falk 1984 only - Sep 16 0:00 1:00 S Rule Falk 1985 2000 - Sep Sun>=9 0:00 1:00 S Rule Falk 1986 2000 - Apr Sun>=16 0:00 0 - -Rule Falk 2001 max - Apr Sun>=15 2:00 0 - +Rule Falk 2001 2010 - Apr Sun>=15 2:00 0 - +Rule Falk 2012 max - Apr Sun>=15 2:00 0 - Rule Falk 2001 max - Sep Sun>=1 2:00 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Atlantic/Stanley -3:51:24 - LMT 1890 diff --git a/make/sun/security/Makefile b/make/sun/security/Makefile index efff97d7e559d6db817c0dc8ca6bdf8d99e7d1c2..6e03ffbe05db363d23d7873c0bf091d62fca3174 100644 --- a/make/sun/security/Makefile +++ b/make/sun/security/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -52,12 +52,10 @@ ifeq ($(ARCH_DATA_MODEL), 64) endif endif -# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform. +# Build Microsoft CryptoAPI provider only on Windows platform. MSCAPI = ifeq ($(PLATFORM), windows) - ifneq ($(ARCH_DATA_MODEL), 64) - MSCAPI = mscapi - endif + MSCAPI = mscapi endif # Build in-tree elliptic curve crypto provider only when diff --git a/make/tools/GenerateCharacter/CharacterData00.java.template b/make/tools/GenerateCharacter/CharacterData00.java.template index 5a1fd5a6364850e5bc925436616c169c6329b735..8de328869af1ff3361027e492fa3117dd63682ec 100644 --- a/make/tools/GenerateCharacter/CharacterData00.java.template +++ b/make/tools/GenerateCharacter/CharacterData00.java.template @@ -73,11 +73,37 @@ class CharacterData00 extends CharacterData { return props; } + int getPropertiesEx(int ch) { + char offset = (char)ch; + int props = $$LookupEx(offset); + return props; + } + int getType(int ch) { int props = getProperties(ch); return (props & $$maskType); } + boolean isOtherLowercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherLowercase) != 0; + } + + boolean isOtherUppercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherUppercase) != 0; + } + + boolean isOtherAlphabetic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherAlphabetic) != 0; + } + + boolean isIdeographic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskIdeographic) != 0; + } + boolean isJavaIdentifierStart(int ch) { int props = getProperties(ch); return ((props & $$maskIdentifierInfo) >= $$lowJavaStart); diff --git a/make/tools/GenerateCharacter/CharacterData01.java.template b/make/tools/GenerateCharacter/CharacterData01.java.template index fef710002ca9a64f051d8139a74a3419d474ca16..1245eb13c07b9f75718bf768d7fc5c6e55429782 100644 --- a/make/tools/GenerateCharacter/CharacterData01.java.template +++ b/make/tools/GenerateCharacter/CharacterData01.java.template @@ -72,11 +72,37 @@ class CharacterData01 extends CharacterData { return props; } + int getPropertiesEx(int ch) { + char offset = (char)ch; + int props = $$LookupEx(offset); + return props; + } + int getType(int ch) { int props = getProperties(ch); return (props & $$maskType); } + boolean isOtherLowercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherLowercase) != 0; + } + + boolean isOtherUppercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherUppercase) != 0; + } + + boolean isOtherAlphabetic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherAlphabetic) != 0; + } + + boolean isIdeographic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskIdeographic) != 0; + } + boolean isJavaIdentifierStart(int ch) { int props = getProperties(ch); return ((props & $$maskIdentifierInfo) >= $$lowJavaStart); diff --git a/make/tools/GenerateCharacter/CharacterData02.java.template b/make/tools/GenerateCharacter/CharacterData02.java.template index 845decc3d1ae38967cb94c662c825419fa9ba9ed..7719e4a62953ed10c51c0383f3c4fac312a8fb09 100644 --- a/make/tools/GenerateCharacter/CharacterData02.java.template +++ b/make/tools/GenerateCharacter/CharacterData02.java.template @@ -66,11 +66,37 @@ class CharacterData02 extends CharacterData { */ int getProperties(int ch) { - char offset = (char)ch; + char offset = (char)ch; int props = $$Lookup(offset); return props; } + int getPropertiesEx(int ch) { + char offset = (char)ch; + int props = $$LookupEx(offset); + return props; + } + + boolean isOtherLowercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherLowercase) != 0; + } + + boolean isOtherUppercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherUppercase) != 0; + } + + boolean isOtherAlphabetic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherAlphabetic) != 0; + } + + boolean isIdeographic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskIdeographic) != 0; + } + int getType(int ch) { int props = getProperties(ch); return (props & $$maskType); diff --git a/make/tools/GenerateCharacter/CharacterData0E.java.template b/make/tools/GenerateCharacter/CharacterData0E.java.template index 12abce182d2b6e270ebc27939b409a911386ea70..15416ffc7ad89b22721efcba0bedb61d814caa2e 100644 --- a/make/tools/GenerateCharacter/CharacterData0E.java.template +++ b/make/tools/GenerateCharacter/CharacterData0E.java.template @@ -66,11 +66,37 @@ class CharacterData0E extends CharacterData { */ int getProperties(int ch) { - char offset = (char)ch; + char offset = (char)ch; int props = $$Lookup(offset); return props; } + int getPropertiesEx(int ch) { + char offset = (char)ch; + int props = $$LookupEx(offset); + return props; + } + + boolean isOtherLowercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherLowercase) != 0; + } + + boolean isOtherUppercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherUppercase) != 0; + } + + boolean isOtherAlphabetic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherAlphabetic) != 0; + } + + boolean isIdeographic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskIdeographic) != 0; + } + int getType(int ch) { int props = getProperties(ch); return (props & $$maskType); diff --git a/make/tools/GenerateCharacter/CharacterDataLatin1.java.template b/make/tools/GenerateCharacter/CharacterDataLatin1.java.template index e4646d16bbe9789728fc5821993ab7df2d223189..ed2e38e6aa6ce057e4ccb3f9960a988a8ebd3b9a 100644 --- a/make/tools/GenerateCharacter/CharacterDataLatin1.java.template +++ b/make/tools/GenerateCharacter/CharacterDataLatin1.java.template @@ -67,11 +67,37 @@ class CharacterDataLatin1 extends CharacterData { */ int getProperties(int ch) { - char offset = (char)ch; + char offset = (char)ch; int props = $$Lookup(offset); return props; } + int getPropertiesEx(int ch) { + char offset = (char)ch; + int props = $$LookupEx(offset); + return props; + } + + boolean isOtherLowercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherLowercase) != 0; + } + + boolean isOtherUppercase(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherUppercase) != 0; + } + + boolean isOtherAlphabetic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskOtherAlphabetic) != 0; + } + + boolean isIdeographic(int ch) { + int props = getPropertiesEx(ch); + return (props & $$maskIdeographic) != 0; + } + int getType(int ch) { int props = getProperties(ch); return (props & $$maskType); diff --git a/make/tools/UnicodeData/PropList.txt b/make/tools/UnicodeData/PropList.txt new file mode 100644 index 0000000000000000000000000000000000000000..eeeb81845e3a809f3af5d22e23dec930c4f2d2cf --- /dev/null +++ b/make/tools/UnicodeData/PropList.txt @@ -0,0 +1,1296 @@ +# PropList-6.0.0.txt +# Date: 2010-08-19, 00:48:28 GMT [MD] +# +# Unicode Character Database +# Copyright (c) 1991-2010 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# For documentation, see http://www.unicode.org/reports/tr44/ + +# ================================================ + +0009..000D ; White_Space # Cc [5] .. +0020 ; White_Space # Zs SPACE +0085 ; White_Space # Cc +00A0 ; White_Space # Zs NO-BREAK SPACE +1680 ; White_Space # Zs OGHAM SPACE MARK +180E ; White_Space # Zs MONGOLIAN VOWEL SEPARATOR +2000..200A ; White_Space # Zs [11] EN QUAD..HAIR SPACE +2028 ; White_Space # Zl LINE SEPARATOR +2029 ; White_Space # Zp PARAGRAPH SEPARATOR +202F ; White_Space # Zs NARROW NO-BREAK SPACE +205F ; White_Space # Zs MEDIUM MATHEMATICAL SPACE +3000 ; White_Space # Zs IDEOGRAPHIC SPACE + +# Total code points: 26 + +# ================================================ + +200E..200F ; Bidi_Control # Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +202A..202E ; Bidi_Control # Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + +# Total code points: 7 + +# ================================================ + +200C..200D ; Join_Control # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER + +# Total code points: 2 + +# ================================================ + +002D ; Dash # Pd HYPHEN-MINUS +058A ; Dash # Pd ARMENIAN HYPHEN +05BE ; Dash # Pd HEBREW PUNCTUATION MAQAF +1400 ; Dash # Pd CANADIAN SYLLABICS HYPHEN +1806 ; Dash # Pd MONGOLIAN TODO SOFT HYPHEN +2010..2015 ; Dash # Pd [6] HYPHEN..HORIZONTAL BAR +2053 ; Dash # Po SWUNG DASH +207B ; Dash # Sm SUPERSCRIPT MINUS +208B ; Dash # Sm SUBSCRIPT MINUS +2212 ; Dash # Sm MINUS SIGN +2E17 ; Dash # Pd DOUBLE OBLIQUE HYPHEN +2E1A ; Dash # Pd HYPHEN WITH DIAERESIS +301C ; Dash # Pd WAVE DASH +3030 ; Dash # Pd WAVY DASH +30A0 ; Dash # Pd KATAKANA-HIRAGANA DOUBLE HYPHEN +FE31..FE32 ; Dash # Pd [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH +FE58 ; Dash # Pd SMALL EM DASH +FE63 ; Dash # Pd SMALL HYPHEN-MINUS +FF0D ; Dash # Pd FULLWIDTH HYPHEN-MINUS + +# Total code points: 25 + +# ================================================ + +002D ; Hyphen # Pd HYPHEN-MINUS +00AD ; Hyphen # Cf SOFT HYPHEN +058A ; Hyphen # Pd ARMENIAN HYPHEN +1806 ; Hyphen # Pd MONGOLIAN TODO SOFT HYPHEN +2010..2011 ; Hyphen # Pd [2] HYPHEN..NON-BREAKING HYPHEN +2E17 ; Hyphen # Pd DOUBLE OBLIQUE HYPHEN +30FB ; Hyphen # Po KATAKANA MIDDLE DOT +FE63 ; Hyphen # Pd SMALL HYPHEN-MINUS +FF0D ; Hyphen # Pd FULLWIDTH HYPHEN-MINUS +FF65 ; Hyphen # Po HALFWIDTH KATAKANA MIDDLE DOT + +# Total code points: 11 + +# ================================================ + +0022 ; Quotation_Mark # Po QUOTATION MARK +0027 ; Quotation_Mark # Po APOSTROPHE +00AB ; Quotation_Mark # Pi LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00BB ; Quotation_Mark # Pf RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +2018 ; Quotation_Mark # Pi LEFT SINGLE QUOTATION MARK +2019 ; Quotation_Mark # Pf RIGHT SINGLE QUOTATION MARK +201A ; Quotation_Mark # Ps SINGLE LOW-9 QUOTATION MARK +201B..201C ; Quotation_Mark # Pi [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK +201D ; Quotation_Mark # Pf RIGHT DOUBLE QUOTATION MARK +201E ; Quotation_Mark # Ps DOUBLE LOW-9 QUOTATION MARK +201F ; Quotation_Mark # Pi DOUBLE HIGH-REVERSED-9 QUOTATION MARK +2039 ; Quotation_Mark # Pi SINGLE LEFT-POINTING ANGLE QUOTATION MARK +203A ; Quotation_Mark # Pf SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +300C ; Quotation_Mark # Ps LEFT CORNER BRACKET +300D ; Quotation_Mark # Pe RIGHT CORNER BRACKET +300E ; Quotation_Mark # Ps LEFT WHITE CORNER BRACKET +300F ; Quotation_Mark # Pe RIGHT WHITE CORNER BRACKET +301D ; Quotation_Mark # Ps REVERSED DOUBLE PRIME QUOTATION MARK +301E..301F ; Quotation_Mark # Pe [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK +FE41 ; Quotation_Mark # Ps PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET +FE42 ; Quotation_Mark # Pe PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET +FE43 ; Quotation_Mark # Ps PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET +FE44 ; Quotation_Mark # Pe PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET +FF02 ; Quotation_Mark # Po FULLWIDTH QUOTATION MARK +FF07 ; Quotation_Mark # Po FULLWIDTH APOSTROPHE +FF62 ; Quotation_Mark # Ps HALFWIDTH LEFT CORNER BRACKET +FF63 ; Quotation_Mark # Pe HALFWIDTH RIGHT CORNER BRACKET + +# Total code points: 29 + +# ================================================ + +0021 ; Terminal_Punctuation # Po EXCLAMATION MARK +002C ; Terminal_Punctuation # Po COMMA +002E ; Terminal_Punctuation # Po FULL STOP +003A..003B ; Terminal_Punctuation # Po [2] COLON..SEMICOLON +003F ; Terminal_Punctuation # Po QUESTION MARK +037E ; Terminal_Punctuation # Po GREEK QUESTION MARK +0387 ; Terminal_Punctuation # Po GREEK ANO TELEIA +0589 ; Terminal_Punctuation # Po ARMENIAN FULL STOP +05C3 ; Terminal_Punctuation # Po HEBREW PUNCTUATION SOF PASUQ +060C ; Terminal_Punctuation # Po ARABIC COMMA +061B ; Terminal_Punctuation # Po ARABIC SEMICOLON +061F ; Terminal_Punctuation # Po ARABIC QUESTION MARK +06D4 ; Terminal_Punctuation # Po ARABIC FULL STOP +0700..070A ; Terminal_Punctuation # Po [11] SYRIAC END OF PARAGRAPH..SYRIAC CONTRACTION +070C ; Terminal_Punctuation # Po SYRIAC HARKLEAN METOBELUS +07F8..07F9 ; Terminal_Punctuation # Po [2] NKO COMMA..NKO EXCLAMATION MARK +0830..083E ; Terminal_Punctuation # Po [15] SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUNCTUATION ANNAAU +085E ; Terminal_Punctuation # Po MANDAIC PUNCTUATION +0964..0965 ; Terminal_Punctuation # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA +0E5A..0E5B ; Terminal_Punctuation # Po [2] THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT +0F08 ; Terminal_Punctuation # Po TIBETAN MARK SBRUL SHAD +0F0D..0F12 ; Terminal_Punctuation # Po [6] TIBETAN MARK SHAD..TIBETAN MARK RGYA GRAM SHAD +104A..104B ; Terminal_Punctuation # Po [2] MYANMAR SIGN LITTLE SECTION..MYANMAR SIGN SECTION +1361..1368 ; Terminal_Punctuation # Po [8] ETHIOPIC WORDSPACE..ETHIOPIC PARAGRAPH SEPARATOR +166D..166E ; Terminal_Punctuation # Po [2] CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP +16EB..16ED ; Terminal_Punctuation # Po [3] RUNIC SINGLE PUNCTUATION..RUNIC CROSS PUNCTUATION +17D4..17D6 ; Terminal_Punctuation # Po [3] KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH +17DA ; Terminal_Punctuation # Po KHMER SIGN KOOMUUT +1802..1805 ; Terminal_Punctuation # Po [4] MONGOLIAN COMMA..MONGOLIAN FOUR DOTS +1808..1809 ; Terminal_Punctuation # Po [2] MONGOLIAN MANCHU COMMA..MONGOLIAN MANCHU FULL STOP +1944..1945 ; Terminal_Punctuation # Po [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK +1AA8..1AAB ; Terminal_Punctuation # Po [4] TAI THAM SIGN KAAN..TAI THAM SIGN SATKAANKUU +1B5A..1B5B ; Terminal_Punctuation # Po [2] BALINESE PANTI..BALINESE PAMADA +1B5D..1B5F ; Terminal_Punctuation # Po [3] BALINESE CARIK PAMUNGKAH..BALINESE CARIK PAREREN +1C3B..1C3F ; Terminal_Punctuation # Po [5] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK +1C7E..1C7F ; Terminal_Punctuation # Po [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD +203C..203D ; Terminal_Punctuation # Po [2] DOUBLE EXCLAMATION MARK..INTERROBANG +2047..2049 ; Terminal_Punctuation # Po [3] DOUBLE QUESTION MARK..EXCLAMATION QUESTION MARK +2E2E ; Terminal_Punctuation # Po REVERSED QUESTION MARK +3001..3002 ; Terminal_Punctuation # Po [2] IDEOGRAPHIC COMMA..IDEOGRAPHIC FULL STOP +A4FE..A4FF ; Terminal_Punctuation # Po [2] LISU PUNCTUATION COMMA..LISU PUNCTUATION FULL STOP +A60D..A60F ; Terminal_Punctuation # Po [3] VAI COMMA..VAI QUESTION MARK +A6F3..A6F7 ; Terminal_Punctuation # Po [5] BAMUM FULL STOP..BAMUM QUESTION MARK +A876..A877 ; Terminal_Punctuation # Po [2] PHAGS-PA MARK SHAD..PHAGS-PA MARK DOUBLE SHAD +A8CE..A8CF ; Terminal_Punctuation # Po [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA +A92F ; Terminal_Punctuation # Po KAYAH LI SIGN SHYA +A9C7..A9C9 ; Terminal_Punctuation # Po [3] JAVANESE PADA PANGKAT..JAVANESE PADA LUNGSI +AA5D..AA5F ; Terminal_Punctuation # Po [3] CHAM PUNCTUATION DANDA..CHAM PUNCTUATION TRIPLE DANDA +AADF ; Terminal_Punctuation # Po TAI VIET SYMBOL KOI KOI +ABEB ; Terminal_Punctuation # Po MEETEI MAYEK CHEIKHEI +FE50..FE52 ; Terminal_Punctuation # Po [3] SMALL COMMA..SMALL FULL STOP +FE54..FE57 ; Terminal_Punctuation # Po [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK +FF01 ; Terminal_Punctuation # Po FULLWIDTH EXCLAMATION MARK +FF0C ; Terminal_Punctuation # Po FULLWIDTH COMMA +FF0E ; Terminal_Punctuation # Po FULLWIDTH FULL STOP +FF1A..FF1B ; Terminal_Punctuation # Po [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON +FF1F ; Terminal_Punctuation # Po FULLWIDTH QUESTION MARK +FF61 ; Terminal_Punctuation # Po HALFWIDTH IDEOGRAPHIC FULL STOP +FF64 ; Terminal_Punctuation # Po HALFWIDTH IDEOGRAPHIC COMMA +1039F ; Terminal_Punctuation # Po UGARITIC WORD DIVIDER +103D0 ; Terminal_Punctuation # Po OLD PERSIAN WORD DIVIDER +10857 ; Terminal_Punctuation # Po IMPERIAL ARAMAIC SECTION SIGN +1091F ; Terminal_Punctuation # Po PHOENICIAN WORD SEPARATOR +10B3A..10B3F ; Terminal_Punctuation # Po [6] TINY TWO DOTS OVER ONE DOT PUNCTUATION..LARGE ONE RING OVER TWO RINGS PUNCTUATION +11047..1104D ; Terminal_Punctuation # Po [7] BRAHMI DANDA..BRAHMI PUNCTUATION LOTUS +110BE..110C1 ; Terminal_Punctuation # Po [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA +12470..12473 ; Terminal_Punctuation # Po [4] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON + +# Total code points: 169 + +# ================================================ + +005E ; Other_Math # Sk CIRCUMFLEX ACCENT +03D0..03D2 ; Other_Math # L& [3] GREEK BETA SYMBOL..GREEK UPSILON WITH HOOK SYMBOL +03D5 ; Other_Math # L& GREEK PHI SYMBOL +03F0..03F1 ; Other_Math # L& [2] GREEK KAPPA SYMBOL..GREEK RHO SYMBOL +03F4..03F5 ; Other_Math # L& [2] GREEK CAPITAL THETA SYMBOL..GREEK LUNATE EPSILON SYMBOL +2016 ; Other_Math # Po DOUBLE VERTICAL LINE +2032..2034 ; Other_Math # Po [3] PRIME..TRIPLE PRIME +2040 ; Other_Math # Pc CHARACTER TIE +2061..2064 ; Other_Math # Cf [4] FUNCTION APPLICATION..INVISIBLE PLUS +207D ; Other_Math # Ps SUPERSCRIPT LEFT PARENTHESIS +207E ; Other_Math # Pe SUPERSCRIPT RIGHT PARENTHESIS +208D ; Other_Math # Ps SUBSCRIPT LEFT PARENTHESIS +208E ; Other_Math # Pe SUBSCRIPT RIGHT PARENTHESIS +20D0..20DC ; Other_Math # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE +20E1 ; Other_Math # Mn COMBINING LEFT RIGHT ARROW ABOVE +20E5..20E6 ; Other_Math # Mn [2] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING DOUBLE VERTICAL STROKE OVERLAY +20EB..20EF ; Other_Math # Mn [5] COMBINING LONG DOUBLE SOLIDUS OVERLAY..COMBINING RIGHT ARROW BELOW +2102 ; Other_Math # L& DOUBLE-STRUCK CAPITAL C +2107 ; Other_Math # L& EULER CONSTANT +210A..2113 ; Other_Math # L& [10] SCRIPT SMALL G..SCRIPT SMALL L +2115 ; Other_Math # L& DOUBLE-STRUCK CAPITAL N +2119..211D ; Other_Math # L& [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R +2124 ; Other_Math # L& DOUBLE-STRUCK CAPITAL Z +2128 ; Other_Math # L& BLACK-LETTER CAPITAL Z +2129 ; Other_Math # So TURNED GREEK SMALL LETTER IOTA +212C..212D ; Other_Math # L& [2] SCRIPT CAPITAL B..BLACK-LETTER CAPITAL C +212F..2131 ; Other_Math # L& [3] SCRIPT SMALL E..SCRIPT CAPITAL F +2133..2134 ; Other_Math # L& [2] SCRIPT CAPITAL M..SCRIPT SMALL O +2135..2138 ; Other_Math # Lo [4] ALEF SYMBOL..DALET SYMBOL +213C..213F ; Other_Math # L& [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STRUCK CAPITAL PI +2145..2149 ; Other_Math # L& [5] DOUBLE-STRUCK ITALIC CAPITAL D..DOUBLE-STRUCK ITALIC SMALL J +2195..2199 ; Other_Math # So [5] UP DOWN ARROW..SOUTH WEST ARROW +219C..219F ; Other_Math # So [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW +21A1..21A2 ; Other_Math # So [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL +21A4..21A5 ; Other_Math # So [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR +21A7 ; Other_Math # So DOWNWARDS ARROW FROM BAR +21A9..21AD ; Other_Math # So [5] LEFTWARDS ARROW WITH HOOK..LEFT RIGHT WAVE ARROW +21B0..21B1 ; Other_Math # So [2] UPWARDS ARROW WITH TIP LEFTWARDS..UPWARDS ARROW WITH TIP RIGHTWARDS +21B6..21B7 ; Other_Math # So [2] ANTICLOCKWISE TOP SEMICIRCLE ARROW..CLOCKWISE TOP SEMICIRCLE ARROW +21BC..21CD ; Other_Math # So [18] LEFTWARDS HARPOON WITH BARB UPWARDS..LEFTWARDS DOUBLE ARROW WITH STROKE +21D0..21D1 ; Other_Math # So [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW +21D3 ; Other_Math # So DOWNWARDS DOUBLE ARROW +21D5..21DB ; Other_Math # So [7] UP DOWN DOUBLE ARROW..RIGHTWARDS TRIPLE ARROW +21DD ; Other_Math # So RIGHTWARDS SQUIGGLE ARROW +21E4..21E5 ; Other_Math # So [2] LEFTWARDS ARROW TO BAR..RIGHTWARDS ARROW TO BAR +23B4..23B5 ; Other_Math # So [2] TOP SQUARE BRACKET..BOTTOM SQUARE BRACKET +23B7 ; Other_Math # So RADICAL SYMBOL BOTTOM +23D0 ; Other_Math # So VERTICAL LINE EXTENSION +23E2 ; Other_Math # So WHITE TRAPEZIUM +25A0..25A1 ; Other_Math # So [2] BLACK SQUARE..WHITE SQUARE +25AE..25B6 ; Other_Math # So [9] BLACK VERTICAL RECTANGLE..BLACK RIGHT-POINTING TRIANGLE +25BC..25C0 ; Other_Math # So [5] BLACK DOWN-POINTING TRIANGLE..BLACK LEFT-POINTING TRIANGLE +25C6..25C7 ; Other_Math # So [2] BLACK DIAMOND..WHITE DIAMOND +25CA..25CB ; Other_Math # So [2] LOZENGE..WHITE CIRCLE +25CF..25D3 ; Other_Math # So [5] BLACK CIRCLE..CIRCLE WITH UPPER HALF BLACK +25E2 ; Other_Math # So BLACK LOWER RIGHT TRIANGLE +25E4 ; Other_Math # So BLACK UPPER LEFT TRIANGLE +25E7..25EC ; Other_Math # So [6] SQUARE WITH LEFT HALF BLACK..WHITE UP-POINTING TRIANGLE WITH DOT +2605..2606 ; Other_Math # So [2] BLACK STAR..WHITE STAR +2640 ; Other_Math # So FEMALE SIGN +2642 ; Other_Math # So MALE SIGN +2660..2663 ; Other_Math # So [4] BLACK SPADE SUIT..BLACK CLUB SUIT +266D..266E ; Other_Math # So [2] MUSIC FLAT SIGN..MUSIC NATURAL SIGN +27C5 ; Other_Math # Ps LEFT S-SHAPED BAG DELIMITER +27C6 ; Other_Math # Pe RIGHT S-SHAPED BAG DELIMITER +27E6 ; Other_Math # Ps MATHEMATICAL LEFT WHITE SQUARE BRACKET +27E7 ; Other_Math # Pe MATHEMATICAL RIGHT WHITE SQUARE BRACKET +27E8 ; Other_Math # Ps MATHEMATICAL LEFT ANGLE BRACKET +27E9 ; Other_Math # Pe MATHEMATICAL RIGHT ANGLE BRACKET +27EA ; Other_Math # Ps MATHEMATICAL LEFT DOUBLE ANGLE BRACKET +27EB ; Other_Math # Pe MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET +27EC ; Other_Math # Ps MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET +27ED ; Other_Math # Pe MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET +27EE ; Other_Math # Ps MATHEMATICAL LEFT FLATTENED PARENTHESIS +27EF ; Other_Math # Pe MATHEMATICAL RIGHT FLATTENED PARENTHESIS +2983 ; Other_Math # Ps LEFT WHITE CURLY BRACKET +2984 ; Other_Math # Pe RIGHT WHITE CURLY BRACKET +2985 ; Other_Math # Ps LEFT WHITE PARENTHESIS +2986 ; Other_Math # Pe RIGHT WHITE PARENTHESIS +2987 ; Other_Math # Ps Z NOTATION LEFT IMAGE BRACKET +2988 ; Other_Math # Pe Z NOTATION RIGHT IMAGE BRACKET +2989 ; Other_Math # Ps Z NOTATION LEFT BINDING BRACKET +298A ; Other_Math # Pe Z NOTATION RIGHT BINDING BRACKET +298B ; Other_Math # Ps LEFT SQUARE BRACKET WITH UNDERBAR +298C ; Other_Math # Pe RIGHT SQUARE BRACKET WITH UNDERBAR +298D ; Other_Math # Ps LEFT SQUARE BRACKET WITH TICK IN TOP CORNER +298E ; Other_Math # Pe RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +298F ; Other_Math # Ps LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +2990 ; Other_Math # Pe RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER +2991 ; Other_Math # Ps LEFT ANGLE BRACKET WITH DOT +2992 ; Other_Math # Pe RIGHT ANGLE BRACKET WITH DOT +2993 ; Other_Math # Ps LEFT ARC LESS-THAN BRACKET +2994 ; Other_Math # Pe RIGHT ARC GREATER-THAN BRACKET +2995 ; Other_Math # Ps DOUBLE LEFT ARC GREATER-THAN BRACKET +2996 ; Other_Math # Pe DOUBLE RIGHT ARC LESS-THAN BRACKET +2997 ; Other_Math # Ps LEFT BLACK TORTOISE SHELL BRACKET +2998 ; Other_Math # Pe RIGHT BLACK TORTOISE SHELL BRACKET +29D8 ; Other_Math # Ps LEFT WIGGLY FENCE +29D9 ; Other_Math # Pe RIGHT WIGGLY FENCE +29DA ; Other_Math # Ps LEFT DOUBLE WIGGLY FENCE +29DB ; Other_Math # Pe RIGHT DOUBLE WIGGLY FENCE +29FC ; Other_Math # Ps LEFT-POINTING CURVED ANGLE BRACKET +29FD ; Other_Math # Pe RIGHT-POINTING CURVED ANGLE BRACKET +FE61 ; Other_Math # Po SMALL ASTERISK +FE63 ; Other_Math # Pd SMALL HYPHEN-MINUS +FE68 ; Other_Math # Po SMALL REVERSE SOLIDUS +FF3C ; Other_Math # Po FULLWIDTH REVERSE SOLIDUS +FF3E ; Other_Math # Sk FULLWIDTH CIRCUMFLEX ACCENT +1D400..1D454 ; Other_Math # L& [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G +1D456..1D49C ; Other_Math # L& [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A +1D49E..1D49F ; Other_Math # L& [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D +1D4A2 ; Other_Math # L& MATHEMATICAL SCRIPT CAPITAL G +1D4A5..1D4A6 ; Other_Math # L& [2] MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL SCRIPT CAPITAL K +1D4A9..1D4AC ; Other_Math # L& [4] MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL SCRIPT CAPITAL Q +1D4AE..1D4B9 ; Other_Math # L& [12] MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL SCRIPT SMALL D +1D4BB ; Other_Math # L& MATHEMATICAL SCRIPT SMALL F +1D4BD..1D4C3 ; Other_Math # L& [7] MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SCRIPT SMALL N +1D4C5..1D505 ; Other_Math # L& [65] MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL FRAKTUR CAPITAL B +1D507..1D50A ; Other_Math # L& [4] MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL FRAKTUR CAPITAL G +1D50D..1D514 ; Other_Math # L& [8] MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL FRAKTUR CAPITAL Q +1D516..1D51C ; Other_Math # L& [7] MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL FRAKTUR CAPITAL Y +1D51E..1D539 ; Other_Math # L& [28] MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL DOUBLE-STRUCK CAPITAL B +1D53B..1D53E ; Other_Math # L& [4] MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEMATICAL DOUBLE-STRUCK CAPITAL G +1D540..1D544 ; Other_Math # L& [5] MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEMATICAL DOUBLE-STRUCK CAPITAL M +1D546 ; Other_Math # L& MATHEMATICAL DOUBLE-STRUCK CAPITAL O +1D54A..1D550 ; Other_Math # L& [7] MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEMATICAL DOUBLE-STRUCK CAPITAL Y +1D552..1D6A5 ; Other_Math # L& [340] MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMATICAL ITALIC SMALL DOTLESS J +1D6A8..1D6C0 ; Other_Math # L& [25] MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICAL BOLD CAPITAL OMEGA +1D6C2..1D6DA ; Other_Math # L& [25] MATHEMATICAL BOLD SMALL ALPHA..MATHEMATICAL BOLD SMALL OMEGA +1D6DC..1D6FA ; Other_Math # L& [31] MATHEMATICAL BOLD EPSILON SYMBOL..MATHEMATICAL ITALIC CAPITAL OMEGA +1D6FC..1D714 ; Other_Math # L& [25] MATHEMATICAL ITALIC SMALL ALPHA..MATHEMATICAL ITALIC SMALL OMEGA +1D716..1D734 ; Other_Math # L& [31] MATHEMATICAL ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD ITALIC CAPITAL OMEGA +1D736..1D74E ; Other_Math # L& [25] MATHEMATICAL BOLD ITALIC SMALL ALPHA..MATHEMATICAL BOLD ITALIC SMALL OMEGA +1D750..1D76E ; Other_Math # L& [31] MATHEMATICAL BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA +1D770..1D788 ; Other_Math # L& [25] MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA +1D78A..1D7A8 ; Other_Math # L& [31] MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA +1D7AA..1D7C2 ; Other_Math # L& [25] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA +1D7C4..1D7CB ; Other_Math # L& [8] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD SMALL DIGAMMA +1D7CE..1D7FF ; Other_Math # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE + +# Total code points: 1217 + +# ================================================ + +0030..0039 ; Hex_Digit # Nd [10] DIGIT ZERO..DIGIT NINE +0041..0046 ; Hex_Digit # L& [6] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER F +0061..0066 ; Hex_Digit # L& [6] LATIN SMALL LETTER A..LATIN SMALL LETTER F +FF10..FF19 ; Hex_Digit # Nd [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE +FF21..FF26 ; Hex_Digit # L& [6] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER F +FF41..FF46 ; Hex_Digit # L& [6] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER F + +# Total code points: 44 + +# ================================================ + +0030..0039 ; ASCII_Hex_Digit # Nd [10] DIGIT ZERO..DIGIT NINE +0041..0046 ; ASCII_Hex_Digit # L& [6] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER F +0061..0066 ; ASCII_Hex_Digit # L& [6] LATIN SMALL LETTER A..LATIN SMALL LETTER F + +# Total code points: 22 + +# ================================================ + +0345 ; Other_Alphabetic # Mn COMBINING GREEK YPOGEGRAMMENI +05B0..05BD ; Other_Alphabetic # Mn [14] HEBREW POINT SHEVA..HEBREW POINT METEG +05BF ; Other_Alphabetic # Mn HEBREW POINT RAFE +05C1..05C2 ; Other_Alphabetic # Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +05C4..05C5 ; Other_Alphabetic # Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT +05C7 ; Other_Alphabetic # Mn HEBREW POINT QAMATS QATAN +0610..061A ; Other_Alphabetic # Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA +064B..0657 ; Other_Alphabetic # Mn [13] ARABIC FATHATAN..ARABIC INVERTED DAMMA +0659..065F ; Other_Alphabetic # Mn [7] ARABIC ZWARAKAY..ARABIC WAVY HAMZA BELOW +0670 ; Other_Alphabetic # Mn ARABIC LETTER SUPERSCRIPT ALEF +06D6..06DC ; Other_Alphabetic # Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN +06E1..06E4 ; Other_Alphabetic # Mn [4] ARABIC SMALL HIGH DOTLESS HEAD OF KHAH..ARABIC SMALL HIGH MADDA +06E7..06E8 ; Other_Alphabetic # Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON +06ED ; Other_Alphabetic # Mn ARABIC SMALL LOW MEEM +0711 ; Other_Alphabetic # Mn SYRIAC LETTER SUPERSCRIPT ALAPH +0730..073F ; Other_Alphabetic # Mn [16] SYRIAC PTHAHA ABOVE..SYRIAC RWAHA +07A6..07B0 ; Other_Alphabetic # Mn [11] THAANA ABAFILI..THAANA SUKUN +0816..0817 ; Other_Alphabetic # Mn [2] SAMARITAN MARK IN..SAMARITAN MARK IN-ALAF +081B..0823 ; Other_Alphabetic # Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A +0825..0827 ; Other_Alphabetic # Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U +0829..082C ; Other_Alphabetic # Mn [4] SAMARITAN VOWEL SIGN LONG I..SAMARITAN VOWEL SIGN SUKUN +0900..0902 ; Other_Alphabetic # Mn [3] DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANAGARI SIGN ANUSVARA +0903 ; Other_Alphabetic # Mc DEVANAGARI SIGN VISARGA +093A ; Other_Alphabetic # Mn DEVANAGARI VOWEL SIGN OE +093B ; Other_Alphabetic # Mc DEVANAGARI VOWEL SIGN OOE +093E..0940 ; Other_Alphabetic # Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II +0941..0948 ; Other_Alphabetic # Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI +0949..094C ; Other_Alphabetic # Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU +094E..094F ; Other_Alphabetic # Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW +0955..0957 ; Other_Alphabetic # Mn [3] DEVANAGARI VOWEL SIGN CANDRA LONG E..DEVANAGARI VOWEL SIGN UUE +0962..0963 ; Other_Alphabetic # Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL +0981 ; Other_Alphabetic # Mn BENGALI SIGN CANDRABINDU +0982..0983 ; Other_Alphabetic # Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA +09BE..09C0 ; Other_Alphabetic # Mc [3] BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN II +09C1..09C4 ; Other_Alphabetic # Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR +09C7..09C8 ; Other_Alphabetic # Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI +09CB..09CC ; Other_Alphabetic # Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU +09D7 ; Other_Alphabetic # Mc BENGALI AU LENGTH MARK +09E2..09E3 ; Other_Alphabetic # Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL +0A01..0A02 ; Other_Alphabetic # Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI +0A03 ; Other_Alphabetic # Mc GURMUKHI SIGN VISARGA +0A3E..0A40 ; Other_Alphabetic # Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II +0A41..0A42 ; Other_Alphabetic # Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU +0A47..0A48 ; Other_Alphabetic # Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI +0A4B..0A4C ; Other_Alphabetic # Mn [2] GURMUKHI VOWEL SIGN OO..GURMUKHI VOWEL SIGN AU +0A51 ; Other_Alphabetic # Mn GURMUKHI SIGN UDAAT +0A70..0A71 ; Other_Alphabetic # Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK +0A75 ; Other_Alphabetic # Mn GURMUKHI SIGN YAKASH +0A81..0A82 ; Other_Alphabetic # Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA +0A83 ; Other_Alphabetic # Mc GUJARATI SIGN VISARGA +0ABE..0AC0 ; Other_Alphabetic # Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II +0AC1..0AC5 ; Other_Alphabetic # Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E +0AC7..0AC8 ; Other_Alphabetic # Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI +0AC9 ; Other_Alphabetic # Mc GUJARATI VOWEL SIGN CANDRA O +0ACB..0ACC ; Other_Alphabetic # Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU +0AE2..0AE3 ; Other_Alphabetic # Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL +0B01 ; Other_Alphabetic # Mn ORIYA SIGN CANDRABINDU +0B02..0B03 ; Other_Alphabetic # Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA +0B3E ; Other_Alphabetic # Mc ORIYA VOWEL SIGN AA +0B3F ; Other_Alphabetic # Mn ORIYA VOWEL SIGN I +0B40 ; Other_Alphabetic # Mc ORIYA VOWEL SIGN II +0B41..0B44 ; Other_Alphabetic # Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR +0B47..0B48 ; Other_Alphabetic # Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI +0B4B..0B4C ; Other_Alphabetic # Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU +0B56 ; Other_Alphabetic # Mn ORIYA AI LENGTH MARK +0B57 ; Other_Alphabetic # Mc ORIYA AU LENGTH MARK +0B62..0B63 ; Other_Alphabetic # Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL +0B82 ; Other_Alphabetic # Mn TAMIL SIGN ANUSVARA +0BBE..0BBF ; Other_Alphabetic # Mc [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN I +0BC0 ; Other_Alphabetic # Mn TAMIL VOWEL SIGN II +0BC1..0BC2 ; Other_Alphabetic # Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU +0BC6..0BC8 ; Other_Alphabetic # Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI +0BCA..0BCC ; Other_Alphabetic # Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU +0BD7 ; Other_Alphabetic # Mc TAMIL AU LENGTH MARK +0C01..0C03 ; Other_Alphabetic # Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA +0C3E..0C40 ; Other_Alphabetic # Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II +0C41..0C44 ; Other_Alphabetic # Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR +0C46..0C48 ; Other_Alphabetic # Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI +0C4A..0C4C ; Other_Alphabetic # Mn [3] TELUGU VOWEL SIGN O..TELUGU VOWEL SIGN AU +0C55..0C56 ; Other_Alphabetic # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK +0C62..0C63 ; Other_Alphabetic # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL +0C82..0C83 ; Other_Alphabetic # Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA +0CBE ; Other_Alphabetic # Mc KANNADA VOWEL SIGN AA +0CBF ; Other_Alphabetic # Mn KANNADA VOWEL SIGN I +0CC0..0CC4 ; Other_Alphabetic # Mc [5] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN VOCALIC RR +0CC6 ; Other_Alphabetic # Mn KANNADA VOWEL SIGN E +0CC7..0CC8 ; Other_Alphabetic # Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI +0CCA..0CCB ; Other_Alphabetic # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO +0CCC ; Other_Alphabetic # Mn KANNADA VOWEL SIGN AU +0CD5..0CD6 ; Other_Alphabetic # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +0CE2..0CE3 ; Other_Alphabetic # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL +0D02..0D03 ; Other_Alphabetic # Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA +0D3E..0D40 ; Other_Alphabetic # Mc [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II +0D41..0D44 ; Other_Alphabetic # Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR +0D46..0D48 ; Other_Alphabetic # Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI +0D4A..0D4C ; Other_Alphabetic # Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU +0D57 ; Other_Alphabetic # Mc MALAYALAM AU LENGTH MARK +0D62..0D63 ; Other_Alphabetic # Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL +0D82..0D83 ; Other_Alphabetic # Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA +0DCF..0DD1 ; Other_Alphabetic # Mc [3] SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA +0DD2..0DD4 ; Other_Alphabetic # Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA +0DD6 ; Other_Alphabetic # Mn SINHALA VOWEL SIGN DIGA PAA-PILLA +0DD8..0DDF ; Other_Alphabetic # Mc [8] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA +0DF2..0DF3 ; Other_Alphabetic # Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA +0E31 ; Other_Alphabetic # Mn THAI CHARACTER MAI HAN-AKAT +0E34..0E3A ; Other_Alphabetic # Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU +0E4D ; Other_Alphabetic # Mn THAI CHARACTER NIKHAHIT +0EB1 ; Other_Alphabetic # Mn LAO VOWEL SIGN MAI KAN +0EB4..0EB9 ; Other_Alphabetic # Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU +0EBB..0EBC ; Other_Alphabetic # Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO +0ECD ; Other_Alphabetic # Mn LAO NIGGAHITA +0F71..0F7E ; Other_Alphabetic # Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO +0F7F ; Other_Alphabetic # Mc TIBETAN SIGN RNAM BCAD +0F80..0F81 ; Other_Alphabetic # Mn [2] TIBETAN VOWEL SIGN REVERSED I..TIBETAN VOWEL SIGN REVERSED II +0F8D..0F97 ; Other_Alphabetic # Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA +0F99..0FBC ; Other_Alphabetic # Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA +102B..102C ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN TALL AA..MYANMAR VOWEL SIGN AA +102D..1030 ; Other_Alphabetic # Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU +1031 ; Other_Alphabetic # Mc MYANMAR VOWEL SIGN E +1032..1036 ; Other_Alphabetic # Mn [5] MYANMAR VOWEL SIGN AI..MYANMAR SIGN ANUSVARA +1038 ; Other_Alphabetic # Mc MYANMAR SIGN VISARGA +103B..103C ; Other_Alphabetic # Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA +103D..103E ; Other_Alphabetic # Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA +1056..1057 ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR +1058..1059 ; Other_Alphabetic # Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL +105E..1060 ; Other_Alphabetic # Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA +1062 ; Other_Alphabetic # Mc MYANMAR VOWEL SIGN SGAW KAREN EU +1067..1068 ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN WESTERN PWO KAREN EU..MYANMAR VOWEL SIGN WESTERN PWO KAREN UE +1071..1074 ; Other_Alphabetic # Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE +1082 ; Other_Alphabetic # Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA +1083..1084 ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN SHAN AA..MYANMAR VOWEL SIGN SHAN E +1085..1086 ; Other_Alphabetic # Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y +109C ; Other_Alphabetic # Mc MYANMAR VOWEL SIGN AITON A +109D ; Other_Alphabetic # Mn MYANMAR VOWEL SIGN AITON AI +135F ; Other_Alphabetic # Mn ETHIOPIC COMBINING GEMINATION MARK +1712..1713 ; Other_Alphabetic # Mn [2] TAGALOG VOWEL SIGN I..TAGALOG VOWEL SIGN U +1732..1733 ; Other_Alphabetic # Mn [2] HANUNOO VOWEL SIGN I..HANUNOO VOWEL SIGN U +1752..1753 ; Other_Alphabetic # Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U +1772..1773 ; Other_Alphabetic # Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U +17B6 ; Other_Alphabetic # Mc KHMER VOWEL SIGN AA +17B7..17BD ; Other_Alphabetic # Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA +17BE..17C5 ; Other_Alphabetic # Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU +17C6 ; Other_Alphabetic # Mn KHMER SIGN NIKAHIT +17C7..17C8 ; Other_Alphabetic # Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU +18A9 ; Other_Alphabetic # Mn MONGOLIAN LETTER ALI GALI DAGALGA +1920..1922 ; Other_Alphabetic # Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U +1923..1926 ; Other_Alphabetic # Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU +1927..1928 ; Other_Alphabetic # Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O +1929..192B ; Other_Alphabetic # Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA +1930..1931 ; Other_Alphabetic # Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA +1932 ; Other_Alphabetic # Mn LIMBU SMALL LETTER ANUSVARA +1933..1938 ; Other_Alphabetic # Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA +19B0..19C0 ; Other_Alphabetic # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY +19C8..19C9 ; Other_Alphabetic # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2 +1A17..1A18 ; Other_Alphabetic # Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U +1A19..1A1B ; Other_Alphabetic # Mc [3] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN AE +1A55 ; Other_Alphabetic # Mc TAI THAM CONSONANT SIGN MEDIAL RA +1A56 ; Other_Alphabetic # Mn TAI THAM CONSONANT SIGN MEDIAL LA +1A57 ; Other_Alphabetic # Mc TAI THAM CONSONANT SIGN LA TANG LAI +1A58..1A5E ; Other_Alphabetic # Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA +1A61 ; Other_Alphabetic # Mc TAI THAM VOWEL SIGN A +1A62 ; Other_Alphabetic # Mn TAI THAM VOWEL SIGN MAI SAT +1A63..1A64 ; Other_Alphabetic # Mc [2] TAI THAM VOWEL SIGN AA..TAI THAM VOWEL SIGN TALL AA +1A65..1A6C ; Other_Alphabetic # Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW +1A6D..1A72 ; Other_Alphabetic # Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI +1A73..1A74 ; Other_Alphabetic # Mn [2] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN MAI KANG +1B00..1B03 ; Other_Alphabetic # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG +1B04 ; Other_Alphabetic # Mc BALINESE SIGN BISAH +1B35 ; Other_Alphabetic # Mc BALINESE VOWEL SIGN TEDUNG +1B36..1B3A ; Other_Alphabetic # Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA +1B3B ; Other_Alphabetic # Mc BALINESE VOWEL SIGN RA REPA TEDUNG +1B3C ; Other_Alphabetic # Mn BALINESE VOWEL SIGN LA LENGA +1B3D..1B41 ; Other_Alphabetic # Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG +1B42 ; Other_Alphabetic # Mn BALINESE VOWEL SIGN PEPET +1B43 ; Other_Alphabetic # Mc BALINESE VOWEL SIGN PEPET TEDUNG +1B80..1B81 ; Other_Alphabetic # Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR +1B82 ; Other_Alphabetic # Mc SUNDANESE SIGN PANGWISAD +1BA1 ; Other_Alphabetic # Mc SUNDANESE CONSONANT SIGN PAMINGKAL +1BA2..1BA5 ; Other_Alphabetic # Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU +1BA6..1BA7 ; Other_Alphabetic # Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG +1BA8..1BA9 ; Other_Alphabetic # Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG +1BE7 ; Other_Alphabetic # Mc BATAK VOWEL SIGN E +1BE8..1BE9 ; Other_Alphabetic # Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE +1BEA..1BEC ; Other_Alphabetic # Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O +1BED ; Other_Alphabetic # Mn BATAK VOWEL SIGN KARO O +1BEE ; Other_Alphabetic # Mc BATAK VOWEL SIGN U +1BEF..1BF1 ; Other_Alphabetic # Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H +1C24..1C2B ; Other_Alphabetic # Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU +1C2C..1C33 ; Other_Alphabetic # Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T +1C34..1C35 ; Other_Alphabetic # Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG +1CF2 ; Other_Alphabetic # Mc VEDIC SIGN ARDHAVISARGA +24B6..24E9 ; Other_Alphabetic # So [52] CIRCLED LATIN CAPITAL LETTER A..CIRCLED LATIN SMALL LETTER Z +2DE0..2DFF ; Other_Alphabetic # Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS +A823..A824 ; Other_Alphabetic # Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I +A825..A826 ; Other_Alphabetic # Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E +A827 ; Other_Alphabetic # Mc SYLOTI NAGRI VOWEL SIGN OO +A880..A881 ; Other_Alphabetic # Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA +A8B4..A8C3 ; Other_Alphabetic # Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU +A926..A92A ; Other_Alphabetic # Mn [5] KAYAH LI VOWEL UE..KAYAH LI VOWEL O +A947..A951 ; Other_Alphabetic # Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R +A952 ; Other_Alphabetic # Mc REJANG CONSONANT SIGN H +A980..A982 ; Other_Alphabetic # Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR +A983 ; Other_Alphabetic # Mc JAVANESE SIGN WIGNYAN +A9B4..A9B5 ; Other_Alphabetic # Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG +A9B6..A9B9 ; Other_Alphabetic # Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT +A9BA..A9BB ; Other_Alphabetic # Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE +A9BC ; Other_Alphabetic # Mn JAVANESE VOWEL SIGN PEPET +A9BD..A9BF ; Other_Alphabetic # Mc [3] JAVANESE CONSONANT SIGN KERET..JAVANESE CONSONANT SIGN CAKRA +AA29..AA2E ; Other_Alphabetic # Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE +AA2F..AA30 ; Other_Alphabetic # Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI +AA31..AA32 ; Other_Alphabetic # Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE +AA33..AA34 ; Other_Alphabetic # Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA +AA35..AA36 ; Other_Alphabetic # Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA +AA43 ; Other_Alphabetic # Mn CHAM CONSONANT SIGN FINAL NG +AA4C ; Other_Alphabetic # Mn CHAM CONSONANT SIGN FINAL M +AA4D ; Other_Alphabetic # Mc CHAM CONSONANT SIGN FINAL H +AAB0 ; Other_Alphabetic # Mn TAI VIET MAI KANG +AAB2..AAB4 ; Other_Alphabetic # Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U +AAB7..AAB8 ; Other_Alphabetic # Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA +AABE ; Other_Alphabetic # Mn TAI VIET VOWEL AM +ABE3..ABE4 ; Other_Alphabetic # Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP +ABE5 ; Other_Alphabetic # Mn MEETEI MAYEK VOWEL SIGN ANAP +ABE6..ABE7 ; Other_Alphabetic # Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP +ABE8 ; Other_Alphabetic # Mn MEETEI MAYEK VOWEL SIGN UNAP +ABE9..ABEA ; Other_Alphabetic # Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG +FB1E ; Other_Alphabetic # Mn HEBREW POINT JUDEO-SPANISH VARIKA +10A01..10A03 ; Other_Alphabetic # Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R +10A05..10A06 ; Other_Alphabetic # Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O +10A0C..10A0F ; Other_Alphabetic # Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA +11000 ; Other_Alphabetic # Mc BRAHMI SIGN CANDRABINDU +11001 ; Other_Alphabetic # Mn BRAHMI SIGN ANUSVARA +11002 ; Other_Alphabetic # Mc BRAHMI SIGN VISARGA +11038..11045 ; Other_Alphabetic # Mn [14] BRAHMI VOWEL SIGN AA..BRAHMI VOWEL SIGN AU +11082 ; Other_Alphabetic # Mc KAITHI SIGN VISARGA +110B0..110B2 ; Other_Alphabetic # Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II +110B3..110B6 ; Other_Alphabetic # Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI +110B7..110B8 ; Other_Alphabetic # Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + +# Total code points: 795 + +# ================================================ + +3006 ; Ideographic # Lo IDEOGRAPHIC CLOSING MARK +3007 ; Ideographic # Nl IDEOGRAPHIC NUMBER ZERO +3021..3029 ; Ideographic # Nl [9] HANGZHOU NUMERAL ONE..HANGZHOU NUMERAL NINE +3038..303A ; Ideographic # Nl [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY +3400..4DB5 ; Ideographic # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 +4E00..9FCB ; Ideographic # Lo [20940] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCB +F900..FA2D ; Ideographic # Lo [302] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA2D +FA30..FA6D ; Ideographic # Lo [62] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILITY IDEOGRAPH-FA6D +FA70..FAD9 ; Ideographic # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9 +20000..2A6D6 ; Ideographic # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 +2A700..2B734 ; Ideographic # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 +2B740..2B81D ; Ideographic # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D +2F800..2FA1D ; Ideographic # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D + +# Total code points: 75630 + +# ================================================ + +005E ; Diacritic # Sk CIRCUMFLEX ACCENT +0060 ; Diacritic # Sk GRAVE ACCENT +00A8 ; Diacritic # Sk DIAERESIS +00AF ; Diacritic # Sk MACRON +00B4 ; Diacritic # Sk ACUTE ACCENT +00B7 ; Diacritic # Po MIDDLE DOT +00B8 ; Diacritic # Sk CEDILLA +02B0..02C1 ; Diacritic # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP +02C2..02C5 ; Diacritic # Sk [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD +02C6..02D1 ; Diacritic # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON +02D2..02DF ; Diacritic # Sk [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT +02E0..02E4 ; Diacritic # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +02E5..02EB ; Diacritic # Sk [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK +02EC ; Diacritic # Lm MODIFIER LETTER VOICING +02ED ; Diacritic # Sk MODIFIER LETTER UNASPIRATED +02EE ; Diacritic # Lm MODIFIER LETTER DOUBLE APOSTROPHE +02EF..02FF ; Diacritic # Sk [17] MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW +0300..034E ; Diacritic # Mn [79] COMBINING GRAVE ACCENT..COMBINING UPWARDS ARROW BELOW +0350..0357 ; Diacritic # Mn [8] COMBINING RIGHT ARROWHEAD ABOVE..COMBINING RIGHT HALF RING ABOVE +035D..0362 ; Diacritic # Mn [6] COMBINING DOUBLE BREVE..COMBINING DOUBLE RIGHTWARDS ARROW BELOW +0374 ; Diacritic # Lm GREEK NUMERAL SIGN +0375 ; Diacritic # Sk GREEK LOWER NUMERAL SIGN +037A ; Diacritic # Lm GREEK YPOGEGRAMMENI +0384..0385 ; Diacritic # Sk [2] GREEK TONOS..GREEK DIALYTIKA TONOS +0483..0487 ; Diacritic # Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE +0559 ; Diacritic # Lm ARMENIAN MODIFIER LETTER LEFT HALF RING +0591..05A1 ; Diacritic # Mn [17] HEBREW ACCENT ETNAHTA..HEBREW ACCENT PAZER +05A3..05BD ; Diacritic # Mn [27] HEBREW ACCENT MUNAH..HEBREW POINT METEG +05BF ; Diacritic # Mn HEBREW POINT RAFE +05C1..05C2 ; Diacritic # Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +05C4 ; Diacritic # Mn HEBREW MARK UPPER DOT +064B..0652 ; Diacritic # Mn [8] ARABIC FATHATAN..ARABIC SUKUN +0657..0658 ; Diacritic # Mn [2] ARABIC INVERTED DAMMA..ARABIC MARK NOON GHUNNA +06DF..06E0 ; Diacritic # Mn [2] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH UPRIGHT RECTANGULAR ZERO +06E5..06E6 ; Diacritic # Lm [2] ARABIC SMALL WAW..ARABIC SMALL YEH +06EA..06EC ; Diacritic # Mn [3] ARABIC EMPTY CENTRE LOW STOP..ARABIC ROUNDED HIGH STOP WITH FILLED CENTRE +0730..074A ; Diacritic # Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH +07A6..07B0 ; Diacritic # Mn [11] THAANA ABAFILI..THAANA SUKUN +07EB..07F3 ; Diacritic # Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE +07F4..07F5 ; Diacritic # Lm [2] NKO HIGH TONE APOSTROPHE..NKO LOW TONE APOSTROPHE +0818..0819 ; Diacritic # Mn [2] SAMARITAN MARK OCCLUSION..SAMARITAN MARK DAGESH +093C ; Diacritic # Mn DEVANAGARI SIGN NUKTA +094D ; Diacritic # Mn DEVANAGARI SIGN VIRAMA +0951..0954 ; Diacritic # Mn [4] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI ACUTE ACCENT +0971 ; Diacritic # Lm DEVANAGARI SIGN HIGH SPACING DOT +09BC ; Diacritic # Mn BENGALI SIGN NUKTA +09CD ; Diacritic # Mn BENGALI SIGN VIRAMA +0A3C ; Diacritic # Mn GURMUKHI SIGN NUKTA +0A4D ; Diacritic # Mn GURMUKHI SIGN VIRAMA +0ABC ; Diacritic # Mn GUJARATI SIGN NUKTA +0ACD ; Diacritic # Mn GUJARATI SIGN VIRAMA +0B3C ; Diacritic # Mn ORIYA SIGN NUKTA +0B4D ; Diacritic # Mn ORIYA SIGN VIRAMA +0BCD ; Diacritic # Mn TAMIL SIGN VIRAMA +0C4D ; Diacritic # Mn TELUGU SIGN VIRAMA +0CBC ; Diacritic # Mn KANNADA SIGN NUKTA +0CCD ; Diacritic # Mn KANNADA SIGN VIRAMA +0D4D ; Diacritic # Mn MALAYALAM SIGN VIRAMA +0DCA ; Diacritic # Mn SINHALA SIGN AL-LAKUNA +0E47..0E4C ; Diacritic # Mn [6] THAI CHARACTER MAITAIKHU..THAI CHARACTER THANTHAKHAT +0E4E ; Diacritic # Mn THAI CHARACTER YAMAKKAN +0EC8..0ECC ; Diacritic # Mn [5] LAO TONE MAI EK..LAO CANCELLATION MARK +0F18..0F19 ; Diacritic # Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS +0F35 ; Diacritic # Mn TIBETAN MARK NGAS BZUNG NYI ZLA +0F37 ; Diacritic # Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS +0F39 ; Diacritic # Mn TIBETAN MARK TSA -PHRU +0F3E..0F3F ; Diacritic # Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES +0F82..0F84 ; Diacritic # Mn [3] TIBETAN SIGN NYI ZLA NAA DA..TIBETAN MARK HALANTA +0F86..0F87 ; Diacritic # Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS +0FC6 ; Diacritic # Mn TIBETAN SYMBOL PADMA GDAN +1037 ; Diacritic # Mn MYANMAR SIGN DOT BELOW +1039..103A ; Diacritic # Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT +1087..108C ; Diacritic # Mc [6] MYANMAR SIGN SHAN TONE-2..MYANMAR SIGN SHAN COUNCIL TONE-3 +108D ; Diacritic # Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE +108F ; Diacritic # Mc MYANMAR SIGN RUMAI PALAUNG TONE-5 +109A..109B ; Diacritic # Mc [2] MYANMAR SIGN KHAMTI TONE-1..MYANMAR SIGN KHAMTI TONE-3 +17C9..17D3 ; Diacritic # Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT +17DD ; Diacritic # Mn KHMER SIGN ATTHACAN +1939..193B ; Diacritic # Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I +1A75..1A7C ; Diacritic # Mn [8] TAI THAM SIGN TONE-1..TAI THAM SIGN KHUEN-LUE KARAN +1A7F ; Diacritic # Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT +1B34 ; Diacritic # Mn BALINESE SIGN REREKAN +1B44 ; Diacritic # Mc BALINESE ADEG ADEG +1B6B..1B73 ; Diacritic # Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG +1BAA ; Diacritic # Mc SUNDANESE SIGN PAMAAEH +1C36..1C37 ; Diacritic # Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA +1C78..1C7D ; Diacritic # Lm [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD +1CD0..1CD2 ; Diacritic # Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA +1CD3 ; Diacritic # Po VEDIC SIGN NIHSHVASA +1CD4..1CE0 ; Diacritic # Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA +1CE1 ; Diacritic # Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA +1CE2..1CE8 ; Diacritic # Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL +1CED ; Diacritic # Mn VEDIC SIGN TIRYAK +1D2C..1D61 ; Diacritic # Lm [54] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL CHI +1D62..1D6A ; Diacritic # L& [9] LATIN SUBSCRIPT SMALL LETTER I..GREEK SUBSCRIPT SMALL LETTER CHI +1DC4..1DCF ; Diacritic # Mn [12] COMBINING MACRON-ACUTE..COMBINING ZIGZAG BELOW +1DFD..1DFF ; Diacritic # Mn [3] COMBINING ALMOST EQUAL TO BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW +1FBD ; Diacritic # Sk GREEK KORONIS +1FBF..1FC1 ; Diacritic # Sk [3] GREEK PSILI..GREEK DIALYTIKA AND PERISPOMENI +1FCD..1FCF ; Diacritic # Sk [3] GREEK PSILI AND VARIA..GREEK PSILI AND PERISPOMENI +1FDD..1FDF ; Diacritic # Sk [3] GREEK DASIA AND VARIA..GREEK DASIA AND PERISPOMENI +1FED..1FEF ; Diacritic # Sk [3] GREEK DIALYTIKA AND VARIA..GREEK VARIA +1FFD..1FFE ; Diacritic # Sk [2] GREEK OXIA..GREEK DASIA +2CEF..2CF1 ; Diacritic # Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS +2E2F ; Diacritic # Lm VERTICAL TILDE +302A..302F ; Diacritic # Mn [6] IDEOGRAPHIC LEVEL TONE MARK..HANGUL DOUBLE DOT TONE MARK +3099..309A ; Diacritic # Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +309B..309C ; Diacritic # Sk [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +30FC ; Diacritic # Lm KATAKANA-HIRAGANA PROLONGED SOUND MARK +A66F ; Diacritic # Mn COMBINING CYRILLIC VZMET +A67C..A67D ; Diacritic # Mn [2] COMBINING CYRILLIC KAVYKA..COMBINING CYRILLIC PAYEROK +A67F ; Diacritic # Lm CYRILLIC PAYEROK +A6F0..A6F1 ; Diacritic # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS +A717..A71F ; Diacritic # Lm [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK +A720..A721 ; Diacritic # Sk [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE +A788 ; Diacritic # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT +A8C4 ; Diacritic # Mn SAURASHTRA SIGN VIRAMA +A8E0..A8F1 ; Diacritic # Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA +A92B..A92D ; Diacritic # Mn [3] KAYAH LI TONE PLOPHU..KAYAH LI TONE CALYA PLOPHU +A92E ; Diacritic # Po KAYAH LI SIGN CWI +A953 ; Diacritic # Mc REJANG VIRAMA +A9B3 ; Diacritic # Mn JAVANESE SIGN CECAK TELU +A9C0 ; Diacritic # Mc JAVANESE PANGKON +AA7B ; Diacritic # Mc MYANMAR SIGN PAO KAREN TONE +AABF ; Diacritic # Mn TAI VIET TONE MAI EK +AAC0 ; Diacritic # Lo TAI VIET TONE MAI NUENG +AAC1 ; Diacritic # Mn TAI VIET TONE MAI THO +AAC2 ; Diacritic # Lo TAI VIET TONE MAI SONG +ABEC ; Diacritic # Mc MEETEI MAYEK LUM IYEK +ABED ; Diacritic # Mn MEETEI MAYEK APUN IYEK +FB1E ; Diacritic # Mn HEBREW POINT JUDEO-SPANISH VARIKA +FE20..FE26 ; Diacritic # Mn [7] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON +FF3E ; Diacritic # Sk FULLWIDTH CIRCUMFLEX ACCENT +FF40 ; Diacritic # Sk FULLWIDTH GRAVE ACCENT +FF70 ; Diacritic # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK +FF9E..FF9F ; Diacritic # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +FFE3 ; Diacritic # Sk FULLWIDTH MACRON +110B9..110BA ; Diacritic # Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA +1D167..1D169 ; Diacritic # Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 +1D16D..1D172 ; Diacritic # Mc [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5 +1D17B..1D182 ; Diacritic # Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE +1D185..1D18B ; Diacritic # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE +1D1AA..1D1AD ; Diacritic # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + +# Total code points: 639 + +# ================================================ + +00B7 ; Extender # Po MIDDLE DOT +02D0..02D1 ; Extender # Lm [2] MODIFIER LETTER TRIANGULAR COLON..MODIFIER LETTER HALF TRIANGULAR COLON +0640 ; Extender # Lm ARABIC TATWEEL +07FA ; Extender # Lm NKO LAJANYALAN +0E46 ; Extender # Lm THAI CHARACTER MAIYAMOK +0EC6 ; Extender # Lm LAO KO LA +1843 ; Extender # Lm MONGOLIAN LETTER TODO LONG VOWEL SIGN +1AA7 ; Extender # Lm TAI THAM SIGN MAI YAMOK +1C36 ; Extender # Mn LEPCHA SIGN RAN +1C7B ; Extender # Lm OL CHIKI RELAA +3005 ; Extender # Lm IDEOGRAPHIC ITERATION MARK +3031..3035 ; Extender # Lm [5] VERTICAL KANA REPEAT MARK..VERTICAL KANA REPEAT MARK LOWER HALF +309D..309E ; Extender # Lm [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK +30FC..30FE ; Extender # Lm [3] KATAKANA-HIRAGANA PROLONGED SOUND MARK..KATAKANA VOICED ITERATION MARK +A015 ; Extender # Lm YI SYLLABLE WU +A60C ; Extender # Lm VAI SYLLABLE LENGTHENER +A9CF ; Extender # Lm JAVANESE PANGRANGKEP +AA70 ; Extender # Lm MYANMAR MODIFIER LETTER KHAMTI REDUPLICATION +AADD ; Extender # Lm TAI VIET SYMBOL SAM +FF70 ; Extender # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK + +# Total code points: 28 + +# ================================================ + +02B0..02B8 ; Other_Lowercase # Lm [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y +02C0..02C1 ; Other_Lowercase # Lm [2] MODIFIER LETTER GLOTTAL STOP..MODIFIER LETTER REVERSED GLOTTAL STOP +02E0..02E4 ; Other_Lowercase # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +0345 ; Other_Lowercase # Mn COMBINING GREEK YPOGEGRAMMENI +037A ; Other_Lowercase # Lm GREEK YPOGEGRAMMENI +1D2C..1D61 ; Other_Lowercase # Lm [54] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL CHI +1D78 ; Other_Lowercase # Lm MODIFIER LETTER CYRILLIC EN +1D9B..1DBF ; Other_Lowercase # Lm [37] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL THETA +2090..2094 ; Other_Lowercase # Lm [5] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER SCHWA +2170..217F ; Other_Lowercase # Nl [16] SMALL ROMAN NUMERAL ONE..SMALL ROMAN NUMERAL ONE THOUSAND +24D0..24E9 ; Other_Lowercase # So [26] CIRCLED LATIN SMALL LETTER A..CIRCLED LATIN SMALL LETTER Z +2C7D ; Other_Lowercase # Lm MODIFIER LETTER CAPITAL V +A770 ; Other_Lowercase # Lm MODIFIER LETTER US + +# Total code points: 159 + +# ================================================ + +2160..216F ; Other_Uppercase # Nl [16] ROMAN NUMERAL ONE..ROMAN NUMERAL ONE THOUSAND +24B6..24CF ; Other_Uppercase # So [26] CIRCLED LATIN CAPITAL LETTER A..CIRCLED LATIN CAPITAL LETTER Z + +# Total code points: 42 + +# ================================================ + +FDD0..FDEF ; Noncharacter_Code_Point # Cn [32] .. +FFFE..FFFF ; Noncharacter_Code_Point # Cn [2] .. +1FFFE..1FFFF ; Noncharacter_Code_Point # Cn [2] .. +2FFFE..2FFFF ; Noncharacter_Code_Point # Cn [2] .. +3FFFE..3FFFF ; Noncharacter_Code_Point # Cn [2] .. +4FFFE..4FFFF ; Noncharacter_Code_Point # Cn [2] .. +5FFFE..5FFFF ; Noncharacter_Code_Point # Cn [2] .. +6FFFE..6FFFF ; Noncharacter_Code_Point # Cn [2] .. +7FFFE..7FFFF ; Noncharacter_Code_Point # Cn [2] .. +8FFFE..8FFFF ; Noncharacter_Code_Point # Cn [2] .. +9FFFE..9FFFF ; Noncharacter_Code_Point # Cn [2] .. +AFFFE..AFFFF ; Noncharacter_Code_Point # Cn [2] .. +BFFFE..BFFFF ; Noncharacter_Code_Point # Cn [2] .. +CFFFE..CFFFF ; Noncharacter_Code_Point # Cn [2] .. +DFFFE..DFFFF ; Noncharacter_Code_Point # Cn [2] .. +EFFFE..EFFFF ; Noncharacter_Code_Point # Cn [2] .. +FFFFE..FFFFF ; Noncharacter_Code_Point # Cn [2] .. +10FFFE..10FFFF; Noncharacter_Code_Point # Cn [2] .. + +# Total code points: 66 + +# ================================================ + +09BE ; Other_Grapheme_Extend # Mc BENGALI VOWEL SIGN AA +09D7 ; Other_Grapheme_Extend # Mc BENGALI AU LENGTH MARK +0B3E ; Other_Grapheme_Extend # Mc ORIYA VOWEL SIGN AA +0B57 ; Other_Grapheme_Extend # Mc ORIYA AU LENGTH MARK +0BBE ; Other_Grapheme_Extend # Mc TAMIL VOWEL SIGN AA +0BD7 ; Other_Grapheme_Extend # Mc TAMIL AU LENGTH MARK +0CC2 ; Other_Grapheme_Extend # Mc KANNADA VOWEL SIGN UU +0CD5..0CD6 ; Other_Grapheme_Extend # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +0D3E ; Other_Grapheme_Extend # Mc MALAYALAM VOWEL SIGN AA +0D57 ; Other_Grapheme_Extend # Mc MALAYALAM AU LENGTH MARK +0DCF ; Other_Grapheme_Extend # Mc SINHALA VOWEL SIGN AELA-PILLA +0DDF ; Other_Grapheme_Extend # Mc SINHALA VOWEL SIGN GAYANUKITTA +200C..200D ; Other_Grapheme_Extend # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER +FF9E..FF9F ; Other_Grapheme_Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +1D165 ; Other_Grapheme_Extend # Mc MUSICAL SYMBOL COMBINING STEM +1D16E..1D172 ; Other_Grapheme_Extend # Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + +# Total code points: 23 + +# ================================================ + +2FF0..2FF1 ; IDS_Binary_Operator # So [2] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO BELOW +2FF4..2FFB ; IDS_Binary_Operator # So [8] IDEOGRAPHIC DESCRIPTION CHARACTER FULL SURROUND..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID + +# Total code points: 10 + +# ================================================ + +2FF2..2FF3 ; IDS_Trinary_Operator # So [2] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW + +# Total code points: 2 + +# ================================================ + +2E80..2E99 ; Radical # So [26] CJK RADICAL REPEAT..CJK RADICAL RAP +2E9B..2EF3 ; Radical # So [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE +2F00..2FD5 ; Radical # So [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE + +# Total code points: 329 + +# ================================================ + +3400..4DB5 ; Unified_Ideograph # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 +4E00..9FCB ; Unified_Ideograph # Lo [20940] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCB +FA0E..FA0F ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA0E..CJK COMPATIBILITY IDEOGRAPH-FA0F +FA11 ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA11 +FA13..FA14 ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA13..CJK COMPATIBILITY IDEOGRAPH-FA14 +FA1F ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA1F +FA21 ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA21 +FA23..FA24 ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA23..CJK COMPATIBILITY IDEOGRAPH-FA24 +FA27..FA29 ; Unified_Ideograph # Lo [3] CJK COMPATIBILITY IDEOGRAPH-FA27..CJK COMPATIBILITY IDEOGRAPH-FA29 +20000..2A6D6 ; Unified_Ideograph # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 +2A700..2B734 ; Unified_Ideograph # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 +2B740..2B81D ; Unified_Ideograph # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D + +# Total code points: 74616 + +# ================================================ + +034F ; Other_Default_Ignorable_Code_Point # Mn COMBINING GRAPHEME JOINER +115F..1160 ; Other_Default_Ignorable_Code_Point # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER +2065..2069 ; Other_Default_Ignorable_Code_Point # Cn [5] .. +3164 ; Other_Default_Ignorable_Code_Point # Lo HANGUL FILLER +FFA0 ; Other_Default_Ignorable_Code_Point # Lo HALFWIDTH HANGUL FILLER +FFF0..FFF8 ; Other_Default_Ignorable_Code_Point # Cn [9] .. +E0000 ; Other_Default_Ignorable_Code_Point # Cn +E0002..E001F ; Other_Default_Ignorable_Code_Point # Cn [30] .. +E0080..E00FF ; Other_Default_Ignorable_Code_Point # Cn [128] .. +E01F0..E0FFF ; Other_Default_Ignorable_Code_Point # Cn [3600] .. + +# Total code points: 3778 + +# ================================================ + +0149 ; Deprecated # L& LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +0673 ; Deprecated # Lo ARABIC LETTER ALEF WITH WAVY HAMZA BELOW +0F77 ; Deprecated # Mn TIBETAN VOWEL SIGN VOCALIC RR +0F79 ; Deprecated # Mn TIBETAN VOWEL SIGN VOCALIC LL +17A3..17A4 ; Deprecated # Lo [2] KHMER INDEPENDENT VOWEL QAQ..KHMER INDEPENDENT VOWEL QAA +206A..206F ; Deprecated # Cf [6] INHIBIT SYMMETRIC SWAPPING..NOMINAL DIGIT SHAPES +2329 ; Deprecated # Ps LEFT-POINTING ANGLE BRACKET +232A ; Deprecated # Pe RIGHT-POINTING ANGLE BRACKET +E0001 ; Deprecated # Cf LANGUAGE TAG +E0020..E007F ; Deprecated # Cf [96] TAG SPACE..CANCEL TAG + +# Total code points: 111 + +# ================================================ + +0069..006A ; Soft_Dotted # L& [2] LATIN SMALL LETTER I..LATIN SMALL LETTER J +012F ; Soft_Dotted # L& LATIN SMALL LETTER I WITH OGONEK +0249 ; Soft_Dotted # L& LATIN SMALL LETTER J WITH STROKE +0268 ; Soft_Dotted # L& LATIN SMALL LETTER I WITH STROKE +029D ; Soft_Dotted # L& LATIN SMALL LETTER J WITH CROSSED-TAIL +02B2 ; Soft_Dotted # Lm MODIFIER LETTER SMALL J +03F3 ; Soft_Dotted # L& GREEK LETTER YOT +0456 ; Soft_Dotted # L& CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +0458 ; Soft_Dotted # L& CYRILLIC SMALL LETTER JE +1D62 ; Soft_Dotted # L& LATIN SUBSCRIPT SMALL LETTER I +1D96 ; Soft_Dotted # L& LATIN SMALL LETTER I WITH RETROFLEX HOOK +1DA4 ; Soft_Dotted # Lm MODIFIER LETTER SMALL I WITH STROKE +1DA8 ; Soft_Dotted # Lm MODIFIER LETTER SMALL J WITH CROSSED-TAIL +1E2D ; Soft_Dotted # L& LATIN SMALL LETTER I WITH TILDE BELOW +1ECB ; Soft_Dotted # L& LATIN SMALL LETTER I WITH DOT BELOW +2071 ; Soft_Dotted # Lm SUPERSCRIPT LATIN SMALL LETTER I +2148..2149 ; Soft_Dotted # L& [2] DOUBLE-STRUCK ITALIC SMALL I..DOUBLE-STRUCK ITALIC SMALL J +2C7C ; Soft_Dotted # L& LATIN SUBSCRIPT SMALL LETTER J +1D422..1D423 ; Soft_Dotted # L& [2] MATHEMATICAL BOLD SMALL I..MATHEMATICAL BOLD SMALL J +1D456..1D457 ; Soft_Dotted # L& [2] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL ITALIC SMALL J +1D48A..1D48B ; Soft_Dotted # L& [2] MATHEMATICAL BOLD ITALIC SMALL I..MATHEMATICAL BOLD ITALIC SMALL J +1D4BE..1D4BF ; Soft_Dotted # L& [2] MATHEMATICAL SCRIPT SMALL I..MATHEMATICAL SCRIPT SMALL J +1D4F2..1D4F3 ; Soft_Dotted # L& [2] MATHEMATICAL BOLD SCRIPT SMALL I..MATHEMATICAL BOLD SCRIPT SMALL J +1D526..1D527 ; Soft_Dotted # L& [2] MATHEMATICAL FRAKTUR SMALL I..MATHEMATICAL FRAKTUR SMALL J +1D55A..1D55B ; Soft_Dotted # L& [2] MATHEMATICAL DOUBLE-STRUCK SMALL I..MATHEMATICAL DOUBLE-STRUCK SMALL J +1D58E..1D58F ; Soft_Dotted # L& [2] MATHEMATICAL BOLD FRAKTUR SMALL I..MATHEMATICAL BOLD FRAKTUR SMALL J +1D5C2..1D5C3 ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF SMALL I..MATHEMATICAL SANS-SERIF SMALL J +1D5F6..1D5F7 ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF BOLD SMALL I..MATHEMATICAL SANS-SERIF BOLD SMALL J +1D62A..1D62B ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF ITALIC SMALL I..MATHEMATICAL SANS-SERIF ITALIC SMALL J +1D65E..1D65F ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J +1D692..1D693 ; Soft_Dotted # L& [2] MATHEMATICAL MONOSPACE SMALL I..MATHEMATICAL MONOSPACE SMALL J + +# Total code points: 46 + +# ================================================ + +0E40..0E44 ; Logical_Order_Exception # Lo [5] THAI CHARACTER SARA E..THAI CHARACTER SARA AI MAIMALAI +0EC0..0EC4 ; Logical_Order_Exception # Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI +AAB5..AAB6 ; Logical_Order_Exception # Lo [2] TAI VIET VOWEL E..TAI VIET VOWEL O +AAB9 ; Logical_Order_Exception # Lo TAI VIET VOWEL UEA +AABB..AABC ; Logical_Order_Exception # Lo [2] TAI VIET VOWEL AUE..TAI VIET VOWEL AY + +# Total code points: 15 + +# ================================================ + +2118 ; Other_ID_Start # Sm SCRIPT CAPITAL P +212E ; Other_ID_Start # So ESTIMATED SYMBOL +309B..309C ; Other_ID_Start # Sk [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + +# Total code points: 4 + +# ================================================ + +00B7 ; Other_ID_Continue # Po MIDDLE DOT +0387 ; Other_ID_Continue # Po GREEK ANO TELEIA +1369..1371 ; Other_ID_Continue # No [9] ETHIOPIC DIGIT ONE..ETHIOPIC DIGIT NINE +19DA ; Other_ID_Continue # No NEW TAI LUE THAM DIGIT ONE + +# Total code points: 12 + +# ================================================ + +0021 ; STerm # Po EXCLAMATION MARK +002E ; STerm # Po FULL STOP +003F ; STerm # Po QUESTION MARK +055C ; STerm # Po ARMENIAN EXCLAMATION MARK +055E ; STerm # Po ARMENIAN QUESTION MARK +0589 ; STerm # Po ARMENIAN FULL STOP +061F ; STerm # Po ARABIC QUESTION MARK +06D4 ; STerm # Po ARABIC FULL STOP +0700..0702 ; STerm # Po [3] SYRIAC END OF PARAGRAPH..SYRIAC SUBLINEAR FULL STOP +07F9 ; STerm # Po NKO EXCLAMATION MARK +0964..0965 ; STerm # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA +104A..104B ; STerm # Po [2] MYANMAR SIGN LITTLE SECTION..MYANMAR SIGN SECTION +1362 ; STerm # Po ETHIOPIC FULL STOP +1367..1368 ; STerm # Po [2] ETHIOPIC QUESTION MARK..ETHIOPIC PARAGRAPH SEPARATOR +166E ; STerm # Po CANADIAN SYLLABICS FULL STOP +1735..1736 ; STerm # Po [2] PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION +1803 ; STerm # Po MONGOLIAN FULL STOP +1809 ; STerm # Po MONGOLIAN MANCHU FULL STOP +1944..1945 ; STerm # Po [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK +1AA8..1AAB ; STerm # Po [4] TAI THAM SIGN KAAN..TAI THAM SIGN SATKAANKUU +1B5A..1B5B ; STerm # Po [2] BALINESE PANTI..BALINESE PAMADA +1B5E..1B5F ; STerm # Po [2] BALINESE CARIK SIKI..BALINESE CARIK PAREREN +1C3B..1C3C ; STerm # Po [2] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION NYET THYOOM TA-ROL +1C7E..1C7F ; STerm # Po [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD +203C..203D ; STerm # Po [2] DOUBLE EXCLAMATION MARK..INTERROBANG +2047..2049 ; STerm # Po [3] DOUBLE QUESTION MARK..EXCLAMATION QUESTION MARK +2E2E ; STerm # Po REVERSED QUESTION MARK +3002 ; STerm # Po IDEOGRAPHIC FULL STOP +A4FF ; STerm # Po LISU PUNCTUATION FULL STOP +A60E..A60F ; STerm # Po [2] VAI FULL STOP..VAI QUESTION MARK +A6F3 ; STerm # Po BAMUM FULL STOP +A6F7 ; STerm # Po BAMUM QUESTION MARK +A876..A877 ; STerm # Po [2] PHAGS-PA MARK SHAD..PHAGS-PA MARK DOUBLE SHAD +A8CE..A8CF ; STerm # Po [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA +A92F ; STerm # Po KAYAH LI SIGN SHYA +A9C8..A9C9 ; STerm # Po [2] JAVANESE PADA LINGSA..JAVANESE PADA LUNGSI +AA5D..AA5F ; STerm # Po [3] CHAM PUNCTUATION DANDA..CHAM PUNCTUATION TRIPLE DANDA +ABEB ; STerm # Po MEETEI MAYEK CHEIKHEI +FE52 ; STerm # Po SMALL FULL STOP +FE56..FE57 ; STerm # Po [2] SMALL QUESTION MARK..SMALL EXCLAMATION MARK +FF01 ; STerm # Po FULLWIDTH EXCLAMATION MARK +FF0E ; STerm # Po FULLWIDTH FULL STOP +FF1F ; STerm # Po FULLWIDTH QUESTION MARK +FF61 ; STerm # Po HALFWIDTH IDEOGRAPHIC FULL STOP +10A56..10A57 ; STerm # Po [2] KHAROSHTHI PUNCTUATION DANDA..KHAROSHTHI PUNCTUATION DOUBLE DANDA +11047..11048 ; STerm # Po [2] BRAHMI DANDA..BRAHMI DOUBLE DANDA +110BE..110C1 ; STerm # Po [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA + +# Total code points: 76 + +# ================================================ + +180B..180D ; Variation_Selector # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE +FE00..FE0F ; Variation_Selector # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 +E0100..E01EF ; Variation_Selector # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + +# Total code points: 259 + +# ================================================ + +0009..000D ; Pattern_White_Space # Cc [5] .. +0020 ; Pattern_White_Space # Zs SPACE +0085 ; Pattern_White_Space # Cc +200E..200F ; Pattern_White_Space # Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +2028 ; Pattern_White_Space # Zl LINE SEPARATOR +2029 ; Pattern_White_Space # Zp PARAGRAPH SEPARATOR + +# Total code points: 11 + +# ================================================ + +0021..0023 ; Pattern_Syntax # Po [3] EXCLAMATION MARK..NUMBER SIGN +0024 ; Pattern_Syntax # Sc DOLLAR SIGN +0025..0027 ; Pattern_Syntax # Po [3] PERCENT SIGN..APOSTROPHE +0028 ; Pattern_Syntax # Ps LEFT PARENTHESIS +0029 ; Pattern_Syntax # Pe RIGHT PARENTHESIS +002A ; Pattern_Syntax # Po ASTERISK +002B ; Pattern_Syntax # Sm PLUS SIGN +002C ; Pattern_Syntax # Po COMMA +002D ; Pattern_Syntax # Pd HYPHEN-MINUS +002E..002F ; Pattern_Syntax # Po [2] FULL STOP..SOLIDUS +003A..003B ; Pattern_Syntax # Po [2] COLON..SEMICOLON +003C..003E ; Pattern_Syntax # Sm [3] LESS-THAN SIGN..GREATER-THAN SIGN +003F..0040 ; Pattern_Syntax # Po [2] QUESTION MARK..COMMERCIAL AT +005B ; Pattern_Syntax # Ps LEFT SQUARE BRACKET +005C ; Pattern_Syntax # Po REVERSE SOLIDUS +005D ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET +005E ; Pattern_Syntax # Sk CIRCUMFLEX ACCENT +0060 ; Pattern_Syntax # Sk GRAVE ACCENT +007B ; Pattern_Syntax # Ps LEFT CURLY BRACKET +007C ; Pattern_Syntax # Sm VERTICAL LINE +007D ; Pattern_Syntax # Pe RIGHT CURLY BRACKET +007E ; Pattern_Syntax # Sm TILDE +00A1 ; Pattern_Syntax # Po INVERTED EXCLAMATION MARK +00A2..00A5 ; Pattern_Syntax # Sc [4] CENT SIGN..YEN SIGN +00A6..00A7 ; Pattern_Syntax # So [2] BROKEN BAR..SECTION SIGN +00A9 ; Pattern_Syntax # So COPYRIGHT SIGN +00AB ; Pattern_Syntax # Pi LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00AC ; Pattern_Syntax # Sm NOT SIGN +00AE ; Pattern_Syntax # So REGISTERED SIGN +00B0 ; Pattern_Syntax # So DEGREE SIGN +00B1 ; Pattern_Syntax # Sm PLUS-MINUS SIGN +00B6 ; Pattern_Syntax # So PILCROW SIGN +00BB ; Pattern_Syntax # Pf RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +00BF ; Pattern_Syntax # Po INVERTED QUESTION MARK +00D7 ; Pattern_Syntax # Sm MULTIPLICATION SIGN +00F7 ; Pattern_Syntax # Sm DIVISION SIGN +2010..2015 ; Pattern_Syntax # Pd [6] HYPHEN..HORIZONTAL BAR +2016..2017 ; Pattern_Syntax # Po [2] DOUBLE VERTICAL LINE..DOUBLE LOW LINE +2018 ; Pattern_Syntax # Pi LEFT SINGLE QUOTATION MARK +2019 ; Pattern_Syntax # Pf RIGHT SINGLE QUOTATION MARK +201A ; Pattern_Syntax # Ps SINGLE LOW-9 QUOTATION MARK +201B..201C ; Pattern_Syntax # Pi [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK +201D ; Pattern_Syntax # Pf RIGHT DOUBLE QUOTATION MARK +201E ; Pattern_Syntax # Ps DOUBLE LOW-9 QUOTATION MARK +201F ; Pattern_Syntax # Pi DOUBLE HIGH-REVERSED-9 QUOTATION MARK +2020..2027 ; Pattern_Syntax # Po [8] DAGGER..HYPHENATION POINT +2030..2038 ; Pattern_Syntax # Po [9] PER MILLE SIGN..CARET +2039 ; Pattern_Syntax # Pi SINGLE LEFT-POINTING ANGLE QUOTATION MARK +203A ; Pattern_Syntax # Pf SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +203B..203E ; Pattern_Syntax # Po [4] REFERENCE MARK..OVERLINE +2041..2043 ; Pattern_Syntax # Po [3] CARET INSERTION POINT..HYPHEN BULLET +2044 ; Pattern_Syntax # Sm FRACTION SLASH +2045 ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH QUILL +2046 ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH QUILL +2047..2051 ; Pattern_Syntax # Po [11] DOUBLE QUESTION MARK..TWO ASTERISKS ALIGNED VERTICALLY +2052 ; Pattern_Syntax # Sm COMMERCIAL MINUS SIGN +2053 ; Pattern_Syntax # Po SWUNG DASH +2055..205E ; Pattern_Syntax # Po [10] FLOWER PUNCTUATION MARK..VERTICAL FOUR DOTS +2190..2194 ; Pattern_Syntax # Sm [5] LEFTWARDS ARROW..LEFT RIGHT ARROW +2195..2199 ; Pattern_Syntax # So [5] UP DOWN ARROW..SOUTH WEST ARROW +219A..219B ; Pattern_Syntax # Sm [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE +219C..219F ; Pattern_Syntax # So [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW +21A0 ; Pattern_Syntax # Sm RIGHTWARDS TWO HEADED ARROW +21A1..21A2 ; Pattern_Syntax # So [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL +21A3 ; Pattern_Syntax # Sm RIGHTWARDS ARROW WITH TAIL +21A4..21A5 ; Pattern_Syntax # So [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR +21A6 ; Pattern_Syntax # Sm RIGHTWARDS ARROW FROM BAR +21A7..21AD ; Pattern_Syntax # So [7] DOWNWARDS ARROW FROM BAR..LEFT RIGHT WAVE ARROW +21AE ; Pattern_Syntax # Sm LEFT RIGHT ARROW WITH STROKE +21AF..21CD ; Pattern_Syntax # So [31] DOWNWARDS ZIGZAG ARROW..LEFTWARDS DOUBLE ARROW WITH STROKE +21CE..21CF ; Pattern_Syntax # Sm [2] LEFT RIGHT DOUBLE ARROW WITH STROKE..RIGHTWARDS DOUBLE ARROW WITH STROKE +21D0..21D1 ; Pattern_Syntax # So [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW +21D2 ; Pattern_Syntax # Sm RIGHTWARDS DOUBLE ARROW +21D3 ; Pattern_Syntax # So DOWNWARDS DOUBLE ARROW +21D4 ; Pattern_Syntax # Sm LEFT RIGHT DOUBLE ARROW +21D5..21F3 ; Pattern_Syntax # So [31] UP DOWN DOUBLE ARROW..UP DOWN WHITE ARROW +21F4..22FF ; Pattern_Syntax # Sm [268] RIGHT ARROW WITH SMALL CIRCLE..Z NOTATION BAG MEMBERSHIP +2300..2307 ; Pattern_Syntax # So [8] DIAMETER SIGN..WAVY LINE +2308..230B ; Pattern_Syntax # Sm [4] LEFT CEILING..RIGHT FLOOR +230C..231F ; Pattern_Syntax # So [20] BOTTOM RIGHT CROP..BOTTOM RIGHT CORNER +2320..2321 ; Pattern_Syntax # Sm [2] TOP HALF INTEGRAL..BOTTOM HALF INTEGRAL +2322..2328 ; Pattern_Syntax # So [7] FROWN..KEYBOARD +2329 ; Pattern_Syntax # Ps LEFT-POINTING ANGLE BRACKET +232A ; Pattern_Syntax # Pe RIGHT-POINTING ANGLE BRACKET +232B..237B ; Pattern_Syntax # So [81] ERASE TO THE LEFT..NOT CHECK MARK +237C ; Pattern_Syntax # Sm RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW +237D..239A ; Pattern_Syntax # So [30] SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL +239B..23B3 ; Pattern_Syntax # Sm [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM +23B4..23DB ; Pattern_Syntax # So [40] TOP SQUARE BRACKET..FUSE +23DC..23E1 ; Pattern_Syntax # Sm [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET +23E2..23F3 ; Pattern_Syntax # So [18] WHITE TRAPEZIUM..HOURGLASS WITH FLOWING SAND +23F4..23FF ; Pattern_Syntax # Cn [12] .. +2400..2426 ; Pattern_Syntax # So [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO +2427..243F ; Pattern_Syntax # Cn [25] .. +2440..244A ; Pattern_Syntax # So [11] OCR HOOK..OCR DOUBLE BACKSLASH +244B..245F ; Pattern_Syntax # Cn [21] .. +2500..25B6 ; Pattern_Syntax # So [183] BOX DRAWINGS LIGHT HORIZONTAL..BLACK RIGHT-POINTING TRIANGLE +25B7 ; Pattern_Syntax # Sm WHITE RIGHT-POINTING TRIANGLE +25B8..25C0 ; Pattern_Syntax # So [9] BLACK RIGHT-POINTING SMALL TRIANGLE..BLACK LEFT-POINTING TRIANGLE +25C1 ; Pattern_Syntax # Sm WHITE LEFT-POINTING TRIANGLE +25C2..25F7 ; Pattern_Syntax # So [54] BLACK LEFT-POINTING SMALL TRIANGLE..WHITE CIRCLE WITH UPPER RIGHT QUADRANT +25F8..25FF ; Pattern_Syntax # Sm [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE +2600..266E ; Pattern_Syntax # So [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN +266F ; Pattern_Syntax # Sm MUSIC SHARP SIGN +2670..26FF ; Pattern_Syntax # So [144] WEST SYRIAC CROSS..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE +2700 ; Pattern_Syntax # Cn +2701..2767 ; Pattern_Syntax # So [103] UPPER BLADE SCISSORS..ROTATED FLORAL HEART BULLET +2768 ; Pattern_Syntax # Ps MEDIUM LEFT PARENTHESIS ORNAMENT +2769 ; Pattern_Syntax # Pe MEDIUM RIGHT PARENTHESIS ORNAMENT +276A ; Pattern_Syntax # Ps MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT +276B ; Pattern_Syntax # Pe MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT +276C ; Pattern_Syntax # Ps MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT +276D ; Pattern_Syntax # Pe MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT +276E ; Pattern_Syntax # Ps HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT +276F ; Pattern_Syntax # Pe HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT +2770 ; Pattern_Syntax # Ps HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT +2771 ; Pattern_Syntax # Pe HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT +2772 ; Pattern_Syntax # Ps LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT +2773 ; Pattern_Syntax # Pe LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT +2774 ; Pattern_Syntax # Ps MEDIUM LEFT CURLY BRACKET ORNAMENT +2775 ; Pattern_Syntax # Pe MEDIUM RIGHT CURLY BRACKET ORNAMENT +2794..27BF ; Pattern_Syntax # So [44] HEAVY WIDE-HEADED RIGHTWARDS ARROW..DOUBLE CURLY LOOP +27C0..27C4 ; Pattern_Syntax # Sm [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET +27C5 ; Pattern_Syntax # Ps LEFT S-SHAPED BAG DELIMITER +27C6 ; Pattern_Syntax # Pe RIGHT S-SHAPED BAG DELIMITER +27C7..27CA ; Pattern_Syntax # Sm [4] OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE +27CB ; Pattern_Syntax # Cn +27CC ; Pattern_Syntax # Sm LONG DIVISION +27CD ; Pattern_Syntax # Cn +27CE..27E5 ; Pattern_Syntax # Sm [24] SQUARED LOGICAL AND..WHITE SQUARE WITH RIGHTWARDS TICK +27E6 ; Pattern_Syntax # Ps MATHEMATICAL LEFT WHITE SQUARE BRACKET +27E7 ; Pattern_Syntax # Pe MATHEMATICAL RIGHT WHITE SQUARE BRACKET +27E8 ; Pattern_Syntax # Ps MATHEMATICAL LEFT ANGLE BRACKET +27E9 ; Pattern_Syntax # Pe MATHEMATICAL RIGHT ANGLE BRACKET +27EA ; Pattern_Syntax # Ps MATHEMATICAL LEFT DOUBLE ANGLE BRACKET +27EB ; Pattern_Syntax # Pe MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET +27EC ; Pattern_Syntax # Ps MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET +27ED ; Pattern_Syntax # Pe MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET +27EE ; Pattern_Syntax # Ps MATHEMATICAL LEFT FLATTENED PARENTHESIS +27EF ; Pattern_Syntax # Pe MATHEMATICAL RIGHT FLATTENED PARENTHESIS +27F0..27FF ; Pattern_Syntax # Sm [16] UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW +2800..28FF ; Pattern_Syntax # So [256] BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678 +2900..2982 ; Pattern_Syntax # Sm [131] RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..Z NOTATION TYPE COLON +2983 ; Pattern_Syntax # Ps LEFT WHITE CURLY BRACKET +2984 ; Pattern_Syntax # Pe RIGHT WHITE CURLY BRACKET +2985 ; Pattern_Syntax # Ps LEFT WHITE PARENTHESIS +2986 ; Pattern_Syntax # Pe RIGHT WHITE PARENTHESIS +2987 ; Pattern_Syntax # Ps Z NOTATION LEFT IMAGE BRACKET +2988 ; Pattern_Syntax # Pe Z NOTATION RIGHT IMAGE BRACKET +2989 ; Pattern_Syntax # Ps Z NOTATION LEFT BINDING BRACKET +298A ; Pattern_Syntax # Pe Z NOTATION RIGHT BINDING BRACKET +298B ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH UNDERBAR +298C ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH UNDERBAR +298D ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH TICK IN TOP CORNER +298E ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +298F ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +2990 ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER +2991 ; Pattern_Syntax # Ps LEFT ANGLE BRACKET WITH DOT +2992 ; Pattern_Syntax # Pe RIGHT ANGLE BRACKET WITH DOT +2993 ; Pattern_Syntax # Ps LEFT ARC LESS-THAN BRACKET +2994 ; Pattern_Syntax # Pe RIGHT ARC GREATER-THAN BRACKET +2995 ; Pattern_Syntax # Ps DOUBLE LEFT ARC GREATER-THAN BRACKET +2996 ; Pattern_Syntax # Pe DOUBLE RIGHT ARC LESS-THAN BRACKET +2997 ; Pattern_Syntax # Ps LEFT BLACK TORTOISE SHELL BRACKET +2998 ; Pattern_Syntax # Pe RIGHT BLACK TORTOISE SHELL BRACKET +2999..29D7 ; Pattern_Syntax # Sm [63] DOTTED FENCE..BLACK HOURGLASS +29D8 ; Pattern_Syntax # Ps LEFT WIGGLY FENCE +29D9 ; Pattern_Syntax # Pe RIGHT WIGGLY FENCE +29DA ; Pattern_Syntax # Ps LEFT DOUBLE WIGGLY FENCE +29DB ; Pattern_Syntax # Pe RIGHT DOUBLE WIGGLY FENCE +29DC..29FB ; Pattern_Syntax # Sm [32] INCOMPLETE INFINITY..TRIPLE PLUS +29FC ; Pattern_Syntax # Ps LEFT-POINTING CURVED ANGLE BRACKET +29FD ; Pattern_Syntax # Pe RIGHT-POINTING CURVED ANGLE BRACKET +29FE..2AFF ; Pattern_Syntax # Sm [258] TINY..N-ARY WHITE VERTICAL BAR +2B00..2B2F ; Pattern_Syntax # So [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE +2B30..2B44 ; Pattern_Syntax # Sm [21] LEFT ARROW WITH SMALL CIRCLE..RIGHTWARDS ARROW THROUGH SUPERSET +2B45..2B46 ; Pattern_Syntax # So [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW +2B47..2B4C ; Pattern_Syntax # Sm [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR +2B4D..2B4F ; Pattern_Syntax # Cn [3] .. +2B50..2B59 ; Pattern_Syntax # So [10] WHITE MEDIUM STAR..HEAVY CIRCLED SALTIRE +2B5A..2BFF ; Pattern_Syntax # Cn [166] .. +2E00..2E01 ; Pattern_Syntax # Po [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER +2E02 ; Pattern_Syntax # Pi LEFT SUBSTITUTION BRACKET +2E03 ; Pattern_Syntax # Pf RIGHT SUBSTITUTION BRACKET +2E04 ; Pattern_Syntax # Pi LEFT DOTTED SUBSTITUTION BRACKET +2E05 ; Pattern_Syntax # Pf RIGHT DOTTED SUBSTITUTION BRACKET +2E06..2E08 ; Pattern_Syntax # Po [3] RAISED INTERPOLATION MARKER..DOTTED TRANSPOSITION MARKER +2E09 ; Pattern_Syntax # Pi LEFT TRANSPOSITION BRACKET +2E0A ; Pattern_Syntax # Pf RIGHT TRANSPOSITION BRACKET +2E0B ; Pattern_Syntax # Po RAISED SQUARE +2E0C ; Pattern_Syntax # Pi LEFT RAISED OMISSION BRACKET +2E0D ; Pattern_Syntax # Pf RIGHT RAISED OMISSION BRACKET +2E0E..2E16 ; Pattern_Syntax # Po [9] EDITORIAL CORONIS..DOTTED RIGHT-POINTING ANGLE +2E17 ; Pattern_Syntax # Pd DOUBLE OBLIQUE HYPHEN +2E18..2E19 ; Pattern_Syntax # Po [2] INVERTED INTERROBANG..PALM BRANCH +2E1A ; Pattern_Syntax # Pd HYPHEN WITH DIAERESIS +2E1B ; Pattern_Syntax # Po TILDE WITH RING ABOVE +2E1C ; Pattern_Syntax # Pi LEFT LOW PARAPHRASE BRACKET +2E1D ; Pattern_Syntax # Pf RIGHT LOW PARAPHRASE BRACKET +2E1E..2E1F ; Pattern_Syntax # Po [2] TILDE WITH DOT ABOVE..TILDE WITH DOT BELOW +2E20 ; Pattern_Syntax # Pi LEFT VERTICAL BAR WITH QUILL +2E21 ; Pattern_Syntax # Pf RIGHT VERTICAL BAR WITH QUILL +2E22 ; Pattern_Syntax # Ps TOP LEFT HALF BRACKET +2E23 ; Pattern_Syntax # Pe TOP RIGHT HALF BRACKET +2E24 ; Pattern_Syntax # Ps BOTTOM LEFT HALF BRACKET +2E25 ; Pattern_Syntax # Pe BOTTOM RIGHT HALF BRACKET +2E26 ; Pattern_Syntax # Ps LEFT SIDEWAYS U BRACKET +2E27 ; Pattern_Syntax # Pe RIGHT SIDEWAYS U BRACKET +2E28 ; Pattern_Syntax # Ps LEFT DOUBLE PARENTHESIS +2E29 ; Pattern_Syntax # Pe RIGHT DOUBLE PARENTHESIS +2E2A..2E2E ; Pattern_Syntax # Po [5] TWO DOTS OVER ONE DOT PUNCTUATION..REVERSED QUESTION MARK +2E2F ; Pattern_Syntax # Lm VERTICAL TILDE +2E30..2E31 ; Pattern_Syntax # Po [2] RING POINT..WORD SEPARATOR MIDDLE DOT +2E32..2E7F ; Pattern_Syntax # Cn [78] .. +3001..3003 ; Pattern_Syntax # Po [3] IDEOGRAPHIC COMMA..DITTO MARK +3008 ; Pattern_Syntax # Ps LEFT ANGLE BRACKET +3009 ; Pattern_Syntax # Pe RIGHT ANGLE BRACKET +300A ; Pattern_Syntax # Ps LEFT DOUBLE ANGLE BRACKET +300B ; Pattern_Syntax # Pe RIGHT DOUBLE ANGLE BRACKET +300C ; Pattern_Syntax # Ps LEFT CORNER BRACKET +300D ; Pattern_Syntax # Pe RIGHT CORNER BRACKET +300E ; Pattern_Syntax # Ps LEFT WHITE CORNER BRACKET +300F ; Pattern_Syntax # Pe RIGHT WHITE CORNER BRACKET +3010 ; Pattern_Syntax # Ps LEFT BLACK LENTICULAR BRACKET +3011 ; Pattern_Syntax # Pe RIGHT BLACK LENTICULAR BRACKET +3012..3013 ; Pattern_Syntax # So [2] POSTAL MARK..GETA MARK +3014 ; Pattern_Syntax # Ps LEFT TORTOISE SHELL BRACKET +3015 ; Pattern_Syntax # Pe RIGHT TORTOISE SHELL BRACKET +3016 ; Pattern_Syntax # Ps LEFT WHITE LENTICULAR BRACKET +3017 ; Pattern_Syntax # Pe RIGHT WHITE LENTICULAR BRACKET +3018 ; Pattern_Syntax # Ps LEFT WHITE TORTOISE SHELL BRACKET +3019 ; Pattern_Syntax # Pe RIGHT WHITE TORTOISE SHELL BRACKET +301A ; Pattern_Syntax # Ps LEFT WHITE SQUARE BRACKET +301B ; Pattern_Syntax # Pe RIGHT WHITE SQUARE BRACKET +301C ; Pattern_Syntax # Pd WAVE DASH +301D ; Pattern_Syntax # Ps REVERSED DOUBLE PRIME QUOTATION MARK +301E..301F ; Pattern_Syntax # Pe [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK +3020 ; Pattern_Syntax # So POSTAL MARK FACE +3030 ; Pattern_Syntax # Pd WAVY DASH +FD3E ; Pattern_Syntax # Ps ORNATE LEFT PARENTHESIS +FD3F ; Pattern_Syntax # Pe ORNATE RIGHT PARENTHESIS +FE45..FE46 ; Pattern_Syntax # Po [2] SESAME DOT..WHITE SESAME DOT + +# Total code points: 2760 + +# EOF diff --git a/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java b/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java index c898259925b3e2c15fa3a6bdf4b3bf050d718bc4..2f7828b6c10c57dcd58d0bd7b8ba85551f09a661 100644 --- a/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java +++ b/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java @@ -1,4 +1,3 @@ - /* * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,6 +33,7 @@ import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.File; +import java.util.List; import build.tools.generatecharacter.CharacterName; @@ -68,18 +68,17 @@ public class GenerateCharacter { final static boolean DEBUG = false; - final static int MAX_UNICODE_VALUE = 0xFFFF; final static String commandMarker = "$$"; static String ROOT = ""; static String DefaultUnicodeSpecFileName = ROOT + "UnicodeData.txt"; static String DefaultSpecialCasingFileName = ROOT + "SpecialCasing.txt"; + static String DefaultPropListFileName = ROOT + "PropList.txt"; static String DefaultJavaTemplateFileName = ROOT + "Character.java.template"; static String DefaultJavaOutputFileName = ROOT + "Character.java"; static String DefaultCTemplateFileName = ROOT + "Character.c.template"; static String DefaultCOutputFileName = ROOT + "Character.c"; - static String CharacterDataClassName = "CharacterData"; - static int plane = 0; + static int plane = 0; /* The overall idea is that, in the generated Character class source code, most character property data is stored in a special multi-level table whose @@ -105,7 +104,11 @@ public class GenerateCharacter { entries are short rather than byte). */ - /* The character properties are currently encoded into 32 bits in the following manner: + /* The character properties are currently encoded into A (32 bits)and B (16 bits) + two parts. + + A: the low 32 bits are defined in the following manner: + 1 bit Mirrored property. 4 bits Bidirectional category (see below) (unused if -nobidi switch specified) 9 bits A signed offset used for converting case . @@ -148,6 +151,14 @@ public class GenerateCharacter { will produce the desired numeric value. 5 bits The digit offset (see description of previous field) 5 bits Character type (see below) + + B: the high 16 bits are defined as: + 1 bit Other_Lowercase property + 1 bit Other_Uppercase property + 1 bit Other_Alphabetic property + 1 bit Other_Math property + 1 bit Ideographic property + 1 bit Noncharacter codepoint property */ @@ -173,9 +184,22 @@ public class GenerateCharacter { // case offset are 9 bits maskCase = 0x01FF, shiftBidi = 27, maskBidi = 0x78000000, - shiftMirrored = 31, maskMirrored = 0x80000000, + shiftMirrored = 31, //maskMirrored = 0x80000000, shiftPlane = 16, maskPlane = 0xFF0000; + // maskMirrored needs to be long, if up 16-bit + private static final long maskMirrored = 0x80000000L; + + // bit masks identify the 16-bit priperty field described above, in B + // table + private static final long + maskOtherLowercase = 0x100000000L, + maskOtherUppercase = 0x200000000L, + maskOtherAlphabetic = 0x400000000L, + maskOtherMath = 0x800000000L, + maskIdeographic = 0x1000000000L, + maskNoncharacterCP = 0x2000000000L; + // Can compare masked values with these to determine // numeric or lexical types. public static int @@ -258,7 +282,7 @@ public class GenerateCharacter { * The specification file is assumed to contain its data in sorted order by * character code; as a result, the array passed as an argument to this method * has its components in the same sorted order, with one entry for each defined - * Unicode character or character range. (A range is indicated by two consecutive + * Unicode character or character range. (A range is indicated by two consecutive * entries, such that the name of the first entry begins with "<" and ends with * "First>" and the second entry begins with "<" and ends with "Last>".) This is * therefore a sparse representation of the character property data. @@ -282,7 +306,8 @@ public class GenerateCharacter { * @see GenerateCharacter#buildOne */ - static long[] buildMap(UnicodeSpec[] data, SpecialCaseMap[] specialMaps) { + static long[] buildMap(UnicodeSpec[] data, SpecialCaseMap[] specialMaps, PropList propList) + { long[] result; if (bLatin1 == true) { result = new long[256]; @@ -290,13 +315,13 @@ public class GenerateCharacter { result = new long[1<<16]; } int k=0; - int codePoint = plane<<16; + int codePoint = plane<<16; UnicodeSpec nonCharSpec = new UnicodeSpec(); for (int j = 0; j < data.length && k < result.length; j++) { if (data[j].codePoint == codePoint) { result[k] = buildOne(codePoint, data[j], specialMaps); ++k; - ++codePoint; + ++codePoint; } else if(data[j].codePoint > codePoint) { if (data[j].name.endsWith("Last>")) { @@ -304,7 +329,7 @@ public class GenerateCharacter { while (codePoint < data[j].codePoint && k < result.length) { result[k] = buildOne(codePoint, data[j], specialMaps); ++k; - ++codePoint; + ++codePoint; } } else { @@ -312,15 +337,14 @@ public class GenerateCharacter { while (codePoint < data[j].codePoint && k < result.length) { result[k] = buildOne(codePoint, nonCharSpec, specialMaps); ++k; - ++codePoint; + ++codePoint; } } k = data[j].codePoint & 0xFFFF; - codePoint = data[j].codePoint; + codePoint = data[j].codePoint; result[k] = buildOne(codePoint, data[j], specialMaps); ++k; - ++codePoint; - + ++codePoint; } else { System.out.println("An error has occured during spec mapping."); @@ -333,8 +357,17 @@ public class GenerateCharacter { while (k < result.length) { result[k] = buildOne(codePoint, nonCharSpec, specialMaps); ++k; - ++codePoint; + ++codePoint; } + // now add all extra supported properties from PropList, to the + // upper 16-bit + addExProp(result, propList, "Other_Lowercase", maskOtherLowercase); + addExProp(result, propList, "Other_Uppercase", maskOtherUppercase); + addExProp(result, propList, "Other_Alphabetic", maskOtherAlphabetic); + addExProp(result, propList, "Ideographic", maskIdeographic); + //addExProp(result, propList, "Other_Math", maskOtherMath); + //addExProp(result, propList, "Noncharacter_CodePoint", maskNoncharacterCP); + return result; } @@ -381,15 +414,15 @@ public class GenerateCharacter { // record the general category resultA |= us.generalCategory; - // record the numeric properties - NUMERIC: { + // record the numeric properties + NUMERIC: { STRANGE: { int val = 0; - // c is A-Z + // c is A-Z if ((c >= 0x0041) && (c <= 0x005A)) { val = c - 0x0041; resultA |= valueJavaSupradecimal; - // c is a-z + // c is a-z } else if ((c >= 0x0061) && (c <= 0x007A)) { val = c - 0x0061; resultA |= valueJavaSupradecimal; @@ -428,7 +461,7 @@ public class GenerateCharacter { resultA |= valueStrangeNumeric; } // end NUMERIC - // record case mapping + // record case mapping int offset = 0; // might have a 1:M mapping int specialMap = SpecialCaseMap.find(c, specialCaseMaps); @@ -458,12 +491,12 @@ public class GenerateCharacter { } } if ((us.hasTitleMap() && us.titleMap != us.upperMap) || - (bHasUpper && us.hasLowerMap())) { + (bHasUpper && us.hasLowerMap())) { resultA |= maskTitleCase; } if (bHasUpper && !us.hasLowerMap() && !us.hasTitleMap() && verbose) { - System.out.println("Warning: Character " + hex4(c) + " has upper but " + - "no title case; Java won't know this"); + System.out.println("Warning: Character " + hex4(c) + " has upper but " + + "no title case; Java won't know this"); } if (offset < minOffsetSeen) minOffsetSeen = offset; if (offset > maxOffsetSeen) maxOffsetSeen = offset; @@ -475,8 +508,7 @@ public class GenerateCharacter { } resultA |= ((offset & maskCase) << shiftCaseOffset); - - // record lexical info about this character + // record lexical info about this character if (us.generalCategory == UnicodeSpec.LOWERCASE_LETTER || us.generalCategory == UnicodeSpec.UPPERCASE_LETTER || us.generalCategory == UnicodeSpec.TITLECASE_LETTER @@ -539,6 +571,16 @@ public class GenerateCharacter { return resultA; } + static void addExProp(long[] map, PropList propList, String prop, long mask) { + List cps = propList.codepoints(prop); + if (cps != null) { + for (Integer cp : cps) { + if (cp < map.length) + map[cp] |= mask; + } + } + } + /** * This is the heart of the table compression strategy. The inputs are a map * and a number of bits (size). The map is simply an array of long integer values; @@ -645,8 +687,8 @@ OUTER: for (int i = 0; i < n; i += m) { */ static void generateCharacterClass(String theTemplateFileName, - String theOutputFileName) - throws FileNotFoundException, IOException { + String theOutputFileName) + throws FileNotFoundException, IOException { BufferedReader in = new BufferedReader(new FileReader(theTemplateFileName)); PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(theOutputFileName))); out.println(commentStart + @@ -719,6 +761,9 @@ OUTER: for (int i = 0; i < n; i += m) { if (x.length() >= 9 && x.substring(0, 7).equals("Lookup(") && x.substring(x.length()-1).equals(")") ) return genAccess("A", x.substring(7, x.length()-1), (identifiers ? 2 : 32)); + if (x.length() >= 11 && x.substring(0, 9).equals("LookupEx(") && + x.substring(x.length()-1).equals(")") ) + return genAccess("B", x.substring(9, x.length()-1), 16); if (x.equals("shiftType")) return Long.toString(shiftType); if (x.equals("shiftIdentifierInfo")) return Long.toString(shiftIdentifierInfo); if (x.equals("maskIdentifierInfo")) return "0x" + hex8(maskIdentifierInfo); @@ -731,6 +776,10 @@ OUTER: for (int i = 0; i < n; i += m) { if (x.equals("maskLowerCase")) return "0x" + hex8(maskLowerCase); if (x.equals("maskUpperCase")) return "0x" + hex8(maskUpperCase); if (x.equals("maskTitleCase")) return "0x" + hex8(maskTitleCase); + if (x.equals("maskOtherLowercase")) return "0x" + hex4(maskOtherLowercase >> 32); + if (x.equals("maskOtherUppercase")) return "0x" + hex4(maskOtherUppercase >> 32); + if (x.equals("maskOtherAlphabetic")) return "0x" + hex4(maskOtherAlphabetic >> 32); + if (x.equals("maskIdeographic")) return "0x" + hex4(maskIdeographic >> 32); if (x.equals("valueIgnorable")) return "0x" + hex8(valueIgnorable); if (x.equals("valueJavaUnicodeStart")) return "0x" + hex8(valueJavaUnicodeStart); if (x.equals("valueJavaOnlyStart")) return "0x" + hex8(valueJavaOnlyStart); @@ -899,7 +948,7 @@ OUTER: for (int i = 0; i < n; i += m) { // If we ever need more than 32 bits to represent the character properties, // then a table "B" may be needed as well. - // genTable(result, "B", tables[n - 1], 32, 16, sizes[n - 1], false, 0, true, true, false); + genTable(result, "B", tables[n - 1], 32, 16, sizes[n - 1], false, 0, true, true, false); totalBytes += ((((tables[n - 1].length * (identifiers ? 2 : 32)) + 31) >> 5) << 2); result.append(commentStart); @@ -1080,9 +1129,9 @@ OUTER: for (int i = 0; i < n; i += m) { */ static void genTable(StringBuffer result, String name, - long[] table, int extract, int bits, int size, - boolean preshifted, int shift, boolean hexFormat, - boolean properties, boolean hexComment) { + long[] table, int extract, int bits, int size, + boolean preshifted, int shift, boolean hexFormat, + boolean properties, boolean hexComment) { String atype = bits == 1 ? (Csyntax ? "unsigned long" : "int") : bits == 2 ? (Csyntax ? "unsigned long" : "int") : @@ -1137,7 +1186,12 @@ OUTER: for (int i = 0; i < n; i += m) { char ch = '\u0000'; int charsPerEntry = -entriesPerChar; for (int j=0; j> extract; + //long entry = table[j] >> extract; + long entry; + if ("A".equals(name)) + entry = (table[j] & 0xffffffffL) >> extract; + else + entry = (table[j] >> extract); if (shiftEntries) entry <<= shift; if (entry >= (1L << bits)) { FAIL("Entry too big"); @@ -1549,6 +1603,7 @@ OUTER: for (int i = 0; i < n; i += m) { static String OutputFileName = null; static String UnicodeSpecFileName = null; // liu static String SpecialCasingFileName = null; + static String PropListFileName = null; static boolean useCharForByte = false; static int[] sizes; static int bins = 0; // liu; if > 0, then perform search @@ -1668,20 +1723,28 @@ OUTER: for (int i = 0; i < n; i += m) { SpecialCasingFileName = args[++j]; } } - else if (args[j].equals("-plane")) { - if (j == args.length -1) { - FAIL("Plane number missing after -plane"); - } - else { - plane = Integer.parseInt(args[++j]); - } - if (plane > 0) { - bLatin1 = false; - } - } - else if ("-usecharforbyte".equals(args[j])) { - useCharForByte = true; - } + else if (args[j].equals("-proplist")) { + if (j == args.length -1) { + FAIL("File name missing after -proplist"); + } + else { + PropListFileName = args[++j]; + } + } + else if (args[j].equals("-plane")) { + if (j == args.length -1) { + FAIL("Plane number missing after -plane"); + } + else { + plane = Integer.parseInt(args[++j]); + } + if (plane > 0) { + bLatin1 = false; + } + } + else if ("-usecharforbyte".equals(args[j])) { + useCharForByte = true; + } else if (args[j].equals("-latin1")) { bLatin1 = true; plane = 0; @@ -1728,6 +1791,10 @@ OUTER: for (int i = 0; i < n; i += m) { SpecialCasingFileName = DefaultSpecialCasingFileName; desc.append(" [-specialcasing " + SpecialCasingFileName + ']'); } + if (PropListFileName == null) { + PropListFileName = DefaultPropListFileName; + desc.append(" [-proplist " + PropListFileName + ']'); + } if (TemplateFileName == null) { TemplateFileName = (Csyntax ? DefaultCTemplateFileName : DefaultJavaTemplateFileName); @@ -1877,12 +1944,13 @@ OUTER: for (int i = 0; i < n; i += m) { try { UnicodeSpec[] data = UnicodeSpec.readSpecFile(new File(UnicodeSpecFileName), plane); - specialCaseMaps = SpecialCaseMap.readSpecFile(new File(SpecialCasingFileName), plane); + PropList propList = PropList.readSpecFile(new File(PropListFileName), plane); + if (verbose) { System.out.println(data.length + " items read from Unicode spec file " + UnicodeSpecFileName); // liu } - long[] map = buildMap(data, specialCaseMaps); + long[] map = buildMap(data, specialCaseMaps, propList); if (verbose) { System.err.println("Completed building of initial map"); } diff --git a/make/tools/src/build/tools/generatecharacter/PropList.java b/make/tools/src/build/tools/generatecharacter/PropList.java new file mode 100644 index 0000000000000000000000000000000000000000..4591d5d667827ab1767ddeea53ee7b9511633f56 --- /dev/null +++ b/make/tools/src/build/tools/generatecharacter/PropList.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.generatecharacter; + +import java.util.regex.*; +import java.util.*; +import java.io.*; + +/** + * A PropList object contains the lists of code points that have + * the same Unicode property defined in PropList.txt + * + * @author Xueming Shen + */ +public class PropList { + + public static PropList readSpecFile(File file, int plane) + throws IOException + { + return new PropList(file, plane); + } + + public List codepoints(String name) { + return propMap.get(name); + } + + public Set names() { + return propMap.keySet(); + } + + private Map> propMap = + new LinkedHashMap>(); + + private PropList(File file, int plane) throws IOException { + + int i, j; + BufferedReader sbfr = new BufferedReader(new FileReader(file)); + Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s*;\\s+(\\w+)\\s+#.*").matcher(""); + String line = null; + int lineNo = 0; + while ((line = sbfr.readLine()) != null) { + lineNo++; + if (line.length() <= 1 || line.charAt(0) == '#') { + continue; + } + m.reset(line); + if (m.matches()) { + int start = Integer.parseInt(m.group(1), 16); + if ((start >> 16) != plane) + continue; + int end = (m.group(2)==null)?start + :Integer.parseInt(m.group(2), 16); + String name = m.group(3); + + start &= 0xffff; + end &= 0xffff; + + ArrayList list = propMap.get(name); + if (list == null) { + list = new ArrayList(); + propMap.put(name, list); + } + while (start <= end) + list.add(start++); + } else { + System.out.printf("Warning: Unrecognized line %d <%s>%n", lineNo, line); + } + } + sbfr.close(); + + //for (String name: propMap.keySet()) { + // System.out.printf("%s %d%n", name, propMap.get(name).size()); + //} + } + + public static void main(String[] args) throws IOException { + readSpecFile(new File(args[0]), Integer.decode(args[1])); + } +} diff --git a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java index 74ac1b2bf238f17cee11352897da34fca1c6bb15..8008049a751239e9b91d5189bf72645b928030df 100644 --- a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java +++ b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java @@ -1666,7 +1666,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern */ protected void removeCurrentRow() { ((Row)getCurrentRow()).setDeleted(); - rvh.remove(cursorPos); + rvh.remove(cursorPos - 1); --numRows; } @@ -6349,7 +6349,6 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern // this can happen if deleted rows are being shown if (row.getDeleted() == true) { removeCurrentRow(); - --numRows; } } diff --git a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java index c9499f1d1a0f528ed61cebc8ba95c1e2f60ce427..5da153d72ea1c4783746e30ae8ac972f771f63e8 100644 --- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java +++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -395,7 +395,13 @@ public class Krb5LoginModule implements LoginModule { private boolean succeeded = false; private boolean commitSucceeded = false; private String username; + + // Encryption keys calculated from password. Assigned when storekey == true + // and useKeyTab == false (or true but not found) private EncryptionKey[] encKeys = null; + + KeyTab ktab = null; + private Credentials cred = null; private PrincipalName principal = null; @@ -663,28 +669,49 @@ public class Krb5LoginModule implements LoginModule { (krb5PrincName.toString(), PrincipalName.KRB_NT_PRINCIPAL); } + + /* + * Before dynamic KeyTab support (6894072), here we check if + * the keytab contains keys for the principal. If no, keytab + * will not be used and password is prompted for. + * + * After 6894072, we normally don't check it, and expect the + * keys can be populated until a real connection is made. The + * check is still done when isInitiator == true, where the keys + * will be used right now. + * + * Probably tricky relations: + * + * useKeyTab is config flag, but when it's true but the ktab + * does not contains keys for principal, we would use password + * and keep the flag unchanged (for reuse?). In this method, + * we use (ktab != null) to check whether keytab is used. + * After this method (and when storeKey == true), we use + * (encKeys == null) to check. + */ if (useKeyTab) { - encKeys = - EncryptionKey.acquireSecretKeys(principal, keyTabName); - - if (debug) { - if (encKeys != null) - System.out.println - ("principal's key obtained from the keytab"); - else - System.out.println - ("Key for the principal " + - principal + - " not available in " + - ((keyTabName == null) ? - "default key tab" : keyTabName)); + ktab = (keyTabName == null) + ? KeyTab.getInstance() + : KeyTab.getInstance(new File(keyTabName)); + if (isInitiator) { + if (Krb5Util.keysFromJavaxKeyTab(ktab, principal).length + == 0) { + ktab = null; + if (debug) { + System.out.println + ("Key for the principal " + + principal + + " not available in " + + ((keyTabName == null) ? + "default key tab" : keyTabName)); + } + } } - } KrbAsReqBuilder builder; - // We can't get the key from the keytab so prompt - if (encKeys == null) { + + if (ktab == null) { promptForPass(getPasswdFromSharedState); builder = new KrbAsReqBuilder(principal, password); if (isInitiator) { @@ -693,9 +720,13 @@ public class Krb5LoginModule implements LoginModule { // updated with PA info cred = builder.action().getCreds(); } - encKeys = builder.getKeys(); + if (storeKey) { + encKeys = builder.getKeys(); + // When encKeys is empty, the login actually fails. + // For compatibility, exception is thrown in commit(). + } } else { - builder = new KrbAsReqBuilder(principal, encKeys); + builder = new KrbAsReqBuilder(principal, ktab); if (isInitiator) { cred = builder.action().getCreds(); } @@ -705,10 +736,15 @@ public class Krb5LoginModule implements LoginModule { if (debug) { System.out.println("principal is " + principal); HexDumpEncoder hd = new HexDumpEncoder(); - for (int i = 0; i < encKeys.length; i++) { - System.out.println("EncryptionKey: keyType=" + - encKeys[i].getEType() + " keyBytes (hex dump)=" + - hd.encodeBuffer(encKeys[i].getBytes())); + if (ktab != null) { + System.out.println("Will use keytab"); + } else if (storeKey) { + for (int i = 0; i < encKeys.length; i++) { + System.out.println("EncryptionKey: keyType=" + + encKeys[i].getEType() + + " keyBytes (hex dump)=" + + hd.encodeBuffer(encKeys[i].getBytes())); + } } } @@ -989,8 +1025,8 @@ public class Krb5LoginModule implements LoginModule { kerbTicket = Krb5Util.credsToTicket(cred); } - if (storeKey) { - if (encKeys == null || encKeys.length <= 0) { + if (storeKey && encKeys != null) { + if (encKeys.length == 0) { succeeded = false; throw new LoginException("Null Server Key "); } @@ -1006,10 +1042,11 @@ public class Krb5LoginModule implements LoginModule { } } - // Let us add the kerbClientPrinc,kerbTicket and kerbKey (if + // Let us add the kerbClientPrinc,kerbTicket and KeyTab/KerbKey (if // storeKey is true) - if (!princSet.contains(kerbClientPrinc)) + if (!princSet.contains(kerbClientPrinc)) { princSet.add(kerbClientPrinc); + } // add the TGT if (kerbTicket != null) { @@ -1018,19 +1055,29 @@ public class Krb5LoginModule implements LoginModule { } if (storeKey) { - for (int i = 0; i < kerbKeys.length; i++) { - if (!privCredSet.contains(kerbKeys[i])) { - privCredSet.add(kerbKeys[i]); + if (encKeys == null) { + if (!privCredSet.contains(ktab)) { + privCredSet.add(ktab); + // Compatibility; also add keys to privCredSet + for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) { + privCredSet.add(new Krb5Util.KeysFromKeyTab(key)); + } } - encKeys[i].destroy(); - encKeys[i] = null; - if (debug) { - System.out.println("Added server's key" - + kerbKeys[i]); - System.out.println("\t\t[Krb5LoginModule] " + - "added Krb5Principal " + - kerbClientPrinc.toString() - + " to Subject"); + } else { + for (int i = 0; i < kerbKeys.length; i ++) { + if (!privCredSet.contains(kerbKeys[i])) { + privCredSet.add(kerbKeys[i]); + } + encKeys[i].destroy(); + encKeys[i] = null; + if (debug) { + System.out.println("Added server's key" + + kerbKeys[i]); + System.out.println("\t\t[Krb5LoginModule] " + + "added Krb5Principal " + + kerbClientPrinc.toString() + + " to Subject"); + } } } } @@ -1106,7 +1153,8 @@ public class Krb5LoginModule implements LoginModule { while (it.hasNext()) { Object o = it.next(); if (o instanceof KerberosTicket || - o instanceof KerberosKey) { + o instanceof KerberosKey || + o instanceof KeyTab) { it.remove(); } } @@ -1161,6 +1209,7 @@ public class Krb5LoginModule implements LoginModule { } else { // remove temp results for the next try encKeys = null; + ktab = null; principal = null; } username = null; diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/AccessWatchpointSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/AccessWatchpointSpec.java index 9ffd9148827fb02c1337fd52d6ec727e5454724e..09e3f7e681423f0d7fbcff6dc3bf49d7523d91a0 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/AccessWatchpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/AccessWatchpointSpec.java @@ -26,7 +26,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; -import com.sun.jdi.request.*; public class AccessWatchpointSpec extends WatchpointSpec { @@ -38,6 +37,7 @@ public class AccessWatchpointSpec extends WatchpointSpec { /** * The 'refType' is known to match. */ + @Override void resolve(ReferenceType refType) throws InvalidTypeException, NoSuchFieldException { if (!(refType instanceof ClassType)) { @@ -51,6 +51,7 @@ public class AccessWatchpointSpec extends WatchpointSpec { .createAccessWatchpointRequest(field)); } + @Override public boolean equals(Object obj) { return (obj instanceof AccessWatchpointSpec) && super.equals(obj); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/AmbiguousMethodException.java b/src/share/classes/com/sun/tools/example/debug/bdi/AmbiguousMethodException.java index 0e3d7668d2e017c4579155c156ba70e3c506fe83..667cbb225934a1de1601e627b57c7bd2ff0d2ee5 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/AmbiguousMethodException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/AmbiguousMethodException.java @@ -27,6 +27,9 @@ package com.sun.tools.example.debug.bdi; public class AmbiguousMethodException extends Exception { + + private static final long serialVersionUID = 7793370943251707514L; + public AmbiguousMethodException() { super(); diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/BreakpointSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/BreakpointSpec.java index 798e5907063eca54e4233a0bff07a869b5e0dcd7..541582ef89ae4ef92a2e64a2ed504cedb3faf0ed 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/BreakpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/BreakpointSpec.java @@ -25,30 +25,33 @@ package com.sun.tools.example.debug.bdi; -import com.sun.jdi.request.*; - public abstract class BreakpointSpec extends EventRequestSpec { BreakpointSpec(EventRequestSpecList specs, ReferenceTypeSpec refSpec) { super(specs, refSpec); } + @Override void notifySet(SpecListener listener, SpecEvent evt) { listener.breakpointSet(evt); } + @Override void notifyDeferred(SpecListener listener, SpecEvent evt) { listener.breakpointDeferred(evt); } + @Override void notifyResolved(SpecListener listener, SpecEvent evt) { listener.breakpointResolved(evt); } + @Override void notifyDeleted(SpecListener listener, SpecEvent evt) { listener.breakpointDeleted(evt); } + @Override void notifyError(SpecListener listener, SpecErrorEvent evt) { listener.breakpointError(evt); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ChildSession.java b/src/share/classes/com/sun/tools/example/debug/bdi/ChildSession.java index 5d5613c228a2d992a313e638024978f37696c5c0..917b0d8803a22cbe2adabf187c22b7306949fb05 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ChildSession.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ChildSession.java @@ -43,10 +43,6 @@ class ChildSession extends Session { private BufferedReader out; private BufferedReader err; - private InputWriter inputWriter; - private OutputReader outputReader; - private OutputReader errorReader; - private InputListener input; private OutputListener output; private OutputListener error; @@ -84,6 +80,7 @@ class ChildSession extends Session { this.error = error; } + @Override public boolean attach() { if (!connectToVMProcess()) { @@ -131,6 +128,7 @@ class ChildSession extends Session { return true; } + @Override public void detach() { //### debug @@ -242,10 +240,7 @@ class ChildSession extends Session { this.diagnostics = diagnostics; } - public void quit() { - running = false; - } - + @Override public void run() { try { int count; @@ -254,6 +249,7 @@ class ChildSession extends Session { // Run in Swing event dispatcher thread. final String chars = new String(buffer, 0, count); SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { output.putString(chars); } @@ -264,6 +260,7 @@ class ChildSession extends Session { } catch (IOException e) { // Run in Swing event dispatcher thread. SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { diagnostics.putString("IO error reading " + streamName + @@ -288,11 +285,7 @@ class ChildSession extends Session { this.input = input; } - public void quit() { - //### Won't have much effect if blocked on input! - running = false; - } - + @Override public void run() { String line; while (running) { diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/EvaluationException.java b/src/share/classes/com/sun/tools/example/debug/bdi/EvaluationException.java index 211bb5331b3e6590150bd537bf18bc5d86df7ab8..0e0a6b0b4849ad756483ce37d2dc0909329b1c8b 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/EvaluationException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/EvaluationException.java @@ -25,4 +25,7 @@ package com.sun.tools.example.debug.bdi; -public class EvaluationException extends Exception {} +public class EvaluationException extends Exception { + + private static final long serialVersionUID = 4947109680354951694L; +} diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java index 28412756264bf2839bad003a788241de59eb443d..796d5803b9cde8bc6ede854d155f9dd79c6c918b 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java @@ -25,8 +25,6 @@ package com.sun.tools.example.debug.bdi; -import java.util.*; - import com.sun.jdi.*; import com.sun.jdi.request.EventRequest; diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ExceptionSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/ExceptionSpec.java index 8be23905e3c5ec874ee500d55de1dbef24071d20..fa3fcb3de289730362abd888487e96a717d2e9fd 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ExceptionSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ExceptionSpec.java @@ -26,11 +26,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.ReferenceType; -import com.sun.jdi.request.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.Iterator; public class ExceptionSpec extends EventRequestSpec { @@ -45,22 +40,27 @@ public class ExceptionSpec extends EventRequestSpec { this.notifyUncaught = notifyUncaught; } + @Override void notifySet(SpecListener listener, SpecEvent evt) { listener.exceptionInterceptSet(evt); } + @Override void notifyDeferred(SpecListener listener, SpecEvent evt) { listener.exceptionInterceptDeferred(evt); } + @Override void notifyResolved(SpecListener listener, SpecEvent evt) { listener.exceptionInterceptResolved(evt); } + @Override void notifyDeleted(SpecListener listener, SpecEvent evt) { listener.exceptionInterceptDeleted(evt); } + @Override void notifyError(SpecListener listener, SpecErrorEvent evt) { listener.exceptionInterceptError(evt); } @@ -68,16 +68,19 @@ public class ExceptionSpec extends EventRequestSpec { /** * The 'refType' is known to match. */ + @Override void resolve(ReferenceType refType) { setRequest(refType.virtualMachine().eventRequestManager() .createExceptionRequest(refType, notifyCaught, notifyUncaught)); } + @Override public int hashCode() { return refSpec.hashCode(); } + @Override public boolean equals(Object obj) { if (obj instanceof ExceptionSpec) { ExceptionSpec es = (ExceptionSpec)obj; @@ -88,6 +91,7 @@ public class ExceptionSpec extends EventRequestSpec { } } + @Override public String toString() { StringBuffer buffer = new StringBuffer("exception catch "); buffer.append(refSpec.toString()); diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java b/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java index 7dc60f5d6252e66870e904644eb0c756ce8cb712..35f2075daa921a825c97c11322103feffb56420c 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java @@ -26,7 +26,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; -import com.sun.jdi.event.*; import com.sun.jdi.request.*; import com.sun.jdi.connect.*; import com.sun.tools.example.debug.expr.ExpressionParser; @@ -56,7 +55,7 @@ public class ExecutionManager { // Session Listeners - Vector sessionListeners = new Vector(); + ArrayList sessionListeners = new ArrayList(); public void addSessionListener(SessionListener listener) { sessionListeners.add(listener); @@ -68,7 +67,7 @@ public class ExecutionManager { // Spec Listeners - Vector specListeners = new Vector(); + ArrayList specListeners = new ArrayList(); public void addSpecListener(SpecListener cl) { specListeners.add(cl); @@ -80,7 +79,7 @@ public class ExecutionManager { // JDI Listeners - Vector jdiListeners = new Vector(); + ArrayList jdiListeners = new ArrayList(); /** * Adds a JDIListener @@ -105,50 +104,50 @@ public class ExecutionManager { // App Echo Listeners - private Vector appEchoListeners = new Vector(); + private ArrayList appEchoListeners = new ArrayList(); public void addApplicationEchoListener(OutputListener l) { - appEchoListeners.addElement(l); + appEchoListeners.add(l); } public void removeApplicationEchoListener(OutputListener l) { - appEchoListeners.removeElement(l); + appEchoListeners.remove(l); } // App Output Listeners - private Vector appOutputListeners = new Vector(); + private ArrayList appOutputListeners = new ArrayList(); public void addApplicationOutputListener(OutputListener l) { - appOutputListeners.addElement(l); + appOutputListeners.add(l); } public void removeApplicationOutputListener(OutputListener l) { - appOutputListeners.removeElement(l); + appOutputListeners.remove(l); } // App Error Listeners - private Vector appErrorListeners = new Vector(); + private ArrayList appErrorListeners = new ArrayList(); public void addApplicationErrorListener(OutputListener l) { - appErrorListeners.addElement(l); + appErrorListeners.add(l); } public void removeApplicationErrorListener(OutputListener l) { - appErrorListeners.removeElement(l); + appErrorListeners.remove(l); } // Diagnostic Listeners - private Vector diagnosticsListeners = new Vector(); + private ArrayList diagnosticsListeners = new ArrayList(); public void addDiagnosticsListener(OutputListener l) { - diagnosticsListeners.addElement(l); + diagnosticsListeners.add(l); } public void removeDiagnosticsListener(OutputListener l) { - diagnosticsListeners.removeElement(l); + diagnosticsListeners.remove(l); } /////////// End Listener Registration ////////////// @@ -159,7 +158,9 @@ public class ExecutionManager { } void ensureActiveSession() throws NoSessionException { - if (session == null) throw new NoSessionException(); + if (session == null) { + throw new NoSessionException(); + } } public EventRequestManager eventRequestManager() { @@ -293,6 +294,7 @@ public class ExecutionManager { ensureActiveSession(); if (f != null) { frameGetter = new ExpressionParser.GetFrame() { + @Override public StackFrame get() /* throws IncompatibleThreadStateException */ { return f; } @@ -628,35 +630,35 @@ public class ExecutionManager { */ private void notifyInterrupted() { - Vector l = (Vector)sessionListeners.clone(); + ArrayList l = new ArrayList(sessionListeners); EventObject evt = new EventObject(this); for (int i = 0; i < l.size(); i++) { - ((SessionListener)l.elementAt(i)).sessionInterrupt(evt); + l.get(i).sessionInterrupt(evt); } } private void notifyContinued() { - Vector l = (Vector)sessionListeners.clone(); + ArrayList l = new ArrayList(sessionListeners); EventObject evt = new EventObject(this); for (int i = 0; i < l.size(); i++) { - ((SessionListener)l.elementAt(i)).sessionContinue(evt); + l.get(i).sessionContinue(evt); } } private void notifySessionStart() { - Vector l = (Vector)sessionListeners.clone(); + ArrayList l = new ArrayList(sessionListeners); EventObject evt = new EventObject(this); for (int i = 0; i < l.size(); i++) { - ((SessionListener)l.elementAt(i)).sessionStart(evt); + l.get(i).sessionStart(evt); } } private void notifySessionDeath() { /*** noop for now - Vector l = (Vector)sessionListeners.clone(); + ArrayList l = new ArrayList(sessionListeners); EventObject evt = new EventObject(this); for (int i = 0; i < l.size(); i++) { - ((SessionListener)l.elementAt(i)).sessionDeath(evt); + ((SessionListener)l.get(i)).sessionDeath(evt); } ****/ } @@ -684,6 +686,7 @@ public class ExecutionManager { } private InputListener appInput = new InputListener() { + @Override public String getLine() { // Don't allow reader to be interrupted -- catch and retry. String line = null; @@ -703,6 +706,7 @@ public class ExecutionManager { // Run in Swing event dispatcher thread. final String input = line; SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { echoInputLine(input); } @@ -714,37 +718,40 @@ public class ExecutionManager { private static String newline = System.getProperty("line.separator"); private void echoInputLine(String line) { - Vector l = (Vector)appEchoListeners.clone(); + ArrayList l = new ArrayList(appEchoListeners); for (int i = 0; i < l.size(); i++) { - OutputListener ol = (OutputListener)l.elementAt(i); + OutputListener ol = l.get(i); ol.putString(line); ol.putString(newline); } } private OutputListener appOutput = new OutputListener() { + @Override public void putString(String string) { - Vector l = (Vector)appOutputListeners.clone(); + ArrayList l = new ArrayList(appEchoListeners); for (int i = 0; i < l.size(); i++) { - ((OutputListener)l.elementAt(i)).putString(string); + l.get(i).putString(string); } } }; private OutputListener appError = new OutputListener() { + @Override public void putString(String string) { - Vector l = (Vector)appErrorListeners.clone(); + ArrayList l = new ArrayList(appEchoListeners); for (int i = 0; i < l.size(); i++) { - ((OutputListener)l.elementAt(i)).putString(string); + l.get(i).putString(string); } } }; private OutputListener diagnostics = new OutputListener() { + @Override public void putString(String string) { - Vector l = (Vector)diagnosticsListeners.clone(); + ArrayList l = new ArrayList(diagnosticsListeners); for (int i = 0; i < l.size(); i++) { - ((OutputListener)l.elementAt(i)).putString(string); + l.get(i).putString(string); } } }; diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/FrameIndexOutOfBoundsException.java b/src/share/classes/com/sun/tools/example/debug/bdi/FrameIndexOutOfBoundsException.java index 5f5db5e42063432c5c18f3a7560eadc8d417a7ef..5d70918cb3ba10184909152c91531457bacd75eb 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/FrameIndexOutOfBoundsException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/FrameIndexOutOfBoundsException.java @@ -25,4 +25,7 @@ package com.sun.tools.example.debug.bdi; -public class FrameIndexOutOfBoundsException extends IndexOutOfBoundsException {} +public class FrameIndexOutOfBoundsException extends IndexOutOfBoundsException { + + private static final long serialVersionUID = -4870148107027371437L; +} diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java b/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java index 5b1a9b0bd8b188fa31d7ef80e589a6e52db2a283..dedc2477e0c8a7cb99c4a2af25dffa29e4ed9fe6 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java @@ -28,8 +28,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; import com.sun.jdi.event.*; -import java.util.*; - import com.sun.tools.example.debug.event.*; import javax.swing.SwingUtilities; @@ -55,6 +53,7 @@ class JDIEventSource extends Thread { this.queue = session.vm.eventQueue(); } + @Override public void run() { try { runLoop(); @@ -78,6 +77,7 @@ class JDIEventSource extends Thread { //### Gross foul hackery! private void dispatchEventSet(final AbstractEventSet es) { SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { boolean interrupted = es.suspendedAll(); es.notify(firstListener); @@ -117,54 +117,65 @@ class JDIEventSource extends Thread { //### This is a Hack, deal with it private class FirstListener implements JDIListener { + @Override public void accessWatchpoint(AccessWatchpointEventSet e) { session.runtime.validateThreadInfo(); wantInterrupt = true; } + @Override public void classPrepare(ClassPrepareEventSet e) { wantInterrupt = false; runtime.resolve(e.getReferenceType()); } + @Override public void classUnload(ClassUnloadEventSet e) { wantInterrupt = false; } + @Override public void exception(ExceptionEventSet e) { wantInterrupt = true; } + @Override public void locationTrigger(LocationTriggerEventSet e) { session.runtime.validateThreadInfo(); wantInterrupt = true; } + @Override public void modificationWatchpoint(ModificationWatchpointEventSet e) { session.runtime.validateThreadInfo(); wantInterrupt = true; } + @Override public void threadDeath(ThreadDeathEventSet e) { wantInterrupt = false; } + @Override public void threadStart(ThreadStartEventSet e) { wantInterrupt = false; } + @Override public void vmDeath(VMDeathEventSet e) { //### Should have some way to notify user //### that VM died before the session ended. wantInterrupt = false; } + @Override public void vmDisconnect(VMDisconnectEventSet e) { //### Notify user? wantInterrupt = false; session.runtime.endSession(); } + @Override public void vmStart(VMStartEventSet e) { //### Do we need to do anything with it? wantInterrupt = false; diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java index b82b386043e1478a4ee1374d0168aac060ad1d28..0a1e0b1cb3d28269adae410e9620c48117bcd8ea 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java @@ -26,11 +26,7 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; -import com.sun.jdi.request.*; - -import java.util.ArrayList; import java.util.List; -import java.util.Iterator; public class LineBreakpointSpec extends BreakpointSpec { int lineNumber; @@ -44,6 +40,7 @@ public class LineBreakpointSpec extends BreakpointSpec { /** * The 'refType' is known to match. */ + @Override void resolve(ReferenceType refType) throws InvalidTypeException, LineNotFoundException { if (!(refType instanceof ClassType)) { @@ -81,10 +78,12 @@ public class LineBreakpointSpec extends BreakpointSpec { return lineNumber; } + @Override public int hashCode() { return refSpec.hashCode() + lineNumber; } + @Override public boolean equals(Object obj) { if (obj instanceof LineBreakpointSpec) { LineBreakpointSpec breakpoint = (LineBreakpointSpec)obj; @@ -96,6 +95,7 @@ public class LineBreakpointSpec extends BreakpointSpec { } } + @Override public String errorMessageFor(Exception e) { if (e instanceof LineNotFoundException) { return ("No code at line " + lineNumber() + " in " + refSpec); @@ -107,6 +107,7 @@ public class LineBreakpointSpec extends BreakpointSpec { } } + @Override public String toString() { StringBuffer buffer = new StringBuffer("breakpoint "); buffer.append(refSpec.toString()); diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/LineNotFoundException.java b/src/share/classes/com/sun/tools/example/debug/bdi/LineNotFoundException.java index 00ad8d8f7eae3532f9c58fbaea4f621b939ded62..6d906a8b65ca61db9367a234b30bf2a06a353e30 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/LineNotFoundException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/LineNotFoundException.java @@ -27,6 +27,9 @@ package com.sun.tools.example.debug.bdi; public class LineNotFoundException extends Exception { + + private static final long serialVersionUID = -5630418117861587582L; + public LineNotFoundException() { super(); diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/MalformedMemberNameException.java b/src/share/classes/com/sun/tools/example/debug/bdi/MalformedMemberNameException.java index 5c6be5d092fc8ac66f1918d2ff9654f7b4a908e7..c73e685f50365780af22857c539eff8fbe08086b 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/MalformedMemberNameException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/MalformedMemberNameException.java @@ -26,6 +26,9 @@ package com.sun.tools.example.debug.bdi; class MalformedMemberNameException extends Exception { + + private static final long serialVersionUID = -7726664097374844485L; + public MalformedMemberNameException() { super(); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java index 9e265bd08dbce956fd983cc308783cef7fc5868e..7a9748af102b17a2f7bfd10f1ad43b3c36801ba1 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java @@ -26,11 +26,8 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; -import com.sun.jdi.request.*; - import java.util.ArrayList; import java.util.List; -import java.util.Iterator; public class MethodBreakpointSpec extends BreakpointSpec { String methodId; @@ -47,6 +44,7 @@ public class MethodBreakpointSpec extends BreakpointSpec { /** * The 'refType' is known to match. */ + @Override void resolve(ReferenceType refType) throws MalformedMemberNameException, AmbiguousMethodException, InvalidTypeException, @@ -80,12 +78,14 @@ public class MethodBreakpointSpec extends BreakpointSpec { return methodArgs; } + @Override public int hashCode() { return refSpec.hashCode() + ((methodId != null) ? methodId.hashCode() : 0) + ((methodArgs != null) ? methodArgs.hashCode() : 0); } + @Override public boolean equals(Object obj) { if (obj instanceof MethodBreakpointSpec) { MethodBreakpointSpec breakpoint = (MethodBreakpointSpec)obj; @@ -98,6 +98,7 @@ public class MethodBreakpointSpec extends BreakpointSpec { } } + @Override public String errorMessageFor(Exception e) { if (e instanceof AmbiguousMethodException) { return ("Method " + methodName() + " is overloaded; specify arguments"); @@ -114,6 +115,7 @@ public class MethodBreakpointSpec extends BreakpointSpec { } } + @Override public String toString() { StringBuffer buffer = new StringBuffer("breakpoint "); buffer.append(refSpec.toString()); @@ -257,7 +259,7 @@ public class MethodBreakpointSpec extends BreakpointSpec { */ if ((name.indexOf('.') == -1) || name.startsWith("*.")) { try { - List refs = specs.runtime.findClassesMatchingPattern(name); + List refs = specs.runtime.findClassesMatchingPattern(name); if (refs.size() > 0) { //### ambiguity??? name = ((ReferenceType)(refs.get(0))).name(); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/MethodNotFoundException.java b/src/share/classes/com/sun/tools/example/debug/bdi/MethodNotFoundException.java index 8fa2e60b79fdaf83fb2dbd2772906512d0e3cd93..9fd3aa9efc74ee343fafb05fc499352068df8e7e 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/MethodNotFoundException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/MethodNotFoundException.java @@ -27,6 +27,8 @@ package com.sun.tools.example.debug.bdi; public class MethodNotFoundException extends Exception { + private static final long serialVersionUID = -2064968107599632609L; + public MethodNotFoundException() { super(); diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ModificationWatchpointSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/ModificationWatchpointSpec.java index 7816ce698d2464f434dfcf5de3b1f7881ca19ec7..7043d666ec870d4b4aeb845a2479b2cd1bcf9006 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ModificationWatchpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ModificationWatchpointSpec.java @@ -26,7 +26,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; -import com.sun.jdi.request.*; public class ModificationWatchpointSpec extends WatchpointSpec { @@ -38,6 +37,7 @@ public class ModificationWatchpointSpec extends WatchpointSpec { /** * The 'refType' is known to match. */ + @Override void resolve(ReferenceType refType) throws InvalidTypeException, NoSuchFieldException { if (!(refType instanceof ClassType)) { @@ -51,6 +51,7 @@ public class ModificationWatchpointSpec extends WatchpointSpec { .createModificationWatchpointRequest(field)); } + @Override public boolean equals(Object obj) { return (obj instanceof ModificationWatchpointSpec) && super.equals(obj); diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/NoSessionException.java b/src/share/classes/com/sun/tools/example/debug/bdi/NoSessionException.java index 9a40b41384617290d5c392f138c3c5095a9f8214..32988ab140b47af28f098cd7276caf8c8c7973c1 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/NoSessionException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/NoSessionException.java @@ -25,4 +25,7 @@ package com.sun.tools.example.debug.bdi; -public class NoSessionException extends Exception {} +public class NoSessionException extends Exception { + + private static final long serialVersionUID = -7324357828115128603L; +} diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/NoThreadException.java b/src/share/classes/com/sun/tools/example/debug/bdi/NoThreadException.java index aa36d667ee0178ad0744c4fc525f43cdd41ff065..460b1a4ba4cdae98d49f9b74e1b562e06d011353 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/NoThreadException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/NoThreadException.java @@ -25,4 +25,8 @@ package com.sun.tools.example.debug.bdi; -public class NoThreadException extends Exception {} +public class NoThreadException extends Exception { + + private static final long serialVersionUID = 1846613539928921998L; + +} diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/PatternReferenceTypeSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/PatternReferenceTypeSpec.java index e9bd3f93793662effe8fae2411e274ec6c3c2aeb..4f6d73e8e711ce1fde482416b771bf1c1a29a1c8 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/PatternReferenceTypeSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/PatternReferenceTypeSpec.java @@ -47,6 +47,7 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { /** * Does the specified ReferenceType match this spec. */ + @Override public boolean matches(ReferenceType refType) { if (isWild) { return refType.name().endsWith(classId); @@ -55,10 +56,12 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { } } + @Override public int hashCode() { return classId.hashCode(); } + @Override public boolean equals(Object obj) { if (obj instanceof PatternReferenceTypeSpec) { PatternReferenceTypeSpec spec = (PatternReferenceTypeSpec)obj; @@ -89,6 +92,7 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { } } + @Override public String toString() { return isWild? "*" + classId : classId; } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ReferenceTypeSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/ReferenceTypeSpec.java index e3282b747f179848308662929470cc0c1578e15f..fc478060aaac540cde95c8b5d5c067230264ea45 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ReferenceTypeSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ReferenceTypeSpec.java @@ -33,7 +33,9 @@ interface ReferenceTypeSpec { */ boolean matches(ReferenceType refType); + @Override int hashCode(); + @Override boolean equals(Object obj); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/Session.java b/src/share/classes/com/sun/tools/example/debug/bdi/Session.java index 61790af7b32cef3dce43271a3e8c7ce0e382c744..4599cb1ba10fbc1252b25d5a34b46d7112b416be 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/Session.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/Session.java @@ -27,7 +27,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.VirtualMachine; import com.sun.jdi.VMDisconnectedException; -import com.sun.jdi.event.EventSet; /** * Our repository of what we know about the state of one diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/SourceNameReferenceTypeSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/SourceNameReferenceTypeSpec.java index 2b8a1e158dbce87e862bdf5e9a325087d117a0aa..c788f5d0c53765371a94de62d71090b2e84a219f 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/SourceNameReferenceTypeSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/SourceNameReferenceTypeSpec.java @@ -39,6 +39,7 @@ class SourceNameReferenceTypeSpec implements ReferenceTypeSpec { /** * Does the specified ReferenceType match this spec. */ + @Override public boolean matches(ReferenceType refType) { try { if (refType.sourceName().equals(sourceName)) { @@ -48,9 +49,6 @@ class SourceNameReferenceTypeSpec implements ReferenceTypeSpec { return true; } catch(AbsentInformationException exc) { } catch(ObjectCollectedException exc) { - } catch(InvalidLineNumberException exc) { -// } catch(ClassNotPreparedException exc) { -// -- should not happen, so don't catch this --- } } } catch(AbsentInformationException exc) { @@ -59,10 +57,12 @@ class SourceNameReferenceTypeSpec implements ReferenceTypeSpec { return false; } + @Override public int hashCode() { return sourceName.hashCode() + linenumber; } + @Override public boolean equals(Object obj) { if (obj instanceof SourceNameReferenceTypeSpec) { SourceNameReferenceTypeSpec spec = (SourceNameReferenceTypeSpec)obj; @@ -74,6 +74,7 @@ class SourceNameReferenceTypeSpec implements ReferenceTypeSpec { } } + @Override public String toString() { return sourceName + "@" + linenumber; } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/SpecErrorEvent.java b/src/share/classes/com/sun/tools/example/debug/bdi/SpecErrorEvent.java index 86a7575bafa7a0e71ad8f77802c51b56af4fe00b..c6b9f4e78d3c4137b1be8e70b22110709c2c6de4 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/SpecErrorEvent.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/SpecErrorEvent.java @@ -25,10 +25,9 @@ package com.sun.tools.example.debug.bdi; -import java.util.EventObject; - public class SpecErrorEvent extends SpecEvent { + private static final long serialVersionUID = 8162634387866409578L; private Exception reason; public SpecErrorEvent(EventRequestSpec eventRequestSpec, diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/SpecEvent.java b/src/share/classes/com/sun/tools/example/debug/bdi/SpecEvent.java index 6cc1d3a1bfc7c24c275e53597aa557bdacd75ccd..625a263fcefa1c0e6aaba2a7b58ac3bbb218cd3c 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/SpecEvent.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/SpecEvent.java @@ -31,6 +31,7 @@ import com.sun.jdi.request.EventRequest; public class SpecEvent extends EventObject { + private static final long serialVersionUID = 4820735456787276230L; private EventRequestSpec eventRequestSpec; public SpecEvent(EventRequestSpec eventRequestSpec) { diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java b/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java index 419a466f70bcd44662a41bedd0c0115a0072ba74..c6ec121d8088be54c801d1bfbec1f8d694323f7e 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java @@ -26,7 +26,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.ThreadGroupReference; -import com.sun.jdi.ThreadReference; import java.util.List; import java.util.Stack; import java.util.ArrayList; @@ -73,10 +72,12 @@ public class ThreadGroupIterator implements Iterator { } } + @Override public boolean hasNext() { return !stack.isEmpty(); } + @Override public ThreadGroupReference next() { return nextThreadGroup(); } @@ -87,6 +88,7 @@ public class ThreadGroupIterator implements Iterator { return tg; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ThreadInfo.java b/src/share/classes/com/sun/tools/example/debug/bdi/ThreadInfo.java index 7ced75a40f41a4ecb6dfdbfd3be61cdbed5012f7..b9516c4313f3a52f699bbd628f961fe0cbbf5ece 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ThreadInfo.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ThreadInfo.java @@ -26,9 +26,6 @@ package com.sun.tools.example.debug.bdi; import com.sun.jdi.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Iterator; //### Should handle target VM death or connection failure cleanly. diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java b/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java index c6b2ce6efd2949610ab617cf627d8610cc7a8e79..6fafd71cd80212bd815e2b2ae4708cfc0dd8ccb1 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java @@ -43,6 +43,7 @@ public class ThreadIterator implements Iterator { tgi = new ThreadGroupIterator(tgl); } + @Override public boolean hasNext() { while (it == null || !it.hasNext()) { if (!tgi.hasNext()) { @@ -53,6 +54,7 @@ public class ThreadIterator implements Iterator { return true; } + @Override public ThreadReference next() { return it.next(); } @@ -61,6 +63,7 @@ public class ThreadIterator implements Iterator { return next(); } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/Utils.java b/src/share/classes/com/sun/tools/example/debug/bdi/Utils.java index 81993bf05e8b49058958469185c9eadd7cd72695..d3e0173dc9bdcd71322098dc87f1e2fad20cbbd3 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/Utils.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/Utils.java @@ -26,9 +26,6 @@ package com.sun.tools.example.debug.bdi; //### does it belong here? import com.sun.jdi.*; -import com.sun.tools.jdi.*; -import java.util.*; -import java.io.*; public class Utils { diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/VMLaunchFailureException.java b/src/share/classes/com/sun/tools/example/debug/bdi/VMLaunchFailureException.java index fcbe82b332cfdd7ccb244d3e42245207743d90de..d0c482c50e0385ee7c220431521eb02a773e5cdf 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/VMLaunchFailureException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/VMLaunchFailureException.java @@ -25,4 +25,7 @@ package com.sun.tools.example.debug.bdi; -public class VMLaunchFailureException extends Exception {} +public class VMLaunchFailureException extends Exception { + + private static final long serialVersionUID = -2439646729274310108L; +} diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/VMNotInterruptedException.java b/src/share/classes/com/sun/tools/example/debug/bdi/VMNotInterruptedException.java index 4ddc5a9fc868c2902f21b79e0741c8bdbda919f4..ef12d6d2446bc0f07f420c8ca8559f6ef2aeaf6c 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/VMNotInterruptedException.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/VMNotInterruptedException.java @@ -25,4 +25,7 @@ package com.sun.tools.example.debug.bdi; -public class VMNotInterruptedException extends Exception {} +public class VMNotInterruptedException extends Exception { + + private static final long serialVersionUID = 8111074582188765600L; +} diff --git a/src/share/classes/com/sun/tools/example/debug/bdi/WatchpointSpec.java b/src/share/classes/com/sun/tools/example/debug/bdi/WatchpointSpec.java index 8414a17340a32484612a886b0cd9f17da4596e6d..469b4230a9a9e4268f6d7080fabf9f14cfcc2a4a 100644 --- a/src/share/classes/com/sun/tools/example/debug/bdi/WatchpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/bdi/WatchpointSpec.java @@ -25,9 +25,6 @@ package com.sun.tools.example.debug.bdi; -import com.sun.jdi.*; -import com.sun.jdi.request.*; - public abstract class WatchpointSpec extends EventRequestSpec { final String fieldId; @@ -40,31 +37,38 @@ public abstract class WatchpointSpec extends EventRequestSpec { // } } + @Override void notifySet(SpecListener listener, SpecEvent evt) { listener.watchpointSet(evt); } + @Override void notifyDeferred(SpecListener listener, SpecEvent evt) { listener.watchpointDeferred(evt); } + @Override void notifyResolved(SpecListener listener, SpecEvent evt) { listener.watchpointResolved(evt); } + @Override void notifyDeleted(SpecListener listener, SpecEvent evt) { listener.watchpointDeleted(evt); } + @Override void notifyError(SpecListener listener, SpecErrorEvent evt) { listener.watchpointError(evt); } + @Override public int hashCode() { return refSpec.hashCode() + fieldId.hashCode() + getClass().hashCode(); } + @Override public boolean equals(Object obj) { if (obj instanceof WatchpointSpec) { WatchpointSpec watchpoint = (WatchpointSpec)obj; @@ -77,6 +81,7 @@ public abstract class WatchpointSpec extends EventRequestSpec { } } + @Override public String errorMessageFor(Exception e) { if (e instanceof NoSuchFieldException) { return ("No field " + fieldId + " in " + refSpec); diff --git a/src/share/classes/com/sun/tools/example/debug/event/AbstractEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/AbstractEventSet.java index 3dedd03463812939ebf513f263ddf420912e50ef..80cbd9a0da83794a2587e527e00c91dbff3d8d2d 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/AbstractEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/AbstractEventSet.java @@ -33,6 +33,7 @@ import java.util.*; public abstract class AbstractEventSet extends EventObject implements EventSet { + private static final long serialVersionUID = 2772717574222076977L; private final EventSet jdiEventSet; final Event oneEvent; @@ -81,6 +82,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { // Implement Mirror + @Override public VirtualMachine virtualMachine() { return jdiEventSet.virtualMachine(); } @@ -105,10 +107,12 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { return jdiEventSet.suspendPolicy(); } + @Override public void resume() { jdiEventSet.resume(); } + @Override public int suspendPolicy() { return jdiEventSet.suspendPolicy(); } @@ -128,6 +132,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { /** * Return an iterator specific to {@link Event} objects. */ + @Override public EventIterator eventIterator() { return jdiEventSet.eventIterator(); } @@ -142,6 +147,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * * @return the number of elements in this set (its cardinality). */ + @Override public int size() { return jdiEventSet.size(); } @@ -151,6 +157,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * * @return true if this set contains no elements. */ + @Override public boolean isEmpty() { return jdiEventSet.isEmpty(); } @@ -163,6 +170,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * * @return true if this set contains the specified element. */ + @Override public boolean contains(Object o) { return jdiEventSet.contains(o); } @@ -174,6 +182,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * * @return an iterator over the elements in this set. */ + @Override public Iterator iterator() { return jdiEventSet.iterator(); } @@ -184,6 +193,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * * @return an array containing all of the elements in this set. */ + @Override public Object[] toArray() { return jdiEventSet.toArray(); } @@ -202,6 +212,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * @throws ArrayStoreException the runtime type of a is not a supertype * of the runtime type of every element in this set. */ + @Override public T[] toArray(T a[]) { return jdiEventSet.toArray(a); } @@ -217,6 +228,7 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { * @return true if this set contains all of the elements of the * specified collection. */ + @Override public boolean containsAll(Collection c) { return jdiEventSet.containsAll(c); } @@ -224,21 +236,27 @@ public abstract class AbstractEventSet extends EventObject implements EventSet { // Make the rest of Set unmodifiable + @Override public boolean add(Event e){ throw new UnsupportedOperationException(); } + @Override public boolean remove(Object o) { throw new UnsupportedOperationException(); } + @Override public boolean addAll(Collection coll) { throw new UnsupportedOperationException(); } + @Override public boolean removeAll(Collection coll) { throw new UnsupportedOperationException(); } + @Override public boolean retainAll(Collection coll) { throw new UnsupportedOperationException(); } + @Override public void clear() { throw new UnsupportedOperationException(); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/AccessWatchpointEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/AccessWatchpointEventSet.java index 52894615e2bcf59241e53625a3e75bb210f98402..37b73e5c4a279bda4675120644b7a46079408f50 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/AccessWatchpointEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/AccessWatchpointEventSet.java @@ -25,15 +25,17 @@ package com.sun.tools.example.debug.event; -import com.sun.jdi.*; import com.sun.jdi.event.*; public class AccessWatchpointEventSet extends WatchpointEventSet { + private static final long serialVersionUID = -2620394219156607673L; + AccessWatchpointEventSet(EventSet jdiEventSet) { super(jdiEventSet); } + @Override public void notify(JDIListener listener) { listener.accessWatchpoint(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/ClassPrepareEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/ClassPrepareEventSet.java index 763e5426eec9cb08945073ae26f59e3b6a688467..69050d3f53a367560d5a01b6b9b4ec65048af4c1 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/ClassPrepareEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/ClassPrepareEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public class ClassPrepareEventSet extends AbstractEventSet { + private static final long serialVersionUID = 5958493423581010491L; + ClassPrepareEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -55,6 +57,7 @@ public class ClassPrepareEventSet extends AbstractEventSet { return ((ClassPrepareEvent)oneEvent).referenceType(); } + @Override public void notify(JDIListener listener) { listener.classPrepare(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/ClassUnloadEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/ClassUnloadEventSet.java index b7f996a5a2b9379f4027b8ead5b7a541f9a72b3c..c043b23b29ad34fbb45e8766b788406388fd45d2 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/ClassUnloadEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/ClassUnloadEventSet.java @@ -25,11 +25,12 @@ package com.sun.tools.example.debug.event; -import com.sun.jdi.*; import com.sun.jdi.event.*; public class ClassUnloadEventSet extends AbstractEventSet { + private static final long serialVersionUID = 8370341450345835866L; + ClassUnloadEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -48,6 +49,7 @@ public class ClassUnloadEventSet extends AbstractEventSet { return ((ClassUnloadEvent)oneEvent).classSignature(); } + @Override public void notify(JDIListener listener) { listener.classUnload(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/ExceptionEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/ExceptionEventSet.java index d55aab6121ff7e525d9aee81810bece5ad7544b3..c94fa284ae61319615f58368b4da915a262b1db8 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/ExceptionEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/ExceptionEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public class ExceptionEventSet extends LocatableEventSet { + private static final long serialVersionUID = 5328140167954640711L; + ExceptionEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -75,6 +77,7 @@ public class ExceptionEventSet extends LocatableEventSet { return ((ExceptionEvent)oneEvent).catchLocation(); } + @Override public void notify(JDIListener listener) { listener.exception(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/JDIAdapter.java b/src/share/classes/com/sun/tools/example/debug/event/JDIAdapter.java index 3d310604240d737b88f650e33535c8330320bad4..fb3e7a859aa836376da6adcc5b1b303c1029d9e4 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/JDIAdapter.java +++ b/src/share/classes/com/sun/tools/example/debug/event/JDIAdapter.java @@ -33,36 +33,47 @@ package com.sun.tools.example.debug.event; */ public class JDIAdapter implements JDIListener { + @Override public void accessWatchpoint(AccessWatchpointEventSet e) { } + @Override public void classPrepare(ClassPrepareEventSet e) { } + @Override public void classUnload(ClassUnloadEventSet e) { } + @Override public void exception(ExceptionEventSet e) { } + @Override public void locationTrigger(LocationTriggerEventSet e) { } + @Override public void modificationWatchpoint(ModificationWatchpointEventSet e) { } + @Override public void threadDeath(ThreadDeathEventSet e) { } + @Override public void threadStart(ThreadStartEventSet e) { } + @Override public void vmDeath(VMDeathEventSet e) { } + @Override public void vmDisconnect(VMDisconnectEventSet e) { } + @Override public void vmStart(VMStartEventSet e) { } diff --git a/src/share/classes/com/sun/tools/example/debug/event/LocatableEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/LocatableEventSet.java index 6e557c419e82b3c1002a544771a83146aff9ded9..303af121e4e65c5cfd6e53bd7189cf3e81e31e49 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/LocatableEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/LocatableEventSet.java @@ -33,6 +33,8 @@ import com.sun.jdi.event.*; */ public abstract class LocatableEventSet extends AbstractEventSet { + private static final long serialVersionUID = 1027131209997915620L; + LocatableEventSet(EventSet jdiEventSet) { super(jdiEventSet); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/LocationTriggerEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/LocationTriggerEventSet.java index 6e5366eae61a64b396730a660931d7662ecf8931..b30bea52bef7a1427c6c85ccf7f9920d2af950d4 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/LocationTriggerEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/LocationTriggerEventSet.java @@ -25,15 +25,17 @@ package com.sun.tools.example.debug.event; -import com.sun.jdi.*; import com.sun.jdi.event.*; public class LocationTriggerEventSet extends LocatableEventSet { + private static final long serialVersionUID = -3674631710485872487L; + LocationTriggerEventSet(EventSet jdiEventSet) { super(jdiEventSet); } + @Override public void notify(JDIListener listener) { listener.locationTrigger(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/ModificationWatchpointEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/ModificationWatchpointEventSet.java index d7824b7abf92b6279740be97f89fd39479b32b97..382a8f31b7cd791c8915c123ad6c0fe1d9f68cef 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/ModificationWatchpointEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/ModificationWatchpointEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public class ModificationWatchpointEventSet extends WatchpointEventSet { + private static final long serialVersionUID = -680889300856154719L; + ModificationWatchpointEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -42,6 +44,7 @@ public class ModificationWatchpointEventSet extends WatchpointEventSet { return ((ModificationWatchpointEvent)oneEvent).valueToBe(); } + @Override public void notify(JDIListener listener) { listener.modificationWatchpoint(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/ThreadDeathEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/ThreadDeathEventSet.java index 2e2cc00eea10fd95200c8653add2a02d03effdc0..ad432f77842652f5062ddf3c680ee924d4626b67 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/ThreadDeathEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/ThreadDeathEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public class ThreadDeathEventSet extends AbstractEventSet { + private static final long serialVersionUID = -8801604712308151331L; + ThreadDeathEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -44,6 +46,7 @@ public class ThreadDeathEventSet extends AbstractEventSet { return ((ThreadDeathEvent)oneEvent).thread(); } + @Override public void notify(JDIListener listener) { listener.threadDeath(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/ThreadStartEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/ThreadStartEventSet.java index 8f7ccc6fe3974272a50f3c3398cc8b8858256d33..63b1fb42603b221fe214c9a243f93c4b575ee6a6 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/ThreadStartEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/ThreadStartEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public class ThreadStartEventSet extends AbstractEventSet { + private static final long serialVersionUID = -3802096132294933502L; + ThreadStartEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -44,6 +46,7 @@ public class ThreadStartEventSet extends AbstractEventSet { return ((ThreadStartEvent)oneEvent).thread(); } + @Override public void notify(JDIListener listener) { listener.threadStart(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/VMDeathEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/VMDeathEventSet.java index 963eb8e8e829db0ba6d4d760adf45b90e230bc4c..017f11ff5aedaeab9c5fc06625dfc5069a80fbcf 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/VMDeathEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/VMDeathEventSet.java @@ -29,10 +29,13 @@ import com.sun.jdi.event.*; public class VMDeathEventSet extends AbstractEventSet { + private static final long serialVersionUID = 1163097303940092229L; + VMDeathEventSet(EventSet jdiEventSet) { super(jdiEventSet); } + @Override public void notify(JDIListener listener) { listener.vmDeath(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/VMDisconnectEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/VMDisconnectEventSet.java index d85553095555759b1d3d476ce03d20a9a1da318c..4edf4b872c9e54a3fa6c7d0559b19d96049386a3 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/VMDisconnectEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/VMDisconnectEventSet.java @@ -29,10 +29,13 @@ import com.sun.jdi.event.*; public class VMDisconnectEventSet extends AbstractEventSet { + private static final long serialVersionUID = 7968123152344675342L; + VMDisconnectEventSet(EventSet jdiEventSet) { super(jdiEventSet); } + @Override public void notify(JDIListener listener) { listener.vmDisconnect(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/VMStartEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/VMStartEventSet.java index d04116a44af5ba81d156e408c064a933ab3db6e6..896fa78c36921976c92694eec79b23aefd3a703c 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/VMStartEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/VMStartEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public class VMStartEventSet extends AbstractEventSet { + private static final long serialVersionUID = -3384957227835478191L; + VMStartEventSet(EventSet jdiEventSet) { super(jdiEventSet); } @@ -44,6 +46,7 @@ public class VMStartEventSet extends AbstractEventSet { return ((VMStartEvent)oneEvent).thread(); } + @Override public void notify(JDIListener listener) { listener.vmStart(this); } diff --git a/src/share/classes/com/sun/tools/example/debug/event/WatchpointEventSet.java b/src/share/classes/com/sun/tools/example/debug/event/WatchpointEventSet.java index 5c4de70100119c41117ef7c52b94595673ee84e6..628f21cb92db65d0052536f97102c7c6f73643d3 100644 --- a/src/share/classes/com/sun/tools/example/debug/event/WatchpointEventSet.java +++ b/src/share/classes/com/sun/tools/example/debug/event/WatchpointEventSet.java @@ -30,6 +30,8 @@ import com.sun.jdi.event.*; public abstract class WatchpointEventSet extends LocatableEventSet { + private static final long serialVersionUID = 5606285209703845409L; + WatchpointEventSet(EventSet jdiEventSet) { super(jdiEventSet); } diff --git a/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java b/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java index 3f8d0001a74a01bc4550f38b195a05de972f3c03..c2c79010c6bc0385bd1774f41ce6ea7f9138b974 100644 --- a/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java +++ b/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java @@ -27,25 +27,25 @@ package com.sun.tools.example.debug.expr; import com.sun.jdi.*; + import java.util.Stack; import java.util.List; import java.util.ArrayList; -@SuppressWarnings("unchecked") public class ExpressionParser implements ExpressionParserConstants { - Stack stack = new Stack(); + Stack stack = new Stack(); VirtualMachine vm = null; GetFrame frameGetter = null; private static GetFrame lastFrameGetter; private static LValue lastLValue; LValue peek() { - return (LValue)stack.peek(); + return stack.peek(); } LValue pop() { - return (LValue)stack.pop(); + return stack.pop(); } void push(LValue lval) { @@ -61,17 +61,14 @@ public class ExpressionParser implements ExpressionParserConstants { } public static Value evaluate(String expr, VirtualMachine vm, - GetFrame frameGetter) throws ParseException, - InvocationException, - InvalidTypeException, - ClassNotLoadedException, + GetFrame frameGetter) throws ParseException, InvocationException, + InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException { // TODO StringBufferInputStream is deprecated. java.io.InputStream in = new java.io.StringBufferInputStream(expr); ExpressionParser parser = new ExpressionParser(in); parser.vm = vm; parser.frameGetter = frameGetter; - Value value = null; parser.Expression(); lastFrameGetter = frameGetter; lastLValue = parser.pop(); @@ -89,8 +86,8 @@ public class ExpressionParser implements ExpressionParserConstants { try { parser = new ExpressionParser(new java.io.FileInputStream(args[0])); } catch (java.io.FileNotFoundException e) { - System.out.println("Java Parser Version 1.0.2: File " + - args[0] + " not found."); + System.out.println("Java Parser Version 1.0.2: File " + args[0] + + " not found."); return; } } else { @@ -137,8 +134,7 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(-1); throw new ParseException(); } - label_1: - while (true) { + label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; @@ -189,8 +185,7 @@ public class ExpressionParser implements ExpressionParserConstants { StringBuffer sb = new StringBuffer(); jj_consume_token(IDENTIFIER); sb.append(token); - label_2: - while (true) { + label_2: while (true) { if (jj_2_1(2)) { ; } else { @@ -198,16 +193,18 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(DOT); jj_consume_token(IDENTIFIER); - sb.append('.'); sb.append(token); - } - {if (true) return sb.toString();} + sb.append('.'); + sb.append(token); + } + if (true) { + return sb.toString(); + } throw new Error("Missing return statement in function"); } final public void NameList() throws ParseException { Name(); - label_3: - while (true) { + label_3: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; @@ -261,7 +258,9 @@ public class ExpressionParser implements ExpressionParserConstants { PrimaryExpression(); AssignmentOperator(); Expression(); - LValue exprVal = pop(); pop().setValue(exprVal); push(exprVal); + LValue exprVal = pop(); + pop().setValue(exprVal); + push(exprVal); } final public void AssignmentOperator() throws ParseException { @@ -317,13 +316,18 @@ public class ExpressionParser implements ExpressionParserConstants { Expression(); jj_consume_token(COLON); ConditionalExpression(); - LValue falseBranch = pop(); LValue trueBranch = pop(); + LValue falseBranch = pop(); + LValue trueBranch = pop(); Value cond = pop().interiorGetValue(); if (cond instanceof BooleanValue) { - push(((BooleanValue)cond).booleanValue()? - trueBranch : falseBranch); + push(((BooleanValue) cond).booleanValue() ? trueBranch + : falseBranch); } else { - {if (true) throw new ParseException("Condition must be boolean");} + { + if (true) { + throw new ParseException("Condition must be boolean"); + } + } } break; default: @@ -334,8 +338,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void ConditionalOrExpression() throws ParseException { ConditionalAndExpression(); - label_4: - while (true) { + label_4: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: ; @@ -346,14 +349,17 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(SC_OR); ConditionalAndExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } } final public void ConditionalAndExpression() throws ParseException { InclusiveOrExpression(); - label_5: - while (true) { + label_5: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_AND: ; @@ -364,14 +370,17 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(SC_AND); InclusiveOrExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } } final public void InclusiveOrExpression() throws ParseException { ExclusiveOrExpression(); - label_6: - while (true) { + label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: ; @@ -382,14 +391,17 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(BIT_OR); ExclusiveOrExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } } final public void ExclusiveOrExpression() throws ParseException { AndExpression(); - label_7: - while (true) { + label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XOR: ; @@ -400,14 +412,17 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(XOR); AndExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } } final public void AndExpression() throws ParseException { EqualityExpression(); - label_8: - while (true) { + label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: ; @@ -418,15 +433,18 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(BIT_AND); EqualityExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } } final public void EqualityExpression() throws ParseException { Token tok; InstanceOfExpression(); - label_9: - while (true) { + label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: case NE: @@ -460,7 +478,11 @@ public class ExpressionParser implements ExpressionParserConstants { case INSTANCEOF: jj_consume_token(INSTANCEOF); Type(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } break; default: jj_la1[14] = jj_gen; @@ -471,8 +493,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void RelationalExpression() throws ParseException { Token tok; ShiftExpression(); - label_10: - while (true) { + label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: case LT: @@ -510,8 +531,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void ShiftExpression() throws ParseException { AdditiveExpression(); - label_11: - while (true) { + label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case RSIGNEDSHIFT: @@ -538,15 +558,18 @@ public class ExpressionParser implements ExpressionParserConstants { throw new ParseException(); } AdditiveExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } } final public void AdditiveExpression() throws ParseException { Token tok; MultiplicativeExpression(); - label_12: - while (true) { + label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: @@ -577,8 +600,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void MultiplicativeExpression() throws ParseException { Token tok; UnaryExpression(); - label_13: - while (true) { + label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case SLASH: @@ -627,7 +649,11 @@ public class ExpressionParser implements ExpressionParserConstants { throw new ParseException(); } UnaryExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } break; case INCR: PreIncrementExpression(); @@ -661,13 +687,21 @@ public class ExpressionParser implements ExpressionParserConstants { final public void PreIncrementExpression() throws ParseException { jj_consume_token(INCR); PrimaryExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } final public void PreDecrementExpression() throws ParseException { jj_consume_token(DECR); PrimaryExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } } final public void UnaryExpressionNotPlusMinus() throws ParseException { @@ -687,7 +721,11 @@ public class ExpressionParser implements ExpressionParserConstants { throw new ParseException(); } UnaryExpression(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } break; default: jj_la1[26] = jj_gen; @@ -718,8 +756,10 @@ public class ExpressionParser implements ExpressionParserConstants { } } -// This production is to determine lookahead only. The LOOKAHEAD specifications -// below are not used, but they are there just to indicate that we know about + // This production is to determine lookahead only. The LOOKAHEAD + // specifications + // below are not used, but they are there just to indicate that we know + // about // this. final public void CastLookahead() throws ParseException { if (jj_2_4(2)) { @@ -792,7 +832,11 @@ public class ExpressionParser implements ExpressionParserConstants { break; case DECR: jj_consume_token(DECR); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } break; default: jj_la1[30] = jj_gen; @@ -810,8 +854,7 @@ public class ExpressionParser implements ExpressionParserConstants { if (jj_2_6(2)) { jj_consume_token(LPAREN); PrimitiveType(); - label_14: - while (true) { + label_14: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; @@ -830,8 +873,7 @@ public class ExpressionParser implements ExpressionParserConstants { case LPAREN: jj_consume_token(LPAREN); Name(); - label_15: - while (true) { + label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; @@ -856,8 +898,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void PrimaryExpression() throws ParseException { PrimaryPrefix(); - label_16: - while (true) { + label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: case LBRACKET: @@ -896,7 +937,11 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(SUPER); jj_consume_token(DOT); jj_consume_token(IDENTIFIER); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } break; case LPAREN: jj_consume_token(LPAREN); @@ -914,7 +959,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void PrimarySuffix() throws ParseException { - List argList; + List argList; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); @@ -992,8 +1037,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(NULL); } - final public List Arguments() throws ParseException { - List argList = new ArrayList(); + final public List Arguments() throws ParseException { + List argList = new ArrayList(); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: @@ -1021,15 +1066,18 @@ public class ExpressionParser implements ExpressionParserConstants { ; } jj_consume_token(RPAREN); - {if (true) return argList;} + { + if (true) { + return argList; + } + } throw new Error("Missing return statement in function"); } - final public void ArgumentList(List argList) throws ParseException { + final public void ArgumentList(List argList) throws ParseException { Expression(); argList.add(pop().interiorGetValue()); - label_17: - while (true) { + label_17: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; @@ -1045,7 +1093,8 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void AllocationExpression() throws ParseException { - List argList; String className; + List argList; + String className; if (jj_2_7(2)) { jj_consume_token(NEW); PrimitiveType(); @@ -1062,7 +1111,11 @@ public class ExpressionParser implements ExpressionParserConstants { break; case LBRACKET: ArrayDimensions(); - {if (true) throw new ParseException("operation not yet supported");} + { + if (true) { + throw new ParseException("operation not yet supported"); + } + } break; default: jj_la1[42] = jj_gen; @@ -1079,12 +1132,11 @@ public class ExpressionParser implements ExpressionParserConstants { } /* - * The second LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". + * The second LOOKAHEAD specification below is to parse to PrimarySuffix if + * there is an expression between the "[...]". */ final public void ArrayDimensions() throws ParseException { - label_18: - while (true) { + label_18: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); @@ -1094,8 +1146,7 @@ public class ExpressionParser implements ExpressionParserConstants { break label_18; } } - label_19: - while (true) { + label_19: while (true) { if (jj_2_9(2)) { ; } else { @@ -1107,71 +1158,84 @@ public class ExpressionParser implements ExpressionParserConstants { } final private boolean jj_2_1(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_1(); jj_save(0, xla); return retval; } final private boolean jj_2_2(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_2(); jj_save(1, xla); return retval; } final private boolean jj_2_3(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_3(); jj_save(2, xla); return retval; } final private boolean jj_2_4(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_4(); jj_save(3, xla); return retval; } final private boolean jj_2_5(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_5(); jj_save(4, xla); return retval; } final private boolean jj_2_6(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_6(); jj_save(5, xla); return retval; } final private boolean jj_2_7(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_7(); jj_save(6, xla); return retval; } final private boolean jj_2_8(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_8(); jj_save(7, xla); return retval; } final private boolean jj_2_9(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; + jj_la = xla; + jj_lastpos = jj_scanpos = token; boolean retval = !jj_3_9(); jj_save(8, xla); return retval; } final private boolean jj_3R_154() { - if (jj_scan_token(INCR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(INCR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1180,9 +1244,15 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_154()) { jj_scanpos = xsp; - if (jj_3R_155()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_155()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1191,27 +1261,54 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3_6()) { jj_scanpos = xsp; - if (jj_3R_150()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_150()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_6() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_23()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_23()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_152()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - if (jj_scan_token(RPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_115()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_152()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_115()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1220,45 +1317,86 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_50()) { jj_scanpos = xsp; - if (jj_3R_51()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_51()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_50() { - if (jj_3R_67()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_67()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_5() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_149() { - if (jj_3R_20()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_20()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; xsp = jj_scanpos; - if (jj_3R_151()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_151()) { + jj_scanpos = xsp; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_41() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; xsp = jj_scanpos; if (jj_3R_59()) { @@ -1275,51 +1413,109 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_65()) { jj_scanpos = xsp; - if (jj_3R_66()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_66()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_40() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_123() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_1() { - if (jj_scan_token(DOT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(DOT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_4() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_23()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_23()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1330,76 +1526,129 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_40()) { jj_scanpos = xsp; - if (jj_3R_41()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_41()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_3() { - if (jj_3R_22()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_22()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_24() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3_1()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3_1()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_147() { - if (jj_scan_token(BANG)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(BANG)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_142() { - if (jj_3R_149()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_149()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_122() { - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_49() { - if (jj_scan_token(DOUBLE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(DOUBLE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_141() { - if (jj_3R_148()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_148()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_48() { - if (jj_scan_token(FLOAT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(FLOAT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_146() { - if (jj_scan_token(TILDE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(TILDE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_47() { - if (jj_scan_token(LONG)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LONG)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1408,11 +1657,21 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_146()) { jj_scanpos = xsp; - if (jj_3R_147()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_115()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_147()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_115()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1423,48 +1682,84 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_141()) { jj_scanpos = xsp; - if (jj_3R_142()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_142()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_46() { - if (jj_scan_token(INT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(INT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_145() { - if (jj_scan_token(REM)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(REM)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_45() { - if (jj_scan_token(SHORT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SHORT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_44() { - if (jj_scan_token(BYTE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(BYTE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_135() { - if (jj_scan_token(DECR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_20()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(DECR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_20()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_43() { - if (jj_scan_token(CHAR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(CHAR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1485,49 +1780,95 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; - if (jj_3R_49()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_49()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_42() { - if (jj_scan_token(BOOLEAN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(BOOLEAN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_9() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_121() { - if (jj_3R_23()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_23()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_144() { - if (jj_scan_token(SLASH)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SLASH)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_134() { - if (jj_scan_token(INCR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_20()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(INCR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_20()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1536,62 +1877,105 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_121()) { jj_scanpos = xsp; - if (jj_3R_122()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_122()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } while (true) { xsp = jj_scanpos; - if (jj_3R_123()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_123()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_120() { - if (jj_scan_token(GE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(GE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_133() { - if (jj_scan_token(MINUS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(MINUS)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_127() { - if (jj_3R_136()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_136()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_126() { - if (jj_3R_135()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_135()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_139() { - if (jj_scan_token(MINUS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(MINUS)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_125() { - if (jj_3R_134()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_134()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_132() { - if (jj_scan_token(PLUS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(PLUS)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_143() { - if (jj_scan_token(STAR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(STAR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1600,11 +1984,21 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_132()) { jj_scanpos = xsp; - if (jj_3R_133()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_115()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_133()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_115()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1617,11 +2011,21 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_126()) { jj_scanpos = xsp; - if (jj_3R_127()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_127()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1632,54 +2036,95 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_144()) { jj_scanpos = xsp; - if (jj_3R_145()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_115()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_145()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_115()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_131() { - if (jj_scan_token(RUNSIGNEDSHIFT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(RUNSIGNEDSHIFT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_119() { - if (jj_scan_token(LE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_138() { - if (jj_scan_token(PLUS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(PLUS)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_112() { - if (jj_3R_115()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_115()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_137()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_137()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_88() { - if (jj_3R_86()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_86()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_130() { - if (jj_scan_token(RSIGNEDSHIFT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(RSIGNEDSHIFT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1688,29 +2133,51 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_138()) { jj_scanpos = xsp; - if (jj_3R_139()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_112()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_139()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_112()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_87() { - if (jj_3R_82()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_82()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_118() { - if (jj_scan_token(GT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(GT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_129() { - if (jj_scan_token(LSHIFT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LSHIFT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1721,68 +2188,128 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_130()) { jj_scanpos = xsp; - if (jj_3R_131()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_108()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_131()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_108()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_108() { - if (jj_3R_112()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_112()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_128()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_128()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3_8() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_86() { Token xsp; - if (jj_3_8()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3_8()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } while (true) { xsp = jj_scanpos; - if (jj_3_8()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3_8()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } while (true) { xsp = jj_scanpos; - if (jj_3_9()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3_9()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_117() { - if (jj_scan_token(LT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_106() { - if (jj_3R_108()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_108()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_116()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_116()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } @@ -1796,64 +2323,125 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_119()) { jj_scanpos = xsp; - if (jj_3R_120()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_106()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_120()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_106()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_111() { - if (jj_scan_token(NE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(NE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_109() { - if (jj_scan_token(INSTANCEOF)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_114()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(INSTANCEOF)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_114()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_104() { - if (jj_3R_106()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_106()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_113()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_113()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_81() { - if (jj_scan_token(NEW)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(NEW)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; xsp = jj_scanpos; if (jj_3R_87()) { jj_scanpos = xsp; - if (jj_3R_88()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_88()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_7() { - if (jj_scan_token(NEW)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_23()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_86()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(NEW)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_23()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_86()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1862,39 +2450,68 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3_7()) { jj_scanpos = xsp; - if (jj_3R_81()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_81()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_97() { - if (jj_scan_token(COMMA)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_39() { - if (jj_scan_token(ORASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(ORASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_110() { - if (jj_scan_token(EQ)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(EQ)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_102() { - if (jj_3R_104()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_104()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; xsp = jj_scanpos; - if (jj_3R_109()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_109()) { + jj_scanpos = xsp; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -1903,117 +2520,209 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_110()) { jj_scanpos = xsp; - if (jj_3R_111()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_102()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_111()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_102()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_94() { - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_97()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_97()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_89() { - if (jj_3R_94()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_94()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_38() { - if (jj_scan_token(XORASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(XORASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_82() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; xsp = jj_scanpos; - if (jj_3R_89()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_89()) { + jj_scanpos = xsp; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_105() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_100()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(BIT_AND)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_100()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_100() { - if (jj_3R_102()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_102()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_107()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_107()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_37() { - if (jj_scan_token(ANDASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(ANDASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_85() { - if (jj_scan_token(NULL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(NULL)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_103() { - if (jj_scan_token(XOR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_98()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(XOR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_98()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_98() { - if (jj_3R_100()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_100()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_105()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_105()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_92() { - if (jj_scan_token(FALSE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(FALSE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_36() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_91() { - if (jj_scan_token(TRUE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(TRUE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -2022,109 +2731,189 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_3R_91()) { jj_scanpos = xsp; - if (jj_3R_92()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_92()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_101() { - if (jj_scan_token(BIT_OR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_95()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(BIT_OR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_95()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_95() { - if (jj_3R_98()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_98()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_103()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_103()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_35() { - if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(RSIGNEDSHIFTASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_80() { - if (jj_3R_85()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_85()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_66() { - if (jj_3R_69()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_69()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_79() { - if (jj_3R_84()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_84()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_78() { - if (jj_scan_token(STRING_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(STRING_LITERAL)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_99() { - if (jj_scan_token(SC_AND)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_90()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SC_AND)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_90()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_90() { - if (jj_3R_95()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_95()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_101()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_101()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_34() { - if (jj_scan_token(LSHIFTASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LSHIFTASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_65() { - if (jj_scan_token(NEW)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(NEW)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_77() { - if (jj_scan_token(CHARACTER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(CHARACTER_LITERAL)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_76() { - if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(FLOATING_POINT_LITERAL)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_33() { - if (jj_scan_token(MINUSASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(MINUSASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -2141,89 +2930,161 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_79()) { jj_scanpos = xsp; - if (jj_3R_80()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_80()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_75() { - if (jj_scan_token(INTEGER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(INTEGER_LITERAL)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_96() { - if (jj_scan_token(SC_OR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_83()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SC_OR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_83()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_83() { - if (jj_3R_90()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_90()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_99()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_99()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_64() { - if (jj_scan_token(SUPER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SUPER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_32() { - if (jj_scan_token(PLUSASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(PLUSASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_73() { - if (jj_3R_82()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_82()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_72() { - if (jj_scan_token(DOT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(DOT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_74() { - if (jj_3R_83()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_83()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_96()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_96()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_63() { - if (jj_scan_token(THIS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(THIS)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_31() { - if (jj_scan_token(REMASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(REMASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -2234,120 +3095,231 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; - if (jj_3R_73()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_73()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_71() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_93() { - if (jj_scan_token(HOOK)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(COLON)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_68()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(HOOK)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(COLON)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_68()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_57() { - if (jj_3R_70()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_70()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_30() { - if (jj_scan_token(SLASHASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SLASHASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_27() { - if (jj_3R_58()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_58()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_56() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_152() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_55() { - if (jj_scan_token(SUPER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(DOT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SUPER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(DOT)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_29() { - if (jj_scan_token(STARASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(STARASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_68() { - if (jj_3R_74()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_74()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; xsp = jj_scanpos; - if (jj_3R_93()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_93()) { + jj_scanpos = xsp; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_54() { - if (jj_scan_token(THIS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(THIS)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_62() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_53() { - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_153() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -2364,19 +3336,37 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; - if (jj_3R_57()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_57()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_52() { - if (jj_3R_69()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_69()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -2405,103 +3395,206 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_38()) { jj_scanpos = xsp; - if (jj_3R_39()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_39()) { + return true; + } + if (jj_la == 0 + && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 + && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 + && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_28() { - if (jj_scan_token(ASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(ASSIGN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_61() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3_2() { - if (jj_3R_20()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_21()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_20()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_21()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_20() { - if (jj_3R_26()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_26()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_27()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_27()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } } return false; } final private boolean jj_3R_60() { - if (jj_scan_token(BANG)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(BANG)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_155() { - if (jj_scan_token(DECR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(DECR)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_67() { - if (jj_3R_20()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_21()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_25()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_20()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_21()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_25()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_150() { - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_24()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_24()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_153()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - if (jj_scan_token(RPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_136()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_153()) { + jj_scanpos = xsp; + break; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } + if (jj_3R_136()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_59() { - if (jj_scan_token(TILDE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(TILDE)) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } final private boolean jj_3R_51() { - if (jj_3R_68()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_68()) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + return false; + } return false; } @@ -2512,13 +3605,28 @@ public class ExpressionParser implements ExpressionParserConstants { private Token jj_scanpos, jj_lastpos; private int jj_la; public boolean lookingAhead = false; - private boolean jj_semLA; private int jj_gen; final private int[] jj_la1 = new int[44]; - final private int[] jj_la1_0 = {0x8209400,0x0,0x8209400,0x0,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x1000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x1000000,0x1000000,0x1000000,0x0,0x0,0x0,}; - final private int[] jj_la1_1 = {0x2014,0x0,0x2014,0x0,0x884480c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x884480c0,0x0,0x0,0x884480c0,0x884480c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x884480c0,0x0,0x88400080,0x400000,0x884480c0,0x0,0x0,0x40,}; - final private int[] jj_la1_2 = {0x8,0x400,0x0,0x2000,0xf00c004e,0x8000,0x100000,0x4000000,0x8000000,0x0,0x0,0x0,0x2400000,0x2400000,0x0,0x1830000,0x1830000,0x0,0x0,0xc0000000,0xc0000000,0x0,0x0,0xc0000000,0xf00c004e,0xc0000,0xc0000,0x4e,0xc004e,0x40,0x30000000,0x30000000,0x400,0x400,0x40,0x4440,0x4e,0x4440,0x6,0x0,0xf00c004e,0x2000,0x440,0x0,}; - final private int[] jj_la1_3 = {0x0,0x0,0x0,0x0,0x0,0xffe00,0x0,0x0,0x0,0x8,0x10,0x4,0x0,0x0,0x0,0x0,0x0,0x1c0,0x1c0,0x0,0x0,0x23,0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + final private int[] jj_la1_0 = { 0x8209400, 0x0, 0x8209400, 0x0, 0x1000000, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x0, 0x1000000, 0x1000000, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x1000000, + 0x1000000, 0x1000000, 0x0, 0x0, 0x0, }; + final private int[] jj_la1_1 = { 0x2014, 0x0, 0x2014, 0x0, 0x884480c0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x884480c0, 0x0, 0x0, 0x884480c0, 0x884480c0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x884480c0, 0x0, 0x88400080, 0x400000, + 0x884480c0, 0x0, 0x0, 0x40, }; + final private int[] jj_la1_2 = { 0x8, 0x400, 0x0, 0x2000, 0xf00c004e, + 0x8000, 0x100000, 0x4000000, 0x8000000, 0x0, 0x0, 0x0, 0x2400000, + 0x2400000, 0x0, 0x1830000, 0x1830000, 0x0, 0x0, 0xc0000000, + 0xc0000000, 0x0, 0x0, 0xc0000000, 0xf00c004e, 0xc0000, 0xc0000, 0x4e, + 0xc004e, 0x40, 0x30000000, 0x30000000, 0x400, 0x400, 0x40, 0x4440, + 0x4e, 0x4440, 0x6, 0x0, 0xf00c004e, 0x2000, 0x440, 0x0, }; + final private int[] jj_la1_3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0xffe00, 0x0, 0x0, + 0x0, 0x8, 0x10, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c0, 0x1c0, 0x0, 0x0, + 0x23, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; final private JJExpressionParserCalls[] jj_2_rtns = new JJExpressionParserCalls[9]; private boolean jj_rescan = false; private int jj_gc = 0; @@ -2529,8 +3637,12 @@ public class ExpressionParser implements ExpressionParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJExpressionParserCalls(); + for (int i = 0; i < 44; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJExpressionParserCalls(); + } } public void ReInit(java.io.InputStream stream) { @@ -2539,8 +3651,12 @@ public class ExpressionParser implements ExpressionParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJExpressionParserCalls(); + for (int i = 0; i < 44; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJExpressionParserCalls(); + } } public ExpressionParser(ExpressionParserTokenManager tm) { @@ -2548,8 +3664,12 @@ public class ExpressionParser implements ExpressionParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJExpressionParserCalls(); + for (int i = 0; i < 44; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJExpressionParserCalls(); + } } public void ReInit(ExpressionParserTokenManager tm) { @@ -2557,23 +3677,32 @@ public class ExpressionParser implements ExpressionParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 44; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJExpressionParserCalls(); + for (int i = 0; i < 44; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJExpressionParserCalls(); + } } final private Token jj_consume_token(int kind) throws ParseException { Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); + if ((oldToken = token).next != null) { + token = token.next; + } else { + token = token.next = token_source.getNextToken(); + } jj_ntk = -1; if (token.kind == kind) { jj_gen++; if (++jj_gc > 100) { jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJExpressionParserCalls c = jj_2_rtns[i]; + for (JJExpressionParserCalls jj_2_rtn : jj_2_rtns) { + JJExpressionParserCalls c = jj_2_rtn; while (c != null) { - if (c.gen < jj_gen) c.first = null; + if (c.gen < jj_gen) { + c.first = null; + } c = c.next; } } @@ -2589,7 +3718,8 @@ public class ExpressionParser implements ExpressionParserConstants { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source + .getNextToken(); } else { jj_lastpos = jj_scanpos = jj_scanpos.next; } @@ -2597,16 +3727,25 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = jj_scanpos.next; } if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); + int i = 0; + Token tok = token; + while (tok != null && tok != jj_scanpos) { + i++; + tok = tok.next; + } + if (tok != null) { + jj_add_error_token(kind, i); + } } return (jj_scanpos.kind != kind); } final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); + if (token.next != null) { + token = token.next; + } else { + token = token.next = token_source.getNextToken(); + } jj_ntk = -1; jj_gen++; return token; @@ -2615,27 +3754,33 @@ public class ExpressionParser implements ExpressionParserConstants { final public Token getToken(int index) { Token t = lookingAhead ? jj_scanpos : token; for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); + if (t.next != null) { + t = t.next; + } else { + t = t.next = token_source.getNextToken(); + } } return t; } final private int jj_ntk() { - if ((jj_nt=token.next) == null) + if ((jj_nt = token.next) == null) { return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else + } else { return (jj_ntk = jj_nt.kind); } + } - private java.util.Vector jj_expentries = new java.util.Vector(); + private java.util.Vector jj_expentries = new java.util.Vector(); private int[] jj_expentry; private int jj_kind = -1; private int[] jj_lasttokens = new int[100]; private int jj_endpos; private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; + if (pos >= 100) { + return; + } if (pos == jj_endpos + 1) { jj_lasttokens[jj_endpos++] = kind; } else if (jj_endpos != 0) { @@ -2644,8 +3789,9 @@ public class ExpressionParser implements ExpressionParserConstants { jj_expentry[i] = jj_lasttokens[i]; } boolean exists = false; - for (java.util.Enumeration enum_ = jj_expentries.elements(); enum_.hasMoreElements();) { - int[] oldentry = (int[])(enum_.nextElement()); + for (java.util.Enumeration enum_ = jj_expentries.elements(); enum_ + .hasMoreElements();) { + int[] oldentry = (enum_.nextElement()); if (oldentry.length == jj_expentry.length) { exists = true; for (int i = 0; i < jj_expentry.length; i++) { @@ -2654,11 +3800,17 @@ public class ExpressionParser implements ExpressionParserConstants { break; } } - if (exists) break; - } - } - if (!exists) jj_expentries.addElement(jj_expentry); - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; + if (exists) { + break; + } + } + } + if (!exists) { + jj_expentries.addElement(jj_expentry); + } + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } } } @@ -2702,7 +3854,7 @@ public class ExpressionParser implements ExpressionParserConstants { jj_add_error_token(0, 0); int[][] exptokseq = new int[jj_expentries.size()][]; for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = (int[])jj_expentries.elementAt(i); + exptokseq[i] = jj_expentries.elementAt(i); } return new ParseException(token, exptokseq, tokenImage); } @@ -2719,17 +3871,36 @@ public class ExpressionParser implements ExpressionParserConstants { JJExpressionParserCalls p = jj_2_rtns[i]; do { if (p.gen > jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + jj_la = p.arg; + jj_lastpos = jj_scanpos = p.first; switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - case 2: jj_3_3(); break; - case 3: jj_3_4(); break; - case 4: jj_3_5(); break; - case 5: jj_3_6(); break; - case 6: jj_3_7(); break; - case 7: jj_3_8(); break; - case 8: jj_3_9(); break; + case 0: + jj_3_1(); + break; + case 1: + jj_3_2(); + break; + case 2: + jj_3_3(); + break; + case 3: + jj_3_4(); + break; + case 4: + jj_3_5(); + break; + case 5: + jj_3_6(); + break; + case 6: + jj_3_7(); + break; + case 7: + jj_3_8(); + break; + case 8: + jj_3_9(); + break; } } p = p.next; @@ -2741,10 +3912,15 @@ public class ExpressionParser implements ExpressionParserConstants { final private void jj_save(int index, int xla) { JJExpressionParserCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJExpressionParserCalls(); break; } + if (p.next == null) { + p = p.next = new JJExpressionParserCalls(); + break; + } p = p.next; } - p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + p.gen = jj_gen + xla - jj_la; + p.first = token; + p.arg = xla; } } diff --git a/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java b/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java index 28472858050a9f90dfb0276eb5576d23d34f8643..9787d5de554dad69ed24ecd67d18373520ed7a90 100644 --- a/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java +++ b/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java @@ -25,10 +25,6 @@ /* Generated By:JavaCC: Do not edit this line. ExpressionParserTokenManager.java */ package com.sun.tools.example.debug.expr; -import com.sun.jdi.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; public class ExpressionParserTokenManager implements ExpressionParserConstants { @@ -37,15 +33,17 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) switch (pos) { case 0: - if ((active1 & 0x4000L) != 0L) + if ((active1 & 0x4000L) != 0L) { return 4; + } if ((active0 & 0x7fffffffffffe00L) != 0L) { jjmatchedKind = 67; return 28; } - if ((active1 & 0x100200000000L) != 0L) + if ((active1 & 0x100200000000L) != 0L) { return 49; + } return -1; case 1: if ((active0 & 0x7ffffffbfcffe00L) != 0L) @@ -57,8 +55,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 28; } - if ((active0 & 0x40300000L) != 0L) + if ((active0 & 0x40300000L) != 0L) { return 28; + } return -1; case 2: if ((active0 & 0x77fffb3afeffe00L) != 0L) @@ -70,8 +69,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 28; } - if ((active0 & 0x80004c10000000L) != 0L) + if ((active0 & 0x80004c10000000L) != 0L) { return 28; + } return -1; case 3: if ((active0 & 0x63bff2b8faf4e00L) != 0L) @@ -80,8 +80,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 3; return 28; } - if ((active0 & 0x14400902040b000L) != 0L) + if ((active0 & 0x14400902040b000L) != 0L) { return 28; + } return -1; case 4: if ((active0 & 0x2235f2b80ac0600L) != 0L) @@ -93,8 +94,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 28; } - if ((active0 & 0x418a0000f034800L) != 0L) + if ((active0 & 0x418a0000f034800L) != 0L) { return 28; + } return -1; case 5: if ((active0 & 0x222070a848c0600L) != 0L) @@ -103,8 +105,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 5; return 28; } - if ((active0 & 0x11582100200000L) != 0L) + if ((active0 & 0x11582100200000L) != 0L) { return 28; + } return -1; case 6: if ((active0 & 0x222040a80040200L) != 0L) @@ -113,8 +116,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 6; return 28; } - if ((active0 & 0x30004880400L) != 0L) + if ((active0 & 0x30004880400L) != 0L) { return 28; + } return -1; case 7: if ((active0 & 0x22040a80000000L) != 0L) @@ -123,8 +127,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 7; return 28; } - if ((active0 & 0x200000000040200L) != 0L) + if ((active0 & 0x200000000040200L) != 0L) { return 28; + } return -1; case 8: if ((active0 & 0x2000280000000L) != 0L) @@ -133,8 +138,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 8; return 28; } - if ((active0 & 0x20040800000000L) != 0L) + if ((active0 & 0x20040800000000L) != 0L) { return 28; + } return -1; case 9: if ((active0 & 0x2000000000000L) != 0L) @@ -143,8 +149,9 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) jjmatchedPos = 9; return 28; } - if ((active0 & 0x280000000L) != 0L) + if ((active0 & 0x280000000L) != 0L) { return 28; + } return -1; case 10: if ((active0 & 0x2000000000000L) != 0L) @@ -286,16 +293,19 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) switch(curChar) { case 38: - if ((active1 & 0x8000000L) != 0L) + if ((active1 & 0x8000000L) != 0L) { return jjStopAtPos(1, 91); + } break; case 43: - if ((active1 & 0x10000000L) != 0L) + if ((active1 & 0x10000000L) != 0L) { return jjStopAtPos(1, 92); + } break; case 45: - if ((active1 & 0x20000000L) != 0L) + if ((active1 & 0x20000000L) != 0L) { return jjStopAtPos(1, 93); + } break; case 60: if ((active1 & 0x4000000000L) != 0L) @@ -305,30 +315,31 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) } return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000L); case 61: - if ((active1 & 0x400000L) != 0L) + if ((active1 & 0x400000L) != 0L) { return jjStopAtPos(1, 86); - else if ((active1 & 0x800000L) != 0L) + } else if ((active1 & 0x800000L) != 0L) { return jjStopAtPos(1, 87); - else if ((active1 & 0x1000000L) != 0L) + } else if ((active1 & 0x1000000L) != 0L) { return jjStopAtPos(1, 88); - else if ((active1 & 0x2000000L) != 0L) + } else if ((active1 & 0x2000000L) != 0L) { return jjStopAtPos(1, 89); - else if ((active1 & 0x20000000000L) != 0L) + } else if ((active1 & 0x20000000000L) != 0L) { return jjStopAtPos(1, 105); - else if ((active1 & 0x40000000000L) != 0L) + } else if ((active1 & 0x40000000000L) != 0L) { return jjStopAtPos(1, 106); - else if ((active1 & 0x80000000000L) != 0L) + } else if ((active1 & 0x80000000000L) != 0L) { return jjStopAtPos(1, 107); - else if ((active1 & 0x100000000000L) != 0L) + } else if ((active1 & 0x100000000000L) != 0L) { return jjStopAtPos(1, 108); - else if ((active1 & 0x200000000000L) != 0L) + } else if ((active1 & 0x200000000000L) != 0L) { return jjStopAtPos(1, 109); - else if ((active1 & 0x400000000000L) != 0L) + } else if ((active1 & 0x400000000000L) != 0L) { return jjStopAtPos(1, 110); - else if ((active1 & 0x800000000000L) != 0L) + } else if ((active1 & 0x800000000000L) != 0L) { return jjStopAtPos(1, 111); - else if ((active1 & 0x1000000000000L) != 0L) + } else if ((active1 & 0x1000000000000L) != 0L) { return jjStopAtPos(1, 112); + } break; case 62: if ((active1 & 0x8000000000L) != 0L) @@ -344,8 +355,9 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) case 101: return jjMoveStringLiteralDfa2_0(active0, 0x104000080000L, active1, 0L); case 102: - if ((active0 & 0x40000000L) != 0L) + if ((active0 & 0x40000000L) != 0L) { return jjStartNfaWithStates_0(1, 30, 28); + } break; case 104: return jjMoveStringLiteralDfa2_0(active0, 0x41c200000008000L, active1, 0L); @@ -377,8 +389,9 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) case 121: return jjMoveStringLiteralDfa2_0(active0, 0x2000000001000L, active1, 0L); case 124: - if ((active1 & 0x4000000L) != 0L) + if ((active1 & 0x4000000L) != 0L) { return jjStopAtPos(1, 90); + } break; default : break; @@ -387,8 +400,9 @@ private final int jjMoveStringLiteralDfa1_0(long active0, long active1) } private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) + if (((active0 &= old0) | (active1 &= old1)) == 0L) { return jjStartNfa_0(0, old0, old1); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0, active1); @@ -397,10 +411,11 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, switch(curChar) { case 61: - if ((active1 & 0x2000000000000L) != 0L) + if ((active1 & 0x2000000000000L) != 0L) { return jjStopAtPos(2, 113); - else if ((active1 & 0x4000000000000L) != 0L) + } else if ((active1 & 0x4000000000000L) != 0L) { return jjStopAtPos(2, 114); + } break; case 62: if ((active1 & 0x10000000000L) != 0L) @@ -430,8 +445,9 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, case 112: return jjMoveStringLiteralDfa3_0(active0, 0x800180000000L, active1, 0L); case 114: - if ((active0 & 0x10000000L) != 0L) + if ((active0 & 0x10000000L) != 0L) { return jjStartNfaWithStates_0(2, 28, 28); + } return jjMoveStringLiteralDfa3_0(active0, 0x18000000000000L, active1, 0L); case 115: return jjMoveStringLiteralDfa3_0(active0, 0x200402200L, active1, 0L); @@ -445,12 +461,14 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, case 117: return jjMoveStringLiteralDfa3_0(active0, 0x40000000200000L, active1, 0L); case 119: - if ((active0 & 0x4000000000L) != 0L) + if ((active0 & 0x4000000000L) != 0L) { return jjStartNfaWithStates_0(2, 38, 28); + } break; case 121: - if ((active0 & 0x80000000000000L) != 0L) + if ((active0 & 0x80000000000000L) != 0L) { return jjStartNfaWithStates_0(2, 55, 28); + } break; default : break; @@ -459,8 +477,9 @@ private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, } private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) + if (((active0 &= old0) | (active1 &= old1)) == 0L) { return jjStartNfa_0(1, old0, old1); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0, active1); @@ -469,8 +488,9 @@ private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, switch(curChar) { case 61: - if ((active1 & 0x8000000000000L) != 0L) + if ((active1 & 0x8000000000000L) != 0L) { return jjStopAtPos(3, 115); + } break; case 97: return jjMoveStringLiteralDfa4_0(active0, 0x20000000e080800L, active1, 0L); @@ -479,44 +499,51 @@ private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, case 99: return jjMoveStringLiteralDfa4_0(active0, 0x2000000004000L, active1, 0L); case 100: - if ((active0 & 0x100000000000000L) != 0L) + if ((active0 & 0x100000000000000L) != 0L) { return jjStartNfaWithStates_0(3, 56, 28); + } break; case 101: - if ((active0 & 0x1000L) != 0L) + if ((active0 & 0x1000L) != 0L) { return jjStartNfaWithStates_0(3, 12, 28); - else if ((active0 & 0x2000L) != 0L) + } else if ((active0 & 0x2000L) != 0L) { return jjStartNfaWithStates_0(3, 13, 28); - else if ((active0 & 0x400000L) != 0L) + } else if ((active0 & 0x400000L) != 0L) { return jjStartNfaWithStates_0(3, 22, 28); - else if ((active0 & 0x40000000000000L) != 0L) + } else if ((active0 & 0x40000000000000L) != 0L) { return jjStartNfaWithStates_0(3, 54, 28); + } return jjMoveStringLiteralDfa4_0(active0, 0x800800800000L, active1, 0L); case 103: - if ((active0 & 0x1000000000L) != 0L) + if ((active0 & 0x1000000000L) != 0L) { return jjStartNfaWithStates_0(3, 36, 28); + } break; case 105: return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L, active1, 0L); case 107: return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L, active1, 0L); case 108: - if ((active0 & 0x8000000000L) != 0L) + if ((active0 & 0x8000000000L) != 0L) { return jjStartNfaWithStates_0(3, 39, 28); + } return jjMoveStringLiteralDfa4_0(active0, 0x400080080000400L, active1, 0L); case 110: return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0L); case 111: - if ((active0 & 0x20000000L) != 0L) + if ((active0 & 0x20000000L) != 0L) { return jjStartNfaWithStates_0(3, 29, 28); + } return jjMoveStringLiteralDfa4_0(active0, 0x18000100000000L, active1, 0L); case 114: - if ((active0 & 0x8000L) != 0L) + if ((active0 & 0x8000L) != 0L) { return jjStartNfaWithStates_0(3, 15, 28); + } return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); case 115: - if ((active0 & 0x4000000000000L) != 0L) + if ((active0 & 0x4000000000000L) != 0L) { return jjStartNfaWithStates_0(3, 50, 28); + } return jjMoveStringLiteralDfa4_0(active0, 0x1030000L, active1, 0L); case 116: return jjMoveStringLiteralDfa4_0(active0, 0x1440200040200L, active1, 0L); @@ -531,8 +558,9 @@ private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, } private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) + if (((active0 &= old0) | (active1 &= old1)) == 0L) { return jjStartNfa_0(2, old0, old1); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0, 0L); @@ -545,20 +573,23 @@ private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, case 99: return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000L); case 101: - if ((active0 & 0x1000000L) != 0L) + if ((active0 & 0x1000000L) != 0L) { return jjStartNfaWithStates_0(4, 24, 28); - else if ((active0 & 0x400000000000000L) != 0L) + } else if ((active0 & 0x400000000000000L) != 0L) { return jjStartNfaWithStates_0(4, 58, 28); + } return jjMoveStringLiteralDfa5_0(active0, 0x40080000400L); case 104: - if ((active0 & 0x4000L) != 0L) + if ((active0 & 0x4000L) != 0L) { return jjStartNfaWithStates_0(4, 14, 28); + } return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000L); case 105: return jjMoveStringLiteralDfa5_0(active0, 0x480000040000L); case 107: - if ((active0 & 0x800L) != 0L) + if ((active0 & 0x800L) != 0L) { return jjStartNfaWithStates_0(4, 11, 28); + } break; case 108: if ((active0 & 0x2000000L) != 0L) @@ -570,20 +601,23 @@ private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, case 110: return jjMoveStringLiteralDfa5_0(active0, 0x800000L); case 114: - if ((active0 & 0x800000000000L) != 0L) + if ((active0 & 0x800000000000L) != 0L) { return jjStartNfaWithStates_0(4, 47, 28); + } return jjMoveStringLiteralDfa5_0(active0, 0x100900000200L); case 115: - if ((active0 & 0x10000L) != 0L) + if ((active0 & 0x10000L) != 0L) { return jjStartNfaWithStates_0(4, 16, 28); + } return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L); case 116: - if ((active0 & 0x20000L) != 0L) + if ((active0 & 0x20000L) != 0L) { return jjStartNfaWithStates_0(4, 17, 28); - else if ((active0 & 0x8000000L) != 0L) + } else if ((active0 & 0x8000000L) != 0L) { return jjStartNfaWithStates_0(4, 27, 28); - else if ((active0 & 0x200000000000L) != 0L) + } else if ((active0 & 0x200000000000L) != 0L) { return jjStartNfaWithStates_0(4, 45, 28); + } return jjMoveStringLiteralDfa5_0(active0, 0x200000000000000L); case 117: return jjMoveStringLiteralDfa5_0(active0, 0x80000L); @@ -603,8 +637,9 @@ private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, } private final int jjMoveStringLiteralDfa5_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(3, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0, 0L); @@ -615,26 +650,29 @@ private final int jjMoveStringLiteralDfa5_0(long old0, long active0) case 97: return jjMoveStringLiteralDfa6_0(active0, 0x600L); case 99: - if ((active0 & 0x80000000000L) != 0L) + if ((active0 & 0x80000000000L) != 0L) { return jjStartNfaWithStates_0(5, 43, 28); - else if ((active0 & 0x400000000000L) != 0L) + } else if ((active0 & 0x400000000000L) != 0L) { return jjStartNfaWithStates_0(5, 46, 28); + } return jjMoveStringLiteralDfa6_0(active0, 0x40000000000L); case 100: return jjMoveStringLiteralDfa6_0(active0, 0x800000L); case 101: - if ((active0 & 0x200000L) != 0L) + if ((active0 & 0x200000L) != 0L) { return jjStartNfaWithStates_0(5, 21, 28); - else if ((active0 & 0x2000000000L) != 0L) + } else if ((active0 & 0x2000000000L) != 0L) { return jjStartNfaWithStates_0(5, 37, 28); + } break; case 102: return jjMoveStringLiteralDfa6_0(active0, 0x800000000L); case 103: return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); case 104: - if ((active0 & 0x1000000000000L) != 0L) + if ((active0 & 0x1000000000000L) != 0L) { return jjStartNfaWithStates_0(5, 48, 28); + } break; case 105: return jjMoveStringLiteralDfa6_0(active0, 0x220000000000000L); @@ -643,18 +681,21 @@ private final int jjMoveStringLiteralDfa5_0(long old0, long active0) case 109: return jjMoveStringLiteralDfa6_0(active0, 0x80000000L); case 110: - if ((active0 & 0x100000000000L) != 0L) + if ((active0 & 0x100000000000L) != 0L) { return jjStartNfaWithStates_0(5, 44, 28); + } return jjMoveStringLiteralDfa6_0(active0, 0x200040000L); case 114: return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000L); case 115: - if ((active0 & 0x10000000000000L) != 0L) + if ((active0 & 0x10000000000000L) != 0L) { return jjStartNfaWithStates_0(5, 52, 28); + } break; case 116: - if ((active0 & 0x100000000L) != 0L) + if ((active0 & 0x100000000L) != 0L) { return jjStartNfaWithStates_0(5, 32, 28); + } return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L); default : break; @@ -663,8 +704,9 @@ private final int jjMoveStringLiteralDfa5_0(long old0, long active0) } private final int jjMoveStringLiteralDfa6_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(4, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0, 0L); @@ -677,32 +719,37 @@ private final int jjMoveStringLiteralDfa6_0(long old0, long active0) case 99: return jjMoveStringLiteralDfa7_0(active0, 0x200000200L); case 101: - if ((active0 & 0x10000000000L) != 0L) + if ((active0 & 0x10000000000L) != 0L) { return jjStartNfaWithStates_0(6, 40, 28); - else if ((active0 & 0x20000000000L) != 0L) + } else if ((active0 & 0x20000000000L) != 0L) { return jjStartNfaWithStates_0(6, 41, 28); + } return jjMoveStringLiteralDfa7_0(active0, 0x20000080000000L); case 108: return jjMoveStringLiteralDfa7_0(active0, 0x200000000000000L); case 110: - if ((active0 & 0x400L) != 0L) + if ((active0 & 0x400L) != 0L) { return jjStartNfaWithStates_0(6, 10, 28); + } break; case 111: return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L); case 115: - if ((active0 & 0x800000L) != 0L) + if ((active0 & 0x800000L) != 0L) { return jjStartNfaWithStates_0(6, 23, 28); + } break; case 116: - if ((active0 & 0x80000L) != 0L) + if ((active0 & 0x80000L) != 0L) { return jjStartNfaWithStates_0(6, 19, 28); + } return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L); case 117: return jjMoveStringLiteralDfa7_0(active0, 0x40000L); case 121: - if ((active0 & 0x4000000L) != 0L) + if ((active0 & 0x4000000L) != 0L) { return jjStartNfaWithStates_0(6, 26, 28); + } break; default : break; @@ -711,8 +758,9 @@ private final int jjMoveStringLiteralDfa6_0(long old0, long active0) } private final int jjMoveStringLiteralDfa7_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(5, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(6, active0, 0L); @@ -723,16 +771,18 @@ private final int jjMoveStringLiteralDfa7_0(long old0, long active0) case 99: return jjMoveStringLiteralDfa8_0(active0, 0x800000000L); case 101: - if ((active0 & 0x40000L) != 0L) + if ((active0 & 0x40000L) != 0L) { return jjStartNfaWithStates_0(7, 18, 28); - else if ((active0 & 0x200000000000000L) != 0L) + } else if ((active0 & 0x200000000000000L) != 0L) { return jjStartNfaWithStates_0(7, 57, 28); + } return jjMoveStringLiteralDfa8_0(active0, 0x40200000000L); case 110: return jjMoveStringLiteralDfa8_0(active0, 0x22000080000000L); case 116: - if ((active0 & 0x200L) != 0L) + if ((active0 & 0x200L) != 0L) { return jjStartNfaWithStates_0(7, 9, 28); + } break; default : break; @@ -741,8 +791,9 @@ private final int jjMoveStringLiteralDfa7_0(long old0, long active0) } private final int jjMoveStringLiteralDfa8_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(6, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(7, active0, 0L); @@ -751,20 +802,23 @@ private final int jjMoveStringLiteralDfa8_0(long old0, long active0) switch(curChar) { case 100: - if ((active0 & 0x40000000000L) != 0L) + if ((active0 & 0x40000000000L) != 0L) { return jjStartNfaWithStates_0(8, 42, 28); + } break; case 101: - if ((active0 & 0x800000000L) != 0L) + if ((active0 & 0x800000000L) != 0L) { return jjStartNfaWithStates_0(8, 35, 28); + } break; case 105: return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000L); case 111: return jjMoveStringLiteralDfa9_0(active0, 0x200000000L); case 116: - if ((active0 & 0x20000000000000L) != 0L) + if ((active0 & 0x20000000000000L) != 0L) { return jjStartNfaWithStates_0(8, 53, 28); + } return jjMoveStringLiteralDfa9_0(active0, 0x80000000L); default : break; @@ -773,8 +827,9 @@ private final int jjMoveStringLiteralDfa8_0(long old0, long active0) } private final int jjMoveStringLiteralDfa9_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(7, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(8, active0, 0L); @@ -783,12 +838,14 @@ private final int jjMoveStringLiteralDfa9_0(long old0, long active0) switch(curChar) { case 102: - if ((active0 & 0x200000000L) != 0L) + if ((active0 & 0x200000000L) != 0L) { return jjStartNfaWithStates_0(9, 33, 28); + } break; case 115: - if ((active0 & 0x80000000L) != 0L) + if ((active0 & 0x80000000L) != 0L) { return jjStartNfaWithStates_0(9, 31, 28); + } break; case 122: return jjMoveStringLiteralDfa10_0(active0, 0x2000000000000L); @@ -799,8 +856,9 @@ private final int jjMoveStringLiteralDfa9_0(long old0, long active0) } private final int jjMoveStringLiteralDfa10_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(8, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(9, active0, 0L); @@ -817,8 +875,9 @@ private final int jjMoveStringLiteralDfa10_0(long old0, long active0) } private final int jjMoveStringLiteralDfa11_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) + if (((active0 &= old0)) == 0L) { return jjStartNfa_0(9, old0, 0L); + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(10, active0, 0L); @@ -827,8 +886,9 @@ private final int jjMoveStringLiteralDfa11_0(long old0, long active0) switch(curChar) { case 100: - if ((active0 & 0x2000000000000L) != 0L) + if ((active0 & 0x2000000000000L) != 0L) { return jjStartNfaWithStates_0(11, 49, 28); + } break; default : break; @@ -891,320 +951,395 @@ static final long[] jjbitVec8 = { }; private final int jjMoveNfa_0(int startState, int curPos) { - int[] nextStates; int startsAt = 0; jjnewStateCnt = 67; int i = 1; jjstateSet[0] = startState; - int j, kind = 0x7fffffff; + int kind = 0x7fffffff; for (;;) { - if (++jjround == 0x7fffffff) + if (++jjround == 0x7fffffff) { ReInitRounds(); + } if (curChar < 64) { long l = 1L << curChar; - MatchLoop: do + //MatchLoop + do { switch(jjstateSet[--i]) { case 0: - if ((0x3ff000000000000L & l) != 0L) + if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddStates(0, 6); - else if (curChar == 47) + } else if (curChar == 47) { jjAddStates(7, 9); - else if (curChar == 36) + } else if (curChar == 36) { - if (kind > 67) + if (kind > 67) { kind = 67; + } jjCheckNAdd(28); } - else if (curChar == 34) + else if (curChar == 34) { jjCheckNAddStates(10, 12); - else if (curChar == 39) + } else if (curChar == 39) { jjAddStates(13, 14); - else if (curChar == 46) + } else if (curChar == 46) { jjCheckNAdd(4); + } if ((0x3fe000000000000L & l) != 0L) { - if (kind > 59) + if (kind > 59) { kind = 59; + } jjCheckNAddTwoStates(1, 2); } else if (curChar == 48) { - if (kind > 59) + if (kind > 59) { kind = 59; + } jjCheckNAddStates(15, 17); } break; case 49: - if (curChar == 42) + if (curChar == 42) { jjCheckNAddTwoStates(62, 63); - else if (curChar == 47) + } else if (curChar == 47) { jjCheckNAddStates(18, 20); - if (curChar == 42) + } + if (curChar == 42) { jjstateSet[jjnewStateCnt++] = 54; + } break; case 1: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 59) + } + if (kind > 59) { kind = 59; + } jjCheckNAddTwoStates(1, 2); break; case 3: - if (curChar == 46) + if (curChar == 46) { jjCheckNAdd(4); + } break; case 4: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 63) + } + if (kind > 63) { kind = 63; + } jjCheckNAddStates(21, 23); break; case 6: - if ((0x280000000000L & l) != 0L) + if ((0x280000000000L & l) != 0L) { jjCheckNAdd(7); + } break; case 7: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 63) + } + if (kind > 63) { kind = 63; + } jjCheckNAddTwoStates(7, 8); break; case 9: - if (curChar == 39) + if (curChar == 39) { jjAddStates(13, 14); + } break; case 10: - if ((0xffffff7fffffdbffL & l) != 0L) + if ((0xffffff7fffffdbffL & l) != 0L) { jjCheckNAdd(11); + } break; case 11: - if (curChar == 39 && kind > 65) + if (curChar == 39 && kind > 65) { kind = 65; + } break; case 13: - if ((0x8400000000L & l) != 0L) + if ((0x8400000000L & l) != 0L) { jjCheckNAdd(11); + } break; case 14: - if ((0xff000000000000L & l) != 0L) + if ((0xff000000000000L & l) != 0L) { jjCheckNAddTwoStates(15, 11); + } break; case 15: - if ((0xff000000000000L & l) != 0L) + if ((0xff000000000000L & l) != 0L) { jjCheckNAdd(11); + } break; case 16: - if ((0xf000000000000L & l) != 0L) + if ((0xf000000000000L & l) != 0L) { jjstateSet[jjnewStateCnt++] = 17; + } break; case 17: - if ((0xff000000000000L & l) != 0L) + if ((0xff000000000000L & l) != 0L) { jjCheckNAdd(15); + } break; case 18: - if (curChar == 34) + if (curChar == 34) { jjCheckNAddStates(10, 12); + } break; case 19: - if ((0xfffffffbffffdbffL & l) != 0L) + if ((0xfffffffbffffdbffL & l) != 0L) { jjCheckNAddStates(10, 12); + } break; case 21: - if ((0x8400000000L & l) != 0L) + if ((0x8400000000L & l) != 0L) { jjCheckNAddStates(10, 12); + } break; case 22: - if (curChar == 34 && kind > 66) + if (curChar == 34 && kind > 66) { kind = 66; + } break; case 23: - if ((0xff000000000000L & l) != 0L) + if ((0xff000000000000L & l) != 0L) { jjCheckNAddStates(24, 27); + } break; case 24: - if ((0xff000000000000L & l) != 0L) + if ((0xff000000000000L & l) != 0L) { jjCheckNAddStates(10, 12); + } break; case 25: - if ((0xf000000000000L & l) != 0L) + if ((0xf000000000000L & l) != 0L) { jjstateSet[jjnewStateCnt++] = 26; + } break; case 26: - if ((0xff000000000000L & l) != 0L) + if ((0xff000000000000L & l) != 0L) { jjCheckNAdd(24); + } break; case 27: - if (curChar != 36) + if (curChar != 36) { break; - if (kind > 67) + } + if (kind > 67) { kind = 67; + } jjCheckNAdd(28); break; case 28: - if ((0x3ff001000000000L & l) == 0L) + if ((0x3ff001000000000L & l) == 0L) { break; - if (kind > 67) + } + if (kind > 67) { kind = 67; + } jjCheckNAdd(28); break; case 29: - if ((0x3ff000000000000L & l) != 0L) + if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddStates(0, 6); + } break; case 30: - if ((0x3ff000000000000L & l) != 0L) + if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddTwoStates(30, 31); + } break; case 31: - if (curChar != 46) + if (curChar != 46) { break; - if (kind > 63) + } + if (kind > 63) { kind = 63; + } jjCheckNAddStates(28, 30); break; case 32: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 63) + } + if (kind > 63) { kind = 63; + } jjCheckNAddStates(28, 30); break; case 34: - if ((0x280000000000L & l) != 0L) + if ((0x280000000000L & l) != 0L) { jjCheckNAdd(35); + } break; case 35: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 63) + } + if (kind > 63) { kind = 63; + } jjCheckNAddTwoStates(35, 8); break; case 36: - if ((0x3ff000000000000L & l) != 0L) + if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddTwoStates(36, 37); + } break; case 38: - if ((0x280000000000L & l) != 0L) + if ((0x280000000000L & l) != 0L) { jjCheckNAdd(39); + } break; case 39: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 63) + } + if (kind > 63) { kind = 63; + } jjCheckNAddTwoStates(39, 8); break; case 40: - if ((0x3ff000000000000L & l) != 0L) + if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddStates(31, 33); + } break; case 42: - if ((0x280000000000L & l) != 0L) + if ((0x280000000000L & l) != 0L) { jjCheckNAdd(43); + } break; case 43: - if ((0x3ff000000000000L & l) != 0L) + if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddTwoStates(43, 8); + } break; case 44: - if (curChar != 48) + if (curChar != 48) { break; - if (kind > 59) + } + if (kind > 59) { kind = 59; + } jjCheckNAddStates(15, 17); break; case 46: - if ((0x3ff000000000000L & l) == 0L) + if ((0x3ff000000000000L & l) == 0L) { break; - if (kind > 59) + } + if (kind > 59) { kind = 59; + } jjCheckNAddTwoStates(46, 2); break; case 47: - if ((0xff000000000000L & l) == 0L) + if ((0xff000000000000L & l) == 0L) { break; - if (kind > 59) + } + if (kind > 59) { kind = 59; + } jjCheckNAddTwoStates(47, 2); break; case 48: - if (curChar == 47) + if (curChar == 47) { jjAddStates(7, 9); + } break; case 50: - if ((0xffffffffffffdbffL & l) != 0L) + if ((0xffffffffffffdbffL & l) != 0L) { jjCheckNAddStates(18, 20); + } break; case 51: - if ((0x2400L & l) != 0L && kind > 6) + if ((0x2400L & l) != 0L && kind > 6) { kind = 6; + } break; case 52: - if (curChar == 10 && kind > 6) + if (curChar == 10 && kind > 6) { kind = 6; + } break; case 53: - if (curChar == 13) + if (curChar == 13) { jjstateSet[jjnewStateCnt++] = 52; + } break; case 54: - if (curChar == 42) + if (curChar == 42) { jjCheckNAddTwoStates(55, 56); + } break; case 55: - if ((0xfffffbffffffffffL & l) != 0L) + if ((0xfffffbffffffffffL & l) != 0L) { jjCheckNAddTwoStates(55, 56); + } break; case 56: - if (curChar == 42) + if (curChar == 42) { jjCheckNAddStates(34, 36); + } break; case 57: - if ((0xffff7bffffffffffL & l) != 0L) + if ((0xffff7bffffffffffL & l) != 0L) { jjCheckNAddTwoStates(58, 56); + } break; case 58: - if ((0xfffffbffffffffffL & l) != 0L) + if ((0xfffffbffffffffffL & l) != 0L) { jjCheckNAddTwoStates(58, 56); + } break; case 59: - if (curChar == 47 && kind > 7) + if (curChar == 47 && kind > 7) { kind = 7; + } break; case 60: - if (curChar == 42) + if (curChar == 42) { jjstateSet[jjnewStateCnt++] = 54; + } break; case 61: - if (curChar == 42) + if (curChar == 42) { jjCheckNAddTwoStates(62, 63); + } break; case 62: - if ((0xfffffbffffffffffL & l) != 0L) + if ((0xfffffbffffffffffL & l) != 0L) { jjCheckNAddTwoStates(62, 63); + } break; case 63: - if (curChar == 42) + if (curChar == 42) { jjCheckNAddStates(37, 39); + } break; case 64: - if ((0xffff7bffffffffffL & l) != 0L) + if ((0xffff7bffffffffffL & l) != 0L) { jjCheckNAddTwoStates(65, 63); + } break; case 65: - if ((0xfffffbffffffffffL & l) != 0L) + if ((0xfffffbffffffffffL & l) != 0L) { jjCheckNAddTwoStates(65, 63); + } break; case 66: - if (curChar == 47 && kind > 8) + if (curChar == 47 && kind > 8) { kind = 8; + } break; default : break; } @@ -1213,75 +1348,93 @@ private final int jjMoveNfa_0(int startState, int curPos) else if (curChar < 128) { long l = 1L << (curChar & 077); - MatchLoop: do + //MatchLoop + do { switch(jjstateSet[--i]) { case 0: case 28: - if ((0x7fffffe87fffffeL & l) == 0L) + if ((0x7fffffe87fffffeL & l) == 0L) { break; - if (kind > 67) + } + if (kind > 67) { kind = 67; + } jjCheckNAdd(28); break; case 2: - if ((0x100000001000L & l) != 0L && kind > 59) + if ((0x100000001000L & l) != 0L && kind > 59) { kind = 59; + } break; case 5: - if ((0x2000000020L & l) != 0L) + if ((0x2000000020L & l) != 0L) { jjAddStates(40, 41); + } break; case 8: - if ((0x5000000050L & l) != 0L && kind > 63) + if ((0x5000000050L & l) != 0L && kind > 63) { kind = 63; + } break; case 10: - if ((0xffffffffefffffffL & l) != 0L) + if ((0xffffffffefffffffL & l) != 0L) { jjCheckNAdd(11); + } break; case 12: - if (curChar == 92) + if (curChar == 92) { jjAddStates(42, 44); + } break; case 13: - if ((0x14404410000000L & l) != 0L) + if ((0x14404410000000L & l) != 0L) { jjCheckNAdd(11); + } break; case 19: - if ((0xffffffffefffffffL & l) != 0L) + if ((0xffffffffefffffffL & l) != 0L) { jjCheckNAddStates(10, 12); + } break; case 20: - if (curChar == 92) + if (curChar == 92) { jjAddStates(45, 47); + } break; case 21: - if ((0x14404410000000L & l) != 0L) + if ((0x14404410000000L & l) != 0L) { jjCheckNAddStates(10, 12); + } break; case 33: - if ((0x2000000020L & l) != 0L) + if ((0x2000000020L & l) != 0L) { jjAddStates(48, 49); + } break; case 37: - if ((0x2000000020L & l) != 0L) + if ((0x2000000020L & l) != 0L) { jjAddStates(50, 51); + } break; case 41: - if ((0x2000000020L & l) != 0L) + if ((0x2000000020L & l) != 0L) { jjAddStates(52, 53); + } break; case 45: - if ((0x100000001000000L & l) != 0L) + if ((0x100000001000000L & l) != 0L) { jjCheckNAdd(46); + } break; case 46: - if ((0x7e0000007eL & l) == 0L) + if ((0x7e0000007eL & l) == 0L) { break; - if (kind > 59) + } + if (kind > 59) { kind = 59; + } jjCheckNAddTwoStates(46, 2); break; case 50: @@ -1312,47 +1465,57 @@ private final int jjMoveNfa_0(int startState, int curPos) long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); - MatchLoop: do + //MatchLoop + do { switch(jjstateSet[--i]) { case 0: case 28: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) + if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) { break; - if (kind > 67) + } + if (kind > 67) { kind = 67; + } jjCheckNAdd(28); break; case 10: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjstateSet[jjnewStateCnt++] = 11; + } break; case 19: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjAddStates(10, 12); + } break; case 50: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjAddStates(18, 20); + } break; case 55: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(55, 56); + } break; case 57: case 58: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(58, 56); + } break; case 62: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(62, 63); + } break; case 64: case 65: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(65, 63); + } break; default : break; } @@ -1365,8 +1528,9 @@ private final int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 67 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 67 - (jjnewStateCnt = startsAt))) { return curPos; + } try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } @@ -1384,8 +1548,9 @@ private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, lo case 0: return ((jjbitVec2[i2] & l2) != 0L); default : - if ((jjbitVec0[i1] & l1) != 0L) + if ((jjbitVec0[i1] & l1) != 0L) { return true; + } return false; } } @@ -1404,8 +1569,9 @@ private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, lo case 61: return ((jjbitVec8[i2] & l2) != 0L); default : - if ((jjbitVec3[i1] & l1) != 0L) + if ((jjbitVec3[i1] & l1) != 0L) { return true; + } return false; } } @@ -1449,8 +1615,9 @@ private final int[] jjstateSet = new int[134]; protected char curChar; public ExpressionParserTokenManager(ASCII_UCodeESC_CharStream stream) { - if (ASCII_UCodeESC_CharStream.staticFlag) + if (ASCII_UCodeESC_CharStream.staticFlag) { throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + } input_stream = stream; } public ExpressionParserTokenManager(ASCII_UCodeESC_CharStream stream, int lexState) @@ -1469,9 +1636,10 @@ private final void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 67; i-- > 0;) + for (i = 67; i-- > 0;) { jjrounds[i] = 0x80000000; } +} public void ReInit(ASCII_UCodeESC_CharStream stream, int lexState) { ReInit(stream); @@ -1479,11 +1647,12 @@ public void ReInit(ASCII_UCodeESC_CharStream stream, int lexState) } public void SwitchTo(int lexState) { - if (lexState >= 1 || lexState < 0) + if (lexState >= 1 || lexState < 0) { throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else + } else { curLexState = lexState; } +} private final Token jjFillToken() { @@ -1507,7 +1676,6 @@ int jjmatchedKind; public final Token getNextToken() { - int kind; Token specialToken = null; Token matchedToken; int curPos = 0; @@ -1528,17 +1696,19 @@ public final Token getNextToken() } try { - while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) + while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) { curChar = input_stream.BeginToken(); } + } catch (java.io.IOException e1) { continue EOFLoop; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); if (jjmatchedKind != 0x7fffffff) { - if (jjmatchedPos + 1 < curPos) + if (jjmatchedPos + 1 < curPos) { input_stream.backup(curPos - jjmatchedPos - 1); + } if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); @@ -1550,9 +1720,9 @@ public final Token getNextToken() if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); - if (specialToken == null) + if (specialToken == null) { specialToken = matchedToken; - else + } else { matchedToken.specialToken = specialToken; specialToken = (specialToken.next = matchedToken); @@ -1572,9 +1742,9 @@ public final Token getNextToken() if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; - } - else + } else { error_column++; + } } if (!EOFSeen) { input_stream.backup(1); diff --git a/src/share/classes/com/sun/tools/example/debug/expr/LValue.java b/src/share/classes/com/sun/tools/example/debug/expr/LValue.java index 5dd8cf43d106036a2db180d20d91aafd9b8fe1eb..42ef2963e0b2e8cbe371504a1da3a71806a65721 100644 --- a/src/share/classes/com/sun/tools/example/debug/expr/LValue.java +++ b/src/share/classes/com/sun/tools/example/debug/expr/LValue.java @@ -156,6 +156,7 @@ abstract class LValue { return new LValueArrayElement(interiorGetValue(), index); } + @Override public String toString() { try { return interiorGetValue().toString(); @@ -419,6 +420,7 @@ abstract class LValue { this.var = var; } + @Override Value getValue() { if (jdiValue == null) { jdiValue = frame.getValue(var); @@ -426,12 +428,14 @@ abstract class LValue { return jdiValue; } + @Override void setValue0(Value val) throws InvalidTypeException, ClassNotLoadedException { frame.setValue(var, val); jdiValue = val; } + @Override void invokeWith(List arguments) throws ParseException { throw new ParseException(var.name() + " is not a method"); } @@ -469,6 +473,7 @@ abstract class LValue { } } + @Override Value getValue() throws InvocationException, InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, ParseException { @@ -485,6 +490,7 @@ abstract class LValue { } } + @Override void setValue0(Value val) throws ParseException, InvalidTypeException, ClassNotLoadedException { @@ -495,6 +501,7 @@ abstract class LValue { jdiValue = val; } + @Override void invokeWith(List arguments) throws ParseException { if (matchingMethod != null) { throw new ParseException("Invalid consecutive invocations"); @@ -531,6 +538,7 @@ abstract class LValue { } } + @Override Value getValue() throws InvocationException, InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, ParseException { @@ -548,6 +556,7 @@ abstract class LValue { } } + @Override void setValue0(Value val) throws ParseException, InvalidTypeException, ClassNotLoadedException { @@ -562,6 +571,7 @@ abstract class LValue { jdiValue = val; } + @Override void invokeWith(List arguments) throws ParseException { if (matchingMethod != null) { throw new ParseException("Invalid consecutive invocations"); @@ -589,6 +599,7 @@ abstract class LValue { this.arrayRef = value; } + @Override Value getValue() { if (jdiValue == null) { jdiValue = arrayRef.virtualMachine().mirrorOf(arrayRef.length()); @@ -596,10 +607,12 @@ abstract class LValue { return jdiValue; } + @Override void setValue0(Value value) throws ParseException { throw new ParseException("Cannot set constant: " + value); } + @Override void invokeWith(List arguments) throws ParseException { throw new ParseException("Array element is not a method"); } @@ -618,6 +631,7 @@ abstract class LValue { this.index = index; } + @Override Value getValue() { if (jdiValue == null) { jdiValue = array.getValue(index); @@ -625,12 +639,14 @@ abstract class LValue { return jdiValue; } + @Override void setValue0(Value val) throws InvalidTypeException, ClassNotLoadedException { array.setValue(index, val); jdiValue = val; } + @Override void invokeWith(List arguments) throws ParseException { throw new ParseException("Array element is not a method"); } @@ -643,6 +659,7 @@ abstract class LValue { this.value = value; } + @Override Value getValue() { if (jdiValue == null) { jdiValue = value; @@ -650,10 +667,12 @@ abstract class LValue { return jdiValue; } + @Override void setValue0(Value val) throws ParseException { throw new ParseException("Cannot set constant: " + value); } + @Override void invokeWith(List arguments) throws ParseException { throw new ParseException("Constant is not a method"); } diff --git a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java index bf615935604775e6a821c9803001bd670c284774..8ee53728f028a1baf60b576250d53d1ce26988c0 100644 --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java @@ -37,6 +37,8 @@ package com.sun.tools.example.debug.expr; */ public class ParseException extends Exception { + private static final long serialVersionUID = 7978489144303647901L; + /** * This constructor is used by the method "generateParseException" * in the generated parser. Calling this constructor generates @@ -119,20 +121,21 @@ public class ParseException extends Exception { * of the final stack trace, and hence the correct error message * gets displayed. */ + @Override public String getMessage() { if (!specialConstructor) { return super.getMessage(); } String expected = ""; int maxSize = 0; - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; + for (int[] expectedTokenSequence : expectedTokenSequences) { + if (maxSize < expectedTokenSequence.length) { + maxSize = expectedTokenSequence.length; } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - expected += tokenImage[expectedTokenSequences[i][j]] + " "; + for (int j = 0; j < expectedTokenSequence.length; j++) { + expected += tokenImage[expectedTokenSequence[j]] + " "; } - if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { + if (expectedTokenSequence[expectedTokenSequence.length - 1] != 0) { expected += "..."; } expected += eol + " "; @@ -140,7 +143,9 @@ public class ParseException extends Exception { String retval = "Encountered \""; Token tok = currentToken.next; for (int i = 0; i < maxSize; i++) { - if (i != 0) retval += " "; + if (i != 0) { + retval += " "; + } if (tok.kind == 0) { retval += tokenImage[0]; break; diff --git a/src/share/classes/com/sun/tools/example/debug/expr/Token.java b/src/share/classes/com/sun/tools/example/debug/expr/Token.java index ea0a9ef33d728f05120b94005aee184f361065b6..534120014f30ff10097003cc56c1c94bda78fff7 100644 --- a/src/share/classes/com/sun/tools/example/debug/expr/Token.java +++ b/src/share/classes/com/sun/tools/example/debug/expr/Token.java @@ -78,6 +78,7 @@ public class Token { /** * Returns the image. */ + @Override public final String toString() { return image; diff --git a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java index 2f4365018feda8c80d8e0de198b3b8a8941be6be..16a40df286e38c035a0c9b63ef3c5b357c3b0f17 100644 --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java @@ -32,6 +32,8 @@ public class TokenMgrError extends Error * Ordinals for various reasons why an Error of this type can be thrown. */ + private static final long serialVersionUID = -6236440836177601522L; + /** * Lexical error occured. */ @@ -136,6 +138,7 @@ public class TokenMgrError extends Error * * from this method for such cases in the release version of your parser. */ + @Override public String getMessage() { return super.getMessage(); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/ApplicationTool.java b/src/share/classes/com/sun/tools/example/debug/gui/ApplicationTool.java index 8eee7c76418f3731874bd9ad345cf95e79f07ffc..e9a4c0b7808ecf57063c00667dee7f6b898d0714 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/ApplicationTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/ApplicationTool.java @@ -29,12 +29,12 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; -import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; public class ApplicationTool extends JPanel { - private Environment env; + private static final long serialVersionUID = 310966063293205714L; + private ExecutionManager runtime; private TypeScript script; @@ -45,13 +45,13 @@ public class ApplicationTool extends JPanel { super(new BorderLayout()); - this.env = env; this.runtime = env.getExecutionManager(); this.script = new TypeScript(PROMPT, false); // No implicit echo. this.add(script); script.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { runtime.sendLineToApplication(script.readln()); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java b/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java index abfc86a810b0db22df8ec686c9cb16e402ccb305..945243458bf5ec831de25aa1577334fb215c7093 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java @@ -25,12 +25,10 @@ package com.sun.tools.example.debug.gui; -import java.io.*; import java.util.*; import javax.swing.*; import javax.swing.tree.*; -import javax.swing.event.*; import java.awt.*; import java.awt.event.*; @@ -40,6 +38,8 @@ import com.sun.tools.example.debug.bdi.*; public class ClassTreeTool extends JPanel { + private static final long serialVersionUID = 526178912591739259L; + private Environment env; private ExecutionManager runtime; @@ -49,7 +49,7 @@ public class ClassTreeTool extends JPanel { private JTree tree; private DefaultTreeModel treeModel; private ClassTreeNode root; - private SearchPath sourcePath; +// private SearchPath sourcePath; private CommandInterpreter interpreter; @@ -87,6 +87,7 @@ public class ClassTreeTool extends JPanel { ******/ MouseListener ml = new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { int selRow = tree.getRowForLocation(e.getX(), e.getY()); TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); @@ -121,6 +122,7 @@ public class ClassTreeTool extends JPanel { // SessionListener + @Override public void sessionStart(EventObject e) { // Get system classes and any others loaded before attaching. try { @@ -134,19 +136,24 @@ public class ClassTreeTool extends JPanel { } } + @Override public void sessionInterrupt(EventObject e) {} + @Override public void sessionContinue(EventObject e) {} // JDIListener + @Override public void classPrepare(ClassPrepareEventSet e) { root.addClass(e.getReferenceType()); } + @Override public void classUnload(ClassUnloadEventSet e) { root.removeClass(e.getClassName()); } + @Override public void vmDisconnect(VMDisconnectEventSet e) { // Clear contents of this view. root = createClassTree(HEADING); @@ -169,6 +176,7 @@ public class ClassTreeTool extends JPanel { this.refTy = refTy; } + @Override public String toString() { return name; } @@ -185,6 +193,7 @@ public class ClassTreeTool extends JPanel { return (refTy == null); } + @Override public boolean isLeaf() { return !isPackage(); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java b/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java index 1ff8163b6832670335d4c7dff332012fe115fd73..97ab320bf8be18a516447928778e63e8f8c35371 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java @@ -29,8 +29,6 @@ import java.io.*; import java.util.*; import com.sun.jdi.*; -import com.sun.jdi.request.*; - import com.sun.tools.example.debug.bdi.*; public class CommandInterpreter { @@ -93,9 +91,9 @@ public class CommandInterpreter { try { ThreadReference[] threads = threads(); long threadID = Long.parseLong(id, 16); - for (int i = 0; i < threads.length; i++) { - if (threads[i].uniqueID() == threadID) { - thread = threads[i]; + for (ThreadReference thread2 : threads) { + if (thread2.uniqueID() == threadID) { + thread = thread2; break; } } @@ -239,16 +237,18 @@ public class CommandInterpreter { for (int i = 0 ; i < tlist.size() ; i++) { ThreadReference thr = tlist.get(i); int len = Utils.description(thr).length(); - if (len > maxId) + if (len > maxId) { maxId = len; + } String name = thr.name(); int iDot = name.lastIndexOf('.'); if (iDot >= 0 && name.length() > iDot) { name = name.substring(iDot + 1); } - if (name.length() > maxName) + if (name.length() > maxName) { maxName = name.length(); } + } String maxNumString = String.valueOf(iThread + tlist.size()); int maxNumDigits = maxNumString.length(); for (int i = 0 ; i < tlist.size() ; i++) { @@ -616,7 +616,6 @@ public class CommandInterpreter { int cnt = 1; if (t.hasMoreTokens()) { String idToken = t.nextToken(); - int n; try { cnt = Integer.valueOf(idToken).intValue(); } catch (NumberFormatException e) { @@ -885,7 +884,6 @@ public class CommandInterpreter { } private void commandStop(StringTokenizer t) throws NoSessionException { - Location bploc; String token; if (!t.hasMoreTokens()) { diff --git a/src/share/classes/com/sun/tools/example/debug/gui/CommandTool.java b/src/share/classes/com/sun/tools/example/debug/gui/CommandTool.java index 1f47adfcf97968815b6237e7a7c9c82ed10b1a80..42157e4423edca9f0b7f69c078e5b6ba8377983a 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/CommandTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/CommandTool.java @@ -40,6 +40,8 @@ import com.sun.tools.example.debug.event.*; public class CommandTool extends JPanel { + private static final long serialVersionUID = 8613516856378346415L; + private Environment env; private ContextManager context; @@ -68,6 +70,7 @@ public class CommandTool extends JPanel { // Establish handler for incoming commands. script.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { interpreter.executeCommand(script.readln()); } @@ -107,15 +110,17 @@ public class CommandTool extends JPanel { // JDIListener + @Override public void accessWatchpoint(AccessWatchpointEventSet e) { setThread(e); for (EventIterator it = e.eventIterator(); it.hasNext(); ) { - Event evt = it.nextEvent(); + it.nextEvent(); diagnostics.putString("Watchpoint hit: " + locationString(e)); } } + @Override public void classPrepare(ClassPrepareEventSet e) { if (context.getVerboseFlag()) { String name = e.getReferenceType().name(); @@ -123,6 +128,7 @@ public class CommandTool extends JPanel { } } + @Override public void classUnload(ClassUnloadEventSet e) { if (context.getVerboseFlag()) { diagnostics.putString("Class " + e.getClassName() + @@ -130,12 +136,14 @@ public class CommandTool extends JPanel { } } + @Override public void exception(ExceptionEventSet e) { setThread(e); String name = e.getException().referenceType().name(); diagnostics.putString("Exception: " + name); } + @Override public void locationTrigger(LocationTriggerEventSet e) { String locString = locationString(e); setThread(e); @@ -155,15 +163,17 @@ public class CommandTool extends JPanel { } } + @Override public void modificationWatchpoint(ModificationWatchpointEventSet e) { setThread(e); for (EventIterator it = e.eventIterator(); it.hasNext(); ) { - Event evt = it.nextEvent(); + it.nextEvent(); diagnostics.putString("Watchpoint hit: " + locationString(e)); } } + @Override public void threadDeath(ThreadDeathEventSet e) { if (context.getVerboseFlag()) { diagnostics.putString("Thread " + e.getThread() + @@ -171,6 +181,7 @@ public class CommandTool extends JPanel { } } + @Override public void threadStart(ThreadStartEventSet e) { if (context.getVerboseFlag()) { diagnostics.putString("Thread " + e.getThread() + @@ -178,16 +189,19 @@ public class CommandTool extends JPanel { } } + @Override public void vmDeath(VMDeathEventSet e) { script.setPrompt(DEFAULT_CMD_PROMPT); diagnostics.putString("VM exited"); } + @Override public void vmDisconnect(VMDisconnectEventSet e) { script.setPrompt(DEFAULT_CMD_PROMPT); diagnostics.putString("Disconnected from VM"); } + @Override public void vmStart(VMStartEventSet e) { script.setPrompt(DEFAULT_CMD_PROMPT); diagnostics.putString("VM started"); @@ -195,14 +209,17 @@ public class CommandTool extends JPanel { // SessionListener + @Override public void sessionStart(EventObject e) {} + @Override public void sessionInterrupt(EventObject e) { Thread.yield(); // fetch output diagnostics.putString("VM interrupted by user."); script.setPrompt(DEFAULT_CMD_PROMPT); } + @Override public void sessionContinue(EventObject e) { diagnostics.putString("Execution resumed."); script.setPrompt(DEFAULT_CMD_PROMPT); @@ -210,23 +227,28 @@ public class CommandTool extends JPanel { // SpecListener + @Override public void breakpointSet(SpecEvent e) { EventRequestSpec spec = e.getEventRequestSpec(); diagnostics.putString("Breakpoint set at " + spec + "."); } + @Override public void breakpointDeferred(SpecEvent e) { EventRequestSpec spec = e.getEventRequestSpec(); diagnostics.putString("Breakpoint will be set at " + spec + " when its class is loaded."); } + @Override public void breakpointDeleted(SpecEvent e) { EventRequestSpec spec = e.getEventRequestSpec(); diagnostics.putString("Breakpoint at " + spec.toString() + " deleted."); } + @Override public void breakpointResolved(SpecEvent e) { EventRequestSpec spec = e.getEventRequestSpec(); diagnostics.putString("Breakpoint resolved to " + spec.toString() + "."); } + @Override public void breakpointError(SpecErrorEvent e) { EventRequestSpec spec = e.getEventRequestSpec(); diagnostics.putString("Deferred breakpoint at " + @@ -236,25 +258,35 @@ public class CommandTool extends JPanel { //### Add info for watchpoints and exceptions + @Override public void watchpointSet(SpecEvent e) { } + @Override public void watchpointDeferred(SpecEvent e) { } + @Override public void watchpointDeleted(SpecEvent e) { } + @Override public void watchpointResolved(SpecEvent e) { } + @Override public void watchpointError(SpecErrorEvent e) { } + @Override public void exceptionInterceptSet(SpecEvent e) { } + @Override public void exceptionInterceptDeferred(SpecEvent e) { } + @Override public void exceptionInterceptDeleted(SpecEvent e) { } + @Override public void exceptionInterceptResolved(SpecEvent e) { } + @Override public void exceptionInterceptError(SpecErrorEvent e) { } @@ -263,6 +295,7 @@ public class CommandTool extends JPanel { // If the user selects a new current thread or frame, update prompt. + @Override public void currentFrameChanged(CurrentFrameChangedEvent e) { // Update prompt only if affect thread is current. ThreadReference thread = e.getThread(); diff --git a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java index 3765cd76969d7e9e3a5e2dfa74db508564fca7bc..2ce04907ab2979807377738279ae093f66521ff8 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java @@ -46,7 +46,7 @@ public class ContextManager { private boolean verbose; - private Vector contextListeners = new Vector(); + private ArrayList contextListeners = new ArrayList(); public ContextManager(Environment env) { classManager = env.getClassManager(); @@ -264,11 +264,11 @@ public class ContextManager { private void notifyCurrentFrameChanged(ThreadInfo tinfo, int index, boolean invalidate) { - Vector l = (Vector)contextListeners.clone(); + ArrayList l = new ArrayList(contextListeners); CurrentFrameChangedEvent evt = new CurrentFrameChangedEvent(this, tinfo, index, invalidate); for (int i = 0; i < l.size(); i++) { - ((ContextListener)l.elementAt(i)).currentFrameChanged(evt); + l.get(i).currentFrameChanged(evt); } } @@ -277,28 +277,34 @@ public class ContextManager { // SessionListener + @Override public void sessionStart(EventObject e) { invalidateCurrentThread(); } + @Override public void sessionInterrupt(EventObject e) { setCurrentThreadInvalidate(currentThread); } + @Override public void sessionContinue(EventObject e) { invalidateCurrentThread(); } // JDIListener + @Override public void locationTrigger(LocationTriggerEventSet e) { setCurrentThreadInvalidate(e.getThread()); } + @Override public void exception(ExceptionEventSet e) { setCurrentThreadInvalidate(e.getThread()); } + @Override public void vmDisconnect(VMDisconnectEventSet e) { invalidateCurrentThread(); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/CurrentFrameChangedEvent.java b/src/share/classes/com/sun/tools/example/debug/gui/CurrentFrameChangedEvent.java index 5470d0b8e73da98c158f3ba0f11ca7da714382d5..00c827fd3c9f0f1b5a24604c9bef10e447ce5dfa 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/CurrentFrameChangedEvent.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/CurrentFrameChangedEvent.java @@ -31,6 +31,7 @@ import java.util.EventObject; public class CurrentFrameChangedEvent extends EventObject { + private static final long serialVersionUID = 4214479486546762179L; private ThreadInfo tinfo; private int index; private boolean invalidate; diff --git a/src/share/classes/com/sun/tools/example/debug/gui/Environment.java b/src/share/classes/com/sun/tools/example/debug/gui/Environment.java index d82c49997212257b4b4494cc325f7ba7ee4a66aa..f9884c7d53d284d9439d3fbe392bbd457b770e42 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/Environment.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/Environment.java @@ -26,8 +26,6 @@ package com.sun.tools.example.debug.gui; import java.io.*; -import java.util.*; - import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; diff --git a/src/share/classes/com/sun/tools/example/debug/gui/GUI.java b/src/share/classes/com/sun/tools/example/debug/gui/GUI.java index 5744c5b9d0b2a59a3b0445800cce776d7670edee..1fa88bb28a907019180afdf7d3ae54cb84c64aa2 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/GUI.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/GUI.java @@ -26,8 +26,6 @@ package com.sun.tools.example.debug.gui; import java.io.*; -import java.util.*; - import javax.swing.*; import javax.swing.border.*; import java.awt.*; @@ -38,6 +36,7 @@ import com.sun.tools.example.debug.bdi.*; public class GUI extends JPanel { + private static final long serialVersionUID = 3292463234530679091L; private CommandTool cmdTool; private ApplicationTool appTool; //###HACK## @@ -87,7 +86,7 @@ public class GUI extends JPanel { threadTreeTool = new ThreadTreeTool(env); threadTreeTool.setPreferredSize(new java.awt.Dimension(200, 450)); - JTabbedPane treePane = new JTabbedPane(JTabbedPane.BOTTOM); + JTabbedPane treePane = new JTabbedPane(SwingConstants.BOTTOM); treePane.addTab("Source", null, sourceTreeTool); treePane.addTab("Classes", null, classTreeTool); treePane.addTab("Threads", null, threadTreeTool); @@ -139,12 +138,9 @@ public class GUI extends JPanel { } public static void main(String argv[]) { - String remote = null; String clsName = ""; String progArgs = ""; String javaArgs = ""; - boolean verbose = false; //### Not implemented. - final Environment env = new Environment(); JPanel mainPanel = new GUI(env); @@ -246,13 +242,14 @@ public class GUI extends JPanel { frame.setContentPane(mainPanel); frame.addWindowListener(new WindowAdapter() { + @Override public void windowClosing(WindowEvent e) { env.terminate(); } }); frame.pack(); - frame.show(); + frame.setVisible(true); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java b/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java index 577f8d8b1f95f5daef281b91e2cfa9cde410ef9b..3a6f107bbbc667639f2946295a3fd5c7a5641411 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java @@ -28,7 +28,6 @@ package com.sun.tools.example.debug.gui; import java.io.File; import java.util.Hashtable; import java.util.Enumeration; -import javax.swing.*; import javax.swing.filechooser.*; //### Renamed from 'ExampleFileFilter.java' provided with Swing demos. @@ -93,8 +92,12 @@ public class JDBFileFilter extends FileFilter { */ public JDBFileFilter(String extension, String description) { this(); - if(extension!=null) addExtension(extension); - if(description!=null) setDescription(description); + if(extension!=null) { + addExtension(extension); + } + if(description!=null) { + setDescription(description); + } } /** @@ -120,11 +123,13 @@ public class JDBFileFilter extends FileFilter { */ public JDBFileFilter(String[] filters, String description) { this(); - for (int i = 0; i < filters.length; i++) { + for (String filter : filters) { // add filters one by one - addExtension(filters[i]); + addExtension(filter); } - if(description!=null) setDescription(description); + if(description!=null) { + setDescription(description); + } } /** @@ -136,6 +141,7 @@ public class JDBFileFilter extends FileFilter { * @see #getExtension * @see FileFilter#accepts */ + @Override public boolean accept(File f) { if(f != null) { if(f.isDirectory()) { @@ -196,6 +202,7 @@ public class JDBFileFilter extends FileFilter { * @see isExtensionListInDescription * @see FileFilter#getDescription */ + @Override public String getDescription() { if(fullDescription == null) { if(description == null || isExtensionListInDescription()) { diff --git a/src/share/classes/com/sun/tools/example/debug/gui/JDBMenuBar.java b/src/share/classes/com/sun/tools/example/debug/gui/JDBMenuBar.java index ee8378386b8a436cfdec2ca2fe8c05f1c28c8ca2..c224b57c4f8a842cce6688d857de97fa4c51667a 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/JDBMenuBar.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/JDBMenuBar.java @@ -31,7 +31,6 @@ import java.awt.event.*; import java.util.Vector; import java.util.List; -import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; //### This is currently just a placeholder! @@ -57,6 +56,7 @@ class JDBMenuBar extends JMenuBar { JMenuItem openItem = new JMenuItem("Open...", 'O'); openItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { openCommand(); } @@ -93,6 +93,7 @@ class JDBMenuBar extends JMenuBar { JMenuItem monitorItem = new JMenuItem("Monitor Expression...", 'M'); monitorItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { monitorCommand(); } @@ -101,6 +102,7 @@ class JDBMenuBar extends JMenuBar { JMenuItem unmonitorItem = new JMenuItem("Unmonitor Expression..."); unmonitorItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { unmonitorCommand(); } @@ -110,6 +112,7 @@ class JDBMenuBar extends JMenuBar { JMenu breakpointMenu = new JMenu("Breakpoint"); JMenuItem stopItem = new JMenuItem("Stop in...", 'S'); stopItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { buildBreakpoint(); } @@ -176,6 +179,7 @@ class JDBMenuBar extends JMenuBar { mi.setToolTipText(toolTip); final String cmd = command; mi.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { interpreter.executeCommand(cmd); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/JDBToolBar.java b/src/share/classes/com/sun/tools/example/debug/gui/JDBToolBar.java index f73a12d081d23c35f771153175f95bc08147ac2f..02982b9f70bec9122cd102a405242b48f8b50662 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/JDBToolBar.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/JDBToolBar.java @@ -26,10 +26,8 @@ package com.sun.tools.example.debug.gui; import javax.swing.*; -import java.awt.*; import java.awt.event.*; -import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; class JDBToolBar extends JToolBar { @@ -92,6 +90,7 @@ class JDBToolBar extends JToolBar { button.setToolTipText(toolTip); final String cmd = command; button.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { interpreter.executeCommand(cmd); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java b/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java index f6456a44960209baae5692b7a7e88c19ede2c920..cb1d77b22feeb65d6d51db0a2a55518f73acaf67 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java @@ -29,18 +29,10 @@ import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; -import java.util.Iterator; - -import java.io.IOException; - import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.TitledBorder; @@ -98,6 +90,7 @@ class LaunchTool { comp.add(panel); } + @Override String getText() { return textField.getText(); } @@ -114,6 +107,7 @@ class LaunchTool { comp.add(panel); } + @Override String getText() { return ((Connector.BooleanArgument)arg) .stringValueOf(check.getModel().isSelected()); @@ -147,6 +141,7 @@ class LaunchTool { final boolean[] oked = {false}; JPanel buttonPanel = okCancel( dialog, new ActionListener() { + @Override public void actionPerformed(ActionEvent event) { if (radioGroup.getSelection() == null) { JOptionPane.showMessageDialog(dialog, @@ -162,7 +157,7 @@ class LaunchTool { } ); content.add(BorderLayout.SOUTH, buttonPanel); dialog.pack(); - dialog.show(); + dialog.setVisible(true); return oked[0] ? modelToConnector.get(radioGroup.getSelection()) : @@ -178,7 +173,7 @@ class LaunchTool { Container content = dialog.getContentPane(); JPanel guts = new JPanel(); Border etched = BorderFactory.createEtchedBorder(); - Border titled = BorderFactory.createTitledBorder(etched, + BorderFactory.createTitledBorder(etched, connector.description(), TitledBorder.LEFT, TitledBorder.TOP); guts.setBorder(etched); @@ -199,6 +194,7 @@ class LaunchTool { content.add(guts); JPanel buttonPanel = okCancel( dialog, new ActionListener() { + @Override public void actionPerformed(ActionEvent event) { for (ArgRep ar : argReps) { if (!ar.isSpecified()) { @@ -236,7 +232,7 @@ class LaunchTool { } ); content.add(BorderLayout.SOUTH, buttonPanel); dialog.pack(); - dialog.show(); + dialog.setVisible(true); } private JPanel okCancel(final JDialog dialog, ActionListener okListener) { @@ -247,6 +243,7 @@ class LaunchTool { buttonPanel.add(cancel); ok.addActionListener(okListener); cancel.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent event) { dialog.setVisible(false); dialog.dispose(); diff --git a/src/share/classes/com/sun/tools/example/debug/gui/MonitorListModel.java b/src/share/classes/com/sun/tools/example/debug/gui/MonitorListModel.java index 91c87a4d74c24511dee5dff57fe1e7ab8f6eb2f7..c46219f4720cc81c4cf75f1a42bf329330e74c9c 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/MonitorListModel.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/MonitorListModel.java @@ -42,10 +42,12 @@ public class MonitorListModel extends AbstractListModel { //### remove listeners on exit! } + @Override public Object getElementAt(int index) { return monitors.get(index); } + @Override public int getSize() { return monitors.size(); } @@ -70,7 +72,7 @@ public class MonitorListModel extends AbstractListModel { return Collections.unmodifiableList(monitors); } - public Iterator iterator() { + public Iterator iterator() { return monitors().iterator(); } @@ -80,7 +82,8 @@ public class MonitorListModel extends AbstractListModel { private class MonitorListListener implements ContextListener { - public void currentFrameChanged(CurrentFrameChangedEvent e) { + @Override + public void currentFrameChanged(final CurrentFrameChangedEvent e) { invalidate(); } } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/MonitorTool.java b/src/share/classes/com/sun/tools/example/debug/gui/MonitorTool.java index 21d0fc19bbd92c226194241c8406b992ba7f7186..cf7c10c51c2d7acf96ddba61ef31d9435939e7ee 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/MonitorTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/MonitorTool.java @@ -25,15 +25,9 @@ package com.sun.tools.example.debug.gui; -import java.io.*; -import java.util.*; - import javax.swing.*; -import javax.swing.tree.*; import javax.swing.event.*; import java.awt.*; -import java.awt.event.*; - import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; import com.sun.tools.example.debug.expr.ExpressionParser; @@ -41,6 +35,7 @@ import com.sun.tools.example.debug.expr.ParseException; public class MonitorTool extends JPanel { + private static final long serialVersionUID = -645235951031726647L; private ExecutionManager runtime; private ContextManager context; @@ -64,6 +59,7 @@ public class MonitorTool extends JPanel { } private class MonitorToolListener implements ListSelectionListener { + @Override public void valueChanged(ListSelectionEvent e) { int index = list.getSelectedIndex(); if (index != -1) { @@ -78,6 +74,7 @@ public class MonitorTool extends JPanel { IncompatibleThreadStateException { ExpressionParser.GetFrame frameGetter = new ExpressionParser.GetFrame() { + @Override public StackFrame get() throws IncompatibleThreadStateException { @@ -93,6 +90,7 @@ public class MonitorTool extends JPanel { private class MonitorRenderer extends DefaultListCellRenderer { + @Override public Component getListCellRendererComponent(JList list, Object value, int index, diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java b/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java index e02b8400276ddcf1af679479a236de33833182c4..30905696660817f7ecbfb5d515c1d8911e5bdb97 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java @@ -58,8 +58,8 @@ public class SearchPath { } public File resolve(String relativeFileName) { - for (int i = 0; i < pathArray.length; i++) { - File path = new File(pathArray[i], relativeFileName); + for (String element : pathArray) { + File path = new File(element, relativeFileName); if (path.exists()) { return path; } @@ -76,8 +76,8 @@ public class SearchPath { // classpath is retained. This is the one that will be // found if we later do a 'resolve'. SortedSet s = new TreeSet(); // sorted, no duplicates - for (int i = 0; i < pathArray.length; i++) { - File path = new File(pathArray[i], relativeDirName); + for (String element : pathArray) { + File path = new File(element, relativeDirName); if (path.exists()) { String[] childArray = path.list(filter); if (childArray != null) { diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SingleLeafTreeSelectionModel.java b/src/share/classes/com/sun/tools/example/debug/gui/SingleLeafTreeSelectionModel.java index 2d1b2aa07a8c6e3aaa9bf4f5bb9603546800c444..47df28d1168c893d23e26ad9c26ddbb8e55be909 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SingleLeafTreeSelectionModel.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SingleLeafTreeSelectionModel.java @@ -25,22 +25,25 @@ package com.sun.tools.example.debug.gui; -import javax.swing.*; import javax.swing.tree.*; public class SingleLeafTreeSelectionModel extends DefaultTreeSelectionModel { + private static final long serialVersionUID = -7849105107888117679L; + SingleLeafTreeSelectionModel() { super(); selectionMode = SINGLE_TREE_SELECTION; } + @Override public void setSelectionPath(TreePath path) { if(((TreeNode)(path.getLastPathComponent())).isLeaf()) { super.setSelectionPath(path); } } + @Override public void setSelectionPaths(TreePath[] paths) { // Only look at first path, as all others will be // ignored anyway in single tree selection mode. @@ -49,12 +52,14 @@ public class SingleLeafTreeSelectionModel extends DefaultTreeSelectionModel { } } + @Override public void addSelectionPath(TreePath path) { if(((TreeNode)(path.getLastPathComponent())).isLeaf()) { super.setSelectionPath(path); } } + @Override public void addSelectionPaths(TreePath[] paths) { // Only look at first path, as all others will be // ignored anyway in single tree selection mode. diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java b/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java index 6e8ae7a292e97910869b27814331ac0e1b44dae3..eda83460e83424ebbdc1af45ab91955f17724e5e 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java @@ -31,7 +31,6 @@ import java.util.*; import com.sun.jdi.*; import com.sun.tools.example.debug.event.*; -import com.sun.tools.example.debug.bdi.*; /** * Manage the list of source files. @@ -45,7 +44,7 @@ public class SourceManager { private List sourceList; private SearchPath sourcePath; - private Vector sourceListeners = new Vector(); + private ArrayList sourceListeners = new ArrayList(); private Map classToSource = new HashMap(); @@ -79,18 +78,18 @@ public class SourceManager { } public void addSourceListener(SourceListener l) { - sourceListeners.addElement(l); + sourceListeners.add(l); } public void removeSourceListener(SourceListener l) { - sourceListeners.removeElement(l); + sourceListeners.remove(l); } private void notifySourcepathChanged() { - Vector l = (Vector)sourceListeners.clone(); + ArrayList l = new ArrayList(sourceListeners); SourcepathChangedEvent evt = new SourcepathChangedEvent(this); for (int i = 0; i < l.size(); i++) { - ((SourceListener)l.elementAt(i)).sourcepathChanged(evt); + l.get(i).sourcepathChanged(evt); } } @@ -163,6 +162,7 @@ public class SourceManager { private class SMClassListener extends JDIAdapter implements JDIListener { + @Override public void classPrepare(ClassPrepareEventSet e) { ReferenceType refType = e.getReferenceType(); SourceModel sm = sourceForClass(refType); @@ -171,6 +171,7 @@ public class SourceManager { } } + @Override public void classUnload(ClassUnloadEventSet e) { //### iterate through looking for (e.getTypeName()). //### then remove it. diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java b/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java index 4ad47069589e5860757f804c512b52d31cf76870..b65be0b5a2ddbec68a56331bac767ba62bbfcb6e 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java @@ -31,8 +31,6 @@ import java.util.*; import com.sun.jdi.*; import com.sun.jdi.request.*; -import com.sun.tools.example.debug.bdi.*; - import javax.swing.*; /** @@ -101,6 +99,7 @@ public class SourceModel extends AbstractListModel { // **** Implement ListModel ***** + @Override public Object getElementAt(int index) { if (sourceLines == null) { initialize(); @@ -108,6 +107,7 @@ public class SourceModel extends AbstractListModel { return sourceLines.get(index); } + @Override public int getSize() { if (sourceLines == null) { initialize(); diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SourceTool.java b/src/share/classes/com/sun/tools/example/debug/gui/SourceTool.java index 0f0c24d83e58bb09b6f35b83c1d8d8772671466a..cecbeaf2479dd006728603cf732cb78b6496c4d6 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SourceTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SourceTool.java @@ -26,8 +26,6 @@ package com.sun.tools.example.debug.gui; import java.io.*; -import java.util.*; - import java.awt.*; import java.awt.event.*; import javax.swing.*; @@ -35,13 +33,12 @@ import javax.swing.*; import com.sun.jdi.*; import com.sun.jdi.request.*; -import com.sun.tools.example.debug.event.*; import com.sun.tools.example.debug.bdi.*; -import java.util.List; - public class SourceTool extends JPanel { + private static final long serialVersionUID = -5461299294186395257L; + private Environment env; private ExecutionManager runtime; @@ -99,6 +96,7 @@ public class SourceTool extends JPanel { // ContextListener + @Override public void currentFrameChanged(CurrentFrameChangedEvent e) { showSourceContext(e.getThread(), e.getIndex()); } @@ -108,6 +106,7 @@ public class SourceTool extends JPanel { // SourceListener + @Override public void sourcepathChanged(SourcepathChangedEvent e) { // Reload source view if its contents depend // on the source path. @@ -120,12 +119,15 @@ public class SourceTool extends JPanel { // SpecListener + @Override public void breakpointSet(SpecEvent e) { breakpointResolved(e); } + @Override public void breakpointDeferred(SpecEvent e) { } + @Override public void breakpointDeleted(SpecEvent e) { BreakpointRequest req = (BreakpointRequest)e.getEventRequest(); Location loc = req.location(); @@ -139,6 +141,7 @@ public class SourceTool extends JPanel { } } + @Override public void breakpointResolved(SpecEvent e) { BreakpointRequest req = (BreakpointRequest)e.getEventRequest(); Location loc = req.location(); @@ -150,29 +153,40 @@ public class SourceTool extends JPanel { } } + @Override public void breakpointError(SpecErrorEvent e) { breakpointDeleted(e); } + @Override public void watchpointSet(SpecEvent e) { } + @Override public void watchpointDeferred(SpecEvent e) { } + @Override public void watchpointDeleted(SpecEvent e) { } + @Override public void watchpointResolved(SpecEvent e) { } + @Override public void watchpointError(SpecErrorEvent e) { } + @Override public void exceptionInterceptSet(SpecEvent e) { } + @Override public void exceptionInterceptDeferred(SpecEvent e) { } + @Override public void exceptionInterceptDeleted(SpecEvent e) { } + @Override public void exceptionInterceptResolved(SpecEvent e) { } + @Override public void exceptionInterceptError(SpecErrorEvent e) { } } @@ -269,6 +283,7 @@ public class SourceTool extends JPanel { private class SourceLineRenderer extends DefaultListCellRenderer { + @Override public Component getListCellRendererComponent(JList list, Object value, int index, @@ -301,6 +316,7 @@ public class SourceTool extends JPanel { return this; } + @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); return new Dimension(dim.width, dim.height-5); @@ -309,6 +325,7 @@ public class SourceTool extends JPanel { } private class STMouseListener extends MouseAdapter implements MouseListener { + @Override public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { showPopupMenu((Component)e.getSource(), @@ -316,6 +333,7 @@ public class SourceTool extends JPanel { } } + @Override public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { showPopupMenu((Component)e.getSource(), @@ -354,6 +372,7 @@ public class SourceTool extends JPanel { private JMenuItem commandItem(String label, final String cmd) { JMenuItem item = new JMenuItem(label); item.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { interpreter.executeCommand(cmd); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SourceTreeTool.java b/src/share/classes/com/sun/tools/example/debug/gui/SourceTreeTool.java index e6837e29d5eefed0543ed211b5a0ed7fd112442a..5f572c70896055c20ac161c755db2986333ff51f 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SourceTreeTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SourceTreeTool.java @@ -30,15 +30,15 @@ import java.util.*; import javax.swing.*; import javax.swing.tree.*; -import javax.swing.event.*; import java.awt.*; import java.awt.event.*; -import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; public class SourceTreeTool extends JPanel { + private static final long serialVersionUID = 3336680912107956419L; + private Environment env; private ExecutionManager runtime; @@ -81,6 +81,7 @@ public class SourceTreeTool extends JPanel { ******/ MouseListener ml = new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { int selRow = tree.getRowForLocation(e.getX(), e.getY()); TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); @@ -112,6 +113,7 @@ public class SourceTreeTool extends JPanel { private class SourceTreeToolListener implements SourceListener { + @Override public void sourcepathChanged(SourcepathChangedEvent e) { sourcePath = sourceManager.getSourcePath(); root = createDirectoryTree(HEADING); @@ -121,6 +123,7 @@ public class SourceTreeTool extends JPanel { } private static class SourceOrDirectoryFilter implements FilenameFilter { + @Override public boolean accept(File dir, String name) { return (name.endsWith(".java") || new File(dir, name).isDirectory()); @@ -158,6 +161,7 @@ public class SourceTreeTool extends JPanel { this.isDirectory = isDirectory; } + @Override public String toString() { return name; } @@ -195,6 +199,7 @@ public class SourceTreeTool extends JPanel { * Returns the child TreeNode at index * childIndex. */ + @Override public TreeNode getChildAt(int childIndex) { expandIfNeeded(); return children[childIndex]; @@ -204,6 +209,7 @@ public class SourceTreeTool extends JPanel { * Returns the number of children TreeNodes the receiver * contains. */ + @Override public int getChildCount() { expandIfNeeded(); return children.length; @@ -212,6 +218,7 @@ public class SourceTreeTool extends JPanel { /** * Returns the parent TreeNode of the receiver. */ + @Override public TreeNode getParent() { return parent; } @@ -221,18 +228,21 @@ public class SourceTreeTool extends JPanel { * If the receiver does not contain node, -1 will be * returned. */ + @Override public int getIndex(TreeNode node) { expandIfNeeded(); for (int i = 0; i < children.length; i++) { - if (children[i] == node) + if (children[i] == node) { return i; } + } return -1; } /** * Returns true if the receiver allows children. */ + @Override public boolean getAllowsChildren() { return isDirectory; } @@ -240,6 +250,7 @@ public class SourceTreeTool extends JPanel { /** * Returns true if the receiver is a leaf. */ + @Override public boolean isLeaf() { expandIfNeeded(); return !isDirectory; @@ -248,13 +259,16 @@ public class SourceTreeTool extends JPanel { /** * Returns the children of the receiver as an Enumeration. */ + @Override public Enumeration children() { expandIfNeeded(); return new Enumeration() { int i = 0; + @Override public boolean hasMoreElements() { return (i < children.length); } + @Override public Object nextElement() throws NoSuchElementException { if (i >= children.length) { throw new NoSuchElementException(); diff --git a/src/share/classes/com/sun/tools/example/debug/gui/SourcepathChangedEvent.java b/src/share/classes/com/sun/tools/example/debug/gui/SourcepathChangedEvent.java index 53b3f0382f24e2c82473a97c91bde3fe14e0df4e..975571b0dad95dc0db81736eea885055408e43cb 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/SourcepathChangedEvent.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/SourcepathChangedEvent.java @@ -29,6 +29,8 @@ import java.util.EventObject; public class SourcepathChangedEvent extends EventObject { + private static final long serialVersionUID = 8762169481005804121L; + public SourcepathChangedEvent(Object source) { super(source); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java b/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java index 8d28755778330eb30c2548ff839640dcc6844125..1e3b68eabc684870c02954c01a1d1578e80efb49 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java @@ -25,21 +25,16 @@ package com.sun.tools.example.debug.gui; -import java.io.*; -import java.util.*; -import java.util.List; // Must import explicitly due to conflict with javax.awt.List - import javax.swing.*; -import javax.swing.tree.*; import javax.swing.event.*; import java.awt.*; -import java.awt.event.*; - import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; public class StackTraceTool extends JPanel { + private static final long serialVersionUID = 9140041989427965718L; + private Environment env; private ExecutionManager runtime; @@ -85,6 +80,7 @@ public class StackTraceTool extends JPanel { //### I suspect we handle the case badly that the VM is not interrupted. + @Override public void currentFrameChanged(CurrentFrameChangedEvent e) { // If the current frame of the thread appearing in this // view is changed, move the selection to track it. @@ -103,6 +99,7 @@ public class StackTraceTool extends JPanel { // ListSelectionListener + @Override public void valueChanged(ListSelectionEvent e) { int index = list.getSelectedIndex(); if (index != -1) { @@ -117,6 +114,7 @@ public class StackTraceTool extends JPanel { private class StackFrameRenderer extends DefaultListCellRenderer { + @Override public Component getListCellRendererComponent(JList list, Object value, int index, @@ -174,6 +172,7 @@ public class StackTraceTool extends JPanel { this.tinfo = tinfo; } + @Override public Object getElementAt(int index) { try { return tinfo == null? null : tinfo.getFrame(index); @@ -186,6 +185,7 @@ public class StackTraceTool extends JPanel { } } + @Override public int getSize() { try { return tinfo == null? 1 : tinfo.getFrameCount(); diff --git a/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java b/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java index 2aefdc309e63d8e31a80da1c0675e9e70b7a9740..02cf374f0276ebbd1f882d99efe59e52afc311fc 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java @@ -25,13 +25,11 @@ package com.sun.tools.example.debug.gui; -import java.io.*; import java.util.*; import java.util.List; // Must import explicitly due to conflict with javax.awt.List import javax.swing.*; import javax.swing.tree.*; -import javax.swing.event.*; import java.awt.*; import java.awt.event.*; @@ -45,6 +43,8 @@ import com.sun.tools.example.debug.bdi.*; public class ThreadTreeTool extends JPanel { + private static final long serialVersionUID = 4168599992853038878L; + private Environment env; private ExecutionManager runtime; @@ -79,6 +79,7 @@ public class ThreadTreeTool extends JPanel { tree.setSelectionModel(new SingleLeafTreeSelectionModel()); MouseListener ml = new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { int selRow = tree.getRowForLocation(e.getX(), e.getY()); TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); @@ -131,6 +132,7 @@ public class ThreadTreeTool extends JPanel { // SessionListener + @Override public void sessionStart(EventObject e) { try { for (ThreadReference thread : runtime.allThreads()) { @@ -143,20 +145,25 @@ public class ThreadTreeTool extends JPanel { } } + @Override public void sessionInterrupt(EventObject e) {} + @Override public void sessionContinue(EventObject e) {} // JDIListener + @Override public void threadStart(ThreadStartEventSet e) { root.addThread(e.getThread()); } + @Override public void threadDeath(ThreadDeathEventSet e) { root.removeThread(e.getThread()); } + @Override public void vmDisconnect(VMDisconnectEventSet e) { // Clear the contents of this view. root = createThreadTree(HEADING); @@ -193,6 +200,7 @@ public class ThreadTreeTool extends JPanel { } } + @Override public String toString() { return description; } @@ -213,6 +221,7 @@ public class ThreadTreeTool extends JPanel { return (thread == null); } + @Override public boolean isLeaf() { return !isThreadGroup(); } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/TypeScript.java b/src/share/classes/com/sun/tools/example/debug/gui/TypeScript.java index 84c3262e25efcd6b579755ed52e626a6e2628901..c99a4cd9e27c93ecb112b5c756a8b1b6046777b6 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/TypeScript.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/TypeScript.java @@ -28,10 +28,10 @@ package com.sun.tools.example.debug.gui; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.border.*; public class TypeScript extends JPanel { + private static final long serialVersionUID = -983704841363534885L; private JTextArea history; private JTextField entry; @@ -41,7 +41,6 @@ public class TypeScript extends JPanel { private JScrollBar historyHScrollBar; private boolean echoInput = false; - private boolean nlPending = false; private static String newline = System.getProperty("line.separator"); diff --git a/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptOutputListener.java b/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptOutputListener.java index 6731023760de8486c2db4fea27a773fd89b3fe98..bb3cda6921db52508d4436b3c2544033472ea56c 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptOutputListener.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptOutputListener.java @@ -25,7 +25,6 @@ package com.sun.tools.example.debug.gui; -import javax.swing.*; import com.sun.tools.example.debug.bdi.OutputListener; public class TypeScriptOutputListener implements OutputListener { @@ -42,10 +41,12 @@ public class TypeScriptOutputListener implements OutputListener { this.appendNewline = appendNewline; } + @Override public void putString(String s) { script.append(s); - if (appendNewline) + if (appendNewline) { script.newline(); } + } } diff --git a/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptWriter.java b/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptWriter.java index 89ca4c32aacc1e274f4cbd65b66d2758e285c716..64b5ec2b4439fddcefa2a4e9068e411b08ea0b1d 100644 --- a/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptWriter.java +++ b/src/share/classes/com/sun/tools/example/debug/gui/TypeScriptWriter.java @@ -35,14 +35,17 @@ public class TypeScriptWriter extends Writer { this.script = script; } + @Override public void write(char[] cbuf, int off, int len) throws IOException { script.append(String.valueOf(cbuf, off, len)); } + @Override public void flush() { script.flush(); } + @Override public void close() { script.flush(); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/AccessWatchpointSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/AccessWatchpointSpec.java index 1eedd7af593d6ba97777a1ee759d6e8ed34581d5..1b83363d171a221b6f6a7e572cd5a893be115694 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/AccessWatchpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/AccessWatchpointSpec.java @@ -38,6 +38,7 @@ class AccessWatchpointSpec extends WatchpointSpec { /** * The 'refType' is known to match, return the EventRequest. */ + @Override EventRequest resolveEventRequest(ReferenceType refType) throws NoSuchFieldException { Field field = refType.fieldByName(fieldId); @@ -48,6 +49,7 @@ class AccessWatchpointSpec extends WatchpointSpec { return wp; } + @Override public String toString() { return MessageOutput.format("watch accesses of", new Object [] {refSpec.toString(), diff --git a/src/share/classes/com/sun/tools/example/debug/tty/AmbiguousMethodException.java b/src/share/classes/com/sun/tools/example/debug/tty/AmbiguousMethodException.java index 9975fa54e612b44cbec0d19068498b367c2f2c69..eb210dd4588ef61e867b6e16baa9d3ba59808c5c 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/AmbiguousMethodException.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/AmbiguousMethodException.java @@ -27,6 +27,8 @@ package com.sun.tools.example.debug.tty; public class AmbiguousMethodException extends Exception { + private static final long serialVersionUID = -5372629264936918654L; + public AmbiguousMethodException() { super(); diff --git a/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java index 1105c9e6d3792506587f0f38e5ce2844213a3a4c..ed6c2a10fc57d13c91ed2ad7b35e55c9540def7a 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java @@ -30,7 +30,6 @@ import com.sun.jdi.request.*; import java.util.ArrayList; import java.util.List; -import java.util.Iterator; class BreakpointSpec extends EventRequestSpec { String methodId; @@ -58,6 +57,7 @@ class BreakpointSpec extends EventRequestSpec { /** * The 'refType' is known to match, return the EventRequest. */ + @Override EventRequest resolveEventRequest(ReferenceType refType) throws AmbiguousMethodException, AbsentInformationException, @@ -91,12 +91,14 @@ class BreakpointSpec extends EventRequestSpec { return (methodId != null); } + @Override public int hashCode() { return refSpec.hashCode() + lineNumber + ((methodId != null) ? methodId.hashCode() : 0) + ((methodArgs != null) ? methodArgs.hashCode() : 0); } + @Override public boolean equals(Object obj) { if (obj instanceof BreakpointSpec) { BreakpointSpec breakpoint = (BreakpointSpec)obj; @@ -114,6 +116,7 @@ class BreakpointSpec extends EventRequestSpec { } } + @Override String errorMessageFor(Exception e) { if (e instanceof AmbiguousMethodException) { return (MessageOutput.format("Method is overloaded; specify arguments", @@ -140,6 +143,7 @@ class BreakpointSpec extends EventRequestSpec { } } + @Override public String toString() { StringBuffer buffer = new StringBuffer(refSpec.toString()); if (isMethodBreakpoint()) { diff --git a/src/share/classes/com/sun/tools/example/debug/tty/Commands.java b/src/share/classes/com/sun/tools/example/debug/tty/Commands.java index 48436c9cc96021d0feb5be1dfeee1fd311c3fad8..14a88267fe6eda8a44451a5f27c6631e8594d440 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/Commands.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/Commands.java @@ -51,6 +51,7 @@ class Commands { final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo(); final int stackFrame = threadInfo == null? 0 : threadInfo.getCurrentFrameIndex(); Thread thread = new Thread("asynchronous jdb command") { + @Override public void run() { try { action(); @@ -95,6 +96,7 @@ class Commands { final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo(); if ((threadInfo != null) && (threadInfo.getCurrentFrame() != null)) { frameGetter = new ExpressionParser.GetFrame() { + @Override public StackFrame get() throws IncompatibleThreadStateException { return threadInfo.getCurrentFrame(); } @@ -224,7 +226,6 @@ class Commands { } void commandClass(StringTokenizer t) { - List list = Env.vm().allClasses(); if (!t.hasMoreTokens()) { MessageOutput.println("No class specified."); @@ -709,6 +710,7 @@ class Commands { void doKillThread(final ThreadReference threadToKill, final StringTokenizer tokenizer) { new AsyncExecution() { + @Override void action() { doKill(threadToKill, tokenizer); } @@ -1118,7 +1120,6 @@ class Commands { } void commandStop(StringTokenizer t) { - Location bploc; String atIn; byte suspendPolicy = EventRequest.SUSPEND_ALL; @@ -1665,6 +1666,7 @@ class Commands { void commandPrint(final StringTokenizer t, final boolean dumpObject) { new AsyncExecution() { + @Override void action() { doPrint(t, dumpObject); } @@ -1734,6 +1736,7 @@ class Commands { void commandLock(final StringTokenizer t) { new AsyncExecution() { + @Override void action() { doLock(t); } @@ -1809,6 +1812,7 @@ class Commands { void commandDisableGC(final StringTokenizer t) { new AsyncExecution() { + @Override void action() { doDisableGC(t); } @@ -1837,6 +1841,7 @@ class Commands { void commandEnableGC(final StringTokenizer t) { new AsyncExecution() { + @Override void action() { doEnableGC(t); } @@ -1892,6 +1897,7 @@ class Commands { } } else { new AsyncExecution() { + @Override void action() { doSave(t); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/Env.java b/src/share/classes/com/sun/tools/example/debug/tty/Env.java index b664d094dd687bddaceb5a71f6148fa304d9beb5..e39732692ccd6c189d5de723853901aec1025ac3 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/Env.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/Env.java @@ -29,7 +29,6 @@ import com.sun.jdi.*; import com.sun.jdi.request.StepRequest; import com.sun.jdi.request.MethodEntryRequest; import com.sun.jdi.request.MethodExitRequest; -import com.sun.tools.jdi.*; import java.util.*; import java.io.*; diff --git a/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java b/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java index 0147666d9be06d8c82d2668a43cade5b3950a9d4..31e5035fe8e3588b87d0cfca7957ae2a17397918 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java @@ -27,14 +27,8 @@ package com.sun.tools.example.debug.tty; import com.sun.jdi.*; import com.sun.jdi.event.*; -import com.sun.jdi.request.EventRequestManager; import com.sun.jdi.request.EventRequest; -import java.io.PrintStream; -import java.util.StringTokenizer; -import java.util.Collection; -import java.util.Iterator; - public class EventHandler implements Runnable { EventNotifier notifier; @@ -59,6 +53,7 @@ public class EventHandler implements Runnable { } } + @Override public void run() { EventQueue queue = Env.vm().eventQueue(); while (connected) { diff --git a/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java index 47ae8b4667aef416fffd3d6f9fafd65003d29b50..5c0177b45485717ad2446fd9058933b00292c2ac 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java @@ -30,9 +30,7 @@ import com.sun.jdi.request.EventRequest; import com.sun.jdi.request.ExceptionRequest; import com.sun.jdi.request.ClassPrepareRequest; import com.sun.jdi.event.ClassPrepareEvent; -import java.util.List; import java.util.ArrayList; -import java.util.Iterator; abstract class EventRequestSpec { diff --git a/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java b/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java index 0816b74a0ce5c18e0154d9aa3db3d4299c879d9d..58dc664f0ed5c03a95be86cc503ae511b70122e2 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java @@ -25,15 +25,12 @@ package com.sun.tools.example.debug.tty; -import com.sun.jdi.*; import com.sun.jdi.request.EventRequest; import com.sun.jdi.event.ClassPrepareEvent; import java.util.ArrayList; import java.util.Collections; -import java.util.Iterator; import java.util.List; -import java.util.StringTokenizer; class EventRequestSpecList { diff --git a/src/share/classes/com/sun/tools/example/debug/tty/ExceptionSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/ExceptionSpec.java index b0075061e3d406a883a21fb7798c551607484a1c..f1a3c27272478b5b75f914f004b0207ba1c49407 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/ExceptionSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/ExceptionSpec.java @@ -28,10 +28,6 @@ package com.sun.tools.example.debug.tty; import com.sun.jdi.ReferenceType; import com.sun.jdi.request.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Iterator; - class ExceptionSpec extends EventRequestSpec { private boolean notifyCaught; private boolean notifyUncaught; @@ -51,6 +47,7 @@ class ExceptionSpec extends EventRequestSpec { /** * The 'refType' is known to match, return the EventRequest. */ + @Override EventRequest resolveEventRequest(ReferenceType refType) { EventRequestManager em = refType.virtualMachine().eventRequestManager(); ExceptionRequest excReq = em.createExceptionRequest(refType, @@ -68,6 +65,7 @@ class ExceptionSpec extends EventRequestSpec { return notifyUncaught; } + @Override public int hashCode() { //Reference: Effective Java[tm] (Bloch, 2001), Item 8 int result = 17; @@ -77,6 +75,7 @@ class ExceptionSpec extends EventRequestSpec { return result; } + @Override public boolean equals(Object obj) { if (obj instanceof ExceptionSpec) { ExceptionSpec es = (ExceptionSpec)obj; @@ -90,6 +89,7 @@ class ExceptionSpec extends EventRequestSpec { return false; } + @Override public String toString() { String s; if (notifyCaught && !notifyUncaught) { diff --git a/src/share/classes/com/sun/tools/example/debug/tty/LineNotFoundException.java b/src/share/classes/com/sun/tools/example/debug/tty/LineNotFoundException.java index 5fb6a0ea5fa6f0caf238537333ab878baede73aa..442b798aaae224d57f31ba42dd1c59b18cd7339d 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/LineNotFoundException.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/LineNotFoundException.java @@ -27,6 +27,8 @@ package com.sun.tools.example.debug.tty; public class LineNotFoundException extends Exception { + private static final long serialVersionUID = 3748297722519448995L; + public LineNotFoundException() { super(); diff --git a/src/share/classes/com/sun/tools/example/debug/tty/MalformedMemberNameException.java b/src/share/classes/com/sun/tools/example/debug/tty/MalformedMemberNameException.java index dacf7aca78a71a8aa4d7733eadaa3e0a585070b5..3f2bf46c627b5f36174adeddebd868450b5f93a4 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/MalformedMemberNameException.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/MalformedMemberNameException.java @@ -26,6 +26,8 @@ package com.sun.tools.example.debug.tty; class MalformedMemberNameException extends Exception { + private static final long serialVersionUID = 7759071468833196630L; + public MalformedMemberNameException() { super(); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/ModificationWatchpointSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/ModificationWatchpointSpec.java index 05436c7a614496eed0ad77a4848958f8bc1973a7..ee3a63e969487c63e098a08743c742b57e9d06b5 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/ModificationWatchpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/ModificationWatchpointSpec.java @@ -38,6 +38,7 @@ class ModificationWatchpointSpec extends WatchpointSpec { /** * The 'refType' is known to match, return the EventRequest. */ + @Override EventRequest resolveEventRequest(ReferenceType refType) throws NoSuchFieldException { Field field = refType.fieldByName(fieldId); @@ -48,6 +49,7 @@ class ModificationWatchpointSpec extends WatchpointSpec { return wp; } + @Override public String toString() { return MessageOutput.format("watch modification of", new Object [] {refSpec.toString(), diff --git a/src/share/classes/com/sun/tools/example/debug/tty/PatternReferenceTypeSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/PatternReferenceTypeSpec.java index b6c01774df4a8881d1c9b51b30854d31fc0906c0..cc4473cefd86958728fc0f14c57130e1f1b2ca25 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/PatternReferenceTypeSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/PatternReferenceTypeSpec.java @@ -55,6 +55,7 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { /** * Does the specified ReferenceType match this spec. */ + @Override public boolean matches(ReferenceType refType) { if (classId.startsWith("*")) { return refType.name().endsWith(stem); @@ -65,6 +66,7 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { } } + @Override public ClassPrepareRequest createPrepareRequest() { ClassPrepareRequest request = Env.vm().eventRequestManager().createClassPrepareRequest(); @@ -73,10 +75,12 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { return request; } + @Override public int hashCode() { return classId.hashCode(); } + @Override public boolean equals(Object obj) { if (obj instanceof PatternReferenceTypeSpec) { PatternReferenceTypeSpec spec = (PatternReferenceTypeSpec)obj; @@ -125,6 +129,7 @@ class PatternReferenceTypeSpec implements ReferenceTypeSpec { return true; } + @Override public String toString() { return classId; } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/ReferenceTypeSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/ReferenceTypeSpec.java index 6f085b93d1b1701cdd80d4ca428bd9075a064773..0e76be0cb4c5914ca9811c0eac649ff28fa01801 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/ReferenceTypeSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/ReferenceTypeSpec.java @@ -35,7 +35,9 @@ interface ReferenceTypeSpec { boolean matches(ReferenceType refType); ClassPrepareRequest createPrepareRequest(); + @Override int hashCode(); + @Override boolean equals(Object obj); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java b/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java index 95f82b539565b8f42c3c097c603317de20d6f943..941f6c24722d447ddd97111b2184b0364f099d1e 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java @@ -27,11 +27,8 @@ package com.sun.tools.example.debug.tty; import com.sun.jdi.Location; import com.sun.jdi.AbsentInformationException; -import java.util.Map; -import java.util.HashMap; import java.util.List; import java.util.ArrayList; -import java.util.Iterator; import java.util.StringTokenizer; import java.io.*; diff --git a/src/share/classes/com/sun/tools/example/debug/tty/TTY.java b/src/share/classes/com/sun/tools/example/debug/tty/TTY.java index c717b6ca4b7a9a4f34704a5d2850b6c3a9fe9d86..6514592d67d71f5317a2d957c7d4fab24a67a57f 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/TTY.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/TTY.java @@ -47,34 +47,43 @@ public class TTY implements EventNotifier { */ private static final String progname = "jdb"; + @Override public void vmStartEvent(VMStartEvent se) { Thread.yield(); // fetch output MessageOutput.lnprint("VM Started:"); } + @Override public void vmDeathEvent(VMDeathEvent e) { } + @Override public void vmDisconnectEvent(VMDisconnectEvent e) { } + @Override public void threadStartEvent(ThreadStartEvent e) { } + @Override public void threadDeathEvent(ThreadDeathEvent e) { } + @Override public void classPrepareEvent(ClassPrepareEvent e) { } + @Override public void classUnloadEvent(ClassUnloadEvent e) { } + @Override public void breakpointEvent(BreakpointEvent be) { Thread.yield(); // fetch output MessageOutput.lnprint("Breakpoint hit:"); } + @Override public void fieldWatchEvent(WatchpointEvent fwe) { Field field = fwe.field(); ObjectReference obj = fwe.object(); @@ -90,11 +99,13 @@ public class TTY implements EventNotifier { } } + @Override public void stepEvent(StepEvent se) { Thread.yield(); // fetch output MessageOutput.lnprint("Step completed:"); } + @Override public void exceptionEvent(ExceptionEvent ee) { Thread.yield(); // fetch output Location catchLocation = ee.catchLocation(); @@ -108,6 +119,7 @@ public class TTY implements EventNotifier { } } + @Override public void methodEntryEvent(MethodEntryEvent me) { Thread.yield(); // fetch output /* @@ -125,6 +137,7 @@ public class TTY implements EventNotifier { } } + @Override public boolean methodExitEvent(MethodExitEvent me) { Thread.yield(); // fetch output /* @@ -173,6 +186,7 @@ public class TTY implements EventNotifier { return false; } + @Override public void vmInterrupted() { Thread.yield(); // fetch output printCurrentLocation(); @@ -184,6 +198,7 @@ public class TTY implements EventNotifier { MessageOutput.printPrompt(); } + @Override public void receivedEvent(Event event) { } @@ -317,18 +332,19 @@ public class TTY implements EventNotifier { // Adapted for use with String[][0]. int low = 0; int high = commandList.length - 1; - long i = 0; while (low <= high) { int mid = (low + high) >>> 1; String midVal = commandList[mid][0]; int compare = midVal.compareTo(key); - if (compare < 0) + if (compare < 0) { low = mid + 1; - else if (compare > 0) + } else if (compare > 0) { high = mid - 1; - else + } + else { return mid; // key found } + } return -(low + 1); // key not found. }; @@ -336,7 +352,9 @@ public class TTY implements EventNotifier { * Return true if the command is OK when disconnected. */ private boolean isDisconnectCmd(int ii) { - if (ii < 0 || ii >= commandList.length) return false; + if (ii < 0 || ii >= commandList.length) { + return false; + } return (commandList[ii][1].equals("y")); } @@ -344,7 +362,9 @@ public class TTY implements EventNotifier { * Return true if the command is OK when readonly. */ private boolean isReadOnlyCmd(int ii) { - if (ii < 0 || ii >= commandList.length) return false; + if (ii < 0 || ii >= commandList.length) { + return false; + } return (commandList[ii][2].equals("y")); }; diff --git a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources.java b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources.java index 6193d9ba4c8b2b40c4d0b76575f07a272274e037..f6ba9d74ca71596014a09f18a954b67d3ddc9982 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources.java @@ -44,6 +44,7 @@ public class TTYResources extends java.util.ListResourceBundle { * * @return the contents of this ResourceBundle. */ + @Override public Object[][] getContents() { Object[][] temp = new Object[][] { // NOTE: The value strings in this file containing "{0}" are diff --git a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java index 5544145981533e3abb6c6ae841c4f67fb3864325..2dcace1c486d05a050729560aa0513d903289785 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java @@ -44,6 +44,7 @@ public class TTYResources_ja extends java.util.ListResourceBundle { * * @return the contents of this ResourceBundle. */ + @Override public Object[][] getContents() { Object[][] temp = new Object[][] { // NOTE: The value strings in this file containing "{0}" are diff --git a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java index ac948fb9950a181b5ebf30bc4d5d4e939e8fd99e..dc84bdf4f9cbec6693b3ba78d028a96946b46c02 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java @@ -44,6 +44,7 @@ public class TTYResources_zh_CN extends java.util.ListResourceBundle { * * @return the contents of this ResourceBundle. */ + @Override public Object[][] getContents() { Object[][] temp = new Object[][] { // NOTE: The value strings in this file containing "{0}" are diff --git a/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java b/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java index 1190c33b42334442a90024891f844055cb95ea4c..dd3ad08106cf6d3b6cf8caf30072078c56ba32c7 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java @@ -26,7 +26,6 @@ package com.sun.tools.example.debug.tty; import com.sun.jdi.ThreadGroupReference; -import com.sun.jdi.ThreadReference; import java.util.List; import java.util.Stack; import java.util.ArrayList; @@ -70,10 +69,12 @@ class ThreadGroupIterator implements Iterator { } } + @Override public boolean hasNext() { return !stack.isEmpty(); } + @Override public ThreadGroupReference next() { return nextThreadGroup(); } @@ -84,6 +85,7 @@ class ThreadGroupIterator implements Iterator { return tg; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java b/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java index 1432239f6488d1920c34891f5eaaa8e6a40ddd8e..8ac294fbcaf6bc6928d2342b09d007d76f7244c3 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java @@ -32,8 +32,6 @@ import com.sun.jdi.StackFrame; import java.util.List; import java.util.ArrayList; import java.util.Collections; -import java.util.Iterator; -import java.io.*; class ThreadInfo { // This is a list of all known ThreadInfo objects. It survives diff --git a/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java b/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java index 58ec98495e0b415f403fecbb80b6089ffbfa3940..6acb2ea9d099e0aba3250356e677d7dd14a44228 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java @@ -46,6 +46,7 @@ class ThreadIterator implements Iterator { tgi = new ThreadGroupIterator(); } + @Override public boolean hasNext() { while (it == null || !it.hasNext()) { if (!tgi.hasNext()) { @@ -56,6 +57,7 @@ class ThreadIterator implements Iterator { return true; } + @Override public ThreadReference next() { return it.next(); } @@ -64,6 +66,7 @@ class ThreadIterator implements Iterator { return next(); } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java b/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java index fead3f797882e583162302cda8165e670c9f9445..0b77f9824a2f3735820498d5102ba2b645f77505 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java @@ -28,7 +28,6 @@ package com.sun.tools.example.debug.tty; import com.sun.jdi.*; import com.sun.jdi.connect.*; import com.sun.jdi.request.EventRequestManager; -import com.sun.jdi.request.ExceptionRequest; import com.sun.jdi.request.ThreadStartRequest; import com.sun.jdi.request.ThreadDeathRequest; @@ -292,6 +291,7 @@ class VMConnection { */ private void displayRemoteOutput(final InputStream stream) { Thread thr = new Thread("output reader") { + @Override public void run() { try { dumpStream(stream); diff --git a/src/share/classes/com/sun/tools/example/debug/tty/VMNotConnectedException.java b/src/share/classes/com/sun/tools/example/debug/tty/VMNotConnectedException.java index 448561d04d5bf43df1b5d5a95e0bf8169a106b66..780301ca60799c3e85318c5d47ded4c77c29c940 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/VMNotConnectedException.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/VMNotConnectedException.java @@ -27,6 +27,8 @@ package com.sun.tools.example.debug.tty; public class VMNotConnectedException extends RuntimeException { + private static final long serialVersionUID = -7433430494903950165L; + public VMNotConnectedException() { super(); } diff --git a/src/share/classes/com/sun/tools/example/debug/tty/WatchpointSpec.java b/src/share/classes/com/sun/tools/example/debug/tty/WatchpointSpec.java index e424c40d62a506d29db2350c41761a3d3abe4cc9..6c7da78f48500deadf73d28d6e3822963ee00969 100644 --- a/src/share/classes/com/sun/tools/example/debug/tty/WatchpointSpec.java +++ b/src/share/classes/com/sun/tools/example/debug/tty/WatchpointSpec.java @@ -25,8 +25,6 @@ package com.sun.tools.example.debug.tty; -import com.sun.jdi.*; - abstract class WatchpointSpec extends EventRequestSpec { final String fieldId; @@ -39,11 +37,13 @@ abstract class WatchpointSpec extends EventRequestSpec { } } + @Override public int hashCode() { return refSpec.hashCode() + fieldId.hashCode() + getClass().hashCode(); } + @Override public boolean equals(Object obj) { if (obj instanceof WatchpointSpec) { WatchpointSpec watchpoint = (WatchpointSpec)obj; @@ -56,6 +56,7 @@ abstract class WatchpointSpec extends EventRequestSpec { } } + @Override String errorMessageFor(Exception e) { if (e instanceof NoSuchFieldException) { return (MessageOutput.format("No field in", diff --git a/src/share/classes/com/sun/tools/example/trace/EventThread.java b/src/share/classes/com/sun/tools/example/trace/EventThread.java index 7e729a16b07fce0922e82132be5051c8a2be26e8..229a41689890ac67611a4511d0055709a8ede6c0 100644 --- a/src/share/classes/com/sun/tools/example/trace/EventThread.java +++ b/src/share/classes/com/sun/tools/example/trace/EventThread.java @@ -49,7 +49,8 @@ public class EventThread extends Thread { private boolean vmDied = true; // VMDeath occurred // Maps ThreadReference to ThreadTrace instances - private Map traceMap = new HashMap(); + private Map traceMap = + new HashMap<>(); EventThread(VirtualMachine vm, String[] excludes, PrintWriter writer) { super("event-handler"); @@ -63,6 +64,7 @@ public class EventThread extends Thread { * As long as we are connected, get event sets off * the queue and dispatch the events within them. */ + @Override public void run() { EventQueue queue = vm.eventQueue(); while (connected) { @@ -208,7 +210,7 @@ public class EventThread extends Thread { * creating one if needed. */ ThreadTrace threadTrace(ThreadReference thread) { - ThreadTrace trace = (ThreadTrace)traceMap.get(thread); + ThreadTrace trace = traceMap.get(thread); if (trace == null) { trace = new ThreadTrace(thread); traceMap.put(thread, trace); @@ -297,7 +299,7 @@ public class EventThread extends Thread { } void threadDeathEvent(ThreadDeathEvent event) { - ThreadTrace trace = (ThreadTrace)traceMap.get(event.thread()); + ThreadTrace trace = traceMap.get(event.thread()); if (trace != null) { // only want threads we care about trace.threadDeathEvent(event); // Forward event } @@ -309,9 +311,8 @@ public class EventThread extends Thread { */ private void classPrepareEvent(ClassPrepareEvent event) { EventRequestManager mgr = vm.eventRequestManager(); - List fields = event.referenceType().visibleFields(); - for (Iterator it = fields.iterator(); it.hasNext(); ) { - Field field = (Field)it.next(); + List fields = event.referenceType().visibleFields(); + for (Field field : fields) { ModificationWatchpointRequest req = mgr.createModificationWatchpointRequest(field); for (int i=0; i arguments = + connectorArguments(connector, mainArgs); try { return connector.launch(arguments); } catch (IOException exc) { @@ -186,10 +186,8 @@ public class Trace { * Find a com.sun.jdi.CommandLineLaunch connector */ LaunchingConnector findLaunchingConnector() { - List connectors = Bootstrap.virtualMachineManager().allConnectors(); - Iterator iter = connectors.iterator(); - while (iter.hasNext()) { - Connector connector = (Connector)iter.next(); + List connectors = Bootstrap.virtualMachineManager().allConnectors(); + for (Connector connector : connectors) { if (connector.name().equals("com.sun.jdi.CommandLineLaunch")) { return (LaunchingConnector)connector; } @@ -200,8 +198,8 @@ public class Trace { /** * Return the launching connector's arguments. */ - Map connectorArguments(LaunchingConnector connector, String mainArgs) { - Map arguments = connector.defaultArguments(); + Map connectorArguments(LaunchingConnector connector, String mainArgs) { + Map arguments = connector.defaultArguments(); Connector.Argument mainArg = (Connector.Argument)arguments.get("main"); if (mainArg == null) { diff --git a/src/share/classes/java/awt/Component.java b/src/share/classes/java/awt/Component.java index 5b572797d8436ba1dfdb99f90197a2555bc3031a..f577887abe67c4caf7831dd385c71e25909a3427 100644 --- a/src/share/classes/java/awt/Component.java +++ b/src/share/classes/java/awt/Component.java @@ -2944,6 +2944,46 @@ public abstract class Component implements ImageObserver, MenuContainer, } } + /** + * Revalidates the component hierarchy up to the nearest validate root. + *

+ * This method first invalidates the component hierarchy starting from this + * component up to the nearest validate root. Afterwards, the component + * hierarchy is validated starting from the nearest validate root. + *

+ * This is a convenience method supposed to help application developers + * avoid looking for validate roots manually. Basically, it's equivalent to + * first calling the {@link #invalidate()} method on this component, and + * then calling the {@link #validate()} method on the nearest validate + * root. + * + * @see Container#isValidateRoot + * @since 1.7 + */ + public void revalidate() { + synchronized (getTreeLock()) { + invalidate(); + + Container root = getContainer(); + if (root == null) { + // There's no parents. Just validate itself. + validate(); + } else { + while (!root.isValidateRoot()) { + if (root.getContainer() == null) { + // If there's no validate roots, we'll validate the + // topmost container + break; + } + + root = root.getContainer(); + } + + root.validate(); + } + } + } + /** * Creates a graphics context for this component. This method will * return null if this component is currently not diff --git a/src/share/classes/java/awt/GraphicsDevice.java b/src/share/classes/java/awt/GraphicsDevice.java index f3b7cd390a66eb540fee829746e22fa384a71de5..b99d7ef8def77620c44dee7ae2bf7fa20292ba32 100644 --- a/src/share/classes/java/awt/GraphicsDevice.java +++ b/src/share/classes/java/awt/GraphicsDevice.java @@ -257,6 +257,11 @@ public abstract class GraphicsDevice { * 1.0f, and the background color alpha is set to 255 (completely opaque). * These values are not restored when returning to windowed mode. *

+ * It is unspecified and platform-dependent how decorated windows operate + * in full-screen mode. For this reason, it is recommended to turn off + * the decorations in a {@code Frame} or {@code Dialog} object by using the + * {@code setUndecorated} method. + *

* When returning to windowed mode from an exclusive full-screen window, * any display changes made by calling {@code setDisplayMode} are * automatically restored to their original state. @@ -272,6 +277,8 @@ public abstract class GraphicsDevice { * @see #setDisplayMode * @see Component#enableInputMethods * @see Component#setVisible + * @see Frame#setUndecorated + * @see Dialog#setUndecorated * * @since 1.4 */ diff --git a/src/share/classes/java/awt/RadialGradientPaint.java b/src/share/classes/java/awt/RadialGradientPaint.java index d2ba4be3ece65214c0edf33d920927d1cc0a8836..c9cc43a8e32cf440305184dbf4b0ec57e2fbd4b4 100644 --- a/src/share/classes/java/awt/RadialGradientPaint.java +++ b/src/share/classes/java/awt/RadialGradientPaint.java @@ -49,9 +49,11 @@ import java.beans.ConstructorProperties; * from the focus point to the circumference will thus span all the gradient * colors. *

- * Specifying a focus point outside of the circle's radius will result in the - * focus being set to the intersection point of the focus-center line and the - * perimeter of the circle. + * Specifying a focus point outside of the radius of the circle will cause + * the rings of the gradient pattern to be centered on the point just inside + * the edge of the circle in the direction of the focus point. + * The rendering will internally use this modified location as if it were + * the specified focus point. *

* The user must provide an array of floats specifying how to distribute the * colors along the gradient. These values should range from 0.0 to 1.0 and @@ -621,6 +623,11 @@ public final class RadialGradientPaint extends MultipleGradientPaint { /** * Returns a copy of the focus point of the radial gradient. + * Note that if the focus point specified when the radial gradient + * was constructed lies outside of the radius of the circle, this + * method will still return the original focus point even though + * the rendering may center the rings of color on a different + * point that lies inside the radius. * * @return a {@code Point2D} object that is a copy of the focus point */ diff --git a/src/share/classes/java/awt/Toolkit.java b/src/share/classes/java/awt/Toolkit.java index 58a4ddc7b4f15c07c9ec32c7e066d80be3cb6866..6e00e6afdbf260aba46d82a34b09e98b0be903f1 100644 --- a/src/share/classes/java/awt/Toolkit.java +++ b/src/share/classes/java/awt/Toolkit.java @@ -1870,11 +1870,15 @@ public abstract class Toolkit { /** * Adds the specified property change listener for the named desktop - * property. - * If pcl is null, no exception is thrown and no action is performed. + * property. When a {@link PropertyChangeListenerProxy} object is added, + * its property name is ignored, and the wrapped listener is added. + * If {@code name} is {@code null} or {@code pcl} is {@code null}, + * no exception is thrown and no action is performed. * * @param name The name of the property to listen for * @param pcl The property change listener + * @see PropertyChangeSupport#addPropertyChangeListener(String, + PropertyChangeListener) * @since 1.2 */ public void addPropertyChangeListener(String name, PropertyChangeListener pcl) { @@ -1883,11 +1887,16 @@ public abstract class Toolkit { /** * Removes the specified property change listener for the named - * desktop property. - * If pcl is null, no exception is thrown and no action is performed. + * desktop property. When a {@link PropertyChangeListenerProxy} object + * is removed, its property name is ignored, and + * the wrapped listener is removed. + * If {@code name} is {@code null} or {@code pcl} is {@code null}, + * no exception is thrown and no action is performed. * * @param name The name of the property to remove * @param pcl The property change listener + * @see PropertyChangeSupport#removePropertyChangeListener(String, + PropertyChangeListener) * @since 1.2 */ public void removePropertyChangeListener(String name, PropertyChangeListener pcl) { @@ -1896,12 +1905,15 @@ public abstract class Toolkit { /** * Returns an array of all the property change listeners - * registered on this toolkit. + * registered on this toolkit. The returned array + * contains {@code PropertyChangeListenerProxy} objects + * that associate listeners with the names of desktop properties. * - * @return all of this toolkit's PropertyChangeListeners - * or an empty array if no property change - * listeners are currently registered + * @return all of this toolkit's {@ code PropertyChangeListener} + * objects wrapped in {@code PropertyChangeListenerProxy} objects + * or an empty array if no listeners are added * + * @see PropertyChangeSupport#getPropertyChangeListeners() * @since 1.4 */ public PropertyChangeListener[] getPropertyChangeListeners() { @@ -1909,13 +1921,15 @@ public abstract class Toolkit { } /** - * Returns an array of all the PropertyChangeListeners - * associated with the named property. + * Returns an array of all property change listeners + * associated with the specified name of a desktop property. * * @param propertyName the named property - * @return all of the PropertyChangeListeners associated with - * the named property or an empty array if no such listeners have - * been added + * @return all of the {@code PropertyChangeListener} objects + * associated with the specified name of a desktop property + * or an empty array if no such listeners are added + * + * @see PropertyChangeSupport#getPropertyChangeListeners(String) * @since 1.4 */ public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) { diff --git a/src/share/classes/java/awt/geom/Arc2D.java b/src/share/classes/java/awt/geom/Arc2D.java index 86653be120ceacfb36b40ab33d987f24e685e69c..802ec5a5297918c34c5389fddb565e6b40666d57 100644 --- a/src/share/classes/java/awt/geom/Arc2D.java +++ b/src/share/classes/java/awt/geom/Arc2D.java @@ -681,7 +681,7 @@ public abstract class Arc2D extends RectangularShape { * @see java.awt.geom.Arc2D.Float * @see java.awt.geom.Arc2D.Double */ - Arc2D() { + protected Arc2D() { this(OPEN); } diff --git a/src/share/classes/java/awt/geom/Path2D.java b/src/share/classes/java/awt/geom/Path2D.java index c84948c8ee9c05ebd354b14bb87d86799e33f398..39f7d992b286837091464ad06d5d1f30a7b18a4e 100644 --- a/src/share/classes/java/awt/geom/Path2D.java +++ b/src/share/classes/java/awt/geom/Path2D.java @@ -732,7 +732,7 @@ public abstract class Path2D implements Shape, Cloneable { * * @since 1.6 */ - public PathIterator getPathIterator(AffineTransform at) { + public final PathIterator getPathIterator(AffineTransform at) { if (at == null) { return new CopyIterator(this); } else { @@ -1461,7 +1461,7 @@ public abstract class Path2D implements Shape, Cloneable { * of this {@code Shape}'s outline * @since 1.6 */ - public PathIterator getPathIterator(AffineTransform at) { + public final PathIterator getPathIterator(AffineTransform at) { if (at == null) { return new CopyIterator(this); } else { @@ -2342,8 +2342,8 @@ public abstract class Path2D implements Shape, Cloneable { * * @since 1.6 */ - public PathIterator getPathIterator(AffineTransform at, - double flatness) + public final PathIterator getPathIterator(AffineTransform at, + double flatness) { return new FlatteningPathIterator(getPathIterator(at), flatness); } diff --git a/src/share/classes/java/beans/DefaultPersistenceDelegate.java b/src/share/classes/java/beans/DefaultPersistenceDelegate.java index 6c33c0ce12f191b9c8f24832681c72fa8b28dbfc..951d97210b00bba74f355b23eab3bd4a7d576f70 100644 --- a/src/share/classes/java/beans/DefaultPersistenceDelegate.java +++ b/src/share/classes/java/beans/DefaultPersistenceDelegate.java @@ -26,6 +26,7 @@ package java.beans; import java.util.*; import java.lang.reflect.*; +import java.util.Objects; import sun.reflect.misc.*; @@ -181,10 +182,6 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { return method; } - private static boolean equals(Object o1, Object o2) { - return (o1 == null) ? (o2 == null) : o1.equals(o2); - } - private void doProperty(Class type, PropertyDescriptor pd, Object oldInstance, Object newInstance, Encoder out) throws Exception { Method getter = pd.getReadMethod(); Method setter = pd.getWriteMethod(); @@ -195,7 +192,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { Object oldValue = oldGetExp.getValue(); Object newValue = newGetExp.getValue(); out.writeExpression(oldGetExp); - if (!equals(newValue, out.get(oldValue))) { + if (!Objects.equals(newValue, out.get(oldValue))) { // Search for a static constant with this value; Object e = (Object[])pd.getValue("enumerationValues"); if (e instanceof Object[] && Array.getLength(e) % 3 == 0) { @@ -233,7 +230,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { Object oldValue = oldGetExp.getValue(); Object newValue = newGetExp.getValue(); out.writeExpression(oldGetExp); - if (!equals(newValue, out.get(oldValue))) { + if (!Objects.equals(newValue, out.get(oldValue))) { out.writeStatement(new Statement(field, "set", new Object[] { oldInstance, oldValue })); } } diff --git a/src/share/classes/java/beans/MetaData.java b/src/share/classes/java/beans/MetaData.java index c95a6157948dac8288378668ebca08d92bdbb304..c4ab869e955f15db5c4de1aa862f43dccd3af09d 100644 --- a/src/share/classes/java/beans/MetaData.java +++ b/src/share/classes/java/beans/MetaData.java @@ -56,6 +56,8 @@ import javax.swing.plaf.ColorUIResource; import sun.swing.PrintColorUIResource; +import java.util.Objects; + /* * Like the Intropector, the MetaData class * contains meta objects that describe the way @@ -134,7 +136,7 @@ class ArrayPersistenceDelegate extends PersistenceDelegate { Object oldValue = oldGetExp.getValue(); Object newValue = newGetExp.getValue(); out.writeExpression(oldGetExp); - if (!MetaData.equals(newValue, out.get(oldValue))) { + if (!Objects.equals(newValue, out.get(oldValue))) { // System.out.println("Not equal: " + newGetExp + " != " + actualGetExp); // invokeStatement(Array.class, "set", new Object[]{oldInstance, index, oldValue}, out); DefaultPersistenceDelegate.invokeStatement(oldInstance, "set", new Object[]{index, oldValue}, out); @@ -635,7 +637,7 @@ class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate { Object oldValue = oldGetExp.getValue(); Object newValue = newGetExp.getValue(); out.writeExpression(oldGetExp); - if (!MetaData.equals(newValue, out.get(oldValue))) { + if (!Objects.equals(newValue, out.get(oldValue))) { invokeStatement(oldInstance, "set", new Object[]{index, oldValue}, out); } } @@ -675,7 +677,7 @@ class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate { Object oldValue = oldGetExp.getValue(); Object newValue = newGetExp.getValue(); out.writeExpression(oldGetExp); - if (!MetaData.equals(newValue, out.get(oldValue))) { + if (!Objects.equals(newValue, out.get(oldValue))) { invokeStatement(oldInstance, "put", new Object[]{oldKey, oldValue}, out); } else if ((newValue == null) && !newMap.containsKey(oldKey)) { // put oldValue(=null?) if oldKey is absent in newMap @@ -899,17 +901,17 @@ class java_awt_Component_PersistenceDelegate extends DefaultPersistenceDelegate if (!(oldInstance instanceof java.awt.Window)) { Object oldBackground = c.isBackgroundSet() ? c.getBackground() : null; Object newBackground = c2.isBackgroundSet() ? c2.getBackground() : null; - if (!MetaData.equals(oldBackground, newBackground)) { + if (!Objects.equals(oldBackground, newBackground)) { invokeStatement(oldInstance, "setBackground", new Object[] { oldBackground }, out); } Object oldForeground = c.isForegroundSet() ? c.getForeground() : null; Object newForeground = c2.isForegroundSet() ? c2.getForeground() : null; - if (!MetaData.equals(oldForeground, newForeground)) { + if (!Objects.equals(oldForeground, newForeground)) { invokeStatement(oldInstance, "setForeground", new Object[] { oldForeground }, out); } Object oldFont = c.isFontSet() ? c.getFont() : null; Object newFont = c2.isFontSet() ? c2.getFont() : null; - if (!MetaData.equals(oldFont, newFont)) { + if (!Objects.equals(oldFont, newFont)) { invokeStatement(oldInstance, "setFont", new Object[] { oldFont }, out); } } @@ -1306,10 +1308,6 @@ class MetaData { internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate()); } - /*pp*/ static boolean equals(Object o1, Object o2) { - return (o1 == null) ? (o2 == null) : o1.equals(o2); - } - public synchronized static PersistenceDelegate getPersistenceDelegate(Class type) { if (type == null) { return nullPersistenceDelegate; diff --git a/src/share/classes/java/io/File.java b/src/share/classes/java/io/File.java index 1bfc0c1837e74f1315833021dcdc7d9eb2b973cf..4b9d389a2d0bb74c335838354b2bb5f62c31f9b9 100644 --- a/src/share/classes/java/io/File.java +++ b/src/share/classes/java/io/File.java @@ -25,7 +25,6 @@ package java.io; -import java.beans.ConstructorProperties; import java.net.URI; import java.net.URL; import java.net.MalformedURLException; @@ -247,7 +246,6 @@ public class File * @throws NullPointerException * If the pathname argument is null */ - @ConstructorProperties("path") public File(String pathname) { if (pathname == null) { throw new NullPointerException(); diff --git a/src/share/classes/java/lang/ArithmeticException.java b/src/share/classes/java/lang/ArithmeticException.java index 0d6ed9164ef9ed3d5c7a6d9f76b76bc167c384da..af00777dbcdd2e176162734ab98f1b361dc807c2 100644 --- a/src/share/classes/java/lang/ArithmeticException.java +++ b/src/share/classes/java/lang/ArithmeticException.java @@ -32,7 +32,8 @@ package java.lang; * * {@code ArithmeticException} objects may be constructed by the * virtual machine as if {@linkplain Throwable#Throwable(String, - * Throwable, boolean) suppression were disabled}. + * Throwable, boolean, boolean) suppression were disabled and/or the + * stack trace was not writable}. * * @author unascribed * @since JDK1.0 diff --git a/src/share/classes/java/lang/Character.java b/src/share/classes/java/lang/Character.java index e52a83a84b18cc1fa7aff54138d737bd19c09377..216098bd5335bc3579d344bbb70b5578f87fdfc0 100644 --- a/src/share/classes/java/lang/Character.java +++ b/src/share/classes/java/lang/Character.java @@ -59,14 +59,14 @@ import java.util.Locale; *

The {@code char} data type (and therefore the value that a * {@code Character} object encapsulates) are based on the * original Unicode specification, which defined characters as - * fixed-width 16-bit entities. The Unicode standard has since been + * fixed-width 16-bit entities. The Unicode Standard has since been * changed to allow for characters whose representation requires more * than 16 bits. The range of legal code points is now * U+0000 to U+10FFFF, known as Unicode scalar value. * (Refer to the * definition of the U+n notation in the Unicode - * standard.) + * Standard.) * *

The set of characters from U+0000 to U+FFFF is * sometimes referred to as the Basic Multilingual Plane (BMP). @@ -5200,7 +5200,8 @@ class Character implements java.io.Serializable, Comparable { *

* A character is lowercase if its general category type, provided * by {@code Character.getType(ch)}, is - * {@code LOWERCASE_LETTER}. + * {@code LOWERCASE_LETTER}, or it has contributory property + * Other_Lowercase as defined by the Unicode Standard. *

* The following are examples of lowercase characters: *

@@ -5235,7 +5236,8 @@ class Character implements java.io.Serializable, Comparable {
      * 

* A character is lowercase if its general category type, provided * by {@link Character#getType getType(codePoint)}, is - * {@code LOWERCASE_LETTER}. + * {@code LOWERCASE_LETTER}, or it has contributory property + * Other_Lowercase as defined by the Unicode Standard. *

* The following are examples of lowercase characters: *

@@ -5257,7 +5259,8 @@ class Character implements java.io.Serializable, Comparable {
      * @since   1.5
      */
     public static boolean isLowerCase(int codePoint) {
-        return getType(codePoint) == Character.LOWERCASE_LETTER;
+        return getType(codePoint) == Character.LOWERCASE_LETTER ||
+               CharacterData.of(codePoint).isOtherLowercase(codePoint);
     }
 
     /**
@@ -5265,6 +5268,7 @@ class Character implements java.io.Serializable, Comparable {
      * 

* A character is uppercase if its general category type, provided by * {@code Character.getType(ch)}, is {@code UPPERCASE_LETTER}. + * or it has contributory property Other_Uppercase as defined by the Unicode Standard. *

* The following are examples of uppercase characters: *

@@ -5298,7 +5302,8 @@ class Character implements java.io.Serializable, Comparable {
      * Determines if the specified character (Unicode code point) is an uppercase character.
      * 

* A character is uppercase if its general category type, provided by - * {@link Character#getType(int) getType(codePoint)}, is {@code UPPERCASE_LETTER}. + * {@link Character#getType(int) getType(codePoint)}, is {@code UPPERCASE_LETTER}, + * or it has contributory property Other_Uppercase as defined by the Unicode Standard. *

* The following are examples of uppercase characters: *

@@ -5320,7 +5325,8 @@ class Character implements java.io.Serializable, Comparable {
      * @since   1.5
      */
     public static boolean isUpperCase(int codePoint) {
-        return getType(codePoint) == Character.UPPERCASE_LETTER;
+        return getType(codePoint) == Character.UPPERCASE_LETTER ||
+               CharacterData.of(codePoint).isOtherUppercase(codePoint);
     }
 
     /**
@@ -5724,6 +5730,52 @@ class Character implements java.io.Serializable, Comparable {
         return isJavaIdentifierPart(ch);
     }
 
+    /**
+     * Determines if the specified character (Unicode code point) is an alphabet.
+     * 

+ * A character is considered to be alphabetic if its general category type, + * provided by {@link Character#getType(int) getType(codePoint)}, is any of + * the following: + *

    + *
  • UPPERCASE_LETTER + *
  • LOWERCASE_LETTER + *
  • TITLECASE_LETTER + *
  • MODIFIER_LETTER + *
  • OTHER_LETTER + *
  • LETTER_NUMBER + *
+ * or it has contributory property Other_Alphabetic as defined by the + * Unicode Standard. + * + * @param codePoint the character (Unicode code point) to be tested. + * @return true if the character is a Unicode alphabet + * character, false otherwise. + * @since 1.7 + */ + public static boolean isAlphabetic(int codePoint) { + return (((((1 << Character.UPPERCASE_LETTER) | + (1 << Character.LOWERCASE_LETTER) | + (1 << Character.TITLECASE_LETTER) | + (1 << Character.MODIFIER_LETTER) | + (1 << Character.OTHER_LETTER) | + (1 << Character.LETTER_NUMBER)) >> getType(codePoint)) & 1) != 0) || + CharacterData.of(codePoint).isOtherAlphabetic(codePoint); + } + + /** + * Determines if the specified character (Unicode code point) is a CJKV + * (Chinese, Japanese, Korean and Vietnamese) ideograph, as defined by + * the Unicode Standard. + * + * @param codePoint the character (Unicode code point) to be tested. + * @return true if the character is a Unicode ideograph + * character, false otherwise. + * @since 1.7 + */ + public static boolean isIdeographic(int codePoint) { + return CharacterData.of(codePoint).isIdeographic(codePoint); + } + /** * Determines if the specified character is * permissible as the first character in a Java identifier. @@ -6430,7 +6482,7 @@ class Character implements java.io.Serializable, Comparable { /** * Determines if the specified character is a Unicode space character. * A character is considered to be a space character if and only if - * it is specified to be a space character by the Unicode standard. This + * it is specified to be a space character by the Unicode Standard. This * method returns true if the character's general category type is any of * the following: *
    @@ -6458,7 +6510,7 @@ class Character implements java.io.Serializable, Comparable { * Determines if the specified character (Unicode code point) is a * Unicode space character. A character is considered to be a * space character if and only if it is specified to be a space - * character by the Unicode standard. This method returns true if + * character by the Unicode Standard. This method returns true if * the character's general category type is any of the following: * *
      @@ -6908,7 +6960,7 @@ class Character implements java.io.Serializable, Comparable { * @since 1.4 */ static char[] toUpperCaseCharArray(int codePoint) { - // As of Unicode 4.0, 1:M uppercasings only happen in the BMP. + // As of Unicode 6.0, 1:M uppercasings only happen in the BMP. assert isBmpCodePoint(codePoint); return CharacterData.of(codePoint).toUpperCaseCharArray(codePoint); } @@ -6941,7 +6993,7 @@ class Character implements java.io.Serializable, Comparable { * Note: if the specified character is not assigned a name by * the UnicodeData file (part of the Unicode Character * Database maintained by the Unicode Consortium), the returned - * name is the same as the result of expression + * name is the same as the result of expression. * *
      {@code * Character.UnicodeBlock.of(codePoint).toString().replace('_', ' ') diff --git a/src/share/classes/java/lang/CharacterData.java b/src/share/classes/java/lang/CharacterData.java index af86462b071c89a19b3d6acd3dc9c9ac8e5b5d1d..597f98c443a4a50f60d6995f9fd6132502eab2e6 100644 --- a/src/share/classes/java/lang/CharacterData.java +++ b/src/share/classes/java/lang/CharacterData.java @@ -46,10 +46,27 @@ abstract class CharacterData { int toUpperCaseEx(int ch) { return toUpperCase(ch); } + char[] toUpperCaseCharArray(int ch) { return null; } + boolean isOtherLowercase(int ch) { + return false; + } + + boolean isOtherUppercase(int ch) { + return false; + } + + boolean isOtherAlphabetic(int ch) { + return false; + } + + boolean isIdeographic(int ch) { + return false; + } + // Character <= 0xff (basic latin) is handled by internal fast-path // to avoid initializing large tables. // Note: performance of this "fast-path" code may be sub-optimal diff --git a/src/share/classes/java/lang/Error.java b/src/share/classes/java/lang/Error.java index 1c5c50797f497d0e0dd2fc48833bdbeb78be56bb..d18c15f84ce638275ec5e74470bd8f2a73636556 100644 --- a/src/share/classes/java/lang/Error.java +++ b/src/share/classes/java/lang/Error.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,7 +79,7 @@ public class Error extends Throwable { * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is + * {@link #getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @since 1.4 @@ -90,13 +90,13 @@ public class Error extends Throwable { /** * Constructs a new error with the specified cause and a detail - * message of (cause==null ? null : cause.toString()) (which - * typically contains the class and detail message of cause). + * message of {@code (cause==null ? null : cause.toString())} (which + * typically contains the class and detail message of {@code cause}). * This constructor is useful for errors that are little more than * wrappers for other throwables. * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is + * {@link #getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @since 1.4 @@ -104,4 +104,25 @@ public class Error extends Throwable { public Error(Throwable cause) { super(cause); } + + /** + * Constructs a new error with the specified detail message, + * cause, suppression enabled or disabled, and writable stack + * trace enabled or disabled. + * + * @param message the detail message. + * @param cause the cause. (A {@code null} value is permitted, + * and indicates that the cause is nonexistent or unknown.) + * @param enableSuppression whether or not suppression is enabled + * or disabled + * @param writableStackTrace whether or not the stack trace should + * be writable + * + * @since 1.7 + */ + protected Error(String message, Throwable cause, + boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } } diff --git a/src/share/classes/java/lang/Exception.java b/src/share/classes/java/lang/Exception.java index 944aa052369c03c3244a1a8b1446df3a11407939..0bcbf9cd045faaa88dbf82c5aa505764bd6526a5 100644 --- a/src/share/classes/java/lang/Exception.java +++ b/src/share/classes/java/lang/Exception.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,4 +101,24 @@ public class Exception extends Throwable { public Exception(Throwable cause) { super(cause); } + + /** + * Constructs a new exception with the specified detail message, + * cause, suppression enabled or disabled, and writable stack + * trace enabled or disabled. + * + * @param message the detail message. + * @param cause the cause. (A {@code null} value is permitted, + * and indicates that the cause is nonexistent or unknown.) + * @param enableSuppression whether or not suppression is enabled + * or disabled + * @param writableStackTrace whether or not the stack trace should + * be writable + * @since 1.7 + */ + protected Exception(String message, Throwable cause, + boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } } diff --git a/src/share/classes/java/lang/NullPointerException.java b/src/share/classes/java/lang/NullPointerException.java index 0472710f23f786c602993b4d8b5f19156d6fa6a9..5b87ec4fd7c96bf2f7e70e68c8d40e9806c2ca75 100644 --- a/src/share/classes/java/lang/NullPointerException.java +++ b/src/share/classes/java/lang/NullPointerException.java @@ -43,7 +43,8 @@ package java.lang; * * {@code NullPointerException} objects may be constructed by the * virtual machine as if {@linkplain Throwable#Throwable(String, - * Throwable, boolean) suppression were disabled}. + * Throwable, boolean, boolean) suppression were disabled and/or the + * stack trace was not writable}. * * @author unascribed * @since JDK1.0 diff --git a/src/share/classes/java/lang/OutOfMemoryError.java b/src/share/classes/java/lang/OutOfMemoryError.java index 37b0ae6f47694b47258b72b588a29aa228beba98..0f9df4e2f16519225e69515e7bd162d778346c76 100644 --- a/src/share/classes/java/lang/OutOfMemoryError.java +++ b/src/share/classes/java/lang/OutOfMemoryError.java @@ -32,7 +32,8 @@ package java.lang; * * {@code OutOfMemoryError} objects may be constructed by the virtual * machine as if {@linkplain Throwable#Throwable(String, Throwable, - * boolean) suppression were disabled}. + * boolean, boolean) suppression were disabled and/or the stack trace was not + * writable}. * * @author unascribed * @since JDK1.0 diff --git a/src/share/classes/java/lang/ProcessBuilder.java b/src/share/classes/java/lang/ProcessBuilder.java index c580f507d539afaf27262db5c1f51ad41113c453..6caaaeb906d32c24251cb017c313b272e3ba720f 100644 --- a/src/share/classes/java/lang/ProcessBuilder.java +++ b/src/share/classes/java/lang/ProcessBuilder.java @@ -938,6 +938,11 @@ public final class ProcessBuilder * but at the very least the command must be a non-empty list of * non-null strings. * + *

      A minimal set of system dependent environment variables may + * be required to start a process on some operating systems. + * As a result, the subprocess may inherit additional environment variable + * settings beyond those in the process builder's {@link #environment()}. + * *

      If there is a security manager, its * {@link SecurityManager#checkExec checkExec} * method is called with the first component of this object's diff --git a/src/share/classes/java/lang/Runtime.java b/src/share/classes/java/lang/Runtime.java index 5e4a1bceaba594ce03239a46c404e1da481309bf..3fc29d08376b69e3395758bf529fed7e5ded2d94 100644 --- a/src/share/classes/java/lang/Runtime.java +++ b/src/share/classes/java/lang/Runtime.java @@ -544,6 +544,11 @@ public class Runtime { *

      If envp is null, the subprocess inherits the * environment settings of the current process. * + *

      A minimal set of system dependent environment variables may + * be required to start a process on some operating systems. + * As a result, the subprocess may inherit additional environment variable + * settings beyond those in the specified environment. + * *

      {@link ProcessBuilder#start()} is now the preferred way to * start a process with a modified environment. * diff --git a/src/share/classes/java/lang/RuntimeException.java b/src/share/classes/java/lang/RuntimeException.java index 85c0729dc9f902f6cb1627bcdd7fdc60b5abdb9a..c9731e895a9abfba1bcedd07eca3ed9d9f59daa8 100644 --- a/src/share/classes/java/lang/RuntimeException.java +++ b/src/share/classes/java/lang/RuntimeException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,4 +95,25 @@ public class RuntimeException extends Exception { public RuntimeException(Throwable cause) { super(cause); } + + /** + * Constructs a new runtime exception with the specified detail + * message, cause, suppression enabled or disabled, and writable + * stack trace enabled or disabled. + * + * @param message the detail message. + * @param cause the cause. (A {@code null} value is permitted, + * and indicates that the cause is nonexistent or unknown.) + * @param enableSuppression whether or not suppression is enabled + * or disabled + * @param writableStackTrace whether or not the stack trace should + * be writable + * + * @since 1.7 + */ + protected RuntimeException(String message, Throwable cause, + boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } } diff --git a/src/share/classes/java/lang/StringCoding.java b/src/share/classes/java/lang/StringCoding.java index 95e437df532b52be52100f4f8ef6f6e83dcdf765..95fb45ab659cef93dbd096ce4d82c9b8c86a448f 100644 --- a/src/share/classes/java/lang/StringCoding.java +++ b/src/share/classes/java/lang/StringCoding.java @@ -222,13 +222,13 @@ class StringCoding { off = 0; } } + cd.onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE) + .reset(); if (cd instanceof ArrayDecoder) { int clen = ((ArrayDecoder)cd).decode(ba, off, len, ca); return safeTrim(ca, clen, cs, isTrusted); } else { - cd.onMalformedInput(CodingErrorAction.REPLACE) - .onUnmappableCharacter(CodingErrorAction.REPLACE) - .reset(); ByteBuffer bb = ByteBuffer.wrap(ba, off, len); CharBuffer cb = CharBuffer.wrap(ca); try { @@ -356,13 +356,13 @@ class StringCoding { off = 0; } } + ce.onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE) + .reset(); if (ce instanceof ArrayEncoder) { int blen = ((ArrayEncoder)ce).encode(ca, off, len, ba); return safeTrim(ba, blen, cs, isTrusted); } else { - ce.onMalformedInput(CodingErrorAction.REPLACE) - .onUnmappableCharacter(CodingErrorAction.REPLACE) - .reset(); ByteBuffer bb = ByteBuffer.wrap(ba); CharBuffer cb = CharBuffer.wrap(ca, off, len); try { diff --git a/src/share/classes/java/lang/Throwable.java b/src/share/classes/java/lang/Throwable.java index 8468ecf0d300d3e27d9f7b8b3152ed4a8e4ad3d4..d70fe26841ab8e6e86d7c95314aa7a86d54e92bc 100644 --- a/src/share/classes/java/lang/Throwable.java +++ b/src/share/classes/java/lang/Throwable.java @@ -129,16 +129,41 @@ public class Throwable implements Serializable { */ private String detailMessage; + + /** + * Holder class to defer initializing sentinel objects only used + * for serialization. + */ + private static class SentinelHolder { + /** + * {@linkplain #setStackTrace(StackTraceElement[]) Setting the + * stack trace} to a one-element array containing this sentinel + * value indicates future attempts to set the stack trace will be + * ignored. The sentinal is equal to the result of calling:
      + * {@code new StackTraceElement("", "", null, Integer.MIN_VALUE)} + */ + public static final StackTraceElement STACK_TRACE_ELEMENT_SENTINEL = + new StackTraceElement("", "", null, Integer.MIN_VALUE); + + /** + * Sentinel value used in the serial form to indicate an immutable + * stack trace. + */ + public static final StackTraceElement[] STACK_TRACE_SENTINEL = + new StackTraceElement[] {STACK_TRACE_ELEMENT_SENTINEL}; + } + /** * A shared value for an empty stack. */ - private static final StackTraceElement[] EMPTY_STACK = new StackTraceElement[0]; + private static final StackTraceElement[] UNASSIGNED_STACK = new StackTraceElement[0]; /* * To allow Throwable objects to be made immutable and safely * reused by the JVM, such as OutOfMemoryErrors, fields of - * Throwable that are writable in response to user actions, cause - * and suppressedExceptions obey the following protocol: + * Throwable that are writable in response to user actions, cause, + * stackTrace, and suppressedExceptions obey the following + * protocol: * * 1) The fields are initialized to a non-null sentinel value * which indicates the value has logically not been set. @@ -174,10 +199,15 @@ public class Throwable implements Serializable { /** * The stack trace, as returned by {@link #getStackTrace()}. * + * The field is initialized to a zero-length array. A {@code + * null} value of this field indicates subsequent calls to {@link + * #setStackTrace(StackTraceElement[])} and {@link + * #fillInStackTrace()} will be be no-ops. + * * @serial * @since 1.4 */ - private StackTraceElement[] stackTrace; + private StackTraceElement[] stackTrace = UNASSIGNED_STACK; // Setting this static field introduces an acceptable // initialization dependency on a few java.util classes. @@ -284,24 +314,36 @@ public class Throwable implements Serializable { /** * Constructs a new throwable with the specified detail message, - * cause, and {@linkplain #addSuppressed suppression} enabled or - * disabled. If suppression is disabled, {@link #getSuppressed} - * for this object will return a zero-length array and calls to - * {@link #addSuppressed} that would otherwise append an exception - * to the suppressed list will have no effect. + * cause, {@linkplain #addSuppressed suppression} enabled or + * disabled, and writable stack trace enabled or disabled. If + * suppression is disabled, {@link #getSuppressed} for this object + * will return a zero-length array and calls to {@link + * #addSuppressed} that would otherwise append an exception to the + * suppressed list will have no effect. If the writable stack + * trace is false, this constructor will not call {@link + * #fillInStackTrace()}, a {@code null} will be written to the + * {@code stackTrace} field, and subsequent calls to {@code + * fillInStackTrace} and {@link + * #setStackTrace(StackTraceElement[])} will not set the stack + * trace. If the writable stack trace is false, {@link + * #getStackTrace} will return a zero length array. * *

      Note that the other constructors of {@code Throwable} treat - * suppression as being enabled. Subclasses of {@code Throwable} - * should document any conditions under which suppression is - * disabled. Disabling of suppression should only occur in - * exceptional circumstances where special requirements exist, - * such as a virtual machine reusing exception objects under - * low-memory situations. + * suppression as being enabled and the stack trace as being + * writable. Subclasses of {@code Throwable} should document any + * conditions under which suppression is disabled and document + * conditions under which the stack trace is not writable. + * Disabling of suppression should only occur in exceptional + * circumstances where special requirements exist, such as a + * virtual machine reusing exception objects under low-memory + * situations. * * @param message the detail message. * @param cause the cause. (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @param enableSuppression whether or not suppression is enabled or disabled + * @param writableStackTrace whether or not the stack trace should be + * writable * * @see OutOfMemoryError * @see NullPointerException @@ -309,8 +351,13 @@ public class Throwable implements Serializable { * @since 1.7 */ protected Throwable(String message, Throwable cause, - boolean enableSuppression) { - fillInStackTrace(); + boolean enableSuppression, + boolean writableStackTrace) { + if (writableStackTrace) { + fillInStackTrace(); + } else { + stackTrace = null; + } detailMessage = message; this.cause = cause; if (!enableSuppression) @@ -707,10 +754,22 @@ public class Throwable implements Serializable { * {@code Throwable} object information about the current state of * the stack frames for the current thread. * + *

      If the stack trace of this {@code Throwable} {@linkplain + * Throwable#Throwable(String, Throwable, boolean, boolean) is not + * writable}, calling this method has no effect. + * * @return a reference to this {@code Throwable} instance. * @see java.lang.Throwable#printStackTrace() */ - public synchronized native Throwable fillInStackTrace(); + public synchronized Throwable fillInStackTrace() { + if (stackTrace != null) { + fillInStackTrace(0); + stackTrace = UNASSIGNED_STACK; + } + return this; + } + + private native Throwable fillInStackTrace(int dummy); /** * Provides programmatic access to the stack trace information printed by @@ -740,12 +799,15 @@ public class Throwable implements Serializable { } private synchronized StackTraceElement[] getOurStackTrace() { - // Initialize stack trace if this is the first call to this method - if (stackTrace == null) { + // Initialize stack trace field with information from + // backtrace if this is the first call to this method + if (stackTrace == UNASSIGNED_STACK) { int depth = getStackTraceDepth(); stackTrace = new StackTraceElement[depth]; for (int i=0; i < depth; i++) stackTrace[i] = getStackTraceElement(i); + } else if (stackTrace == null) { + return UNASSIGNED_STACK; } return stackTrace; } @@ -761,6 +823,11 @@ public class Throwable implements Serializable { * when a throwable is constructed or deserialized when a throwable is * read from a serialization stream. * + *

      If the stack trace of this {@code Throwable} {@linkplain + * Throwable#Throwable(String, Throwable, boolean, boolean) is not + * writable}, calling this method has no effect other than + * validating its argument. + * * @param stackTrace the stack trace elements to be associated with * this {@code Throwable}. The specified array is copied by this * call; changes in the specified array after the method invocation @@ -768,18 +835,22 @@ public class Throwable implements Serializable { * trace. * * @throws NullPointerException if {@code stackTrace} is - * {@code null}, or if any of the elements of + * {@code null} or if any of the elements of * {@code stackTrace} are {@code null} * * @since 1.4 */ public void setStackTrace(StackTraceElement[] stackTrace) { + // Validate argument StackTraceElement[] defensiveCopy = stackTrace.clone(); - for (int i = 0; i < defensiveCopy.length; i++) + for (int i = 0; i < defensiveCopy.length; i++) { if (defensiveCopy[i] == null) throw new NullPointerException("stackTrace[" + i + "]"); + } synchronized (this) { + if (this.stackTrace == null) // Immutable stack + return; this.stackTrace = defensiveCopy; } } @@ -808,7 +879,11 @@ public class Throwable implements Serializable { * well-formedness constraints on fields. Null entries and * self-pointers are not allowed in the list of {@code * suppressedExceptions}. Null entries are not allowed for stack - * trace elements. + * trace elements. A null stack trace in the serial form results + * in a zero-length stack element array. A single-element stack + * trace whose entry is equal to {@code new StackTraceElement("", + * "", null, Integer.MIN_VALUE)} results in a {@code null} {@code + * stackTrace} field. * * Note that there are no constraints on the value the {@code * cause} field can hold; both {@code null} and {@code this} are @@ -837,26 +912,60 @@ public class Throwable implements Serializable { suppressedExceptions = suppressed; } // else a null suppressedExceptions field remains null + /* + * For zero-length stack traces, use a clone of + * UNASSIGNED_STACK rather than UNASSIGNED_STACK itself to + * allow identity comparison against UNASSIGNED_STACK in + * getOurStackTrace. The identity of UNASSIGNED_STACK in + * stackTrace indicates to the getOurStackTrace method that + * the stackTrace needs to be constructed from the information + * in backtrace. + */ if (stackTrace != null) { - for (StackTraceElement ste : stackTrace) { - if (ste == null) - throw new NullPointerException("null StackTraceElement in serial stream. "); + if (stackTrace.length == 0) { + stackTrace = UNASSIGNED_STACK.clone(); + } else if (stackTrace.length == 1 && + // Check for the marker of an immutable stack trace + SentinelHolder.STACK_TRACE_ELEMENT_SENTINEL.equals(stackTrace[0])) { + stackTrace = null; + } else { // Verify stack trace elements are non-null. + for(StackTraceElement ste : stackTrace) { + if (ste == null) + throw new NullPointerException("null StackTraceElement in serial stream. "); + } } } else { - // A null stackTrace field in the serial form can result from - // an exception serialized without that field in older JDK releases. - stackTrace = EMPTY_STACK; + // A null stackTrace field in the serial form can result + // from an exception serialized without that field in + // older JDK releases; treat such exceptions as having + // empty stack traces. + stackTrace = UNASSIGNED_STACK.clone(); } - } /** * Write a {@code Throwable} object to a stream. + * + * A {@code null} stack trace field is represented in the serial + * form as a one-element array whose element is equal to {@code + * new StackTraceElement("", "", null, Integer.MIN_VALUE)}. */ private synchronized void writeObject(ObjectOutputStream s) throws IOException { - getOurStackTrace(); // Ensure that stackTrace field is initialized. - s.defaultWriteObject(); + // Ensure that the stackTrace field is initialized to a + // non-null value, if appropriate. As of JDK 7, a null stack + // trace field is a valid value indicating the stack trace + // should not be set. + getOurStackTrace(); + + StackTraceElement[] oldStackTrace = stackTrace; + try { + if (stackTrace == null) + stackTrace = SentinelHolder.STACK_TRACE_SENTINEL; + s.defaultWriteObject(); + } finally { + stackTrace = oldStackTrace; + } } /** @@ -866,8 +975,8 @@ public class Throwable implements Serializable { * try}-with-resources statement. * *

      The suppression behavior is enabled unless disabled - * {@linkplain #Throwable(String, Throwable, boolean) via a - * constructor}. When suppression is disabled, this method does + * {@linkplain #Throwable(String, Throwable, boolean, boolean) via + * a constructor}. When suppression is disabled, this method does * nothing other than to validate its argument. * *

      Note that when one exception {@linkplain @@ -933,8 +1042,8 @@ public class Throwable implements Serializable { * statement, in order to deliver this exception. * * If no exceptions were suppressed or {@linkplain - * Throwable(String, Throwable, boolean) suppression is disabled}, - * an empty array is returned. + * #Throwable(String, Throwable, boolean, boolean) suppression is + * disabled}, an empty array is returned. * * @return an array containing all of the exceptions that were * suppressed to deliver this exception. diff --git a/src/share/classes/java/net/HttpCookie.java b/src/share/classes/java/net/HttpCookie.java index e5124f9181788a1cd7d472ba29ce491569dfa499..34e60126912c9c1fe55c61657715d620a97b145f 100644 --- a/src/share/classes/java/net/HttpCookie.java +++ b/src/share/classes/java/net/HttpCookie.java @@ -34,6 +34,7 @@ import java.util.Date; import java.lang.NullPointerException; // for javadoc import java.util.Locale; +import java.util.Objects; /** * An HttpCookie object represents an http cookie, which carries state @@ -817,7 +818,7 @@ public final class HttpCookie implements Cloneable { // 3. and have same path (case-sensitive). return equalsIgnoreCase(getName(), other.getName()) && equalsIgnoreCase(getDomain(), other.getDomain()) && - equals(getPath(), other.getPath()); + Objects.equals(getPath(), other.getPath()); } @@ -1162,14 +1163,6 @@ public final class HttpCookie implements Cloneable { return false; } - private static boolean equals(String s, String t) { - if (s == t) return true; - if ((s != null) && (t != null)) { - return s.equals(t); - } - return false; - } - private static boolean startsWithIgnoreCase(String s, String start) { if (s == null || start == null) return false; diff --git a/src/share/classes/java/nio/charset/Charset.java b/src/share/classes/java/nio/charset/Charset.java index 51e21c39b6b079cad17e6f31ba2002b3dfbeb78d..51dbe1504dc4c7f13f7b13ee59e2a36ed8e95880 100644 --- a/src/share/classes/java/nio/charset/Charset.java +++ b/src/share/classes/java/nio/charset/Charset.java @@ -143,6 +143,8 @@ import sun.security.action.GetPropertyAction; * *

      Standard charsets

      * + * + * *

      Every implementation of the Java platform is required to support the * following standard charsets. Consult the release documentation for your * implementation to see if any other charsets are supported. The behavior @@ -213,6 +215,8 @@ import sun.security.action.GetPropertyAction; * determined during virtual-machine startup and typically depends upon the * locale and charset being used by the underlying operating system.

      * + *

      The {@link StandardCharset} class defines constants for each of the + * standard charsets. * *

      Terminology

      * diff --git a/src/share/classes/java/nio/charset/StandardCharset.java b/src/share/classes/java/nio/charset/StandardCharset.java new file mode 100644 index 0000000000000000000000000000000000000000..edec058bc45d382fb3d2f58f750fe042ed5ee19b --- /dev/null +++ b/src/share/classes/java/nio/charset/StandardCharset.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.nio.charset; + +/** + * Constant definitions for the standard {@link Charset Charsets}. These + * charsets are guaranteed to be available on every implementation of the Java + * platform. + * + * @see
      Standard Charsets + * @since 1.7 + */ +public final class StandardCharset { + + private StandardCharset() { + throw new AssertionError("No java.nio.charset.StandardCharset instances for you!"); + } + /** + * Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the + * Unicode character set + */ + public static final Charset US_ASCII = Charset.forName("US-ASCII"); + /** + * ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 + */ + public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); + /** + * Eight-bit UCS Transformation Format + */ + public static final Charset UTF_8 = Charset.forName("UTF-8"); + /** + * Sixteen-bit UCS Transformation Format, big-endian byte order + */ + public static final Charset UTF_16BE = Charset.forName("UTF-16BE"); + /** + * Sixteen-bit UCS Transformation Format, little-endian byte order + */ + public static final Charset UTF_16LE = Charset.forName("UTF-16LE"); + /** + * Sixteen-bit UCS Transformation Format, byte order identified by an + * optional byte-order mark + */ + public static final Charset UTF_16 = Charset.forName("UTF-16"); +} diff --git a/src/share/classes/java/nio/file/FileSystem.java b/src/share/classes/java/nio/file/FileSystem.java index 97dfc4649fc3b7ebfcd69f16bbc01f1da59fe28a..9091f4aae6ea8e08ad00dc250f9197998ed4ee1e 100644 --- a/src/share/classes/java/nio/file/FileSystem.java +++ b/src/share/classes/java/nio/file/FileSystem.java @@ -391,6 +391,13 @@ public abstract class FileSystem * character is used to separate the subpatterns. Groups cannot be nested. *

      * + *
    • Leading period/dot characters in file name are + * treated as regular characters in match operations. For example, + * the {@code "*"} glob pattern matches file name {@code ".login"}. + * The {@link Files#isHidden} method may be used to test whether a file + * is considered hidden. + *

    • + * *
    • All other characters match themselves in an implementation * dependent manner. This includes characters representing any {@link * FileSystem#getSeparator name-separators}.

    • diff --git a/src/share/classes/java/nio/file/Path.java b/src/share/classes/java/nio/file/Path.java index ccf0c808d61ed3c03d9a6e03a20a92c30b6a9a0b..2d2e977d49de54367f04e09978ccd9fc0a94c54b 100644 --- a/src/share/classes/java/nio/file/Path.java +++ b/src/share/classes/java/nio/file/Path.java @@ -72,7 +72,7 @@ import java.util.Iterator; * directory and is UTF-8 encoded. *
        *     Path path = FileSystems.getDefault().getPath("logs", "access.log");
      - *     BufferReader reader = Files.newBufferedReader(path, Charset.forName("UTF-8"));
      + *     BufferReader reader = Files.newBufferedReader(path, StandardCharset.UTF_8);
        * 
      * *

      Interoperability

      diff --git a/src/share/classes/java/sql/BatchUpdateException.java b/src/share/classes/java/sql/BatchUpdateException.java index a95e2bfa419a52d76166994be82a4eb65fee8ae5..4fa6241169fc21e37ecf008e735db988c73b1c26 100644 --- a/src/share/classes/java/sql/BatchUpdateException.java +++ b/src/share/classes/java/sql/BatchUpdateException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package java.sql; +import java.util.Arrays; + /** * The subclass of {@link SQLException} thrown when an error * occurs during a batch update operation. In addition to the @@ -77,8 +79,7 @@ public class BatchUpdateException extends SQLException { */ public BatchUpdateException( String reason, String SQLState, int vendorCode, int[] updateCounts ) { - super(reason, SQLState, vendorCode); - this.updateCounts = updateCounts; + this(reason, SQLState, vendorCode, updateCounts, null); } /** @@ -105,8 +106,7 @@ public class BatchUpdateException extends SQLException { */ public BatchUpdateException(String reason, String SQLState, int[] updateCounts) { - super(reason, SQLState); - this.updateCounts = updateCounts; + this(reason, SQLState, 0, updateCounts, null); } /** @@ -132,8 +132,7 @@ public class BatchUpdateException extends SQLException { * @since 1.2 */ public BatchUpdateException(String reason, int[] updateCounts) { - super(reason); - this.updateCounts = updateCounts; + this(reason, null, 0, updateCounts, null); } /** @@ -156,8 +155,7 @@ public class BatchUpdateException extends SQLException { * @since 1.2 */ public BatchUpdateException(int[] updateCounts) { - super(); - this.updateCounts = updateCounts; + this(null, null, 0, updateCounts, null); } /** @@ -172,8 +170,7 @@ public class BatchUpdateException extends SQLException { * @since 1.2 */ public BatchUpdateException() { - super(); - this.updateCounts = null; + this(null, null, 0, null, null); } /** @@ -191,8 +188,7 @@ public class BatchUpdateException extends SQLException { * @since 1.6 */ public BatchUpdateException(Throwable cause) { - super(cause); - this.updateCounts = null; + this(null, null, 0, null, cause); } /** @@ -218,8 +214,7 @@ public class BatchUpdateException extends SQLException { * @since 1.6 */ public BatchUpdateException(int []updateCounts , Throwable cause) { - super(cause); - this.updateCounts = updateCounts; + this(null, null, 0, updateCounts, cause); } /** @@ -243,8 +238,7 @@ public class BatchUpdateException extends SQLException { * @since 1.6 */ public BatchUpdateException(String reason, int []updateCounts, Throwable cause) { - super(reason,cause); - this.updateCounts = updateCounts; + this(reason, null, 0, updateCounts, cause); } /** @@ -269,8 +263,7 @@ public class BatchUpdateException extends SQLException { */ public BatchUpdateException(String reason, String SQLState, int []updateCounts, Throwable cause) { - super(reason,SQLState,cause); - this.updateCounts = updateCounts; + this(reason, SQLState, 0, updateCounts, cause); } /** @@ -297,8 +290,8 @@ public class BatchUpdateException extends SQLException { */ public BatchUpdateException(String reason, String SQLState, int vendorCode, int []updateCounts,Throwable cause) { - super(reason,SQLState,vendorCode,cause); - this.updateCounts = updateCounts; + super(reason, SQLState, vendorCode, cause); + this.updateCounts = (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length); } /** @@ -332,7 +325,7 @@ public class BatchUpdateException extends SQLException { * @since 1.3 */ public int[] getUpdateCounts() { - return updateCounts; + return (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length); } /** @@ -340,7 +333,7 @@ public class BatchUpdateException extends SQLException { * @serial * @since 1.2 */ - private int[] updateCounts; + private final int[] updateCounts; private static final long serialVersionUID = 5977529877145521757L; } diff --git a/src/share/classes/java/util/AbstractSet.java b/src/share/classes/java/util/AbstractSet.java index b99da00826dea463d491209d459e758218c284e4..1f1a49c250e4cdf058c12cdaaca3499c195baeb6 100644 --- a/src/share/classes/java/util/AbstractSet.java +++ b/src/share/classes/java/util/AbstractSet.java @@ -156,9 +156,11 @@ public abstract class AbstractSet extends AbstractCollection implements Se * @throws UnsupportedOperationException if the removeAll operation * is not supported by this set * @throws ClassCastException if the class of an element of this set - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this set contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) * @see #contains(Object) diff --git a/src/share/classes/java/util/ArrayList.java b/src/share/classes/java/util/ArrayList.java index 128ec5b5fd864259cabdf53d4d1ce4a06d12f2a5..14b0fbf5599b76189fd30f5d89fa6daeba700814 100644 --- a/src/share/classes/java/util/ArrayList.java +++ b/src/share/classes/java/util/ArrayList.java @@ -628,9 +628,11 @@ public class ArrayList extends AbstractList * @param c collection containing elements to be removed from this list * @return {@code true} if this list changed as a result of the call * @throws ClassCastException if the class of an element of this list - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this list contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see Collection#contains(Object) */ @@ -646,9 +648,11 @@ public class ArrayList extends AbstractList * @param c collection containing elements to be retained in this list * @return {@code true} if this list changed as a result of the call * @throws ClassCastException if the class of an element of this list - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this list contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see Collection#contains(Object) */ diff --git a/src/share/classes/java/util/Collection.java b/src/share/classes/java/util/Collection.java index 7d0bcdc5aa366753511117e6ccbe6a4e43ca8b59..b8f5869e861ab449d4b91628f9c2292069f553b8 100644 --- a/src/share/classes/java/util/Collection.java +++ b/src/share/classes/java/util/Collection.java @@ -60,7 +60,8 @@ package java.util; * but is not required to, throw the exception if the collection to be added * is empty. * - *

      Some collection implementations have restrictions on the elements that + *

      + * Some collection implementations have restrictions on the elements that * they may contain. For example, some implementations prohibit null elements, * and some have restrictions on the types of their elements. Attempting to * add an ineligible element throws an unchecked exception, typically @@ -152,9 +153,11 @@ public interface Collection extends Iterable { * @return true if this collection contains the specified * element * @throws ClassCastException if the type of the specified element - * is incompatible with this collection (optional) + * is incompatible with this collection + * (optional) * @throws NullPointerException if the specified element is null and this - * collection does not permit null elements (optional) + * collection does not permit null elements + * (optional) */ boolean contains(Object o); @@ -279,9 +282,11 @@ public interface Collection extends Iterable { * @param o element to be removed from this collection, if present * @return true if an element was removed as a result of this call * @throws ClassCastException if the type of the specified element - * is incompatible with this collection (optional) + * is incompatible with this collection + * (optional) * @throws NullPointerException if the specified element is null and this - * collection does not permit null elements (optional) + * collection does not permit null elements + * (optional) * @throws UnsupportedOperationException if the remove operation * is not supported by this collection */ @@ -299,10 +304,13 @@ public interface Collection extends Iterable { * in the specified collection * @throws ClassCastException if the types of one or more elements * in the specified collection are incompatible with this - * collection (optional) + * collection + * (optional) * @throws NullPointerException if the specified collection contains one * or more null elements and this collection does not permit null - * elements (optional), or if the specified collection is null + * elements + * (optional), + * or if the specified collection is null. * @see #contains(Object) */ boolean containsAll(Collection c); @@ -346,10 +354,13 @@ public interface Collection extends Iterable { * is not supported by this collection * @throws ClassCastException if the types of one or more elements * in this collection are incompatible with the specified - * collection (optional) + * collection + * (optional) * @throws NullPointerException if this collection contains one or more * null elements and the specified collection does not support - * null elements (optional), or if the specified collection is null + * null elements + * (optional), + * or if the specified collection is null * @see #remove(Object) * @see #contains(Object) */ @@ -367,10 +378,13 @@ public interface Collection extends Iterable { * is not supported by this collection * @throws ClassCastException if the types of one or more elements * in this collection are incompatible with the specified - * collection (optional) + * collection + * (optional) * @throws NullPointerException if this collection contains one or more * null elements and the specified collection does not permit null - * elements (optional), or if the specified collection is null + * elements + * (optional), + * or if the specified collection is null * @see #remove(Object) * @see #contains(Object) */ diff --git a/src/share/classes/java/util/Collections.java b/src/share/classes/java/util/Collections.java index 80221c8795b160277be0a21123a4ca7c5ded2c65..d15a4292ddd818065a4570a0c5ba24ed19497724 100644 --- a/src/share/classes/java/util/Collections.java +++ b/src/share/classes/java/util/Collections.java @@ -3746,9 +3746,10 @@ public class Collections { * @throws NullPointerException if either collection is {@code null}. * @throws NullPointerException if one collection contains a {@code null} * element and {@code null} is not an eligible element for the other collection. - * (optional) + * (optional) * @throws ClassCastException if one collection contains an element that is - * of a type which is ineligible for the other collection. (optional) + * of a type which is ineligible for the other collection. + * (optional) * @since 1.5 */ public static boolean disjoint(Collection c1, Collection c2) { diff --git a/src/share/classes/java/util/Deque.java b/src/share/classes/java/util/Deque.java index b5516211be635b87c03d005c2d322643d7fdc9ba..051ae9cca46b7aa99106e6f2083d400f3745e3ae 100644 --- a/src/share/classes/java/util/Deque.java +++ b/src/share/classes/java/util/Deque.java @@ -351,9 +351,11 @@ public interface Deque extends Queue { * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) + * is incompatible with this deque + * (optional) * @throws NullPointerException if the specified element is null and this - * deque does not permit null elements (optional) + * deque does not permit null elements + * (optional) */ boolean removeFirstOccurrence(Object o); @@ -369,9 +371,11 @@ public interface Deque extends Queue { * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) + * is incompatible with this deque + * (optional) * @throws NullPointerException if the specified element is null and this - * deque does not permit null elements (optional) + * deque does not permit null elements + * (optional) */ boolean removeLastOccurrence(Object o); @@ -527,9 +531,11 @@ public interface Deque extends Queue { * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) + * is incompatible with this deque + * (optional) * @throws NullPointerException if the specified element is null and this - * deque does not permit null elements (optional) + * deque does not permit null elements + * (optional) */ boolean remove(Object o); @@ -542,9 +548,11 @@ public interface Deque extends Queue { * @param o element whose presence in this deque is to be tested * @return true if this deque contains the specified element * @throws ClassCastException if the type of the specified element - * is incompatible with this deque (optional) + * is incompatible with this deque + * (optional) * @throws NullPointerException if the specified element is null and this - * deque does not permit null elements (optional) + * deque does not permit null elements + * (optional) */ boolean contains(Object o); diff --git a/src/share/classes/java/util/List.java b/src/share/classes/java/util/List.java index 638fcc3a7d1276abb5585f8bee8362465077a9a6..d3d2a1b8947e617c8f51ee4d08663469722c110a 100644 --- a/src/share/classes/java/util/List.java +++ b/src/share/classes/java/util/List.java @@ -134,9 +134,11 @@ public interface List extends Collection { * @param o element whose presence in this list is to be tested * @return true if this list contains the specified element * @throws ClassCastException if the type of the specified element - * is incompatible with this list (optional) + * is incompatible with this list + * (optional) * @throws NullPointerException if the specified element is null and this - * list does not permit null elements (optional) + * list does not permit null elements + * (optional) */ boolean contains(Object o); @@ -245,9 +247,11 @@ public interface List extends Collection { * @param o element to be removed from this list, if present * @return true if this list contained the specified element * @throws ClassCastException if the type of the specified element - * is incompatible with this list (optional) + * is incompatible with this list + * (optional) * @throws NullPointerException if the specified element is null and this - * list does not permit null elements (optional) + * list does not permit null elements + * (optional) * @throws UnsupportedOperationException if the remove operation * is not supported by this list */ @@ -265,10 +269,13 @@ public interface List extends Collection { * specified collection * @throws ClassCastException if the types of one or more elements * in the specified collection are incompatible with this - * list (optional) + * list + * (optional) * @throws NullPointerException if the specified collection contains one * or more null elements and this list does not permit null - * elements (optional), or if the specified collection is null + * elements + * (optional), + * or if the specified collection is null * @see #contains(Object) */ boolean containsAll(Collection c); @@ -334,9 +341,11 @@ public interface List extends Collection { * @throws UnsupportedOperationException if the removeAll operation * is not supported by this list * @throws ClassCastException if the class of an element of this list - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this list contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) * @see #contains(Object) @@ -354,9 +363,11 @@ public interface List extends Collection { * @throws UnsupportedOperationException if the retainAll operation * is not supported by this list * @throws ClassCastException if the class of an element of this list - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this list contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) * @see #contains(Object) @@ -493,9 +504,11 @@ public interface List extends Collection { * @return the index of the first occurrence of the specified element in * this list, or -1 if this list does not contain the element * @throws ClassCastException if the type of the specified element - * is incompatible with this list (optional) + * is incompatible with this list + * (optional) * @throws NullPointerException if the specified element is null and this - * list does not permit null elements (optional) + * list does not permit null elements + * (optional) */ int indexOf(Object o); @@ -510,9 +523,11 @@ public interface List extends Collection { * @return the index of the last occurrence of the specified element in * this list, or -1 if this list does not contain the element * @throws ClassCastException if the type of the specified element - * is incompatible with this list (optional) + * is incompatible with this list + * (optional) * @throws NullPointerException if the specified element is null and this - * list does not permit null elements (optional) + * list does not permit null elements + * (optional) */ int lastIndexOf(Object o); diff --git a/src/share/classes/java/util/ListIterator.java b/src/share/classes/java/util/ListIterator.java index cad6d9bae2fa217be404c5e2461b8ae04b75918a..92859173a561275efec9a5867941d39d370e468b 100644 --- a/src/share/classes/java/util/ListIterator.java +++ b/src/share/classes/java/util/ListIterator.java @@ -173,9 +173,9 @@ public interface ListIterator extends Iterator { /** * Inserts the specified element into the list (optional operation). - * The element is inserted immediately before the next element that - * would be returned by {@link #next}, if any, and after the next - * element that would be returned by {@link #previous}, if any. (If the + * The element is inserted immediately before the element that + * would be returned by {@link #next}, if any, and after the element + * that would be returned by {@link #previous}, if any. (If the * list contains no elements, the new element becomes the sole element * on the list.) The new element is inserted before the implicit * cursor: a subsequent call to {@code next} would be unaffected, and a diff --git a/src/share/classes/java/util/Map.java b/src/share/classes/java/util/Map.java index 2f8f1315c1fe22604a9d9358083ccf247aa0e009..ccdb28813a2f5933cb89c7d0018a3b72c7e79ac6 100644 --- a/src/share/classes/java/util/Map.java +++ b/src/share/classes/java/util/Map.java @@ -144,9 +144,11 @@ public interface Map { * @return true if this map contains a mapping for the specified * key * @throws ClassCastException if the key is of an inappropriate type for - * this map (optional) + * this map + * (optional) * @throws NullPointerException if the specified key is null and this map - * does not permit null keys (optional) + * does not permit null keys + * (optional) */ boolean containsKey(Object key); @@ -162,9 +164,11 @@ public interface Map { * @return true if this map maps one or more keys to the * specified value * @throws ClassCastException if the value is of an inappropriate type for - * this map (optional) + * this map + * (optional) * @throws NullPointerException if the specified value is null and this - * map does not permit null values (optional) + * map does not permit null values + * (optional) */ boolean containsValue(Object value); @@ -187,9 +191,11 @@ public interface Map { * @return the value to which the specified key is mapped, or * {@code null} if this map contains no mapping for the key * @throws ClassCastException if the key is of an inappropriate type for - * this map (optional) + * this map + * (optional) * @throws NullPointerException if the specified key is null and this map - * does not permit null keys (optional) + * does not permit null keys + * (optional) */ V get(Object key); @@ -245,9 +251,11 @@ public interface Map { * @throws UnsupportedOperationException if the remove operation * is not supported by this map * @throws ClassCastException if the key is of an inappropriate type for - * this map (optional) + * this map + * (optional) * @throws NullPointerException if the specified key is null and this - * map does not permit null keys (optional) + * map does not permit null keys + * (optional) */ V remove(Object key); @@ -466,4 +474,5 @@ public interface Map { * @see #equals(Object) */ int hashCode(); + } diff --git a/src/share/classes/java/util/Set.java b/src/share/classes/java/util/Set.java index 8d54f4f9d455865cd9e1831656c33411604bc36f..004e9708e562c4408f9395781183be546cd9f375 100644 --- a/src/share/classes/java/util/Set.java +++ b/src/share/classes/java/util/Set.java @@ -110,9 +110,11 @@ public interface Set extends Collection { * @param o element whose presence in this set is to be tested * @return true if this set contains the specified element * @throws ClassCastException if the type of the specified element - * is incompatible with this set (optional) + * is incompatible with this set + * (optional) * @throws NullPointerException if the specified element is null and this - * set does not permit null elements (optional) + * set does not permit null elements + * (optional) */ boolean contains(Object o); @@ -236,9 +238,11 @@ public interface Set extends Collection { * @param o object to be removed from this set, if present * @return true if this set contained the specified element * @throws ClassCastException if the type of the specified element - * is incompatible with this set (optional) + * is incompatible with this set + * (optional) * @throws NullPointerException if the specified element is null and this - * set does not permit null elements (optional) + * set does not permit null elements + * (optional) * @throws UnsupportedOperationException if the remove operation * is not supported by this set */ @@ -257,10 +261,13 @@ public interface Set extends Collection { * specified collection * @throws ClassCastException if the types of one or more elements * in the specified collection are incompatible with this - * set (optional) + * set + * (optional) * @throws NullPointerException if the specified collection contains one * or more null elements and this set does not permit null - * elements (optional), or if the specified collection is null + * elements + * (optional), + * or if the specified collection is null * @see #contains(Object) */ boolean containsAll(Collection c); @@ -302,9 +309,11 @@ public interface Set extends Collection { * @throws UnsupportedOperationException if the retainAll operation * is not supported by this set * @throws ClassCastException if the class of an element of this set - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this set contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) */ @@ -322,9 +331,11 @@ public interface Set extends Collection { * @throws UnsupportedOperationException if the removeAll operation * is not supported by this set * @throws ClassCastException if the class of an element of this set - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this set contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) * @see #contains(Object) diff --git a/src/share/classes/java/util/Vector.java b/src/share/classes/java/util/Vector.java index 0c89889b19bd13f884183a1386da94db0d2c258a..0d69591abce962f3230d8a4a02af21a505db2443 100644 --- a/src/share/classes/java/util/Vector.java +++ b/src/share/classes/java/util/Vector.java @@ -893,10 +893,13 @@ public class Vector * @return true if this Vector changed as a result of the call * @throws ClassCastException if the types of one or more elements * in this vector are incompatible with the specified - * collection (optional) + * collection + * (optional) * @throws NullPointerException if this vector contains one or more null * elements and the specified collection does not support null - * elements (optional), or if the specified collection is null + * elements + * (optional), + * or if the specified collection is null * @since 1.2 */ public synchronized boolean removeAll(Collection c) { @@ -913,10 +916,13 @@ public class Vector * @return true if this Vector changed as a result of the call * @throws ClassCastException if the types of one or more elements * in this vector are incompatible with the specified - * collection (optional) + * collection + * (optional) * @throws NullPointerException if this vector contains one or more null * elements and the specified collection does not support null - * elements (optional), or if the specified collection is null + * elements + * (optional), + * or if the specified collection is null * @since 1.2 */ public synchronized boolean retainAll(Collection c) { diff --git a/src/share/classes/java/util/concurrent/BlockingDeque.java b/src/share/classes/java/util/concurrent/BlockingDeque.java index 3134eae8ec5d5c64abc84aebd6968149d49e193e..7f37f7e66ea3ebe4d47f9edd1cbcad350b3622f0 100644 --- a/src/share/classes/java/util/concurrent/BlockingDeque.java +++ b/src/share/classes/java/util/concurrent/BlockingDeque.java @@ -400,8 +400,10 @@ public interface BlockingDeque extends BlockingQueue, Deque { * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) - * @throws NullPointerException if the specified element is null (optional) + * is incompatible with this deque + * (optional) + * @throws NullPointerException if the specified element is null + * (optional) */ boolean removeFirstOccurrence(Object o); @@ -416,8 +418,10 @@ public interface BlockingDeque extends BlockingQueue, Deque { * @param o element to be removed from this deque, if present * @return true if an element was removed as a result of this call * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) - * @throws NullPointerException if the specified element is null (optional) + * is incompatible with this deque + * (optional) + * @throws NullPointerException if the specified element is null + * (optional) */ boolean removeLastOccurrence(Object o); @@ -591,8 +595,10 @@ public interface BlockingDeque extends BlockingQueue, Deque { * @param o element to be removed from this deque, if present * @return true if this deque changed as a result of the call * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) - * @throws NullPointerException if the specified element is null (optional) + * is incompatible with this deque + * (optional) + * @throws NullPointerException if the specified element is null + * (optional) */ boolean remove(Object o); @@ -604,8 +610,10 @@ public interface BlockingDeque extends BlockingQueue, Deque { * @param o object to be checked for containment in this deque * @return true if this deque contains the specified element * @throws ClassCastException if the class of the specified element - * is incompatible with this deque (optional) - * @throws NullPointerException if the specified element is null (optional) + * is incompatible with this deque + * (optional) + * @throws NullPointerException if the specified element is null + * (optional) */ public boolean contains(Object o); diff --git a/src/share/classes/java/util/concurrent/BlockingQueue.java b/src/share/classes/java/util/concurrent/BlockingQueue.java index 9886e6da3c103ed20b321c7ce159a415cf8890ab..4511d27efd76413731a872e9083d7e6eea5e40f4 100644 --- a/src/share/classes/java/util/concurrent/BlockingQueue.java +++ b/src/share/classes/java/util/concurrent/BlockingQueue.java @@ -303,8 +303,10 @@ public interface BlockingQueue extends Queue { * @param o element to be removed from this queue, if present * @return true if this queue changed as a result of the call * @throws ClassCastException if the class of the specified element - * is incompatible with this queue (optional) - * @throws NullPointerException if the specified element is null (optional) + * is incompatible with this queue + * (optional) + * @throws NullPointerException if the specified element is null + * (optional) */ boolean remove(Object o); @@ -316,8 +318,10 @@ public interface BlockingQueue extends Queue { * @param o object to be checked for containment in this queue * @return true if this queue contains the specified element * @throws ClassCastException if the class of the specified element - * is incompatible with this queue (optional) - * @throws NullPointerException if the specified element is null (optional) + * is incompatible with this queue + * (optional) + * @throws NullPointerException if the specified element is null + * (optional) */ public boolean contains(Object o); diff --git a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java index c66a82e63054255bd76324bb5ad6fd35d5373041..e82148069b40fb94e2b697c75810fb7ca465ae0b 100644 --- a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -239,7 +239,8 @@ public class ConcurrentHashMap extends AbstractMap /** * Gets the ith element of given table (if nonnull) with volatile - * read semantics. + * read semantics. Note: This is manually integrated into a few + * performance-sensitive methods to reduce call overhead. */ @SuppressWarnings("unchecked") static final HashEntry entryAt(HashEntry[] tab, int i) { @@ -389,8 +390,7 @@ public class ConcurrentHashMap extends AbstractMap else node = new HashEntry(hash, key, value, first); int c = count + 1; - if (c > threshold && first != null && - tab.length < MAXIMUM_CAPACITY) + if (c > threshold && tab.length < MAXIMUM_CAPACITY) rehash(node); else setEntryAt(tab, index, node); @@ -647,7 +647,11 @@ public class ConcurrentHashMap extends AbstractMap /** * Gets the jth element of given segment array (if nonnull) with - * volatile element access semantics via Unsafe. + * volatile element access semantics via Unsafe. (The null check + * can trigger harmlessly only during deserialization.) Note: + * because each element of segments array is set only once (using + * fully ordered writes), some performance-sensitive methods rely + * on this method only as a recheck upon null reads. */ @SuppressWarnings("unchecked") static final Segment segmentAt(Segment[] ss, int j) { @@ -913,12 +917,19 @@ public class ConcurrentHashMap extends AbstractMap * @throws NullPointerException if the specified key is null */ public V get(Object key) { - int hash = hash(key.hashCode()); - for (HashEntry e = entryForHash(segmentForHash(hash), hash); - e != null; e = e.next) { - K k; - if ((k = e.key) == key || (e.hash == hash && key.equals(k))) - return e.value; + Segment s; // manually integrate access methods to reduce overhead + HashEntry[] tab; + int h = hash(key.hashCode()); + long u = (((h >>> segmentShift) & segmentMask) << SSHIFT) + SBASE; + if ((s = (Segment)UNSAFE.getObjectVolatile(segments, u)) != null && + (tab = s.table) != null) { + for (HashEntry e = (HashEntry) UNSAFE.getObjectVolatile + (tab, ((long)(((tab.length - 1) & h)) << TSHIFT) + TBASE); + e != null; e = e.next) { + K k; + if ((k = e.key) == key || (e.hash == h && key.equals(k))) + return e.value; + } } return null; } @@ -932,13 +943,21 @@ public class ConcurrentHashMap extends AbstractMap * equals method; false otherwise. * @throws NullPointerException if the specified key is null */ + @SuppressWarnings("unchecked") public boolean containsKey(Object key) { - int hash = hash(key.hashCode()); - for (HashEntry e = entryForHash(segmentForHash(hash), hash); - e != null; e = e.next) { - K k; - if ((k = e.key) == key || (e.hash == hash && key.equals(k))) - return true; + Segment s; // same as get() except no need for volatile value read + HashEntry[] tab; + int h = hash(key.hashCode()); + long u = (((h >>> segmentShift) & segmentMask) << SSHIFT) + SBASE; + if ((s = (Segment)UNSAFE.getObjectVolatile(segments, u)) != null && + (tab = s.table) != null) { + for (HashEntry e = (HashEntry) UNSAFE.getObjectVolatile + (tab, ((long)(((tab.length - 1) & h)) << TSHIFT) + TBASE); + e != null; e = e.next) { + K k; + if ((k = e.key) == key || (e.hash == h && key.equals(k))) + return true; + } } return false; } @@ -1032,13 +1051,15 @@ public class ConcurrentHashMap extends AbstractMap * null if there was no mapping for key * @throws NullPointerException if the specified key or value is null */ + @SuppressWarnings("unchecked") public V put(K key, V value) { + Segment s; if (value == null) throw new NullPointerException(); int hash = hash(key.hashCode()); int j = (hash >>> segmentShift) & segmentMask; - Segment s = segmentAt(segments, j); - if (s == null) + if ((s = (Segment)UNSAFE.getObject // nonvolatile; recheck + (segments, (j << SSHIFT) + SBASE)) == null) // in ensureSegment s = ensureSegment(j); return s.put(key, hash, value, false); } @@ -1050,13 +1071,15 @@ public class ConcurrentHashMap extends AbstractMap * or null if there was no mapping for the key * @throws NullPointerException if the specified key or value is null */ + @SuppressWarnings("unchecked") public V putIfAbsent(K key, V value) { + Segment s; if (value == null) throw new NullPointerException(); int hash = hash(key.hashCode()); int j = (hash >>> segmentShift) & segmentMask; - Segment s = segmentAt(segments, j); - if (s == null) + if ((s = (Segment)UNSAFE.getObject + (segments, (j << SSHIFT) + SBASE)) == null) s = ensureSegment(j); return s.put(key, hash, value, true); } diff --git a/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java b/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java index 4c1c4616263d46278757b847891837e435f673df..21d59cfc460e841dc71fcc44844de15565541771 100644 --- a/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java +++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java @@ -59,10 +59,17 @@ import java.util.Queue; * ConcurrentModificationException}, and may proceed concurrently with * other operations. * - *

      Beware that, unlike in most collections, the {@code size} - * method is NOT a constant-time operation. Because of the + *

      Beware that, unlike in most collections, the {@code size} method + * is NOT a constant-time operation. Because of the * asynchronous nature of these deques, determining the current number - * of elements requires a traversal of the elements. + * of elements requires a traversal of the elements, and so may report + * inaccurate results if this collection is modified during traversal. + * Additionally, the bulk operations {@code addAll}, + * {@code removeAll}, {@code retainAll}, {@code containsAll}, + * {@code equals}, and {@code toArray} are not guaranteed + * to be performed atomically. For example, an iterator operating + * concurrently with an {@code addAll} operation might view only some + * of the added elements. * *

      This class and its iterator implement all of the optional * methods of the {@link Deque} and {@link Iterator} interfaces. diff --git a/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java b/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java index 09f21ef150434fb14669f4e478a79af6a1e3797e..fcdfcf97eb6f8430db6004b7b2d39702df966193 100644 --- a/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java +++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java @@ -72,7 +72,14 @@ import java.util.Queue; *

      Beware that, unlike in most collections, the {@code size} method * is NOT a constant-time operation. Because of the * asynchronous nature of these queues, determining the current number - * of elements requires a traversal of the elements. + * of elements requires a traversal of the elements, and so may report + * inaccurate results if this collection is modified during traversal. + * Additionally, the bulk operations {@code addAll}, + * {@code removeAll}, {@code retainAll}, {@code containsAll}, + * {@code equals}, and {@code toArray} are not guaranteed + * to be performed atomically. For example, an iterator operating + * concurrently with an {@code addAll} operation might view only some + * of the added elements. * *

      This class and its iterator implement all of the optional * methods of the {@link Queue} and {@link Iterator} interfaces. diff --git a/src/share/classes/java/util/concurrent/ConcurrentMap.java b/src/share/classes/java/util/concurrent/ConcurrentMap.java index 25cf98ff0f1e5c6e8020ef8bd09969d27239a11f..4434c0563b4334e97411e79eef384e76606e0308 100644 --- a/src/share/classes/java/util/concurrent/ConcurrentMap.java +++ b/src/share/classes/java/util/concurrent/ConcurrentMap.java @@ -103,9 +103,11 @@ public interface ConcurrentMap extends Map { * @throws UnsupportedOperationException if the remove operation * is not supported by this map * @throws ClassCastException if the key or value is of an inappropriate - * type for this map (optional) + * type for this map + * (optional) * @throws NullPointerException if the specified key or value is null, - * and this map does not permit null keys or values (optional) + * and this map does not permit null keys or values + * (optional) */ boolean remove(Object key, Object value); diff --git a/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java b/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java index 8e3e4d0a7ccecc97289fa21c29db2de3560833f5..8d23964512b70022d7bb69e0749e60405831e8b2 100644 --- a/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java +++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java @@ -66,12 +66,13 @@ import java.util.concurrent.atomic.*; *

      Beware that, unlike in most collections, the size * method is not a constant-time operation. Because of the * asynchronous nature of these maps, determining the current number - * of elements requires a traversal of the elements. Additionally, - * the bulk operations putAll, equals, and - * clear are not guaranteed to be performed - * atomically. For example, an iterator operating concurrently with a - * putAll operation might view only some of the added - * elements. + * of elements requires a traversal of the elements, and so may report + * inaccurate results if this collection is modified during traversal. + * Additionally, the bulk operations putAll, equals, + * toArray, containsValue, and clear are + * not guaranteed to be performed atomically. For example, an + * iterator operating concurrently with a putAll operation + * might view only some of the added elements. * *

      This class and its views and iterators implement all of the * optional methods of the {@link Map} and {@link Iterator} @@ -1661,7 +1662,9 @@ public class ConcurrentSkipListMap extends AbstractMap /** * Returns true if this map maps one or more keys to the * specified value. This operation requires time linear in the - * map size. + * map size. Additionally, it is possible for the map to change + * during execution of this method, in which case the returned + * result may be inaccurate. * * @param value value whose presence in this map is to be tested * @return true if a mapping to value exists; @@ -1751,7 +1754,7 @@ public class ConcurrentSkipListMap extends AbstractMap * * @return a navigable set view of the keys in this map */ - public NavigableSet keySet() { + public NavigableSet keySet() { KeySet ks = keySet; return (ks != null) ? ks : (keySet = new KeySet(this)); } diff --git a/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java b/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java index eb90bb0bf9ff58be30510c01a62e933360e60654..7b5dc79a932b0f786440e29c5197641b4837a7b8 100644 --- a/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java +++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java @@ -58,12 +58,14 @@ import sun.misc.Unsafe; *

      Beware that, unlike in most collections, the size * method is not a constant-time operation. Because of the * asynchronous nature of these sets, determining the current number - * of elements requires a traversal of the elements. Additionally, the - * bulk operations addAll, removeAll, - * retainAll, and containsAll are not - * guaranteed to be performed atomically. For example, an iterator - * operating concurrently with an addAll operation might view - * only some of the added elements. + * of elements requires a traversal of the elements, and so may report + * inaccurate results if this collection is modified during traversal. + * Additionally, the bulk operations addAll, + * removeAll, retainAll, containsAll, + * equals, and toArray are not guaranteed + * to be performed atomically. For example, an iterator operating + * concurrently with an addAll operation might view only some + * of the added elements. * *

      This class and its iterators implement all of the * optional methods of the {@link Set} and {@link Iterator} diff --git a/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java b/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java index 2774e61136a7a3927e1c96ea6daaa21f8aa54b9c..785ec6fcede229d4c1f7e32c1a6a8ac6b13eee14 100644 --- a/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java +++ b/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java @@ -631,9 +631,11 @@ public class CopyOnWriteArrayList * @param c collection containing elements to be removed from this list * @return true if this list changed as a result of the call * @throws ClassCastException if the class of an element of this list - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this list contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) */ @@ -671,9 +673,11 @@ public class CopyOnWriteArrayList * @param c collection containing elements to be retained in this list * @return true if this list changed as a result of the call * @throws ClassCastException if the class of an element of this list - * is incompatible with the specified collection (optional) + * is incompatible with the specified collection + * (optional) * @throws NullPointerException if this list contains a null element and the - * specified collection does not permit null elements (optional), + * specified collection does not permit null elements + * (optional), * or if the specified collection is null * @see #remove(Object) */ diff --git a/src/share/classes/java/util/concurrent/LinkedTransferQueue.java b/src/share/classes/java/util/concurrent/LinkedTransferQueue.java index 3fe72477bf91bec6b1783d32a61365a7c2dbe795..ebdf223ff6cc861fe271da872214a830d180cd13 100644 --- a/src/share/classes/java/util/concurrent/LinkedTransferQueue.java +++ b/src/share/classes/java/util/concurrent/LinkedTransferQueue.java @@ -51,10 +51,17 @@ import java.util.concurrent.locks.LockSupport; * producer. The tail of the queue is that element that has * been on the queue the shortest time for some producer. * - *

      Beware that, unlike in most collections, the {@code size} - * method is NOT a constant-time operation. Because of the + *

      Beware that, unlike in most collections, the {@code size} method + * is NOT a constant-time operation. Because of the * asynchronous nature of these queues, determining the current number - * of elements requires a traversal of the elements. + * of elements requires a traversal of the elements, and so may report + * inaccurate results if this collection is modified during traversal. + * Additionally, the bulk operations {@code addAll}, + * {@code removeAll}, {@code retainAll}, {@code containsAll}, + * {@code equals}, and {@code toArray} are not guaranteed + * to be performed atomically. For example, an iterator operating + * concurrently with an {@code addAll} operation might view only some + * of the added elements. * *

      This class and its iterator implement all of the * optional methods of the {@link Collection} and {@link diff --git a/src/share/classes/java/util/regex/Pattern.java b/src/share/classes/java/util/regex/Pattern.java index 332590a00e41fffb5038ae073b555c56a1482eb8..fa302cfbab7268c1b9c5c42a043675257f952503 100644 --- a/src/share/classes/java/util/regex/Pattern.java +++ b/src/share/classes/java/util/regex/Pattern.java @@ -206,13 +206,15 @@ import java.util.Arrays; * Equivalent to java.lang.Character.isMirrored() * *   - * Classes for Unicode scripts, blocks and categories + * Classes for Unicode scripts, blocks, categories and binary properties * * \p{IsLatin} - * A Latin script character (simple script) + * A Latin script character (script) * \p{InGreek} - * A character in the Greek block (simple block) + * A character in the Greek block (block) * \p{Lu} - * An uppercase letter (simple category) + * An uppercase letter (category) + * \p{isAlphabetic} + * An alphabetic character (binary property) * \p{Sc} * A currency symbol * \P{InGreek} @@ -328,10 +330,11 @@ import java.util.Arrays; * X, as a named-capturing group * (?:X) * X, as a non-capturing group - * (?idmsux-idmsux)  + * (?idmsuxU-idmsuxU)  * Nothing, but turns match flags i * d m s - * u x on - off + * u x U + * on - off * (?idmsux-idmsux:X)   * X, as a non-capturing group with the * given flags i d @@ -518,61 +521,140 @@ import java.util.Arrays; * *

      This class is in conformance with Level 1 of Unicode Technical - * Standard #18: Unicode Regular Expression Guidelines, plus RL2.1 + * Standard #18: Unicode Regular Expression, plus RL2.1 * Canonical Equivalents. - * - *

      Unicode escape sequences such as \u2014 in Java source code + *

      + * Unicode escape sequences such as \u2014 in Java source code * are processed as described in section 3.3 of * The Java™ Language Specification. - * Such escape sequences are also - * implemented directly by the regular-expression parser so that Unicode - * escapes can be used in expressions that are read from files or from the - * keyboard. Thus the strings "\u2014" and "\\u2014", - * while not equal, compile into the same pattern, which matches the character - * with hexadecimal value 0x2014. - * - *

      A Unicode character can also be represented in a regular-expression by - * using its hexadecimal code point value directly as described in construct + * Such escape sequences are also implemented directly by the regular-expression + * parser so that Unicode escapes can be used in expressions that are read from + * files or from the keyboard. Thus the strings "\u2014" and + * "\\u2014", while not equal, compile into the same pattern, which + * matches the character with hexadecimal value 0x2014. + *

      + * A Unicode character can also be represented in a regular-expression by + * using its Hex notation(hexadecimal code point value) directly as described in construct * \x{...}, for example a supplementary character U+2011F * can be specified as \x{2011F}, instead of two consecutive * Unicode escape sequences of the surrogate pair * \uD840\uDD1F. - * - * - *

      Unicode scripts, blocks and categories are written with the \p and - * \P constructs as in Perl. \p{prop} matches if + *

      + * Unicode scripts, blocks, categories and binary properties are written with + * the \p and \P constructs as in Perl. + * \p{prop} matches if * the input has the property prop, while \P{prop} * does not match if the input has that property. *

      - * Scripts are specified either with the prefix {@code Is}, as in + * Scripts, blocks, categories and binary properties can be used both inside + * and outside of a character class. + * + *

      + * Scripts are specified either with the prefix {@code Is}, as in * {@code IsHiragana}, or by using the {@code script} keyword (or its short * form {@code sc})as in {@code script=Hiragana} or {@code sc=Hiragana}. *

      - * Blocks are specified with the prefix {@code In}, as in + * The script names supported by Pattern are the valid script names + * accepted and defined by + * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}. + * + *

      + * Blocks are specified with the prefix {@code In}, as in * {@code InMongolian}, or by using the keyword {@code block} (or its short * form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}. *

      - * Categories may be specified with the optional prefix {@code Is}: + * The block names supported by Pattern are the valid block names + * accepted and defined by + * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}. + *

      + * + * Categories may be specified with the optional prefix {@code Is}: * Both {@code \p{L}} and {@code \p{IsL}} denote the category of Unicode * letters. Same as scripts and blocks, categories can also be specified * by using the keyword {@code general_category} (or its short form * {@code gc}) as in {@code general_category=Lu} or {@code gc=Lu}. *

      - * Scripts, blocks and categories can be used both inside and outside of a - * character class. - *

      The supported categories are those of + * The supported categories are those of * * The Unicode Standard in the version specified by the * {@link java.lang.Character Character} class. The category names are those * defined in the Standard, both normative and informative. - * The script names supported by Pattern are the valid script names - * accepted and defined by - * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}. - * The block names supported by Pattern are the valid block names - * accepted and defined by - * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}. *

      - *

      Categories that behave like the java.lang.Character + * + * Binary properties are specified with the prefix {@code Is}, as in + * {@code IsAlphabetic}. The supported binary properties by Pattern + * are + *

      + + + *

      + * Predefined Character classes and POSIX character classes are in + * conformance with the recommendation of Annex C: Compatibility Properties + * of Unicode Regular Expression + * , when {@link #UNICODE_CHARACTER_CLASS} flag is specified. + *

      + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
      ClassesMatches
      \p{Lower}A lowercase character:\p{IsLowercase}
      \p{Upper}An uppercase character:\p{IsUppercase}
      \p{ASCII}All ASCII:[\x00-\x7F]
      \p{Alpha}An alphabetic character:\p{IsAlphabetic}
      \p{Digit}A decimal digit character:p{IsDigit}
      \p{Alnum}An alphanumeric character:[\p{IsAlphabetic}\p{IsDigit}]
      \p{Punct}A punctuation character:p{IsPunctuation}
      \p{Graph}A visible character: [^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]
      \p{Print}A printable character: [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]
      \p{Blank}A space or a tab: [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]
      \p{Cntrl}A control character: \p{gc=Cc}
      \p{XDigit}A hexadecimal digit: [\p{gc=Nd}\p{IsHex_Digit}]
      \p{Space}A whitespace character:\p{IsWhite_Space}
      \dA digit: \p{IsDigit}
      \DA non-digit: [^\d]
      \sA whitespace character: \p{IsWhite_Space}
      \SA non-whitespace character: [^\s]
      \wA word character: [\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}]
      \WA non-word character: [^\w]
      + *

      + * + * Categories that behave like the java.lang.Character * boolean ismethodname methods (except for the deprecated ones) are * available through the same \p{prop} syntax where * the specified property has the name javamethodname. @@ -585,8 +667,30 @@ import java.util.Arrays; *

      Perl constructs not supported by this class:

      * *
        + *
      • Predefined character classes (Unicode character) + *

        \h    A horizontal whitespace + *

        \H    A non horizontal whitespace + *

        \v    A vertical whitespace + *

        \V    A non vertical whitespace + *

        \R    Any Unicode linebreak sequence + * \u005cu000D\u005cu000A|[\u005cu000A\u005cu000B\u005cu000C\u005cu000D\u005cu0085\u005cu2028\u005cu2029] + *

        \X    Match Unicode + * + * extended grapheme cluster + *

      • * - *
      • The conditional constructs (?{X}) and + *

      • The backreference constructs, \g{n} for + * the nthcapturing group and + * \g{name} for + * named-capturing group. + *

      • + * + *
      • The named character construct, \N{name} + * for a Unicode character by its name. + *

      • + * + *
      • The conditional constructs + * (?(condition)X) and * (?(condition)X|Y), *

      • * @@ -604,10 +708,6 @@ import java.util.Arrays; * *
          * - *
        • Possessive quantifiers, which greedily match as much as they can - * and do not back off, even when doing so would allow the overall match to - * succeed.

        • - * *
        • Character-class union and intersection as described * above.

        • * @@ -641,13 +741,6 @@ import java.util.Arrays; * within a group; in the latter case, flags are restored at the end of the * group just as in Perl.

          * - *
        • Perl is forgiving about malformed matching constructs, as in the - * expression *a, as well as dangling brackets, as in the - * expression abc], and treats them as literals. This - * class also accepts dangling brackets but is strict about dangling - * metacharacters like +, ? and *, and will throw a - * {@link PatternSyntaxException} if it encounters them.

        • - * *
        * * @@ -796,6 +889,28 @@ public final class Pattern */ public static final int CANON_EQ = 0x80; + /** + * Enables the Unicode version of Predefined character classes and + * POSIX character classes. + * + *

        When this flag is specified then the (US-ASCII only) + * Predefined character classes and POSIX character classes + * are in conformance with + * Unicode Technical + * Standard #18: Unicode Regular Expression + * Annex C: Compatibility Properties. + *

        + * The UNICODE_CHARACTER_CLASS mode can also be enabled via the embedded + * flag expression (?U). + *

        + * The flag implies UNICODE_CASE, that is, it enables Unicode-aware case + * folding. + *

        + * Specifying this flag may impose a performance penalty.

        + * @since 1.7 + */ + public static final int UNICODE_CHARACTER_CLASS = 0x100; + /* Pattern has only two serialized components: The pattern string * and the flags, which are all that is needed to recompile the pattern * when it is deserialized. @@ -918,7 +1033,8 @@ public final class Pattern * Match flags, a bit mask that may include * {@link #CASE_INSENSITIVE}, {@link #MULTILINE}, {@link #DOTALL}, * {@link #UNICODE_CASE}, {@link #CANON_EQ}, {@link #UNIX_LINES}, - * {@link #LITERAL} and {@link #COMMENTS} + * {@link #LITERAL}, {@link #UNICODE_CHARACTER_CLASS} + * and {@link #COMMENTS} * * @throws IllegalArgumentException * If bit values other than those corresponding to the defined @@ -1209,6 +1325,10 @@ public final class Pattern pattern = p; flags = f; + // to use UNICODE_CASE if UNICODE_CHARACTER_CLASS present + if ((flags & UNICODE_CHARACTER_CLASS) != 0) + flags |= UNICODE_CASE; + // Reset group index count capturingGroupCount = 1; localCount = 0; @@ -2164,12 +2284,14 @@ loop: for(int x=0, offset=0; x startIndex) { ch = Character.codePointBefore(seq, i); - left = (ch == '_' || Character.isLetterOrDigit(ch) || + left = (isWord(ch) || ((Character.getType(ch) == Character.NON_SPACING_MARK) && hasBaseCharacter(matcher, i-1, seq))); } boolean right = false; if (i < endIndex) { ch = Character.codePointAt(seq, i); - right = (ch == '_' || Character.isLetterOrDigit(ch) || + right = (isWord(ch) || ((Character.getType(ch) == Character.NON_SPACING_MARK) && hasBaseCharacter(matcher, i, seq))); } else { @@ -5428,6 +5595,12 @@ NEXT: while (i <= last) { defClone("javaUpperCase", new CloneableProperty() { boolean isSatisfiedBy(int ch) { return Character.isUpperCase(ch);}}); + defClone("javaAlphabetic", new CloneableProperty() { + boolean isSatisfiedBy(int ch) { + return Character.isAlphabetic(ch);}}); + defClone("javaIdeographic", new CloneableProperty() { + boolean isSatisfiedBy(int ch) { + return Character.isIdeographic(ch);}}); defClone("javaTitleCase", new CloneableProperty() { boolean isSatisfiedBy(int ch) { return Character.isTitleCase(ch);}}); diff --git a/src/share/classes/java/util/regex/UnicodeProp.java b/src/share/classes/java/util/regex/UnicodeProp.java new file mode 100644 index 0000000000000000000000000000000000000000..d1a68c08fa1b1c2ea540dcf965fc9870496c5017 --- /dev/null +++ b/src/share/classes/java/util/regex/UnicodeProp.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.util.regex; + +import java.util.HashMap; +import java.util.Locale; + +enum UnicodeProp { + + ALPHABETIC { + public boolean is(int ch) { + return Character.isAlphabetic(ch); + } + }, + + LETTER { + public boolean is(int ch) { + return Character.isLetter(ch); + } + }, + + IDEOGRAPHIC { + public boolean is(int ch) { + return Character.isIdeographic(ch); + } + }, + + LOWERCASE { + public boolean is(int ch) { + return Character.isLowerCase(ch); + } + }, + + UPPERCASE { + public boolean is(int ch) { + return Character.isUpperCase(ch); + } + }, + + TITLECASE { + public boolean is(int ch) { + return Character.isTitleCase(ch); + } + }, + + WHITE_SPACE { + // \p{Whitespace} + public boolean is(int ch) { + return ((((1 << Character.SPACE_SEPARATOR) | + (1 << Character.LINE_SEPARATOR) | + (1 << Character.PARAGRAPH_SEPARATOR)) >> Character.getType(ch)) & 1) + != 0 || (ch >= 0x9 && ch <= 0xd) || (ch == 0x85); + } + }, + + CONTROL { + // \p{gc=Control} + public boolean is(int ch) { + return Character.getType(ch) == Character.CONTROL; + } + }, + + PUNCTUATION { + // \p{gc=Punctuation} + public boolean is(int ch) { + return ((((1 << Character.CONNECTOR_PUNCTUATION) | + (1 << Character.DASH_PUNCTUATION) | + (1 << Character.START_PUNCTUATION) | + (1 << Character.END_PUNCTUATION) | + (1 << Character.OTHER_PUNCTUATION) | + (1 << Character.INITIAL_QUOTE_PUNCTUATION) | + (1 << Character.FINAL_QUOTE_PUNCTUATION)) >> Character.getType(ch)) & 1) + != 0; + } + }, + + HEX_DIGIT { + // \p{gc=Decimal_Number} + // \p{Hex_Digit} -> PropList.txt: Hex_Digit + public boolean is(int ch) { + return DIGIT.is(ch) || + (ch >= 0x0030 && ch <= 0x0039) || + (ch >= 0x0041 && ch <= 0x0046) || + (ch >= 0x0061 && ch <= 0x0066) || + (ch >= 0xFF10 && ch <= 0xFF19) || + (ch >= 0xFF21 && ch <= 0xFF26) || + (ch >= 0xFF41 && ch <= 0xFF46); + } + }, + + ASSIGNED { + public boolean is(int ch) { + return Character.getType(ch) != Character.UNASSIGNED; + } + }, + + NONCHARACTER_CODE_POINT { + // PropList.txt:Noncharacter_Code_Point + public boolean is(int ch) { + return (ch & 0xfffe) == 0xfffe || (ch >= 0xfdd0 && ch <= 0xfdef); + } + }, + + DIGIT { + // \p{gc=Decimal_Number} + public boolean is(int ch) { + return Character.isDigit(ch); + } + }, + + ALNUM { + // \p{alpha} + // \p{digit} + public boolean is(int ch) { + return ALPHABETIC.is(ch) || DIGIT.is(ch); + } + }, + + BLANK { + // \p{Whitespace} -- + // [\N{LF} \N{VT} \N{FF} \N{CR} \N{NEL} -> 0xa, 0xb, 0xc, 0xd, 0x85 + // \p{gc=Line_Separator} + // \p{gc=Paragraph_Separator}] + public boolean is(int ch) { + return Character.getType(ch) == Character.SPACE_SEPARATOR || + ch == 0x9; // \N{HT} + } + }, + + GRAPH { + // [^ + // \p{space} + // \p{gc=Control} + // \p{gc=Surrogate} + // \p{gc=Unassigned}] + public boolean is(int ch) { + return ((((1 << Character.SPACE_SEPARATOR) | + (1 << Character.LINE_SEPARATOR) | + (1 << Character.PARAGRAPH_SEPARATOR) | + (1 << Character.CONTROL) | + (1 << Character.SURROGATE) | + (1 << Character.UNASSIGNED)) >> Character.getType(ch)) & 1) + == 0; + } + }, + + PRINT { + // \p{graph} + // \p{blank} + // -- \p{cntrl} + public boolean is(int ch) { + return (GRAPH.is(ch) || BLANK.is(ch)) && !CONTROL.is(ch); + } + }, + + WORD { + // \p{alpha} + // \p{gc=Mark} + // \p{digit} + // \p{gc=Connector_Punctuation} + + public boolean is(int ch) { + return ALPHABETIC.is(ch) || + ((((1 << Character.NON_SPACING_MARK) | + (1 << Character.ENCLOSING_MARK) | + (1 << Character.COMBINING_SPACING_MARK) | + (1 << Character.DECIMAL_DIGIT_NUMBER) | + (1 << Character.CONNECTOR_PUNCTUATION)) >> Character.getType(ch)) & 1) + != 0; + } + }; + + private final static HashMap posix = new HashMap<>(); + private final static HashMap aliases = new HashMap<>(); + static { + posix.put("ALPHA", "ALPHABETIC"); + posix.put("LOWER", "LOWERCASE"); + posix.put("UPPER", "UPPERCASE"); + posix.put("SPACE", "WHITE_SPACE"); + posix.put("PUNCT", "PUNCTUATION"); + posix.put("XDIGIT","HEX_DIGIT"); + posix.put("ALNUM", "ALNUM"); + posix.put("CNTRL", "CONTROL"); + posix.put("DIGIT", "DIGIT"); + posix.put("BLANK", "BLANK"); + posix.put("GRAPH", "GRAPH"); + posix.put("PRINT", "PRINT"); + + aliases.put("WHITESPACE", "WHITE_SPACE"); + aliases.put("HEXDIGIT","HEX_DIGIT"); + aliases.put("NONCHARACTERCODEPOINT", "NONCHARACTER_CODE_POINT"); + } + + public static UnicodeProp forName(String propName) { + propName = propName.toUpperCase(Locale.ENGLISH); + String alias = aliases.get(propName); + if (alias != null) + propName = alias; + try { + return valueOf (propName); + } catch (IllegalArgumentException x) {} + return null; + } + + public static UnicodeProp forPOSIXName(String propName) { + propName = posix.get(propName.toUpperCase(Locale.ENGLISH)); + if (propName == null) + return null; + return valueOf (propName); + } + + public abstract boolean is(int ch); +} diff --git a/src/share/classes/java/util/zip/ZipCoder.java b/src/share/classes/java/util/zip/ZipCoder.java index 8e30fe5c8d76265af1a8f4abbbb79a51cf10cd12..62844916f3d22e24bcd4e2522bad1d3e671233d7 100644 --- a/src/share/classes/java/util/zip/ZipCoder.java +++ b/src/share/classes/java/util/zip/ZipCoder.java @@ -28,11 +28,14 @@ package java.util.zip; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; +import java.nio.charset.StandardCharset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; import java.nio.charset.CoderResult; import java.nio.charset.CodingErrorAction; import java.util.Arrays; +import sun.nio.cs.ArrayDecoder; +import sun.nio.cs.ArrayEncoder; /** * Utility class for zipfile name and comment decoding and encoding @@ -46,6 +49,15 @@ final class ZipCoder { char[] ca = new char[len]; if (len == 0) return new String(ca); + // UTF-8 only for now. Other ArrayDeocder only handles + // CodingErrorAction.REPLACE mode. ZipCoder uses + // REPORT mode. + if (isUTF8 && cd instanceof ArrayDecoder) { + int clen = ((ArrayDecoder)cd).decode(ba, 0, length, ca); + if (clen == -1) // malformed + throw new IllegalArgumentException("MALFORMED"); + return new String(ca, 0, clen); + } ByteBuffer bb = ByteBuffer.wrap(ba, 0, length); CharBuffer cb = CharBuffer.wrap(ca); CoderResult cr = cd.decode(bb, cb, true); @@ -68,6 +80,14 @@ final class ZipCoder { byte[] ba = new byte[len]; if (len == 0) return ba; + // UTF-8 only for now. Other ArrayDeocder only handles + // CodingErrorAction.REPLACE mode. + if (isUTF8 && ce instanceof ArrayEncoder) { + int blen = ((ArrayEncoder)ce).encode(ca, 0, ca.length, ba); + if (blen == -1) // malformed + throw new IllegalArgumentException("MALFORMED"); + return Arrays.copyOf(ba, blen); + } ByteBuffer bb = ByteBuffer.wrap(ba); CharBuffer cb = CharBuffer.wrap(ca); CoderResult cr = ce.encode(cb, bb, true); @@ -84,35 +104,35 @@ final class ZipCoder { // assume invoked only if "this" is not utf8 byte[] getBytesUTF8(String s) { - if (isutf8) + if (isUTF8) return getBytes(s); if (utf8 == null) - utf8 = new ZipCoder(Charset.forName("UTF-8")); + utf8 = new ZipCoder(StandardCharset.UTF_8); return utf8.getBytes(s); } String toStringUTF8(byte[] ba, int len) { - if (isutf8) + if (isUTF8) return toString(ba, len); if (utf8 == null) - utf8 = new ZipCoder(Charset.forName("UTF-8")); + utf8 = new ZipCoder(StandardCharset.UTF_8); return utf8.toString(ba, len); } boolean isUTF8() { - return isutf8; + return isUTF8; } private Charset cs; private CharsetDecoder dec; private CharsetEncoder enc; - private boolean isutf8; + private boolean isUTF8; private ZipCoder utf8; private ZipCoder(Charset cs) { this.cs = cs; - this.isutf8 = cs.name().equals("UTF-8"); + this.isUTF8 = cs.name().equals(StandardCharset.UTF_8.name()); } static ZipCoder get(Charset charset) { diff --git a/src/share/classes/java/util/zip/ZipFile.java b/src/share/classes/java/util/zip/ZipFile.java index 9cfbe826629542722cd31d383699dd9f1d0c0e11..d1861ad732c805781a1ce8130ff9311d1540ab07 100644 --- a/src/share/classes/java/util/zip/ZipFile.java +++ b/src/share/classes/java/util/zip/ZipFile.java @@ -31,6 +31,7 @@ import java.io.IOException; import java.io.EOFException; import java.io.File; import java.nio.charset.Charset; +import java.nio.charset.StandardCharset; import java.util.ArrayDeque; import java.util.Deque; import java.util.Enumeration; @@ -140,7 +141,7 @@ class ZipFile implements ZipConstants, Closeable { * @since 1.3 */ public ZipFile(File file, int mode) throws IOException { - this(file, mode, Charset.forName("UTF-8")); + this(file, mode, StandardCharset.UTF_8); } /** diff --git a/src/share/classes/java/util/zip/ZipInputStream.java b/src/share/classes/java/util/zip/ZipInputStream.java index 77d353a9a7a0a6de119a0440743b8e1a2206287c..ebfcce146ccf697b042a8397a4f8bee1e5b999f4 100644 --- a/src/share/classes/java/util/zip/ZipInputStream.java +++ b/src/share/classes/java/util/zip/ZipInputStream.java @@ -30,6 +30,7 @@ import java.io.IOException; import java.io.EOFException; import java.io.PushbackInputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharset; import static java.util.zip.ZipConstants64.*; /** @@ -75,7 +76,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants { * @param in the actual input stream */ public ZipInputStream(InputStream in) { - this(in, Charset.forName("UTF-8")); + this(in, StandardCharset.UTF_8); } /** diff --git a/src/share/classes/java/util/zip/ZipOutputStream.java b/src/share/classes/java/util/zip/ZipOutputStream.java index fa7b96d9e1c4088784fe92372afe3fe300354aba..c0b59488002a924e845d8316bcfb9ec8200b1e0c 100644 --- a/src/share/classes/java/util/zip/ZipOutputStream.java +++ b/src/share/classes/java/util/zip/ZipOutputStream.java @@ -28,6 +28,7 @@ package java.util.zip; import java.io.OutputStream; import java.io.IOException; import java.nio.charset.Charset; +import java.nio.charset.StandardCharset; import java.util.Vector; import java.util.HashSet; import static java.util.zip.ZipConstants64.*; @@ -100,7 +101,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants { * @param out the actual output stream */ public ZipOutputStream(OutputStream out) { - this(out, Charset.forName("UTF-8")); + this(out, StandardCharset.UTF_8); } /** diff --git a/test/java/beans/XMLEncoder/java_io_File.java b/src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java similarity index 58% rename from test/java/beans/XMLEncoder/java_io_File.java rename to src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java index 252377bb7e25e2e35b0f12821b3b7f736e5d9b63..56ed40eed3e391fd8897d1d5c360076bce1d805a 100644 --- a/test/java/beans/XMLEncoder/java_io_File.java +++ b/src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java @@ -1,10 +1,12 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 @@ -21,27 +23,16 @@ * questions. */ -/* - * @test - * @bug 6708550 - * @summary Tests File encoding - * @author Sergey Malenkov - */ - -import java.io.File; +package javax.security.auth.kerberos; -public final class java_io_File extends AbstractTest { - public static void main(String[] args) { - new java_io_File().test(true); - } - - @Override - protected File getObject() { - return new File("test.txt"); // NON-NLS: local file - } +import sun.misc.JavaxSecurityAuthKerberosAccess; +import sun.security.krb5.EncryptionKey; +import sun.security.krb5.PrincipalName; - @Override - protected File getAnotherObject() { - return new File("/pub/demo/"); // NON-NLS: path +class JavaxSecurityAuthKerberosAccessImpl + implements JavaxSecurityAuthKerberosAccess { + public EncryptionKey[] keyTabGetEncryptionKeys( + KeyTab ktab, PrincipalName principal) { + return ktab.getEncryptionKeys(principal); } } diff --git a/src/share/classes/javax/security/auth/kerberos/KerberosKey.java b/src/share/classes/javax/security/auth/kerberos/KerberosKey.java index 7eb7118a5bcc7cb889e505f0b989a45a4bb33099..ba530f9583c849a69d08527206814f648de91561 100644 --- a/src/share/classes/javax/security/auth/kerberos/KerberosKey.java +++ b/src/share/classes/javax/security/auth/kerberos/KerberosKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,14 +35,16 @@ import javax.security.auth.DestroyFailedException; * principal.

        * * All Kerberos JAAS login modules that obtain a principal's password and - * generate the secret key from it should use this class. Where available, - * the login module might even read this secret key directly from a - * Kerberos "keytab". Sometimes, such as when authenticating a server in + * generate the secret key from it should use this class. + * Sometimes, such as when authenticating a server in * the absence of user-to-user authentication, the login module will store * an instance of this class in the private credential set of a * {@link javax.security.auth.Subject Subject} during the commit phase of the * authentication process.

        * + * A Kerberos service using a keytab to read secret keys should use + * the {@link KeyTab} class, where latest keys can be read when needed.

        + * * It might be necessary for the application to be granted a * {@link javax.security.auth.PrivateCredentialPermission * PrivateCredentialPermission} if it needs to access the KerberosKey diff --git a/src/share/classes/javax/security/auth/kerberos/KeyTab.java b/src/share/classes/javax/security/auth/kerberos/KeyTab.java new file mode 100644 index 0000000000000000000000000000000000000000..c2f8dd79478baccae14b76c19a02033ddb0a9b7c --- /dev/null +++ b/src/share/classes/javax/security/auth/kerberos/KeyTab.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.security.auth.kerberos; + +import java.io.File; +import java.util.Objects; +import sun.misc.SharedSecrets; +import sun.security.krb5.EncryptionKey; +import sun.security.krb5.PrincipalName; +import sun.security.krb5.RealmException; + +/** + * This class encapsulates a keytab file. + *

        + * A Kerberos JAAS login module that obtains long term secret keys from a + * keytab file should use this class. The login module will store + * an instance of this class in the private credential set of a + * {@link javax.security.auth.Subject Subject} during the commit phase of the + * authentication process. + *

        + * It might be necessary for the application to be granted a + * {@link javax.security.auth.PrivateCredentialPermission + * PrivateCredentialPermission} if it needs to access the KeyTab + * instance from a Subject. This permission is not needed when the + * application depends on the default JGSS Kerberos mechanism to access the + * KeyTab. In that case, however, the application will need an appropriate + * {@link javax.security.auth.kerberos.ServicePermission ServicePermission}. + *

        + * The keytab file format is described at + * + * http://www.ioplex.com/utilities/keytab.txt. + * + * @since 1.7 + */ +public final class KeyTab { + + /* + * Impl notes: + * + * This class is only a name, a permanent link to the keytab source + * (can be missing). Itself has no content. In order to read content, + * take a snapshot and read from it. + * + * The snapshot is of type sun.security.krb5.internal.ktab.KeyTab, which + * contains the content of the keytab file when the snapshot is taken. + * Itself has no refresh function and mostly an immutable class (except + * for the create/add/save methods only used by the ktab command). + */ + + // Source, null if using the default one. Note that the default name + // is maintained in snapshot, this field is never "resolved". + private final File file; + + // Set up JavaxSecurityAuthKerberosAccess in SharedSecrets + static { + SharedSecrets.setJavaxSecurityAuthKerberosAccess( + new JavaxSecurityAuthKerberosAccessImpl()); + } + + private KeyTab(File file) { + this.file = file; + } + + /** + * Returns a {@code KeyTab} instance from a {@code File} object. + *

        + * The result of this method is never null. This method only associates + * the returned {@code KeyTab} object with the file and does not read it. + * @param file the keytab {@code File} object, must not be null + * @return the keytab instance + * @throws NullPointerException if the {@code file} argument is null + */ + public static KeyTab getInstance(File file) { + if (file == null) { + throw new NullPointerException("file must be non null"); + } + return new KeyTab(file); + } + + /** + * Returns the default {@code KeyTab} instance. + *

        + * The result of this method is never null. This method only associates + * the returned {@code KeyTab} object with the default keytab file and + * does not read it. + * @return the default keytab instance. + */ + public static KeyTab getInstance() { + return new KeyTab(null); + } + + //Takes a snapshot of the keytab content + private sun.security.krb5.internal.ktab.KeyTab takeSnapshot() { + return sun.security.krb5.internal.ktab.KeyTab.getInstance(file); + } + + /** + * Returns fresh keys for the given Kerberos principal. + *

        + * Implementation of this method should make sure the returned keys match + * the latest content of the keytab file. The result is a newly created + * copy that can be modified by the caller without modifying the keytab + * object. The caller should {@link KerberosKey#destroy() destroy} the + * result keys after they are used. + *

        + * Please note that the keytab file can be created after the + * {@code KeyTab} object is instantiated and its content may change over + * time. Therefore, an application should call this method only when it + * needs to use the keys. Any previous result from an earlier invocation + * could potentially be expired. + *

        + * If there is any error (say, I/O error or format error) + * during the reading process of the KeyTab file, a saved result should be + * returned. If there is no saved result (say, this is the first time this + * method is called, or, all previous read attempts failed), an empty array + * should be returned. This can make sure the result is not drastically + * changed during the (probably slow) update of the keytab file. + *

        + * Each time this method is called and the reading of the file succeeds + * with no exception (say, I/O error or file format error), + * the result should be saved for {@code principal}. The implementation can + * also save keys for other principals having keys in the same keytab object + * if convenient. + *

        + * Any unsupported key read from the keytab is ignored and not included + * in the result. + * + * @param principal the Kerberos principal, must not be null. + * @return the keys (never null, may be empty) + * @throws NullPointerException if the {@code principal} + * argument is null + * @throws SecurityException if a security manager exists and the read + * access to the keytab file is not permitted + */ + public KerberosKey[] getKeys(KerberosPrincipal principal) { + try { + EncryptionKey[] keys = takeSnapshot().readServiceKeys( + new PrincipalName(principal.getName())); + KerberosKey[] kks = new KerberosKey[keys.length]; + for (int i=0; i + * The caller can use the result to determine if it should fallback to + * another mechanism to read the keys. + * @return true if the keytab file exists; false otherwise. + * @throws SecurityException if a security manager exists and the read + * access to the keytab file is not permitted + */ + public boolean exists() { + return !takeSnapshot().isMissing(); + } + + public String toString() { + return file == null ? "Default keytab" : file.toString(); + } + + /** + * Returns a hashcode for this KeyTab. + * + * @return a hashCode() for the KeyTab + */ + public int hashCode() { + return Objects.hash(file); + } + + /** + * Compares the specified Object with this KeyTab for equality. + * Returns true if the given object is also a + * KeyTab and the two + * KeyTab instances are equivalent. + * + * @param other the Object to compare to + * @return true if the specified object is equal to this KeyTab + */ + public boolean equals(Object other) { + if (other == this) + return true; + + if (! (other instanceof KeyTab)) { + return false; + } + + KeyTab otherKtab = (KeyTab) other; + return Objects.equals(otherKtab.file, file); + } +} diff --git a/src/share/classes/javax/swing/JPopupMenu.java b/src/share/classes/javax/swing/JPopupMenu.java index 24a9d4cf6c5562ea479e3ea9cd862c7f43e1e10e..53926e4a744179027c8c60c5a6a5c28d5e0aa03b 100644 --- a/src/share/classes/javax/swing/JPopupMenu.java +++ b/src/share/classes/javax/swing/JPopupMenu.java @@ -342,8 +342,8 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { // Calculate the screen size that popup should fit Dimension popupSize = JPopupMenu.this.getPreferredSize(); - int popupRightX = popupLocation.x + popupSize.width; - int popupBottomY = popupLocation.y + popupSize.height; + long popupRightX = (long)popupLocation.x + (long)popupSize.width; + long popupBottomY = (long)popupLocation.y + (long)popupSize.height; int scrWidth = scrBounds.width; int scrHeight = scrBounds.height; if (!canPopupOverlapTaskBar()) { @@ -358,13 +358,13 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { int scrBottomY = scrBounds.y + scrHeight; // Ensure that popup menu fits the screen - if (popupRightX > scrRightX) { + if (popupRightX > (long)scrRightX) { popupLocation.x = scrRightX - popupSize.width; if( popupLocation.x < scrBounds.x ) { popupLocation.x = scrBounds.x ; } } - if (popupBottomY > scrBottomY) { + if (popupBottomY > (long)scrBottomY) { popupLocation.y = scrBottomY - popupSize.height; if( popupLocation.y < scrBounds.y ) { popupLocation.y = scrBounds.y; diff --git a/src/share/classes/javax/swing/JSplitPane.java b/src/share/classes/javax/swing/JSplitPane.java index d947329d6630dafd7e72b4d20bcb334919dd1e2d..fa773e5ae677f2138ad1d5b3e41bf6fc5ae51d29 100644 --- a/src/share/classes/javax/swing/JSplitPane.java +++ b/src/share/classes/javax/swing/JSplitPane.java @@ -671,7 +671,7 @@ public class JSplitPane extends JComponent implements Accessible * which must be true for the child components * to be continuously * redisplayed and laid out during user intervention. - * The default value of this property is false. + * The default value of this property is look and feel dependent. * Some look and feels might not support continuous layout; * they will ignore this property. * diff --git a/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java index 42c88e0282385c4b5128cdefc82070282217efef..70b0bffaac763836ec5fbc486956aabb68ae7de9 100644 --- a/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java +++ b/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java @@ -154,7 +154,7 @@ public class BasicSplitPaneDivider extends Container setBackground(UIManager.getColor("SplitPane.background")); } - private void revalidate() { + private void revalidateSplitPane() { invalidate(); if (splitPane != null) { splitPane.revalidate(); @@ -315,7 +315,7 @@ public class BasicSplitPaneDivider extends Container setCursor((orientation == JSplitPane.HORIZONTAL_SPLIT) ? Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR) : Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)); - revalidate(); + revalidateSplitPane(); } else if (e.getPropertyName() == JSplitPane. ONE_TOUCH_EXPANDABLE_PROPERTY) { @@ -376,7 +376,7 @@ public class BasicSplitPaneDivider extends Container add(rightButton); } } - revalidate(); + revalidateSplitPane(); } diff --git a/src/share/classes/sun/awt/ExtendedKeyCodes.java b/src/share/classes/sun/awt/ExtendedKeyCodes.java index d6d72ac4ad7c50d20bd51d4c72936e15bd9afad4..fc004ba2a283c2afdacc1c0c964f399f13c00cab 100644 --- a/src/share/classes/sun/awt/ExtendedKeyCodes.java +++ b/src/share/classes/sun/awt/ExtendedKeyCodes.java @@ -13,7 +13,7 @@ public class ExtendedKeyCodes { */ // Keycodes declared in KeyEvent.java with corresponding Unicode values. private final static HashMap regularKeyCodesMap = - new HashMap(83, 1.0f); + new HashMap(98, 1.0f); // Keycodes derived from Unicode values. Here should be collected codes // for characters appearing on the primary layer of at least one @@ -108,6 +108,21 @@ public class ExtendedKeyCodes { regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX); regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE); regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE); + regularKeyCodesMap.put(0x61, KeyEvent.VK_A); + regularKeyCodesMap.put(0x62, KeyEvent.VK_B); + regularKeyCodesMap.put(0x63, KeyEvent.VK_C); + regularKeyCodesMap.put(0x64, KeyEvent.VK_D); + regularKeyCodesMap.put(0x65, KeyEvent.VK_E); + regularKeyCodesMap.put(0x66, KeyEvent.VK_F); + regularKeyCodesMap.put(0x67, KeyEvent.VK_G); + regularKeyCodesMap.put(0x68, KeyEvent.VK_H); + regularKeyCodesMap.put(0x69, KeyEvent.VK_I); + regularKeyCodesMap.put(0x6A, KeyEvent.VK_J); + regularKeyCodesMap.put(0x6B, KeyEvent.VK_K); + regularKeyCodesMap.put(0x6C, KeyEvent.VK_L); + regularKeyCodesMap.put(0x6D, KeyEvent.VK_M); + regularKeyCodesMap.put(0x6E, KeyEvent.VK_N); + regularKeyCodesMap.put(0x6F, KeyEvent.VK_O); regularKeyCodesMap.put(0x70, KeyEvent.VK_P); regularKeyCodesMap.put(0x71, KeyEvent.VK_Q); regularKeyCodesMap.put(0x72, KeyEvent.VK_R); diff --git a/src/share/classes/sun/awt/FontDescriptor.java b/src/share/classes/sun/awt/FontDescriptor.java index 704fbecb8eeb24e6415e3df61b4535b4dba95860..e98ec65e029c2833cb3d64a062f991dbc7072c73 100644 --- a/src/share/classes/sun/awt/FontDescriptor.java +++ b/src/share/classes/sun/awt/FontDescriptor.java @@ -26,6 +26,7 @@ package sun.awt; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; +import java.nio.charset.StandardCharset; import sun.nio.cs.HistoricallyNamedCharset; public class FontDescriptor implements Cloneable { @@ -104,8 +105,8 @@ public class FontDescriptor implements Cloneable { if (useUnicode && unicodeEncoder == null) { try { this.unicodeEncoder = isLE? - Charset.forName("UTF_16LE").newEncoder(): - Charset.forName("UTF_16BE").newEncoder(); + StandardCharset.UTF_16LE.newEncoder(): + StandardCharset.UTF_16BE.newEncoder(); } catch (IllegalArgumentException x) {} } return useUnicode; diff --git a/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/src/share/classes/sun/awt/datatransfer/DataTransferer.java index e8fe5859b2dd74663cd0ef7178f7ec9c7c343d6c..82ff88993497126ca743a2a11f40233a763a1df4 100644 --- a/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -29,12 +29,10 @@ import java.awt.AWTError; import java.awt.EventQueue; import java.awt.Image; import java.awt.Graphics; -import java.awt.Toolkit; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.FlavorMap; import java.awt.datatransfer.FlavorTable; -import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; @@ -66,8 +64,6 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.security.AccessControlContext; -import java.security.AccessControlException; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; @@ -171,7 +167,26 @@ public abstract class DataTransferer { */ public static final DataFlavor javaTextEncodingFlavor; - private static SortedSet standardEncodings; + /** + * Lazy initialization of Standard Encodings. + */ + private static class StandardEncodingsHolder { + private static final SortedSet standardEncodings = load(); + + private static SortedSet load() { + final Comparator comparator = + new CharsetComparator(IndexedComparator.SELECT_WORST); + final SortedSet tempSet = new TreeSet(comparator); + tempSet.add("US-ASCII"); + tempSet.add("ISO-8859-1"); + tempSet.add("UTF-8"); + tempSet.add("UTF-16BE"); + tempSet.add("UTF-16LE"); + tempSet.add("UTF-16"); + tempSet.add(getDefaultTextCharset()); + return Collections.unmodifiableSortedSet(tempSet); + } + } /** * Tracks whether a particular text/* MIME type supports the charset @@ -509,18 +524,7 @@ public abstract class DataTransferer { * non-standard, character sets are not included. */ public static Iterator standardEncodings() { - if (standardEncodings == null) { - TreeSet tempSet = new TreeSet(defaultCharsetComparator); - tempSet.add("US-ASCII"); - tempSet.add("ISO-8859-1"); - tempSet.add("UTF-8"); - tempSet.add("UTF-16BE"); - tempSet.add("UTF-16LE"); - tempSet.add("UTF-16"); - tempSet.add(getDefaultTextCharset()); - standardEncodings = Collections.unmodifiableSortedSet(tempSet); - } - return standardEncodings.iterator(); + return StandardEncodingsHolder.standardEncodings.iterator(); } /** @@ -2398,7 +2402,9 @@ search: public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) { DataFlavor[] flavors = new DataFlavor[flavorsSet.size()]; flavorsSet.toArray(flavors); - Arrays.sort(flavors, defaultFlavorComparator); + final Comparator comparator = + new DataFlavorComparator(IndexedComparator.SELECT_WORST); + Arrays.sort(flavors, comparator); return flavors; } @@ -2455,11 +2461,6 @@ search: return new ArrayList(); } - private static CharsetComparator defaultCharsetComparator = - new CharsetComparator(IndexedComparator.SELECT_WORST); - private static DataFlavorComparator defaultFlavorComparator = - new DataFlavorComparator(IndexedComparator.SELECT_WORST); - /** * A Comparator which includes a helper function for comparing two Objects * which are likely to be keys in the specified Map. diff --git a/src/share/classes/sun/java2d/pisces/Stroker.java b/src/share/classes/sun/java2d/pisces/Stroker.java index dc270c194c87cc6153996682335c661a0f51f4ac..6d4a4c75ac54d34a7627b2e9257e6e142edbb45f 100644 --- a/src/share/classes/sun/java2d/pisces/Stroker.java +++ b/src/share/classes/sun/java2d/pisces/Stroker.java @@ -27,6 +27,8 @@ package sun.java2d.pisces; import java.util.Arrays; import java.util.Iterator; +import static java.lang.Math.ulp; +import static java.lang.Math.sqrt; import sun.awt.geom.PathConsumer2D; @@ -130,7 +132,7 @@ final class Stroker implements PathConsumer2D { private static void computeOffset(final float lx, final float ly, final float w, final float[] m) { - final float len = (float)Math.sqrt(lx*lx + ly*ly); + final float len = (float) sqrt(lx*lx + ly*ly); if (len == 0) { m[0] = m[1] = 0; } else { @@ -217,7 +219,7 @@ final class Stroker implements PathConsumer2D { // this normal's length is at least 0.5 and at most sqrt(2)/2 (because // we know the angle of the arc is > 90 degrees). float nx = my - omy, ny = omx - mx; - float nlen = (float)Math.sqrt(nx*nx + ny*ny); + float nlen = (float) sqrt(nx*nx + ny*ny); float scale = lineWidth2/nlen; float mmx = nx * scale, mmy = ny * scale; @@ -246,8 +248,8 @@ final class Stroker implements PathConsumer2D { // define the bezier curve we're computing. // It is computed using the constraints that P1-P0 and P3-P2 are parallel // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. - float cv = (float)((4.0 / 3.0) * Math.sqrt(0.5-cosext2) / - (1.0 + Math.sqrt(cosext2+0.5))); + float cv = (float) ((4.0 / 3.0) * sqrt(0.5-cosext2) / + (1.0 + sqrt(cosext2+0.5))); // if clockwise, we need to negate cv. if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) cv = -cv; @@ -284,28 +286,20 @@ final class Stroker implements PathConsumer2D { false); } - // Return the intersection point of the lines (x0, y0) -> (x1, y1) - // and (x0p, y0p) -> (x1p, y1p) in m[0] and m[1] - private void computeMiter(final float x0, final float y0, - final float x1, final float y1, - final float x0p, final float y0p, - final float x1p, final float y1p, - final float[] m, int off) + // Put the intersection point of the lines (x0, y0) -> (x1, y1) + // and (x0p, y0p) -> (x1p, y1p) in m[off] and m[off+1]. + // If the lines are parallel, it will put a non finite number in m. + private void computeIntersection(final float x0, final float y0, + final float x1, final float y1, + final float x0p, final float y0p, + final float x1p, final float y1p, + final float[] m, int off) { float x10 = x1 - x0; float y10 = y1 - y0; float x10p = x1p - x0p; float y10p = y1p - y0p; - // if this is 0, the lines are parallel. If they go in the - // same direction, there is no intersection so m[off] and - // m[off+1] will contain infinity, so no miter will be drawn. - // If they go in the same direction that means that the start of the - // current segment and the end of the previous segment have the same - // tangent, in which case this method won't even be involved in - // miter drawing because it won't be called by drawMiter (because - // (mx == omx && my == omy) will be true, and drawMiter will return - // immediately). float den = x10*y10p - x10p*y10; float t = x10p*(y0-y0p) - y10p*(x0-x0p); t /= den; @@ -321,7 +315,8 @@ final class Stroker implements PathConsumer2D { { if ((mx == omx && my == omy) || (pdx == 0 && pdy == 0) || - (dx == 0 && dy == 0)) { + (dx == 0 && dy == 0)) + { return; } @@ -332,12 +327,17 @@ final class Stroker implements PathConsumer2D { my = -my; } - computeMiter((x0 - pdx) + omx, (y0 - pdy) + omy, x0 + omx, y0 + omy, - (dx + x0) + mx, (dy + y0) + my, x0 + mx, y0 + my, - miter, 0); + computeIntersection((x0 - pdx) + omx, (y0 - pdy) + omy, x0 + omx, y0 + omy, + (dx + x0) + mx, (dy + y0) + my, x0 + mx, y0 + my, + miter, 0); float lenSq = (miter[0]-x0)*(miter[0]-x0) + (miter[1]-y0)*(miter[1]-y0); + // If the lines are parallel, lenSq will be either NaN or +inf + // (actually, I'm not sure if the latter is possible. The important + // thing is that -inf is not possible, because lenSq is a square). + // For both of those values, the comparison below will fail and + // no miter will be drawn, which is correct. if (lenSq < miterLimitSq) { emitLineTo(miter[0], miter[1], rev); } @@ -566,8 +566,8 @@ final class Stroker implements PathConsumer2D { // if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4, // in which case ignore if p1 == p2 - final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * Math.ulp(y2)); - final boolean p3eqp4 = within(x3,y3,x4,y4, 6 * Math.ulp(y4)); + final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * ulp(y2)); + final boolean p3eqp4 = within(x3,y3,x4,y4, 6 * ulp(y4)); if (p1eqp2 && p3eqp4) { getLineOffsets(x1, y1, x4, y4, leftOff, rightOff); return 4; @@ -583,7 +583,7 @@ final class Stroker implements PathConsumer2D { float dotsq = (dx1 * dx4 + dy1 * dy4); dotsq = dotsq * dotsq; float l1sq = dx1 * dx1 + dy1 * dy1, l4sq = dx4 * dx4 + dy4 * dy4; - if (Helpers.within(dotsq, l1sq * l4sq, 4 * Math.ulp(dotsq))) { + if (Helpers.within(dotsq, l1sq * l4sq, 4 * ulp(dotsq))) { getLineOffsets(x1, y1, x4, y4, leftOff, rightOff); return 4; } @@ -693,8 +693,6 @@ final class Stroker implements PathConsumer2D { return 8; } - // compute offset curves using bezier spline through t=0.5 (i.e. - // ComputedCurve(0.5) == IdealParallelCurve(0.5)) // return the kind of curve in the right and left arrays. private int computeOffsetQuad(float[] pts, final int off, float[] leftOff, float[] rightOff) @@ -703,58 +701,69 @@ final class Stroker implements PathConsumer2D { final float x2 = pts[off + 2], y2 = pts[off + 3]; final float x3 = pts[off + 4], y3 = pts[off + 5]; - float dx3 = x3 - x2; - float dy3 = y3 - y2; - float dx1 = x2 - x1; - float dy1 = y2 - y1; + final float dx3 = x3 - x2; + final float dy3 = y3 - y2; + final float dx1 = x2 - x1; + final float dy1 = y2 - y1; - // if p1=p2 or p3=p4 it means that the derivative at the endpoint - // vanishes, which creates problems with computeOffset. Usually - // this happens when this stroker object is trying to winden - // a curve with a cusp. What happens is that curveTo splits - // the input curve at the cusp, and passes it to this function. - // because of inaccuracies in the splitting, we consider points - // equal if they're very close to each other. - - // if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4, - // in which case ignore. - final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * Math.ulp(y2)); - final boolean p2eqp3 = within(x2,y2,x3,y3, 6 * Math.ulp(y3)); - if (p1eqp2 || p2eqp3) { - getLineOffsets(x1, y1, x3, y3, leftOff, rightOff); - return 4; - } - - // if p2-p1 and p4-p3 are parallel, that must mean this curve is a line - float dotsq = (dx1 * dx3 + dy1 * dy3); - dotsq = dotsq * dotsq; - float l1sq = dx1 * dx1 + dy1 * dy1, l3sq = dx3 * dx3 + dy3 * dy3; - if (Helpers.within(dotsq, l1sq * l3sq, 4 * Math.ulp(dotsq))) { - getLineOffsets(x1, y1, x3, y3, leftOff, rightOff); - return 4; - } - - // this computes the offsets at t=0, 0.5, 1, using the property that - // for any bezier curve the vectors p2-p1 and p4-p3 are parallel to - // the (dx/dt, dy/dt) vectors at the endpoints. + // this computes the offsets at t = 0, 1 computeOffset(dx1, dy1, lineWidth2, offset[0]); computeOffset(dx3, dy3, lineWidth2, offset[1]); - float x1p = x1 + offset[0][0]; // start - float y1p = y1 + offset[0][1]; // point - float x3p = x3 + offset[1][0]; // end - float y3p = y3 + offset[1][1]; // point - computeMiter(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, leftOff, 2); - leftOff[0] = x1p; leftOff[1] = y1p; - leftOff[4] = x3p; leftOff[5] = y3p; - x1p = x1 - offset[0][0]; y1p = y1 - offset[0][1]; - x3p = x3 - offset[1][0]; y3p = y3 - offset[1][1]; - computeMiter(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, rightOff, 2); - rightOff[0] = x1p; rightOff[1] = y1p; - rightOff[4] = x3p; rightOff[5] = y3p; + leftOff[0] = x1 + offset[0][0]; leftOff[1] = y1 + offset[0][1]; + leftOff[4] = x3 + offset[1][0]; leftOff[5] = y3 + offset[1][1]; + rightOff[0] = x1 - offset[0][0]; rightOff[1] = y1 - offset[0][1]; + rightOff[4] = x3 - offset[1][0]; rightOff[5] = y3 - offset[1][1]; + + float x1p = leftOff[0]; // start + float y1p = leftOff[1]; // point + float x3p = leftOff[4]; // end + float y3p = leftOff[5]; // point + + // Corner cases: + // 1. If the two control vectors are parallel, we'll end up with NaN's + // in leftOff (and rightOff in the body of the if below), so we'll + // do getLineOffsets, which is right. + // 2. If the first or second two points are equal, then (dx1,dy1)==(0,0) + // or (dx3,dy3)==(0,0), so (x1p, y1p)==(x1p+dx1, y1p+dy1) + // or (x3p, y3p)==(x3p-dx3, y3p-dy3), which means that + // computeIntersection will put NaN's in leftOff and right off, and + // we will do getLineOffsets, which is right. + computeIntersection(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, leftOff, 2); + float cx = leftOff[2]; + float cy = leftOff[3]; + + if (!(isFinite(cx) && isFinite(cy))) { + // maybe the right path is not degenerate. + x1p = rightOff[0]; + y1p = rightOff[1]; + x3p = rightOff[4]; + y3p = rightOff[5]; + computeIntersection(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, rightOff, 2); + cx = rightOff[2]; + cy = rightOff[3]; + if (!(isFinite(cx) && isFinite(cy))) { + // both are degenerate. This curve is a line. + getLineOffsets(x1, y1, x3, y3, leftOff, rightOff); + return 4; + } + // {left,right}Off[0,1,4,5] are already set to the correct values. + leftOff[2] = 2*x2 - cx; + leftOff[3] = 2*y2 - cy; + return 6; + } + + // rightOff[2,3] = (x2,y2) - ((left_x2, left_y2) - (x2, y2)) + // == 2*(x2, y2) - (left_x2, left_y2) + rightOff[2] = 2*x2 - cx; + rightOff[3] = 2*y2 - cy; return 6; } + private static boolean isFinite(float x) { + return (Float.NEGATIVE_INFINITY < x && x < Float.POSITIVE_INFINITY); + } + // This is where the curve to be processed is put. We give it // enough room to store 2 curves: one for the current subdivision, the // other for the rest of the curve. @@ -812,12 +821,12 @@ final class Stroker implements PathConsumer2D { // if these vectors are too small, normalize them, to avoid future // precision problems. if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { - float len = (float)Math.sqrt(dxs*dxs + dys*dys); + float len = (float) sqrt(dxs*dxs + dys*dys); dxs /= len; dys /= len; } if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { - float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); + float len = (float) sqrt(dxf*dxf + dyf*dyf); dxf /= len; dyf /= len; } @@ -834,7 +843,6 @@ final class Stroker implements PathConsumer2D { while(it.hasNext()) { int curCurveOff = it.next(); - kind = 0; switch (type) { case 8: kind = computeOffsetCubic(middle, curCurveOff, lp, rp); @@ -843,24 +851,22 @@ final class Stroker implements PathConsumer2D { kind = computeOffsetQuad(middle, curCurveOff, lp, rp); break; } - if (kind != 0) { - emitLineTo(lp[0], lp[1]); - switch(kind) { - case 8: - emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); - emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); - break; - case 6: - emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); - emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); - break; - case 4: - emitLineTo(lp[2], lp[3]); - emitLineTo(rp[0], rp[1], true); - break; - } - emitLineTo(rp[kind - 2], rp[kind - 1], true); + emitLineTo(lp[0], lp[1]); + switch(kind) { + case 8: + emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); + emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); + break; + case 6: + emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); + emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); + break; + case 4: + emitLineTo(lp[2], lp[3]); + emitLineTo(rp[0], rp[1], true); + break; } + emitLineTo(rp[kind - 2], rp[kind - 1], true); } this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; @@ -887,7 +893,7 @@ final class Stroker implements PathConsumer2D { // we rotate it so that the first vector in the control polygon is // parallel to the x-axis. This will ensure that rotated quarter // circles won't be subdivided. - final float hypot = (float)Math.sqrt(x12 * x12 + y12 * y12); + final float hypot = (float) sqrt(x12 * x12 + y12 * y12); final float cos = x12 / hypot; final float sin = y12 / hypot; final float x1 = cos * pts[0] + sin * pts[1]; @@ -976,12 +982,12 @@ final class Stroker implements PathConsumer2D { // if these vectors are too small, normalize them, to avoid future // precision problems. if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { - float len = (float)Math.sqrt(dxs*dxs + dys*dys); + float len = (float) sqrt(dxs*dxs + dys*dys); dxs /= len; dys /= len; } if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { - float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); + float len = (float) sqrt(dxf*dxf + dyf*dyf); dxf /= len; dyf /= len; } @@ -999,20 +1005,18 @@ final class Stroker implements PathConsumer2D { int curCurveOff = it.next(); kind = computeOffsetCubic(middle, curCurveOff, lp, rp); - if (kind != 0) { - emitLineTo(lp[0], lp[1]); - switch(kind) { - case 8: - emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); - emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); - break; - case 4: - emitLineTo(lp[2], lp[3]); - emitLineTo(rp[0], rp[1], true); - break; - } - emitLineTo(rp[kind - 2], rp[kind - 1], true); + emitLineTo(lp[0], lp[1]); + switch(kind) { + case 8: + emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); + emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); + break; + case 4: + emitLineTo(lp[2], lp[3]); + emitLineTo(rp[0], rp[1], true); + break; } + emitLineTo(rp[kind - 2], rp[kind - 1], true); } this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; @@ -1050,12 +1054,12 @@ final class Stroker implements PathConsumer2D { // if these vectors are too small, normalize them, to avoid future // precision problems. if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { - float len = (float)Math.sqrt(dxs*dxs + dys*dys); + float len = (float) sqrt(dxs*dxs + dys*dys); dxs /= len; dys /= len; } if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { - float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); + float len = (float) sqrt(dxf*dxf + dyf*dyf); dxf /= len; dyf /= len; } @@ -1073,20 +1077,18 @@ final class Stroker implements PathConsumer2D { int curCurveOff = it.next(); kind = computeOffsetQuad(middle, curCurveOff, lp, rp); - if (kind != 0) { - emitLineTo(lp[0], lp[1]); - switch(kind) { - case 6: - emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); - emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); - break; - case 4: - emitLineTo(lp[2], lp[3]); - emitLineTo(rp[0], rp[1], true); - break; - } - emitLineTo(rp[kind - 2], rp[kind - 1], true); + emitLineTo(lp[0], lp[1]); + switch(kind) { + case 6: + emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); + emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); + break; + case 4: + emitLineTo(lp[2], lp[3]); + emitLineTo(rp[0], rp[1], true); + break; } + emitLineTo(rp[kind - 2], rp[kind - 1], true); } this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; diff --git a/src/share/classes/sun/misc/FloatingDecimal.java b/src/share/classes/sun/misc/FloatingDecimal.java index 7c621f91a97ae1566934996e82bf6f7278db31f2..1e3a25e84af1cc678681d32deacc264701e903d6 100644 --- a/src/share/classes/sun/misc/FloatingDecimal.java +++ b/src/share/classes/sun/misc/FloatingDecimal.java @@ -30,7 +30,7 @@ import sun.misc.DoubleConsts; import sun.misc.FloatConsts; import java.util.regex.*; -public strictfp class FloatingDecimal{ +public class FloatingDecimal{ boolean isExceptional; boolean isNegative; int decExponent; @@ -239,8 +239,7 @@ public strictfp class FloatingDecimal{ * More difficult if subtracting and the argument * is a normalized a power of 2, as the ULP changes at these points. */ - private static double - ulp( double dval, boolean subtracting ){ + private static double ulp( double dval, boolean subtracting ){ long lbits = Double.doubleToLongBits( dval ) & ~signMask; int binexp = (int)(lbits >>> expShift); double ulpval; @@ -1251,8 +1250,7 @@ public strictfp class FloatingDecimal{ * for a single-precision float. */ - public double - doubleValue(){ + public strictfp double doubleValue(){ int kDigits = Math.min( nDigits, maxDecimalDigits+1 ); long lValue; double dValue; @@ -1611,8 +1609,7 @@ public strictfp class FloatingDecimal{ * ( because of the preference to a zero low-order bit ). */ - public float - floatValue(){ + public strictfp float floatValue(){ int kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 ); int iValue; float fValue; diff --git a/src/share/classes/sun/misc/FormattedFloatingDecimal.java b/src/share/classes/sun/misc/FormattedFloatingDecimal.java index 9d54b0982523ba09ffdc9d9447e02b5a27ee9c71..0b6dd85051fee1c24dfb7e8523b29a67d5184cf6 100644 --- a/src/share/classes/sun/misc/FormattedFloatingDecimal.java +++ b/src/share/classes/sun/misc/FormattedFloatingDecimal.java @@ -30,7 +30,7 @@ import sun.misc.DoubleConsts; import sun.misc.FloatConsts; import java.util.regex.*; -public strictfp class FormattedFloatingDecimal{ +public class FormattedFloatingDecimal{ boolean isExceptional; boolean isNegative; int decExponent; // value set at construction, then immutable @@ -247,8 +247,7 @@ public strictfp class FormattedFloatingDecimal{ * More difficult if subtracting and the argument * is a normalized a power of 2, as the ULP changes at these points. */ - private static double - ulp( double dval, boolean subtracting ){ + private static double ulp( double dval, boolean subtracting ){ long lbits = Double.doubleToLongBits( dval ) & ~signMask; int binexp = (int)(lbits >>> expShift); double ulpval; @@ -1157,8 +1156,7 @@ public strictfp class FormattedFloatingDecimal{ * for a single-precision float. */ - public double - doubleValue(){ + public strictfp double doubleValue(){ int kDigits = Math.min( nDigits, maxDecimalDigits+1 ); long lValue; double dValue; @@ -1517,8 +1515,7 @@ public strictfp class FormattedFloatingDecimal{ * ( because of the preference to a zero low-order bit ). */ - public float - floatValue(){ + public strictfp float floatValue(){ int kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 ); int iValue; float fValue; diff --git a/src/share/classes/sun/misc/JavaxSecurityAuthKerberosAccess.java b/src/share/classes/sun/misc/JavaxSecurityAuthKerberosAccess.java new file mode 100644 index 0000000000000000000000000000000000000000..9c8f9f2d3d20a8e66f27db2e8a61bac0606010ca --- /dev/null +++ b/src/share/classes/sun/misc/JavaxSecurityAuthKerberosAccess.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.misc; + +import javax.security.auth.kerberos.KeyTab; +import sun.security.krb5.EncryptionKey; +import sun.security.krb5.PrincipalName; + +/** + * An unsafe tunnel to get non-public access to classes in the + * javax.security.auth.kerberos package. + */ +public interface JavaxSecurityAuthKerberosAccess { + /** + * Returns keys for a principal in a keytab. + * @return the keys, never null, can be empty. + */ + public EncryptionKey[] keyTabGetEncryptionKeys( + KeyTab ktab, PrincipalName principal); +} diff --git a/src/share/classes/sun/misc/SharedSecrets.java b/src/share/classes/sun/misc/SharedSecrets.java index 0bd39b4a5d42f0b12478143bad17dce21db3ba11..969da9a744fe8dfadf558e8e220f1856fc5c52f5 100644 --- a/src/share/classes/sun/misc/SharedSecrets.java +++ b/src/share/classes/sun/misc/SharedSecrets.java @@ -29,6 +29,7 @@ import java.util.jar.JarFile; import java.io.Console; import java.io.FileDescriptor; import java.security.ProtectionDomain; +import javax.security.auth.kerberos.KeyTab; import java.security.AccessController; @@ -51,6 +52,7 @@ public class SharedSecrets { private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess; private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess; private static JavaSecurityAccess javaSecurityAccess; + private static JavaxSecurityAuthKerberosAccess javaxSecurityAuthKerberosAccess; public static JavaUtilJarAccess javaUtilJarAccess() { if (javaUtilJarAccess == null) { @@ -139,4 +141,16 @@ public class SharedSecrets { } return javaSecurityAccess; } + + public static void setJavaxSecurityAuthKerberosAccess + (JavaxSecurityAuthKerberosAccess jsaka) { + javaxSecurityAuthKerberosAccess = jsaka; + } + + public static JavaxSecurityAuthKerberosAccess + getJavaxSecurityAuthKerberosAccess() { + if (javaxSecurityAuthKerberosAccess == null) + unsafe.ensureClassInitialized(KeyTab.class); + return javaxSecurityAuthKerberosAccess; + } } diff --git a/src/share/classes/sun/nio/cs/UTF_8.java b/src/share/classes/sun/nio/cs/UTF_8.java index 67b7dc841256aa734278704563594b9ad4a15414..56d6bcc7b6d3a098f196b7ab115ddccdf728b979 100644 --- a/src/share/classes/sun/nio/cs/UTF_8.java +++ b/src/share/classes/sun/nio/cs/UTF_8.java @@ -32,6 +32,7 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; import java.nio.charset.CoderResult; +import java.nio.charset.CodingErrorAction; /* Legal UTF-8 Byte Sequences * @@ -77,7 +78,8 @@ class UTF_8 extends Unicode dst.position(dp - dst.arrayOffset()); } - private static class Decoder extends CharsetDecoder { + private static class Decoder extends CharsetDecoder + implements ArrayDecoder { private Decoder(Charset cs) { super(cs, 1.0f, 1.0f); } @@ -353,9 +355,132 @@ class UTF_8 extends Unicode else return decodeBufferLoop(src, dst); } + + private static ByteBuffer getByteBuffer(ByteBuffer bb, byte[] ba, int sp) + { + if (bb == null) + bb = ByteBuffer.wrap(ba); + bb.position(sp); + return bb; + } + + // returns -1 if there is malformed byte(s) and the + // "action" for malformed input is not REPLACE. + public int decode(byte[] sa, int sp, int len, char[] da) { + final int sl = sp + len; + int dp = 0; + int dlASCII = Math.min(len, da.length); + ByteBuffer bb = null; // only necessary if malformed + + // ASCII only optimized loop + while (dp < dlASCII && sa[sp] >= 0) + da[dp++] = (char) sa[sp++]; + + while (sp < sl) { + int b1 = sa[sp++]; + if (b1 >= 0) { + // 1 byte, 7 bits: 0xxxxxxx + da[dp++] = (char) b1; + } else if ((b1 >> 5) == -2) { + // 2 bytes, 11 bits: 110xxxxx 10xxxxxx + if (sp < sl) { + int b2 = sa[sp++]; + if (isMalformed2(b1, b2)) { + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + sp--; // malformedN(bb, 2) always returns 1 + } else { + da[dp++] = (char) (((b1 << 6) ^ b2)^ + (((byte) 0xC0 << 6) ^ + ((byte) 0x80 << 0))); + } + continue; + } + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + return dp; + } else if ((b1 >> 4) == -2) { + // 3 bytes, 16 bits: 1110xxxx 10xxxxxx 10xxxxxx + if (sp + 1 < sl) { + int b2 = sa[sp++]; + int b3 = sa[sp++]; + if (isMalformed3(b1, b2, b3)) { + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + sp -=3; + bb = getByteBuffer(bb, sa, sp); + sp += malformedN(bb, 3).length(); + } else { + da[dp++] = (char)((b1 << 12) ^ + (b2 << 6) ^ + (b3 ^ + (((byte) 0xE0 << 12) ^ + ((byte) 0x80 << 6) ^ + ((byte) 0x80 << 0)))); + } + continue; + } + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + return dp; + } else if ((b1 >> 3) == -2) { + // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + if (sp + 2 < sl) { + int b2 = sa[sp++]; + int b3 = sa[sp++]; + int b4 = sa[sp++]; + int uc = ((b1 << 18) ^ + (b2 << 12) ^ + (b3 << 6) ^ + (b4 ^ + (((byte) 0xF0 << 18) ^ + ((byte) 0x80 << 12) ^ + ((byte) 0x80 << 6) ^ + ((byte) 0x80 << 0)))); + if (isMalformed4(b2, b3, b4) || + // shortest form check + !Character.isSupplementaryCodePoint(uc)) { + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + sp -= 4; + bb = getByteBuffer(bb, sa, sp); + sp += malformedN(bb, 4).length(); + } else { + da[dp++] = Character.highSurrogate(uc); + da[dp++] = Character.lowSurrogate(uc); + } + continue; + } + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + return dp; + } else { + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement().charAt(0); + sp--; + bb = getByteBuffer(bb, sa, sp); + CoderResult cr = malformedN(bb, 1); + if (!cr.isError()) { + // leading byte for 5 or 6-byte, but don't have enough + // bytes in buffer to check. Consumed rest as malformed. + return dp; + } + sp += cr.length(); + } + } + return dp; + } } - private static class Encoder extends CharsetEncoder { + private static class Encoder extends CharsetEncoder + implements ArrayEncoder { private Encoder(Charset cs) { super(cs, 1.1f, 3.0f); @@ -495,5 +620,50 @@ class UTF_8 extends Unicode else return encodeBufferLoop(src, dst); } + + // returns -1 if there is malformed char(s) and the + // "action" for malformed input is not REPLACE. + public int encode(char[] sa, int sp, int len, byte[] da) { + int sl = sp + len; + int dp = 0; + int dlASCII = dp + Math.min(len, da.length); + + // ASCII only optimized loop + while (dp < dlASCII && sa[sp] < '\u0080') + da[dp++] = (byte) sa[sp++]; + + while (sp < sl) { + char c = sa[sp++]; + if (c < 0x80) { + // Have at most seven bits + da[dp++] = (byte)c; + } else if (c < 0x800) { + // 2 bytes, 11 bits + da[dp++] = (byte)(0xc0 | (c >> 6)); + da[dp++] = (byte)(0x80 | (c & 0x3f)); + } else if (Character.isSurrogate(c)) { + if (sgp == null) + sgp = new Surrogate.Parser(); + int uc = sgp.parse(c, sa, sp - 1, sl); + if (uc < 0) { + if (malformedInputAction() != CodingErrorAction.REPLACE) + return -1; + da[dp++] = replacement()[0]; + } else { + da[dp++] = (byte)(0xf0 | ((uc >> 18))); + da[dp++] = (byte)(0x80 | ((uc >> 12) & 0x3f)); + da[dp++] = (byte)(0x80 | ((uc >> 6) & 0x3f)); + da[dp++] = (byte)(0x80 | (uc & 0x3f)); + sp++; // 2 chars + } + } else { + // 3 bytes, 16 bits + da[dp++] = (byte)(0xe0 | ((c >> 12))); + da[dp++] = (byte)(0x80 | ((c >> 6) & 0x3f)); + da[dp++] = (byte)(0x80 | (c & 0x3f)); + } + } + return dp; + } } } diff --git a/src/share/classes/sun/rmi/log/ReliableLog.java b/src/share/classes/sun/rmi/log/ReliableLog.java index 30ea3f1d4647b4e5cc067a38f47cc7c1fca0d190..fe512c2d87c1273c6e851365e65c675cc19b52fa 100644 --- a/src/share/classes/sun/rmi/log/ReliableLog.java +++ b/src/share/classes/sun/rmi/log/ReliableLog.java @@ -380,9 +380,7 @@ public class ReliableLog { } catch (IOException e) { throw e; } catch (Exception e) { - throw new IOException("snapshot failed with exception of type: " + - e.getClass().getName() + - ", message was: " + e.getMessage()); + throw new IOException("snapshot failed", e); } lastSnapshot = System.currentTimeMillis(); } finally { diff --git a/src/share/classes/sun/rmi/server/Activation.java b/src/share/classes/sun/rmi/server/Activation.java index 119910ed5ccb0760a8629e2547f32d5d1aab6e17..919edb7fb657ab45cfb99212f015eceb9e685a7f 100644 --- a/src/share/classes/sun/rmi/server/Activation.java +++ b/src/share/classes/sun/rmi/server/Activation.java @@ -30,6 +30,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ObjectInputStream; import java.io.OutputStream; import java.io.PrintStream; import java.io.PrintWriter; @@ -98,6 +99,7 @@ import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import sun.rmi.log.LogHandler; import sun.rmi.log.ReliableLog; import sun.rmi.registry.RegistryImpl; @@ -147,10 +149,10 @@ public class Activation implements Serializable { /** maps activation id to its respective group id */ private Map idTable = - new HashMap(); + new ConcurrentHashMap<>(); /** maps group id to its GroupEntry groups */ private Map groupTable = - new HashMap(); + new ConcurrentHashMap<>(); private byte majorVersion = MAJOR_VERSION; private byte minorVersion = MINOR_VERSION; @@ -236,9 +238,11 @@ public class Activation implements Serializable { groupSemaphore = getInt("sun.rmi.activation.groupThrottle", 3); groupCounter = 0; Runtime.getRuntime().addShutdownHook(shutdownHook); + + // Use array size of 0, since the value from calling size() + // may be out of date by the time toArray() is called. ActivationGroupID[] gids = - groupTable.keySet().toArray( - new ActivationGroupID[groupTable.size()]); + groupTable.keySet().toArray(new ActivationGroupID[0]); synchronized (startupLock = new Object()) { // all the remote methods briefly synchronize on startupLock @@ -274,6 +278,23 @@ public class Activation implements Serializable { } } + /** + * Previous versions used HashMap instead of ConcurrentHashMap. + * Replace any HashMaps found during deserialization with + * ConcurrentHashMaps. + */ + private void readObject(ObjectInputStream ois) + throws IOException, ClassNotFoundException + { + ois.defaultReadObject(); + if (! (groupTable instanceof ConcurrentHashMap)) { + groupTable = new ConcurrentHashMap<>(groupTable); + } + if (! (idTable instanceof ConcurrentHashMap)) { + idTable = new ConcurrentHashMap<>(idTable); + } + } + private static class SystemRegistryImpl extends RegistryImpl { private static final String NAME = ActivationSystem.class.getName(); @@ -488,9 +509,7 @@ public class Activation implements Serializable { ActivationGroupID id = new ActivationGroupID(systemStub); GroupEntry entry = new GroupEntry(id, desc); // table insertion must take place before log update - synchronized (groupTable) { - groupTable.put(id, entry); - } + groupTable.put(id, entry); addLogRecord(new LogRegisterGroup(id, desc)); return id; } @@ -515,11 +534,7 @@ public class Activation implements Serializable { // remove entry before unregister so state is updated before // logged - synchronized (groupTable) { - GroupEntry entry = getGroupEntry(id); - groupTable.remove(id); - entry.unregisterGroup(true); - } + removeGroupEntry(id).unregisterGroup(true); } public ActivationDesc setActivationDesc(ActivationID id, @@ -637,12 +652,7 @@ public class Activation implements Serializable { unexport(system); // destroy all child processes (groups) - GroupEntry[] groupEntries; - synchronized (groupTable) { - groupEntries = groupTable.values(). - toArray(new GroupEntry[groupTable.size()]); - } - for (GroupEntry groupEntry : groupEntries) { + for (GroupEntry groupEntry : groupTable.values()) { groupEntry.shutdown(); } @@ -693,10 +703,8 @@ public class Activation implements Serializable { } // destroy all child processes (groups) quickly - synchronized (groupTable) { - for (GroupEntry groupEntry : groupTable.values()) { - groupEntry.shutdownFast(); - } + for (GroupEntry groupEntry : groupTable.values()) { + groupEntry.shutdownFast(); } } } @@ -708,33 +716,54 @@ public class Activation implements Serializable { private ActivationGroupID getGroupID(ActivationID id) throws UnknownObjectException { - synchronized (idTable) { - ActivationGroupID groupID = idTable.get(id); - if (groupID != null) { - return groupID; - } + ActivationGroupID groupID = idTable.get(id); + if (groupID != null) { + return groupID; } throw new UnknownObjectException("unknown object: " + id); } /** - * Returns the group entry for the group id. Throws - * UnknownGroupException if the group is not registered. + * Returns the group entry for the group id, optionally removing it. + * Throws UnknownGroupException if the group is not registered. */ - private GroupEntry getGroupEntry(ActivationGroupID id) + private GroupEntry getGroupEntry(ActivationGroupID id, boolean rm) throws UnknownGroupException { if (id.getClass() == ActivationGroupID.class) { - synchronized (groupTable) { - GroupEntry entry = groupTable.get(id); - if (entry != null && !entry.removed) { - return entry; - } + GroupEntry entry; + if (rm) { + entry = groupTable.remove(id); + } else { + entry = groupTable.get(id); + } + if (entry != null && !entry.removed) { + return entry; } } throw new UnknownGroupException("group unknown"); } + /** + * Returns the group entry for the group id. Throws + * UnknownGroupException if the group is not registered. + */ + private GroupEntry getGroupEntry(ActivationGroupID id) + throws UnknownGroupException + { + return getGroupEntry(id, false); + } + + /** + * Removes and returns the group entry for the group id. Throws + * UnknownGroupException if the group is not registered. + */ + private GroupEntry removeGroupEntry(ActivationGroupID id) + throws UnknownGroupException + { + return getGroupEntry(id, true); + } + /** * Returns the group entry for the object's id. Throws * UnknownObjectException if the object is not registered or the @@ -744,11 +773,9 @@ public class Activation implements Serializable { throws UnknownObjectException { ActivationGroupID gid = getGroupID(id); - synchronized (groupTable) { - GroupEntry entry = groupTable.get(gid); - if (entry != null) { - return entry; - } + GroupEntry entry = groupTable.get(gid); + if (entry != null && !entry.removed) { + return entry; } throw new UnknownObjectException("object's group removed"); } @@ -882,9 +909,7 @@ public class Activation implements Serializable { } // table insertion must take place before log update - synchronized (idTable) { - idTable.put(id, groupID); - } + idTable.put(id, groupID); if (addRecord) { addLogRecord(new LogRegisterObject(id, desc)); @@ -901,10 +926,8 @@ public class Activation implements Serializable { restartSet.remove(id); } - // table insertion must take place before log update - synchronized (idTable) { - idTable.remove(id); - } + // table removal must take place before log update + idTable.remove(id); if (addRecord) { addLogRecord(new LogUnregisterObject(id)); } @@ -919,9 +942,7 @@ public class Activation implements Serializable { objects.entrySet()) { ActivationID id = entry.getKey(); - synchronized (idTable) { - idTable.remove(id); - } + idTable.remove(id); ObjectEntry objEntry = entry.getValue(); objEntry.removed = true; } diff --git a/src/share/classes/sun/security/ec/ECKeyPairGenerator.java b/src/share/classes/sun/security/ec/ECKeyPairGenerator.java index 6f994ec1f5e84d322ef9464d0821bb9cf83d13fb..046fb42b7d2025807401c5686478cb902859bdc4 100644 --- a/src/share/classes/sun/security/ec/ECKeyPairGenerator.java +++ b/src/share/classes/sun/security/ec/ECKeyPairGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,15 +121,16 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi { } random.nextBytes(seed); - long[] handles = generateECKeyPair(keySize, encodedParams, seed); + try { - // The 'params' object supplied above is equivalent to the native one - // so there is no need to fetch it. + long[] handles = generateECKeyPair(keySize, encodedParams, seed); - // handles[0] points to the native private key - BigInteger s = new BigInteger(1, getEncodedBytes(handles[0])); + // The 'params' object supplied above is equivalent to the native + // one so there is no need to fetch it. + + // handles[0] points to the native private key + BigInteger s = new BigInteger(1, getEncodedBytes(handles[0])); - try { PrivateKey privateKey = new ECPrivateKeyImpl(s, (ECParameterSpec)params); @@ -163,7 +164,7 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi { * The first handle points to the private key, the second to the public key. */ private static native long[] generateECKeyPair(int keySize, - byte[] encodedParams, byte[] seed); + byte[] encodedParams, byte[] seed) throws GeneralSecurityException; /* * Extracts the encoded key data using the supplied handle. diff --git a/src/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java b/src/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java index 7a7156d9b1cad0b1b093e8c1ed3cb9f9c65d8e38..1df500bc5242a8bd217bb818a499c4659b1efde6 100644 --- a/src/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java +++ b/src/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ import org.ietf.jgss.*; import sun.security.jgss.GSSCaller; import sun.security.jgss.spi.*; import sun.security.krb5.*; -import javax.security.auth.kerberos.*; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.security.AccessController; @@ -43,40 +42,23 @@ import javax.security.auth.DestroyFailedException; * @since 1.4 */ public class Krb5AcceptCredential - extends KerberosKey implements Krb5CredElement { private static final long serialVersionUID = 7714332137352567952L; private Krb5NameElement name; - /** - * We cache an EncryptionKey representation of this key because many - * Krb5 operation require a key in that form. At some point we might do - * away with EncryptionKey altogether and use the base class - * KerberosKey everywhere. - */ - private EncryptionKey[] krb5EncryptionKeys; + private Krb5Util.ServiceCreds screds; - private Krb5AcceptCredential(Krb5NameElement name, KerberosKey[] keys) { + private Krb5AcceptCredential(Krb5NameElement name, Krb5Util.ServiceCreds creds) { /* * Initialize this instance with the data from the acquired * KerberosKey. This class needs to be a KerberosKey too * hence we can't just store a reference. */ - super(keys[0].getPrincipal(), - keys[0].getEncoded(), - keys[0].getKeyType(), - keys[0].getVersionNumber()); this.name = name; - // Cache this for later use by the sun.security.krb5 package. - krb5EncryptionKeys = new EncryptionKey[keys.length]; - for (int i = 0; i < keys.length; i++) { - krb5EncryptionKeys[i] = new EncryptionKey(keys[i].getEncoded(), - keys[i].getKeyType(), - new Integer(keys[i].getVersionNumber())); - } + this.screds = creds; } static Krb5AcceptCredential getInstance(final GSSCaller caller, Krb5NameElement name) @@ -86,12 +68,12 @@ public class Krb5AcceptCredential name.getKrb5PrincipalName().getName()); final AccessControlContext acc = AccessController.getContext(); - KerberosKey[] keys; + Krb5Util.ServiceCreds creds = null; try { - keys = AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public KerberosKey[] run() throws Exception { - return Krb5Util.getKeys( + creds = AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Krb5Util.ServiceCreds run() throws Exception { + return Krb5Util.getServiceCreds( caller == GSSCaller.CALLER_UNKNOWN ? GSSCaller.CALLER_ACCEPT: caller, serverPrinc, acc); }}); @@ -103,17 +85,17 @@ public class Krb5AcceptCredential throw ge; } - if (keys == null || keys.length == 0) + if (creds == null) throw new GSSException(GSSException.NO_CRED, -1, - "Failed to find any Kerberos Key"); + "Failed to find any Kerberos credentails"); if (name == null) { - String fullName = keys[0].getPrincipal().getName(); + String fullName = creds.getName(); name = Krb5NameElement.getInstance(fullName, Krb5MechFactory.NT_GSS_KRB5_PRINCIPAL); } - return new Krb5AcceptCredential(name, keys); + return new Krb5AcceptCredential(name, creds); } /** @@ -171,7 +153,7 @@ public class Krb5AcceptCredential } EncryptionKey[] getKrb5EncryptionKeys() { - return krb5EncryptionKeys; + return screds.getEKeys(); } /** @@ -193,13 +175,6 @@ public class Krb5AcceptCredential * destroy in the base class. */ public void destroy() throws DestroyFailedException { - if (krb5EncryptionKeys != null) { - for (int i = 0; i < krb5EncryptionKeys.length; i++) { - krb5EncryptionKeys[i].destroy(); - } - krb5EncryptionKeys = null; - } - - super.destroy(); + screds.destroy(); } } diff --git a/src/share/classes/sun/security/jgss/krb5/Krb5Util.java b/src/share/classes/sun/security/jgss/krb5/Krb5Util.java index d5b172f92497ecd41b6b2faffb50b64fc0da1356..22552a71c3fff910153721985e9b98ffe667da5a 100644 --- a/src/share/classes/sun/security/jgss/krb5/Krb5Util.java +++ b/src/share/classes/sun/security/jgss/krb5/Krb5Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package sun.security.jgss.krb5; import javax.security.auth.kerberos.KerberosTicket; import javax.security.auth.kerberos.KerberosKey; import javax.security.auth.kerberos.KerberosPrincipal; +import javax.security.auth.kerberos.KeyTab; import javax.security.auth.Subject; import javax.security.auth.login.LoginException; import java.security.AccessControlContext; @@ -38,7 +39,13 @@ import sun.security.krb5.Credentials; import sun.security.krb5.EncryptionKey; import sun.security.krb5.KrbException; import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.Objects; +import java.util.Set; +import sun.misc.SharedSecrets; +import sun.security.krb5.PrincipalName; /** * Utilities for obtaining and converting Kerberos tickets. * @@ -75,7 +82,7 @@ public class Krb5Util { // 1. Try to find service ticket in acc subject Subject accSubj = Subject.getSubject(acc); - KerberosTicket ticket = (KerberosTicket) SubjectComber.find(accSubj, + KerberosTicket ticket = SubjectComber.find(accSubj, serverPrincipal, clientPrincipal, KerberosTicket.class); if (ticket != null) { @@ -87,7 +94,7 @@ public class Krb5Util { // 2. Try to get ticket from login try { loginSubj = GSSUtil.login(caller, GSSUtil.GSS_KRB5_MECH_OID); - ticket = (KerberosTicket) SubjectComber.find(loginSubj, + ticket = SubjectComber.find(loginSubj, serverPrincipal, clientPrincipal, KerberosTicket.class); if (ticket != null) { return ticket; // found it @@ -102,13 +109,13 @@ public class Krb5Util { // Try to get TGT to acquire service ticket // 3. Try to get TGT from acc subject - KerberosTicket tgt = (KerberosTicket) SubjectComber.find(accSubj, + KerberosTicket tgt = SubjectComber.find(accSubj, tgsPrincipal, clientPrincipal, KerberosTicket.class); boolean fromAcc; if (tgt == null && loginSubj != null) { // 4. Try to get TGT from login subject - tgt = (KerberosTicket) SubjectComber.find(loginSubj, + tgt = SubjectComber.find(loginSubj, tgsPrincipal, clientPrincipal, KerberosTicket.class); fromAcc = false; } else { @@ -145,14 +152,14 @@ public class Krb5Util { // Try to get ticket from acc's Subject Subject accSubj = Subject.getSubject(acc); - KerberosTicket ticket = (KerberosTicket) + KerberosTicket ticket = SubjectComber.find(accSubj, serverPrincipal, clientPrincipal, KerberosTicket.class); // Try to get ticket from Subject obtained from GSSUtil if (ticket == null && !GSSUtil.useSubjectCredsOnly(caller)) { Subject subject = GSSUtil.login(caller, GSSUtil.GSS_KRB5_MECH_OID); - ticket = (KerberosTicket) SubjectComber.find(subject, + ticket = SubjectComber.find(subject, serverPrincipal, clientPrincipal, KerberosTicket.class); } return ticket; @@ -182,37 +189,152 @@ public class Krb5Util { return subject; } + // A special KerberosKey, used as keys read from a KeyTab object. + // Each time new keys are read from KeyTab objects in the private + // credentials set, old ones are removed and new ones added. + public static class KeysFromKeyTab extends KerberosKey { + public KeysFromKeyTab(KerberosKey key) { + super(key.getPrincipal(), key.getEncoded(), + key.getKeyType(), key.getVersionNumber()); + } + } + /** - * Retrieves the keys for the specified server principal from - * the Subject in the specified AccessControlContext. - * If the ticket can not be found in the Subject, and if - * useSubjectCredsOnly is false, then obtain keys from - * a LoginContext. + * Credentials of a service, the private secret to authenticate its + * identity, which can be: + * 1. Some KerberosKeys (generated from password) + * 2. A KeyTab (for a typical service) + * 3. A TGT (for a user2user service. Not supported yet) * - * NOTE: This method is used by JSSE Kerberos Cipher Suites + * Note that some creds can coexist. For example, a user2user service + * can use its keytab (or keys) if the client can successfully obtain a + * normal service ticket, otherwise, it can uses the TGT (actually, the + * session key of the TGT) if the client can only acquire a service ticket + * of ENC-TKT-IN-SKEY style. */ - public static KerberosKey[] getKeys(GSSCaller caller, + public static class ServiceCreds { + private KerberosPrincipal kp; + private List ktabs; + private List kk; + private Subject subj; + //private KerberosTicket tgt; // user2user, not supported yet + + private static ServiceCreds getInstance( + Subject subj, String serverPrincipal) { + + ServiceCreds sc = new ServiceCreds(); + sc.subj = subj; + + for (KerberosPrincipal p: subj.getPrincipals(KerberosPrincipal.class)) { + if (serverPrincipal == null || + p.getName().equals(serverPrincipal)) { + sc.kp = p; + serverPrincipal = p.getName(); + break; + } + } + if (sc.kp == null) { + // Compatibility with old behavior: even when there is no + // KerberosPrincipal, we can find one from KerberosKeys + List keys = SubjectComber.findMany( + subj, null, null, KerberosKey.class); + if (!keys.isEmpty()) { + sc.kp = keys.get(0).getPrincipal(); + serverPrincipal = sc.kp.getName(); + if (DEBUG) { + System.out.println(">>> ServiceCreds: no kp?" + + " find one from kk: " + serverPrincipal); + } + } else { + return null; + } + } + sc.ktabs = SubjectComber.findMany( + subj, null, null, KeyTab.class); + sc.kk = SubjectComber.findMany( + subj, serverPrincipal, null, KerberosKey.class); + if (sc.ktabs.isEmpty() && sc.kk.isEmpty()) { + return null; + } + return sc; + } + + public String getName() { + return kp.getName(); + } + + public KerberosKey[] getKKeys() { + if (ktabs.isEmpty()) { + return kk.toArray(new KerberosKey[kk.size()]); + } else { + List keys = new ArrayList<>(); + for (KeyTab ktab: ktabs) { + for (KerberosKey k: ktab.getKeys(kp)) { + keys.add(k); + } + } + // Compatibility: also add keys to privCredSet. Remove old + // ones first, only remove those from keytab. + if (!subj.isReadOnly()) { + Set pcs = subj.getPrivateCredentials(); + synchronized (pcs) { + Iterator iterator = pcs.iterator(); + while (iterator.hasNext()) { + Object obj = iterator.next(); + if (obj instanceof KeysFromKeyTab) { + KerberosKey key = (KerberosKey)obj; + if (Objects.equals(key.getPrincipal(), kp)) { + iterator.remove(); + } + } + } + } + for (KerberosKey key: keys) { + subj.getPrivateCredentials().add(new KeysFromKeyTab(key)); + } + } + return keys.toArray(new KerberosKey[keys.size()]); + } + } + + public EncryptionKey[] getEKeys() { + KerberosKey[] kkeys = getKKeys(); + EncryptionKey[] ekeys = new EncryptionKey[kkeys.length]; + for (int i=0; i kkeys = (List)SubjectComber.findMany( - accSubj, serverPrincipal, null, KerberosKey.class); - - if (kkeys == null && !GSSUtil.useSubjectCredsOnly(caller)) { - Subject subject = GSSUtil.login(caller, GSSUtil.GSS_KRB5_MECH_OID); - kkeys = (List) SubjectComber.findMany(subject, - serverPrincipal, null, KerberosKey.class); + ServiceCreds sc = null; + if (accSubj != null) { + sc = ServiceCreds.getInstance(accSubj, serverPrincipal); } - - int len; - if (kkeys != null && (len = kkeys.size()) > 0) { - KerberosKey[] keys = new KerberosKey[len]; - kkeys.toArray(keys); - return keys; - } else { - return null; + if (sc == null && !GSSUtil.useSubjectCredsOnly(caller)) { + Subject subject = GSSUtil.login(caller, GSSUtil.GSS_KRB5_MECH_OID); + sc = ServiceCreds.getInstance(subject, serverPrincipal); } + return sc; } public static KerberosTicket credsToTicket(Credentials serviceCreds) { @@ -247,4 +369,17 @@ public class Krb5Util { kerbTicket.getRenewTill(), kerbTicket.getClientAddresses()); } + + /** + * A helper method to get EncryptionKeys from a javax..KeyTab + * @param ktab the javax..KeyTab class + * @param cname the PrincipalName + * @return the EKeys, never null, might be empty + */ + public static EncryptionKey[] keysFromJavaxKeyTab( + KeyTab ktab, PrincipalName cname) { + return SharedSecrets.getJavaxSecurityAuthKerberosAccess(). + keyTabGetEncryptionKeys(ktab, cname); + } + } diff --git a/src/share/classes/sun/security/jgss/krb5/SubjectComber.java b/src/share/classes/sun/security/jgss/krb5/SubjectComber.java index e33867dedc87988dc9a5f236d62d3e46e4316c84..c7269cb874f6919b193aaa636a984dd6ba921ca2 100644 --- a/src/share/classes/sun/security/jgss/krb5/SubjectComber.java +++ b/src/share/classes/sun/security/jgss/krb5/SubjectComber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,10 +33,11 @@ import java.util.Iterator; import java.util.ArrayList; import java.util.List; import java.util.Set; +import javax.security.auth.kerberos.KeyTab; /** - * This utility looks through the current Subject and retrieves a ticket or key - * for the desired client/server principals. + * This utility looks through the current Subject and retrieves private + * credentials for the desired client/server principals. * * @author Ram Marti * @since 1.4.2 @@ -52,58 +53,70 @@ class SubjectComber { private SubjectComber() { // Cannot create one of these } - static Object find(Subject subject, String serverPrincipal, - String clientPrincipal, Class credClass) { + static T find(Subject subject, String serverPrincipal, + String clientPrincipal, Class credClass) { - return findAux(subject, serverPrincipal, clientPrincipal, credClass, + return (T)findAux(subject, serverPrincipal, clientPrincipal, credClass, true); } - static Object findMany(Subject subject, String serverPrincipal, - String clientPrincipal, Class credClass) { + static List findMany(Subject subject, String serverPrincipal, + String clientPrincipal, Class credClass) { - return findAux(subject, serverPrincipal, clientPrincipal, credClass, + return (List)findAux(subject, serverPrincipal, clientPrincipal, credClass, false); } /** - * Find the ticket or key for the specified client/server principals + * Find private credentials for the specified client/server principals * in the subject. Returns null if the subject is null. * - * @return the ticket or key + * @return the private credentials */ - private static Object findAux(Subject subject, String serverPrincipal, - String clientPrincipal, Class credClass, boolean oneOnly) { + private static Object findAux(Subject subject, String serverPrincipal, + String clientPrincipal, Class credClass, boolean oneOnly) { if (subject == null) { return null; } else { - List answer = (oneOnly ? null : new ArrayList()); + List answer = (oneOnly ? null : new ArrayList()); - if (credClass == KerberosKey.class) { - // We are looking for a KerberosKey credentials for the - // serverPrincipal - Iterator iterator = - subject.getPrivateCredentials(KerberosKey.class).iterator(); + if (credClass == KeyTab.class) { // Principal un-related + // We are looking for credentials unrelated to serverPrincipal + Iterator iterator = + subject.getPrivateCredentials(credClass).iterator(); while (iterator.hasNext()) { - KerberosKey key = iterator.next(); - if (serverPrincipal == null || - serverPrincipal.equals(key.getPrincipal().getName())) { + T t = iterator.next(); + if (DEBUG) { + System.out.println("Found " + credClass.getSimpleName()); + } + if (oneOnly) { + return t; + } else { + answer.add(t); + } + } + } else if (credClass == KerberosKey.class) { + // We are looking for credentials for the serverPrincipal + Iterator iterator = + subject.getPrivateCredentials(credClass).iterator(); + while (iterator.hasNext()) { + T t = iterator.next(); + String name = ((KerberosKey)t).getPrincipal().getName(); + if (serverPrincipal == null || serverPrincipal.equals(name)) { if (DEBUG) { - System.out.println("Found key for " - + key.getPrincipal() + "(" + - key.getKeyType() + ")"); + System.out.println("Found " + + credClass.getSimpleName() + " for " + name); } if (oneOnly) { - return key; + return t; } else { if (serverPrincipal == null) { // Record name so that keys returned will all // belong to the same principal - serverPrincipal = - key.getPrincipal().getName(); + serverPrincipal = name; } - answer.add(key); + answer.add(t); } } } @@ -167,7 +180,7 @@ class SubjectComber { serverPrincipal = ticket.getServer().getName(); } - answer.add(ticket); + answer.add((T)ticket); } } } diff --git a/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java b/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java index e89006f7aea11c47fdac7f9d08a4952009bacc79..65867fdf4786103531d5299dcd1ce005ecd66e25 100644 --- a/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java +++ b/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -152,75 +152,50 @@ public class NegTokenInit extends SpNegoToken { "did not have the Sequence tag"); } - // parse SEQUENCE of mechTypes, if present - if (tmp1.data.available() > 0) { + // parse various fields if present + int lastField = -1; + while (tmp1.data.available() > 0) { DerValue tmp2 = tmp1.data.getDerValue(); - if (!tmp2.isContextSpecific((byte)0x00)) { - throw new IOException("SPNEGO NegoTokenInit : " + - "did not have the right context tag for mechTypes"); - } - // get the DER-encoded sequence of mechTypes - DerInputStream mValue = tmp2.data; - mechTypes = mValue.toByteArray(); - - // read all the mechTypes - DerValue[] mList = mValue.getSequence(0); - mechTypeList = new Oid[mList.length]; - ObjectIdentifier mech = null; - for (int i = 0; i < mList.length; i++) { - mech = mList[i].getOID(); + if (tmp2.isContextSpecific((byte)0x00)) { + // get the DER-encoded sequence of mechTypes + lastField = checkNextField(lastField, 0); + DerInputStream mValue = tmp2.data; + mechTypes = mValue.toByteArray(); + + // read all the mechTypes + DerValue[] mList = mValue.getSequence(0); + mechTypeList = new Oid[mList.length]; + ObjectIdentifier mech = null; + for (int i = 0; i < mList.length; i++) { + mech = mList[i].getOID(); + if (DEBUG) { + System.out.println("SpNegoToken NegTokenInit: " + + "reading Mechanism Oid = " + mech); + } + mechTypeList[i] = new Oid(mech.toString()); + } + } else if (tmp2.isContextSpecific((byte)0x01)) { + lastField = checkNextField(lastField, 1); + // received reqFlags, skip it + } else if (tmp2.isContextSpecific((byte)0x02)) { + lastField = checkNextField(lastField, 2); if (DEBUG) { System.out.println("SpNegoToken NegTokenInit: " + - "reading Mechanism Oid = " + mech); + "reading Mech Token"); } - mechTypeList[i] = new Oid(mech.toString()); - } - } - - // parse mechToken, if present (skip reqFlags) - if (tmp1.data.available() > 0) { - DerValue tmp3 = tmp1.data.getDerValue(); - if (tmp3.isContextSpecific((byte)0x01)) { - // received reqFlags, skip it - // now parse next field mechToken - if (tmp1.data.available() > 0) { - tmp3 = tmp1.data.getDerValue(); + mechToken = tmp2.data.getOctetString(); + } else if (tmp2.isContextSpecific((byte)0x03)) { + lastField = checkNextField(lastField, 3); + if (!GSSUtil.useMSInterop()) { + mechListMIC = tmp2.data.getOctetString(); + if (DEBUG) { + System.out.println("SpNegoToken NegTokenInit: " + + "MechListMIC Token = " + + getHexBytes(mechListMIC)); + } } } - if (!tmp3.isContextSpecific((byte)0x02)) { - throw new IOException("SPNEGO NegoTokenInit : " + - "did not have the right context tag for mechToken"); - } - if (DEBUG) { - System.out.println("SpNegoToken NegTokenInit: " + - "reading Mech Token"); - } - mechToken = tmp3.data.getOctetString(); } - - // parse mechListMIC, if present and not in MS interop mode - if (!GSSUtil.useMSInterop() && (tmp1.data.available() > 0)) { - if (DEBUG) { - System.out.println("SpNegoToken NegTokenInit: " + - "receiving MechListMIC"); - } - DerValue tmp6 = tmp1.data.getDerValue(); - if (!tmp6.isContextSpecific((byte)0x03)) { - throw new IOException("SPNEGO NegoTokenInit : " + - "did not have the right context tag for MICToken"); - } - mechListMIC = tmp6.data.getOctetString(); - if (DEBUG) { - System.out.println("SpNegoToken NegTokenInit: " + - "MechListMIC Token = " + getHexBytes(mechListMIC)); - } - } else { - if (DEBUG) { - System.out.println("SpNegoToken NegTokenInit : " + - "no MIC token included"); - } - } - } catch (IOException e) { throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, "Invalid SPNEGO NegTokenInit token : " + e.getMessage()); diff --git a/src/share/classes/sun/security/jgss/spnego/NegTokenTarg.java b/src/share/classes/sun/security/jgss/spnego/NegTokenTarg.java index c751666c6a6b3e2fea764790cce7ec93da216c6c..1a4333ff298d088e14fc87ef0139973d487a6e4d 100644 --- a/src/share/classes/sun/security/jgss/spnego/NegTokenTarg.java +++ b/src/share/classes/sun/security/jgss/spnego/NegTokenTarg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -153,69 +153,40 @@ public class NegTokenTarg extends SpNegoToken { "did not have the Sequence tag"); } - // parse negResult, if present - if (tmp1.data.available() > 0) { + // parse various fields if present + int lastField = -1; + while (tmp1.data.available() > 0) { DerValue tmp2 = tmp1.data.getDerValue(); - if (!tmp2.isContextSpecific((byte)0x00)) { - throw new IOException("SPNEGO NegoTokenTarg : " + - "did not have the right context tag for negResult"); - } - negResult = tmp2.data.getEnumerated(); - if (DEBUG) { - System.out.println("SpNegoToken NegTokenTarg: negotiated" + - " result = " + getNegoResultString(negResult)); - } - } - - // parse supportedMech, if present - if (tmp1.data.available() > 0) { - DerValue tmp3 = tmp1.data.getDerValue(); - if (!tmp3.isContextSpecific((byte)0x01)) { - throw new IOException("SPNEGO NegoTokenTarg : " + - "did not have the right context tag for supportedMech"); - } - ObjectIdentifier mech = tmp3.data.getOID(); - supportedMech = new Oid(mech.toString()); - if (DEBUG) { - System.out.println("SpNegoToken NegTokenTarg: " + - "supported mechanism = " + supportedMech); - } - } - - // parse ResponseToken, if present - if (tmp1.data.available() > 0) { - DerValue tmp4 = tmp1.data.getDerValue(); - if (!tmp4.isContextSpecific((byte)0x02)) { - throw new IOException("SPNEGO NegoTokenTarg : did not" + - " have the right context tag for response token"); - } - responseToken = tmp4.data.getOctetString(); - } - - // parse mechListMIC if present and not in MS interop - if (!GSSUtil.useMSInterop() && (tmp1.data.available() > 0)) { - if (DEBUG) { - System.out.println("SpNegoToken NegTokenTarg: " + - "receiving MechListMIC"); - } - DerValue tmp5 = tmp1.data.getDerValue(); - if (!tmp5.isContextSpecific((byte)0x03)) { - throw new IOException("SPNEGO NegoTokenTarg : " + - "did not have the right context tag for mechListMIC"); - } - mechListMIC = tmp5.data.getOctetString(); - if (DEBUG) { - System.out.println("SpNegoToken NegTokenTarg: " + - "MechListMIC Token = " + - getHexBytes(mechListMIC)); - } - } else { - if (DEBUG) { - System.out.println("SpNegoToken NegTokenTarg : " + - "no MIC token included"); + if (tmp2.isContextSpecific((byte)0x00)) { + lastField = checkNextField(lastField, 0); + negResult = tmp2.data.getEnumerated(); + if (DEBUG) { + System.out.println("SpNegoToken NegTokenTarg: negotiated" + + " result = " + getNegoResultString(negResult)); + } + } else if (tmp2.isContextSpecific((byte)0x01)) { + lastField = checkNextField(lastField, 1); + ObjectIdentifier mech = tmp2.data.getOID(); + supportedMech = new Oid(mech.toString()); + if (DEBUG) { + System.out.println("SpNegoToken NegTokenTarg: " + + "supported mechanism = " + supportedMech); + } + } else if (tmp2.isContextSpecific((byte)0x02)) { + lastField = checkNextField(lastField, 2); + responseToken = tmp2.data.getOctetString(); + } else if (tmp2.isContextSpecific((byte)0x03)) { + lastField = checkNextField(lastField, 3); + if (!GSSUtil.useMSInterop()) { + mechListMIC = tmp2.data.getOctetString(); + if (DEBUG) { + System.out.println("SpNegoToken NegTokenTarg: " + + "MechListMIC Token = " + + getHexBytes(mechListMIC)); + } + } } } - } catch (IOException e) { throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, "Invalid SPNEGO NegTokenTarg token : " + e.getMessage()); diff --git a/src/share/classes/sun/security/jgss/spnego/SpNegoToken.java b/src/share/classes/sun/security/jgss/spnego/SpNegoToken.java index c81da7e09cf162ae2649cb3cba18fe5d3e04f415..8683520227fe6926b3ca53f2b09249eef3697c73 100644 --- a/src/share/classes/sun/security/jgss/spnego/SpNegoToken.java +++ b/src/share/classes/sun/security/jgss/spnego/SpNegoToken.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -187,4 +187,21 @@ abstract class SpNegoToken extends GSSToken { return ("Unknown Negotiated Result: " + result); } } + + /** + * Checks if the context tag in a sequence is in correct order. The "last" + * value must be smaller than "current". + * @param last the last tag seen + * @param current the current tag + * @return the current tag, used as the next value for last + * @throws GSSException if there's a wrong order + */ + static int checkNextField(int last, int current) throws GSSException { + if (last < current) { + return current; + } else { + throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, + "Invalid SpNegoToken token : wrong order"); + } + } } diff --git a/src/share/classes/sun/security/krb5/Config.java b/src/share/classes/sun/security/krb5/Config.java index 01d97eaf599a7e2e797b16da39480f4f7215311b..2ec4e12bd7138506b0771f9356c28336787ae5f0 100644 --- a/src/share/classes/sun/security/krb5/Config.java +++ b/src/share/classes/sun/security/krb5/Config.java @@ -110,7 +110,6 @@ public class Config { public static synchronized void refresh() throws KrbException { singleton = new Config(); - KeyTab.refresh(); KdcComm.initStatic(); } diff --git a/src/share/classes/sun/security/krb5/EncryptionKey.java b/src/share/classes/sun/security/krb5/EncryptionKey.java index 8ce51c0c659f7fbffc63443d5b680226adb81a74..1de032945ff7e76e0cfa02dcdcd579eb576fc22f 100644 --- a/src/share/classes/sun/security/krb5/EncryptionKey.java +++ b/src/share/classes/sun/security/krb5/EncryptionKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,8 +138,7 @@ public class EncryptionKey * @returns an array of secret keys or null if none were found. */ public static EncryptionKey[] acquireSecretKeys(PrincipalName princ, - String keytab) - throws KrbException, IOException { + String keytab) { if (princ == null) throw new IllegalArgumentException( @@ -148,11 +147,6 @@ public class EncryptionKey // KeyTab getInstance(keytab) will call KeyTab.getInstance() // if keytab is null KeyTab ktab = KeyTab.getInstance(keytab); - - if (ktab == null) { - return null; - } - return ktab.readServiceKeys(princ); } diff --git a/src/share/classes/sun/security/krb5/KrbAsRep.java b/src/share/classes/sun/security/krb5/KrbAsRep.java index 16c7d87895ff7ed12be080011a3befb0370b2f75..29a7a5b4ccd00b43d50561690f2f367c6bbcae27 100644 --- a/src/share/classes/sun/security/krb5/KrbAsRep.java +++ b/src/share/classes/sun/security/krb5/KrbAsRep.java @@ -37,6 +37,8 @@ import sun.security.krb5.internal.crypto.EType; import sun.security.util.*; import java.io.IOException; import java.util.Objects; +import javax.security.auth.kerberos.KeyTab; +import sun.security.jgss.krb5.Krb5Util; /** * This class encapsulates a AS-REP message that the KDC sends to the @@ -90,29 +92,32 @@ class KrbAsRep extends KrbKdcRep { } /** - * Called by KrbAsReqBuilder to resolve a AS-REP message using keys. - * @param keys user provided keys, not null + * Called by KrbAsReqBuilder to resolve a AS-REP message using a keytab. + * @param ktab the keytab, not null * @param asReq the original AS-REQ sent, used to validate AS-REP + * @param cname the user principal name, used to locate keys in ktab */ - void decryptUsingKeys(EncryptionKey[] keys, KrbAsReq asReq) + void decryptUsingKeyTab(KeyTab ktab, KrbAsReq asReq, PrincipalName cname) throws KrbException, Asn1Exception, IOException { EncryptionKey dkey = null; int encPartKeyType = rep.encPart.getEType(); Integer encPartKvno = rep.encPart.kvno; - try { - dkey = EncryptionKey.findKey(encPartKeyType, encPartKvno, keys); - } catch (KrbException ke) { - if (ke.returnCode() == Krb5.KRB_AP_ERR_BADKEYVER) { - // Fallback to no kvno. In some cases, keytab is generated - // not by sysadmin but Java's ktab command - dkey = EncryptionKey.findKey(encPartKeyType, keys); + try { + dkey = EncryptionKey.findKey(encPartKeyType, encPartKvno, + Krb5Util.keysFromJavaxKeyTab(ktab, cname)); + } catch (KrbException ke) { + if (ke.returnCode() == Krb5.KRB_AP_ERR_BADKEYVER) { + // Fallback to no kvno. In some cases, keytab is generated + // not by sysadmin but Java's ktab command + dkey = EncryptionKey.findKey(encPartKeyType, + Krb5Util.keysFromJavaxKeyTab(ktab, cname)); + } + } + if (dkey == null) { + throw new KrbException(Krb5.API_INVALID_ARG, + "Cannot find key for type/kvno to decrypt AS REP - " + + EType.toString(encPartKeyType) + "/" + encPartKvno); } - } - if (dkey == null) { - throw new KrbException(Krb5.API_INVALID_ARG, - "Cannot find key for type/kvno to decrypt AS REP - " + - EType.toString(encPartKeyType) + "/" + encPartKvno); - } decrypt(dkey, asReq); } diff --git a/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java b/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java index 940d31107e500438442ca67fec7adacca20a694f..dd9b8dcfb92b374b36c25109da631c4060c4c7e3 100644 --- a/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java +++ b/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ package sun.security.krb5; import java.io.IOException; import java.util.Arrays; +import javax.security.auth.kerberos.KeyTab; +import sun.security.jgss.krb5.Krb5Util; import sun.security.krb5.internal.HostAddresses; import sun.security.krb5.internal.KDCOptions; import sun.security.krb5.internal.KRBError; @@ -42,13 +44,16 @@ import sun.security.krb5.internal.crypto.EType; * 1. Gather information to create AS-REQ * 2. Create and send AS-REQ * 3. Receive AS-REP and KRB-ERROR (-KRB_ERR_RESPONSE_TOO_BIG) and parse them - * 4. Emit credentials and secret keys (for JAAS storeKey=true) + * 4. Emit credentials and secret keys (for JAAS storeKey=true with password) * * This class does not: * 1. Deal with real communications (KdcComm does it, and TGS-REQ) * a. Name of KDCs for a realm * b. Server availability, timeout, UDP or TCP * d. KRB_ERR_RESPONSE_TOO_BIG + * 2. Stores its own copy of password, this means: + * a. Do not change/wipe it before Builder finish + * b. Builder will not wipe it for you * * With this class: * 1. KrbAsReq has only one constructor @@ -70,19 +75,17 @@ public final class KrbAsReqBuilder { private HostAddresses addresses; // Secret source: can't be changed once assigned, only one (of the two - // sources) can be set and should be non-null - private EncryptionKey[] keys; - private char[] password; + // sources) can be set to non-null + private final char[] password; + private final KeyTab ktab; // Used to create a ENC-TIMESTAMP in the 2nd AS-REQ - private EncryptionKey pakey; private PAData[] paList; // PA-DATA from both KRB-ERROR and AS-REP. // Used by getKeys() only. // Only AS-REP should be enough per RFC, // combined in case etypes are different. // The generated and received: - int[] eTypes; private KrbAsReq req; private KrbAsRep rep; @@ -94,7 +97,7 @@ public final class KrbAsReqBuilder { private State state; // Called by other constructors - private KrbAsReqBuilder(PrincipalName cname) + private void init(PrincipalName cname) throws KrbException { if (cname.getRealm() == null) { cname.setRealm(Config.getInstance().getDefaultRealm()); @@ -114,14 +117,11 @@ public final class KrbAsReqBuilder { * This argument will neither be modified nor stored by the method. * @throws KrbException */ - public KrbAsReqBuilder(PrincipalName cname, EncryptionKey[] keys) + public KrbAsReqBuilder(PrincipalName cname, KeyTab ktab) throws KrbException { - this(cname); - this.keys = new EncryptionKey[keys.length]; - for (int i=0; i map = new HashMap<>(); + + // KeyTab file does not exist. Note: a missing keytab is still valid + private boolean isMissing = false; + + // KeyTab file is invalid, possibly an I/O error or a file format error. + private boolean isValid = true; + + private final String tabName; + private long lastModified; + private int kt_vno; + private Vector entries = new Vector<>(); - private KeyTab(String filename) throws IOException, RealmException { - init(filename); + /** + * Constructs a KeyTab object. + * + * If there is any I/O error or format errot during the loading, the + * isValid flag is set to false, and all half-read entries are dismissed. + * @param filename path name for the keytab file, must not be null + */ + private KeyTab(String filename) { + tabName = filename; + try { + lastModified = new File(tabName).lastModified(); + try (KeyTabInputStream kis = + new KeyTabInputStream(new FileInputStream(filename))) { + load(kis); + } + } catch (FileNotFoundException e) { + entries.clear(); + isMissing = true; + } catch (Exception ioe) { + entries.clear(); + isValid = false; + } + } + + /** + * Read a keytab file. Returns a new object and save it into cache when + * new content (modified since last read) is available. If keytab file is + * invalid, the old object will be returned. This is a safeguard for + * partial-written keytab files or non-stable network. Please note that + * a missing keytab is valid, which is equivalent to an empty keytab. + * + * @param s file name of keytab, must not be null + * @return the keytab object, can be invalid, but never null. + */ + private synchronized static KeyTab getInstance0(String s) { + long lm = new File(s).lastModified(); + KeyTab old = map.get(s); + if (old != null && old.isValid() && old.lastModified == lm) { + return old; + } + KeyTab ktab = new KeyTab(s); + if (ktab.isValid()) { // A valid new keytab + map.put(s, ktab); + return ktab; + } else if (old != null) { // An existing old one + return old; + } else { + return ktab; // first read is invalid + } } + /** + * Gets a KeyTab object. + * @param s the key tab file name. + * @return the KeyTab object, never null. + */ public static KeyTab getInstance(String s) { - name = parse(s); - if (name == null) { + if (s == null) { return getInstance(); + } else { + return getInstance0(s); } - return getInstance(new File(name)); } /** - * Gets the single instance of KeyTab class. + * Gets a KeyTab object. * @param file the key tab file. - * @return single instance of KeyTab; - * return null if error occurs while reading data out of the file. + * @return the KeyTab object, never null. */ public static KeyTab getInstance(File file) { - try { - if (!(file.exists())) { - singleton = null; - } else { - String fname = file.getAbsolutePath(); - // Since this class deals with file I/O operations, - // we want only one class instance existing. - if (singleton != null) { - File kfile = new File(singleton.name); - String kname = kfile.getAbsolutePath(); - if (kname.equalsIgnoreCase(fname)) { - if (DEBUG) { - System.out.println("KeyTab instance already exists"); - } - } - } else { - singleton = new KeyTab(fname); - } - } - } catch (Exception e) { - singleton = null; - if (DEBUG) { - System.out.println("Could not obtain an instance of KeyTab" + - e.getMessage()); - } + if (file == null) { + return getInstance(); + } else { + return getInstance0(file.getPath()); } - return singleton; } /** - * Gets the single instance of KeyTab class. - * @return single instance of KeyTab; return null if default keytab file - * does not exist, or error occurs while reading data from the file. + * Gets the default KeyTab object. + * @return the KeyTab object, never null. */ public static KeyTab getInstance() { - try { - name = getDefaultKeyTab(); - if (name != null) { - singleton = getInstance(new File(name)); - } - } catch (Exception e) { - singleton = null; - if (DEBUG) { - System.out.println("Could not obtain an instance of KeyTab" + - e.getMessage()); - } - } - return singleton; + return getInstance(getDefaultTabName()); + } + + public boolean isMissing() { + return isMissing; + } + + public boolean isValid() { + return isValid; } /** * The location of keytab file will be read from the configuration file * If it is not specified, consider user.home as the keytab file's * default location. + * @return never null */ - private static String getDefaultKeyTab() { - if (name != null) { - return name; + private static String getDefaultTabName() { + if (defaultTabName != null) { + return defaultTabName; } else { String kname = null; try { @@ -145,7 +192,7 @@ public class KeyTab implements KeyTabConstants { StringTokenizer st = new StringTokenizer(keytab_names, " "); while (st.hasMoreTokens()) { kname = parse(st.nextToken()); - if (kname != null) { + if (new File(kname).exists()) { break; } } @@ -165,19 +212,20 @@ public class KeyTab implements KeyTabConstants { new sun.security.action.GetPropertyAction("user.dir")); } - if (user_home != null) { - kname = user_home + File.separator + "krb5.keytab"; - } + kname = user_home + File.separator + "krb5.keytab"; } + defaultTabName = kname; return kname; } } + /** + * Parses some common keytab name formats + * @param name never null + * @return never null + */ private static String parse(String name) { - String kname = null; - if (name == null) { - return null; - } + String kname; if ((name.length() >= 5) && (name.substring(0, 5).equalsIgnoreCase("FILE:"))) { kname = name.substring(5); @@ -194,18 +242,6 @@ public class KeyTab implements KeyTabConstants { return kname; } - private synchronized void init(String filename) - throws IOException, RealmException { - - if (filename != null) { - KeyTabInputStream kis = - new KeyTabInputStream(new FileInputStream(filename)); - load(kis); - kis.close(); - name = filename; - } - } - private void load(KeyTabInputStream kis) throws IOException, RealmException { @@ -234,14 +270,13 @@ public class KeyTab implements KeyTabConstants { * etypes that have been configured for use. If there are multiple * keys with same etype, the one with the highest kvno is returned. * @param service the PrincipalName of the requested service - * @return an array containing all the service keys + * @return an array containing all the service keys, never null */ public EncryptionKey[] readServiceKeys(PrincipalName service) { KeyTabEntry entry; EncryptionKey key; int size = entries.size(); ArrayList keys = new ArrayList<>(size); - for (int i = size-1; i >= 0; i--) { entry = entries.elementAt(i); if (entry.service.match(service)) { @@ -260,10 +295,7 @@ public class KeyTab implements KeyTabConstants { } } } - size = keys.size(); - if (size == 0) - return null; EncryptionKey[] retVal = keys.toArray(new EncryptionKey[size]); // Sort keys according to default_tkt_enctypes @@ -328,10 +360,13 @@ public class KeyTab implements KeyTabConstants { return false; } - public static String tabName() { - return name; + public String tabName() { + return tabName; } + /////////////////// THE WRITE SIDE /////////////////////// + /////////////// only used by ktab tool ////////////////// + /** * Adds a new entry in the key table. * @param service the service which will have a new entry in the key table. @@ -394,7 +429,7 @@ public class KeyTab implements KeyTabConstants { */ public synchronized static KeyTab create() throws IOException, RealmException { - String dname = getDefaultKeyTab(); + String dname = getDefaultTabName(); return create(dname); } @@ -404,25 +439,24 @@ public class KeyTab implements KeyTabConstants { public synchronized static KeyTab create(String name) throws IOException, RealmException { - KeyTabOutputStream kos = - new KeyTabOutputStream(new FileOutputStream(name)); - kos.writeVersion(KRB5_KT_VNO); - kos.close(); - singleton = new KeyTab(name); - return singleton; + try (KeyTabOutputStream kos = + new KeyTabOutputStream(new FileOutputStream(name))) { + kos.writeVersion(KRB5_KT_VNO); + } + return new KeyTab(name); } /** * Saves the file at the directory. */ public synchronized void save() throws IOException { - KeyTabOutputStream kos = - new KeyTabOutputStream(new FileOutputStream(name)); - kos.writeVersion(kt_vno); - for (int i = 0; i < entries.size(); i++) { - kos.writeEntry(entries.elementAt(i)); + try (KeyTabOutputStream kos = + new KeyTabOutputStream(new FileOutputStream(tabName))) { + kos.writeVersion(kt_vno); + for (int i = 0; i < entries.size(); i++) { + kos.writeEntry(entries.elementAt(i)); + } } - kos.close(); } /** @@ -485,18 +519,9 @@ public class KeyTab implements KeyTabConstants { * @exception IOException. */ public synchronized void createVersion(File file) throws IOException { - KeyTabOutputStream kos = - new KeyTabOutputStream(new FileOutputStream(file)); - kos.write16(KRB5_KT_VNO); - kos.close(); - } - - public static void refresh() { - if (singleton != null) { - if (DEBUG) { - System.out.println("Refreshing Keytab"); - } - singleton = null; + try (KeyTabOutputStream kos = + new KeyTabOutputStream(new FileOutputStream(file))) { + kos.write16(KRB5_KT_VNO); } } } diff --git a/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java b/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java index 1f692f235b6e8b5bb2d3e658d934c7c66958ca12..977d465ac4791d32b585b44741c8dddcd376d58a 100644 --- a/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java +++ b/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java @@ -312,7 +312,8 @@ class CrlRevocationChecker extends PKIXCertPathChecker { DistributionPointFetcher.getInstance(); // all CRLs returned by the DP Fetcher have also been verified mApprovedCRLs.addAll(store.getCRLs(sel, signFlag, prevKey, - mSigProvider, mStores, reasonsMask, trustAnchors)); + mSigProvider, mStores, reasonsMask, trustAnchors, + mParams.getDate())); } catch (Exception e) { if (debug != null) { debug.println("CrlRevocationChecker.verifyRevocationStatus() " @@ -769,7 +770,7 @@ class CrlRevocationChecker extends PKIXCertPathChecker { for (X509CRL crl : crls) { if (dpf.verifyCRL(certImpl, point, crl, reasonsMask, signFlag, prevKey, mSigProvider, - trustAnchors, mStores)) { + trustAnchors, mStores, mParams.getDate())) { results.add(crl); } } diff --git a/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java index 56c5ab91c43cbb89c6689039adc45f61c3acefc6..35d7b2c87e95e5b1cb9dda108250985621379ad6 100644 --- a/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java +++ b/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java @@ -90,8 +90,8 @@ class DistributionPointFetcher { */ Collection getCRLs(X509CRLSelector selector, boolean signFlag, PublicKey prevKey, String provider, List certStores, - boolean[] reasonsMask, - Set trustAnchors) throws CertStoreException { + boolean[] reasonsMask, Set trustAnchors, + Date validity) throws CertStoreException { if (USE_CRLDP == false) { return Collections.emptySet(); @@ -122,7 +122,7 @@ class DistributionPointFetcher { DistributionPoint point = t.next(); Collection crls = getCRLs(selector, certImpl, point, reasonsMask, signFlag, prevKey, provider, - certStores, trustAnchors); + certStores, trustAnchors, validity); results.addAll(crls); } if (debug != null) { @@ -143,7 +143,8 @@ class DistributionPointFetcher { private Collection getCRLs(X509CRLSelector selector, X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask, boolean signFlag, PublicKey prevKey, String provider, - List certStores, Set trustAnchors) { + List certStores, Set trustAnchors, + Date validity) { // check for full name GeneralNames fullName = point.getFullName(); @@ -196,7 +197,7 @@ class DistributionPointFetcher { selector.setIssuerNames(null); if (selector.match(crl) && verifyCRL(certImpl, point, crl, reasonsMask, signFlag, prevKey, provider, trustAnchors, - certStores)) { + certStores, validity)) { crls.add(crl); } } catch (Exception e) { @@ -280,13 +281,15 @@ class DistributionPointFetcher { * @param trustAnchors a {@code Set} of {@code TrustAnchor}s * @param certStores a {@code List} of {@code CertStore}s to be used in * finding certificates and CRLs + * @param validity the time for which the validity of the CRL issuer's + * certification path should be determined * @return true if ok, false if not */ boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point, X509CRL crl, boolean[] reasonsMask, boolean signFlag, PublicKey prevKey, String provider, - Set trustAnchors, - List certStores) throws CRLException, IOException { + Set trustAnchors, List certStores, + Date validity) throws CRLException, IOException { boolean indirectCRL = false; X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl); @@ -605,6 +608,7 @@ class DistributionPointFetcher { } params.setCertStores(certStores); params.setSigProvider(provider); + params.setDate(validity); try { CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); PKIXCertPathBuilderResult result = diff --git a/src/share/classes/sun/security/ssl/SSLSocketImpl.java b/src/share/classes/sun/security/ssl/SSLSocketImpl.java index 8bc8c22a9fdf078faccdbdca022c0d56bb723295..d12eaf1c091099d813a8d020cb57b9edc251bcae 100644 --- a/src/share/classes/sun/security/ssl/SSLSocketImpl.java +++ b/src/share/classes/sun/security/ssl/SSLSocketImpl.java @@ -1453,6 +1453,21 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } } + private void closeSocket(boolean selfInitiated) throws IOException { + if ((debug != null) && Debug.isOn("ssl")) { + System.out.println(threadName() + ", called closeSocket(selfInitiated)"); + } + if (self == this) { + super.close(); + } else if (autoClose) { + self.close(); + } else if (selfInitiated) { + // layered && non-autoclose + // read close_notify alert to clear input stream + waitForClose(false); + } + } + /* * Closing the connection is tricky ... we can't officially close the * connection until we know the other end is ready to go away too, @@ -1491,6 +1506,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } int state = getConnectionState(); + boolean closeSocketCalled = false; + Throwable cachedThrowable = null; try { switch (state) { /* @@ -1531,8 +1548,18 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { return; // connection was closed while we waited } if (state != cs_SENT_CLOSE) { - warning(Alerts.alert_close_notify); - connectionState = cs_SENT_CLOSE; + try { + warning(Alerts.alert_close_notify); + connectionState = cs_SENT_CLOSE; + } catch (Throwable th) { + // we need to ensure socket is closed out + // if we encounter any errors. + connectionState = cs_ERROR; + // cache this for later use + cachedThrowable = th; + closeSocketCalled = true; + closeSocket(selfInitiated); + } } } // If state was cs_SENT_CLOSE before, we don't do the actual @@ -1569,22 +1596,11 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { return; } - if (self == this) { - super.close(); - } else if (autoClose) { - self.close(); - } else if (selfInitiated) { - // layered && non-autoclose - // read close_notify alert to clear input stream - waitForClose(false); + if (!closeSocketCalled) { + closeSocketCalled = true; + closeSocket(selfInitiated); } - // See comment in changeReadCiphers() - readCipher.dispose(); - writeCipher.dispose(); - - // state will be set to cs_CLOSED in the finally block below - break; } } finally { @@ -1595,6 +1611,20 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { // notify any threads waiting for the closing to finish this.notifyAll(); } + if (closeSocketCalled) { + // Dispose of ciphers since we've closed socket + disposeCiphers(); + } + if (cachedThrowable != null) { + /* + * Rethrow the error to the calling method + * The Throwable caught can only be an Error or RuntimeException + */ + if (cachedThrowable instanceof Error) + throw (Error) cachedThrowable; + if (cachedThrowable instanceof RuntimeException) + throw (RuntimeException) cachedThrowable; + } } } @@ -1641,6 +1671,24 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } } + /** + * Called by closeInternal() only. Be sure to consider the + * synchronization locks carefully before calling it elsewhere. + */ + private void disposeCiphers() { + // See comment in changeReadCiphers() + synchronized (readLock) { + readCipher.dispose(); + } + // See comment in changeReadCiphers() + writeLock.lock(); + try { + writeCipher.dispose(); + } finally { + writeLock.unlock(); + } + } + // // EXCEPTION AND ALERT HANDLING // @@ -1761,7 +1809,9 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } int oldState = connectionState; - connectionState = cs_ERROR; + if (connectionState < cs_ERROR) { + connectionState = cs_ERROR; + } /* * Has there been an error received yet? If not, remember it. @@ -1792,13 +1842,17 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * Clean up our side. */ closeSocket(); + // Another thread may have disposed the ciphers during closing + if (connectionState < cs_CLOSED) { + connectionState = (oldState == cs_APP_CLOSED) ? cs_APP_CLOSED + : cs_CLOSED; - // See comment in changeReadCiphers() - readCipher.dispose(); - writeCipher.dispose(); + // We should lock readLock and writeLock if no deadlock risks. + // See comment in changeReadCiphers() + readCipher.dispose(); + writeCipher.dispose(); + } - connectionState = (oldState == cs_APP_CLOSED) ? cs_APP_CLOSED - : cs_CLOSED; throw closeReason; } diff --git a/src/share/classes/sun/security/ssl/ServerHandshaker.java b/src/share/classes/sun/security/ssl/ServerHandshaker.java index ff1c8d7d5c99e551594e29bd33b08c47495e74ff..125de5f3f50119d52304b941e6117470a10000a5 100644 --- a/src/share/classes/sun/security/ssl/ServerHandshaker.java +++ b/src/share/classes/sun/security/ssl/ServerHandshaker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1285,11 +1285,12 @@ final class ServerHandshaker extends Handshaker { // check permission to access and use the secret key of the // Kerberized "host" service - if (kerberosKeys != null) { - + if (kerberosKeys != null && kerberosKeys.length > 0) { if (debug != null && Debug.isOn("handshake")) { - System.out.println("Using Kerberos key: " + - kerberosKeys[0]); + for (SecretKey k: kerberosKeys) { + System.out.println("Using Kerberos key: " + + k); + } } String serverPrincipal = diff --git a/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java b/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java index 94d1e8e75be8775528f3bbef053e702d6e79a6f4..652268e166f6316502de3a76d6e81e97a48b26ed 100644 --- a/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java +++ b/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ import sun.security.krb5.PrincipalName; import sun.security.ssl.Krb5Proxy; /** - * An implementatin of Krb5Proxy that simply delegates to the appropriate + * An implementation of Krb5Proxy that simply delegates to the appropriate * Kerberos APIs. */ public class Krb5ProxyImpl implements Krb5Proxy { @@ -62,7 +62,7 @@ public class Krb5ProxyImpl implements Krb5Proxy { @Override public SecretKey[] getServerKeys(AccessControlContext acc) throws LoginException { - return Krb5Util.getKeys(GSSCaller.CALLER_SSL_SERVER, null, acc); + return Krb5Util.getServiceCreds(GSSCaller.CALLER_SSL_SERVER, null, acc).getKKeys(); } @Override diff --git a/src/share/classes/sun/swing/FilePane.java b/src/share/classes/sun/swing/FilePane.java index a5e7dffda321f16cf23bfc8e96aecb4ce30e37fd..5bf5c1f43b09d4b8d259db63f0dee879d7f6dbdb 100644 --- a/src/share/classes/sun/swing/FilePane.java +++ b/src/share/classes/sun/swing/FilePane.java @@ -763,7 +763,7 @@ public class FilePane extends JPanel implements PropertyChangeListener { public void setValueAt(Object value, int row, int col) { if (col == COLUMN_FILENAME) { - JFileChooser chooser = getFileChooser(); + final JFileChooser chooser = getFileChooser(); File f = (File)getValueAt(row, col); if (f != null) { String oldDisplayName = chooser.getName(f); @@ -782,18 +782,25 @@ public class FilePane extends JPanel implements PropertyChangeListener { // rename FileSystemView fsv = chooser.getFileSystemView(); - File f2 = fsv.createFileObject(f.getParentFile(), newFileName); + final File f2 = fsv.createFileObject(f.getParentFile(), newFileName); if (f2.exists()) { JOptionPane.showMessageDialog(chooser, MessageFormat.format(renameErrorFileExistsText, oldFileName), renameErrorTitleText, JOptionPane.ERROR_MESSAGE); } else { if (FilePane.this.getModel().renameFile(f, f2)) { if (fsv.isParent(chooser.getCurrentDirectory(), f2)) { - if (chooser.isMultiSelectionEnabled()) { - chooser.setSelectedFiles(new File[]{f2}); - } else { - chooser.setSelectedFile(f2); - } + // The setSelectedFile method produces a new setValueAt invocation while the JTable + // is editing. Postpone file selection to be sure that edit mode of the JTable + // is completed + SwingUtilities.invokeLater(new Runnable() { + public void run() { + if (chooser.isMultiSelectionEnabled()) { + chooser.setSelectedFiles(new File[]{f2}); + } else { + chooser.setSelectedFile(f2); + } + } + }); } else { // Could be because of delay in updating Desktop folder // chooser.setSelectedFile(null); diff --git a/src/share/classes/sun/swing/WindowsPlacesBar.java b/src/share/classes/sun/swing/WindowsPlacesBar.java index 9972b671d757f70f6a3af63ee6a275db45af2c71..a05259e5978c1b92fde30fbd6e68f8fd2cdafc2e 100644 --- a/src/share/classes/sun/swing/WindowsPlacesBar.java +++ b/src/share/classes/sun/swing/WindowsPlacesBar.java @@ -29,6 +29,8 @@ import java.awt.event.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.*; +import java.security.AccessController; +import java.security.PrivilegedAction; import javax.swing.*; import javax.swing.border.*; @@ -79,7 +81,12 @@ public class WindowsPlacesBar extends JToolBar setBackground(bgColor); FileSystemView fsv = fc.getFileSystemView(); - files = (File[])ShellFolder.get("fileChooserShortcutPanelFolders"); + files = AccessController.doPrivileged(new PrivilegedAction() { + public File[] run() { + return (File[]) ShellFolder.get("fileChooserShortcutPanelFolders"); + } + }); + buttons = new JToggleButton[files.length]; buttonGroup = new ButtonGroup(); for (int i = 0; i < files.length; i++) { diff --git a/src/share/demo/jvmti/minst/Minst.java b/src/share/demo/jvmti/minst/Minst.java index 6e21926f7d8414ffb8ee921766934b2fa14aeace..04504c79f66355e07bdeeacd5953af9697766c7b 100644 --- a/src/share/demo/jvmti/minst/Minst.java +++ b/src/share/demo/jvmti/minst/Minst.java @@ -45,7 +45,7 @@ public class Minst { */ public static void method_entry(int cnum, int mnum) { - Class x = Minst.class; + Class x = Minst.class; synchronized ( x ) { if ( engaged > 0 ) { engaged = 0; diff --git a/src/share/demo/management/FullThreadDump/Deadlock.java b/src/share/demo/management/FullThreadDump/Deadlock.java index 0a92427f3bb6eb0787ba20741c4fa4036d3048b0..2cc2d3e518d56045b71da837bdd43a442a90a69b 100644 --- a/src/share/demo/management/FullThreadDump/Deadlock.java +++ b/src/share/demo/management/FullThreadDump/Deadlock.java @@ -48,7 +48,7 @@ import java.io.IOException; */ public class Deadlock { public static void main(String[] argv) { - Deadlock dl = new Deadlock(); + new Deadlock(); // Now find deadlock ThreadMonitor monitor = new ThreadMonitor(); @@ -112,6 +112,7 @@ public class Deadlock { this.mon2 = mon2; this.useSync = false; } + @Override public void run() { if (useSync) { syncLock(); diff --git a/src/share/demo/management/FullThreadDump/ThreadMonitor.java b/src/share/demo/management/FullThreadDump/ThreadMonitor.java index 8b9360c81c7e9b07ce3db2c512d3102fc98b023a..eb4ed7803d253e080162baa9438c2fa7f46aa333 100644 --- a/src/share/demo/management/FullThreadDump/ThreadMonitor.java +++ b/src/share/demo/management/FullThreadDump/ThreadMonitor.java @@ -39,7 +39,6 @@ import java.lang.management.LockInfo; import java.lang.management.MonitorInfo; import javax.management.*; import java.io.*; -import java.util.*; /** * Example of using the java.lang.management API to dump stack trace @@ -167,7 +166,8 @@ public class ThreadMonitor { } } - private void printMonitorInfo(ThreadInfo ti, MonitorInfo[] monitors) { + private void printMonitorInfo(ThreadInfo ti) { + MonitorInfo[] monitors = ti.getLockedMonitors(); System.out.println(INDENT + "Locked monitors: count = " + monitors.length); for (MonitorInfo mi : monitors) { System.out.println(INDENT + " - " + mi + " locked at "); @@ -201,6 +201,7 @@ public class ThreadMonitor { ThreadInfo[] infos = tmbean.getThreadInfo(tids, true, true); for (ThreadInfo ti : infos) { printThreadInfo(ti); + printMonitorInfo(ti); printLockInfo(ti.getLockedSynchronizers()); System.out.println(); } diff --git a/src/share/demo/management/JTop/JTop.java b/src/share/demo/management/JTop/JTop.java index 3ec7eedbfd1f68f8266f3280b22b425d9e3f3268..39f4cab133a5fdba12db3d65de1bc87072803624 100644 --- a/src/share/demo/management/JTop/JTop.java +++ b/src/share/demo/management/JTop/JTop.java @@ -57,7 +57,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.SortedMap; import java.util.Timer; @@ -69,10 +68,8 @@ import java.net.MalformedURLException; import static java.lang.management.ManagementFactory.*; import java.awt.*; -import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; -import javax.swing.event.*; import javax.swing.table.*; /** @@ -80,6 +77,8 @@ import javax.swing.table.*; * in a table. */ public class JTop extends JPanel { + + private static final long serialVersionUID = -1499762160973870696L; private MBeanServerConnection server; private ThreadMXBean tmbean; private MyTableModel tmodel; @@ -122,29 +121,34 @@ public class JTop extends JPanel { } class MyTableModel extends AbstractTableModel { + private static final long serialVersionUID = -7877310288576779514L; private String[] columnNames = {"ThreadName", "CPU(sec)", "State"}; // List of all threads. The key of each entry is the CPU time // and its value is the ThreadInfo object with no stack trace. private List> threadList = - Collections.EMPTY_LIST; + Collections.emptyList(); public MyTableModel() { } + @Override public int getColumnCount() { return columnNames.length; } + @Override public int getRowCount() { return threadList.size(); } + @Override public String getColumnName(int col) { return columnNames[col]; } + @Override public Object getValueAt(int row, int col) { Map.Entry me = threadList.get(row); switch (col) { @@ -164,7 +168,8 @@ public class JTop extends JPanel { } } - public Class getColumnClass(int c) { + @Override + public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @@ -207,12 +212,14 @@ public class JTop extends JPanel { * Format Double with 4 fraction digits */ class DoubleRenderer extends DefaultTableCellRenderer { + private static final long serialVersionUID = 1704639497162584382L; NumberFormat formatter; public DoubleRenderer() { super(); setHorizontalAlignment(JLabel.RIGHT); } + @Override public void setValue(Object value) { if (formatter==null) { formatter = NumberFormat.getInstance(); @@ -238,12 +245,14 @@ public class JTop extends JPanel { } // Get the current thread info and CPU time + @Override public List> doInBackground() { return getThreadList(); } // fire table data changed to trigger GUI update // when doInBackground() is finished + @Override protected void done() { try { // Set table model with the new thread list @@ -290,6 +299,7 @@ public class JTop extends JPanel { // A timer task to update GUI per each interval TimerTask timerTask = new TimerTask() { + @Override public void run() { // Schedule the SwingWorker to update the GUI jtop.newSwingWorker().execute(); @@ -299,6 +309,7 @@ public class JTop extends JPanel { // Create the standalone window with JTop panel // by the event dispatcher thread SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { createAndShowGUI(jtop); } diff --git a/src/share/demo/management/JTop/JTopPlugin.java b/src/share/demo/management/JTop/JTopPlugin.java index 03352f5d90bdf9fd0285221bda4bc8b808b52803..9586f9ad48dc187dddde2f405e5d8c6f81bc424a 100644 --- a/src/share/demo/management/JTop/JTopPlugin.java +++ b/src/share/demo/management/JTop/JTopPlugin.java @@ -40,13 +40,13 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.LinkedHashMap; import java.util.Map; -import javax.management.MBeanServerConnection; + import javax.swing.JPanel; import javax.swing.SwingWorker; -import com.sun.tools.jconsole.JConsolePlugin; import com.sun.tools.jconsole.JConsoleContext; import com.sun.tools.jconsole.JConsoleContext.ConnectionState; +import com.sun.tools.jconsole.JConsolePlugin; /** * JTopPlugin is a subclass to com.sun.tools.jconsole.JConsolePlugin @@ -70,6 +70,7 @@ public class JTopPlugin extends JConsolePlugin implements PropertyChangeListener /* * Returns a JTop tab to be added in JConsole. */ + @Override public synchronized Map getTabs() { if (tabs == null) { jtop = new JTop(); @@ -86,6 +87,7 @@ public class JTopPlugin extends JConsolePlugin implements PropertyChangeListener /* * Returns a SwingWorker which is responsible for updating the JTop tab. */ + @Override public SwingWorker newSwingWorker() { return jtop.newSwingWorker(); } @@ -101,10 +103,10 @@ public class JTopPlugin extends JConsolePlugin implements PropertyChangeListener * Property listener to reset the MBeanServerConnection * at reconnection time. */ + @Override public void propertyChange(PropertyChangeEvent ev) { String prop = ev.getPropertyName(); if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) { - ConnectionState oldState = (ConnectionState)ev.getOldValue(); ConnectionState newState = (ConnectionState)ev.getNewValue(); // JConsole supports disconnection and reconnection // The MBeanServerConnection will become invalid when diff --git a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java index d43c4a7f3dd44452782e5fe9c8667177b6ee99b7..676b698f3fbe696a9a63df5de536242e570d52e2 100644 --- a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java +++ b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java @@ -42,9 +42,6 @@ import javax.swing.*; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import java.lang.management.*; -import java.util.*; - - /** * Demo code which plots the memory usage by all memory pools. * The memory usage is sampled at some time interval using @@ -53,6 +50,7 @@ import java.util.*; */ public class MemoryMonitor extends JPanel { + private static final long serialVersionUID = -3463003810776195761L; static JCheckBox dateStampCB = new JCheckBox("Output Date Stamp"); public Surface surf; JPanel controls; @@ -84,6 +82,7 @@ public class MemoryMonitor extends JPanel { controls.add(dateStampCB); dateStampCB.setFont(font); addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { removeAll(); if ((doControls = !doControls)) { @@ -128,28 +127,32 @@ public class MemoryMonitor extends JPanel { public Surface() { setBackground(Color.black); addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { if (thread == null) start(); else stop(); } }); - int i = 0; usedMem = new float[numPools][]; ptNum = new int[numPools]; } + @Override public Dimension getMinimumSize() { return getPreferredSize(); } + @Override public Dimension getMaximumSize() { return getPreferredSize(); } + @Override public Dimension getPreferredSize() { return new Dimension(135,80); } + @Override public void paint(Graphics g) { if (big == null) { @@ -315,13 +318,14 @@ public class MemoryMonitor extends JPanel { notify(); } + @Override public void run() { Thread me = Thread.currentThread(); while (thread == me && !isShowing() || getSize().width == 0) { try { - thread.sleep(500); + Thread.sleep(500); } catch (InterruptedException e) { return; } } @@ -339,7 +343,7 @@ public class MemoryMonitor extends JPanel { } repaint(); try { - thread.sleep(sleepAmount); + Thread.sleep(sleepAmount); } catch (InterruptedException e) { break; } if (MemoryMonitor.dateStampCB.isSelected()) { System.out.println(new Date().toString() + " " + usedStr); @@ -354,6 +358,7 @@ public class MemoryMonitor extends JPanel { static class Memeater extends ClassLoader implements Runnable { Object y[]; public Memeater() {} + @Override public void run() { y = new Object[10000000]; int k =0; @@ -378,7 +383,7 @@ public class MemoryMonitor extends JPanel { } - Class loadNext() throws ClassNotFoundException { + Class loadNext() throws ClassNotFoundException { // public class TestNNNNNN extends java.lang.Object{ // public TestNNNNNN(); @@ -424,15 +429,15 @@ public class MemoryMonitor extends JPanel { int len = begin.length + value.length + end.length; byte b[] = new byte[len]; - int i, pos=0; - for (i=0; i mbeans = server.queryNames(poolName, null); if (mbeans != null) { pools = new ArrayList(); - Iterator iterator = mbeans.iterator(); - while (iterator.hasNext()) { - ObjectName objName = (ObjectName) iterator.next(); + for (ObjectName objName : mbeans) { MemoryPoolMXBean p = newPlatformMXBeanProxy(server, objName.getCanonicalName(), @@ -88,9 +86,7 @@ public class PrintGCStat { mbeans = server.queryNames(gcName, null); if (mbeans != null) { gcmbeans = new ArrayList(); - Iterator iterator = mbeans.iterator(); - while (iterator.hasNext()) { - ObjectName objName = (ObjectName) iterator.next(); + for (ObjectName objName : mbeans) { GarbageCollectorMXBean gc = newPlatformMXBeanProxy(server, objName.getCanonicalName(), @@ -116,7 +112,9 @@ public class PrintGCStat { * of all memory pools as well as the GC statistics. */ public void printVerboseGc() { - System.out.print("Uptime: " + formatMillis(rmbean.getUptime())); + System.out.println("Uptime: " + formatMillis(rmbean.getUptime())); + System.out.println("Heap usage: " + mmbean.getHeapMemoryUsage()); + System.out.println("Non-Heap memory usage: " + mmbean.getNonHeapMemoryUsage()); for (GarbageCollectorMXBean gc : gcmbeans) { System.out.print(" [" + gc.getName() + ": "); System.out.print("Count=" + gc.getCollectionCount()); diff --git a/src/share/demo/management/VerboseGC/VerboseGC.java b/src/share/demo/management/VerboseGC/VerboseGC.java index 9ba2415e7fba9a96745a04434a4823763cadbec5..963389423bae8d2a66c44842ab6e7f7106ac7ae3 100644 --- a/src/share/demo/management/VerboseGC/VerboseGC.java +++ b/src/share/demo/management/VerboseGC/VerboseGC.java @@ -95,9 +95,8 @@ public class VerboseGC { int port = -1; long interval = 5000; // default is 5 second interval long mins = 5; - for (int argIndex = 0; argIndex < args.length; argIndex++) { - String arg = args[argIndex]; - if (args[argIndex].startsWith("-")) { + for (String arg: args) { + if (arg.startsWith("-")) { if (arg.equals("-h") || arg.equals("-help") || arg.equals("-?")) { diff --git a/src/share/demo/nio/zipfs/Demo.java b/src/share/demo/nio/zipfs/Demo.java index dfe77b877ed14553a59314837210fd6682faadf5..394a5f7d013d992533919cfea840e16e348c3a37 100644 --- a/src/share/demo/nio/zipfs/Demo.java +++ b/src/share/demo/nio/zipfs/Demo.java @@ -42,7 +42,6 @@ import java.util.*; import static java.nio.file.StandardOpenOption.*; import static java.nio.file.StandardCopyOption.*; - /* * ZipFileSystem usage demo * @@ -157,7 +156,6 @@ public class Demo { env.put("create", "true"); try (FileSystem fs = provider.newFileSystem(Paths.get(args[1]), env)) { Path path, src, dst; - boolean isRename = false; switch (action) { case rename: src = fs.getPath(args[2]); @@ -303,6 +301,7 @@ public class Demo { final String fStr = (args.length > 3)?args[3]:""; try (DirectoryStream ds = Files.newDirectoryStream(path, new DirectoryStream.Filter() { + @Override public boolean accept(Path path) { return path.toString().contains(fStr); } @@ -358,10 +357,18 @@ public class Demo { return null; } + @SuppressWarnings("unused") + /** + * Not used in demo, but included for demonstrational purposes. + */ private static byte[] getBytes(String name) { return name.getBytes(); } + @SuppressWarnings("unused") + /** + * Not used in demo, but included for demonstrational purposes. + */ private static String getString(byte[] name) { return new String(name); } @@ -534,6 +541,10 @@ public class Demo { Files.createDirectory(path); } + @SuppressWarnings("unused") + /** + * Not used in demo, but included for demonstrational purposes. + */ private static void rmdirs(Path path) throws IOException { while (path != null && path.getNameCount() != 0) { Files.delete(path); @@ -557,7 +568,11 @@ public class Demo { } } - // check the content of two paths are equal + @SuppressWarnings("unused") + /** + * Checks that the content of two paths are equal. + * Not used in demo, but included for demonstrational purposes. + */ private static void checkEqual(Path src, Path dst) throws IOException { //System.out.printf("checking <%s> vs <%s>...%n", diff --git a/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java b/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java index 8ed93f7900e07de6c0193dac14efff6ce7d8a8ea..fa9bf1d5480c6b47276053d38dbc74f2870075b2 100644 --- a/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java +++ b/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java @@ -38,14 +38,18 @@ import javax.swing.text.*; * document. This is used in ScriptShellPanel class as document for editor. */ public class EditableAtEndDocument extends PlainDocument { + + private static final long serialVersionUID = 5358116444851502167L; private int mark; + @Override public void insertString(int offset, String text, AttributeSet a) throws BadLocationException { int len = getLength(); super.insertString(len, text, a); } + @Override public void remove(int offs, int len) throws BadLocationException { int start = offs; int end = offs + len; diff --git a/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java b/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java index bcc6f77dd5a2bd865e16736dc5397e2166ec4848..6bae2c80f8b5d8a2fa33a1784d81ac41fe282fd2 100644 --- a/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java +++ b/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java @@ -32,14 +32,10 @@ package com.sun.demo.scripting.jconsole; import com.sun.tools.jconsole.*; -import java.awt.*; -import java.awt.event.*; import java.io.*; -import java.lang.reflect.*; import java.util.concurrent.CountDownLatch; import javax.script.*; import javax.swing.*; -import javax.swing.event.*; import java.util.*; /** @@ -86,6 +82,7 @@ public class ScriptJConsolePlugin extends JConsolePlugin tabs.put("Script Shell", window); new Thread(new Runnable() { + @Override public void run() { // initialize the script engine initScriptEngine(); @@ -103,10 +100,12 @@ public class ScriptJConsolePlugin extends JConsolePlugin window.dispose(); } + @Override public String getPrompt() { return prompt; } + @Override public String executeCommand(String cmd) { String res; try { @@ -176,7 +175,7 @@ public class ScriptJConsolePlugin extends JConsolePlugin String oldFilename = (String) engine.get(ScriptEngine.FILENAME); engine.put(ScriptEngine.FILENAME, ""); try { - Class myClass = this.getClass(); + Class myClass = this.getClass(); InputStream stream = myClass.getResourceAsStream("/resources/jconsole." + extension); if (stream != null) { diff --git a/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java b/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java index b36c679c5168385ebd6f396e75e4db64070503d0..54731af539f2a2b00a542828517b4728e0ae9549 100644 --- a/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java +++ b/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java @@ -44,8 +44,11 @@ import javax.swing.text.*; * A JPanel subclass containing a scrollable text area displaying the * jconsole's script console. */ + class ScriptShellPanel extends JPanel { + private static final long serialVersionUID = 4116273141148726319L; + // interface to evaluate script command and script prompt interface CommandProcessor { // execute given String as script and return the result @@ -75,9 +78,11 @@ class ScriptShellPanel extends JPanel { add(scroller, BorderLayout.CENTER); editor.getDocument().addDocumentListener(new DocumentListener() { + @Override public void changedUpdate(DocumentEvent e) { } + @Override public void insertUpdate(DocumentEvent e) { if (updating) return; beginUpdate(); @@ -90,10 +95,12 @@ class ScriptShellPanel extends JPanel { // Trim "\\n" combinations final String cmd1 = trimContinuations(cmd); commandExecutor.execute(new Runnable() { + @Override public void run() { final String result = executeCommand(cmd1); SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { if (result != null) { print(result + "\n"); @@ -113,6 +120,7 @@ class ScriptShellPanel extends JPanel { } } + @Override public void removeUpdate(DocumentEvent e) { } }); @@ -121,6 +129,7 @@ class ScriptShellPanel extends JPanel { // the JEditorPane to update the caret's position precisely the // size of the insertion editor.addCaretListener(new CaretListener() { + @Override public void caretUpdate(CaretEvent e) { int len = editor.getDocument().getLength(); if (e.getDot() > len) { @@ -133,6 +142,7 @@ class ScriptShellPanel extends JPanel { hbox.add(Box.createGlue()); JButton button = new JButton("Clear"); // FIXME: i18n? button.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { clear(); } @@ -148,6 +158,7 @@ class ScriptShellPanel extends JPanel { commandExecutor.shutdown(); } + @Override public void requestFocus() { editor.requestFocus(); } diff --git a/src/share/lib/security/sunpkcs11-solaris.cfg b/src/share/lib/security/sunpkcs11-solaris.cfg index d0b34ca134dcb1e643c856ef3b6682f654c83471..daf03a447a3af5f918116f7e2cc51019223b7fdc 100644 --- a/src/share/lib/security/sunpkcs11-solaris.cfg +++ b/src/share/lib/security/sunpkcs11-solaris.cfg @@ -14,6 +14,8 @@ handleStartupErrors = ignoreAll attributes = compatibility disabledMechanisms = { +# the following mechanisms are disabled due to lack of digest cloning support +# need to fix 6414899 first CKM_MD2 CKM_MD5 CKM_SHA_1 @@ -21,9 +23,6 @@ disabledMechanisms = { CKM_SHA384 CKM_SHA512 CKM_DSA_KEY_PAIR_GEN -# KEY_AND_MAC_DERIVE disabled due to Solaris bug 6306708 - CKM_SSL3_KEY_AND_MAC_DERIVE - CKM_TLS_KEY_AND_MAC_DERIVE # the following mechanisms are disabled due to performance issues (Solaris bug 6337157) CKM_DSA_SHA1 CKM_MD5_RSA_PKCS diff --git a/src/share/native/java/lang/Throwable.c b/src/share/native/java/lang/Throwable.c index ebef64f025a3e5d5a7d0d4108a8f715af605b8e8..aaf3c2658655ffc96a3e8b0c532a31ad599472dc 100644 --- a/src/share/native/java/lang/Throwable.c +++ b/src/share/native/java/lang/Throwable.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ * `this' so you can write 'throw e.fillInStackTrace();' */ JNIEXPORT jobject JNICALL -Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable) +Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, int dummy) { JVM_FillInStackTrace(env, throwable); return throwable; diff --git a/src/share/native/sun/awt/giflib/dgif_lib.c b/src/share/native/sun/awt/giflib/dgif_lib.c index b566e7e1cc12afb5d74b3998283608cd40241a8a..742ae9c33358d789d161f7c8c85893b8e3184f90 100644 --- a/src/share/native/sun/awt/giflib/dgif_lib.c +++ b/src/share/native/sun/awt/giflib/dgif_lib.c @@ -70,7 +70,7 @@ /* avoid extra function call in case we use fread (TVT) */ #define READ(_gif,_buf,_len) \ (((GifFilePrivateType*)_gif->Private)->Read ? \ - ((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \ + (size_t)((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \ fread(_buf,1,_len,((GifFilePrivateType*)_gif->Private)->File)) static int DGifGetWord(GifFileType *GifFile, int *Word); diff --git a/src/share/native/sun/font/fontscalerdefs.h b/src/share/native/sun/font/fontscalerdefs.h index 4e1bb99e9c3fd668cacad4c209095375d8b7bdcf..8f142752af9cd96fffd769a1accb5ae82e54c791 100644 --- a/src/share/native/sun/font/fontscalerdefs.h +++ b/src/share/native/sun/font/fontscalerdefs.h @@ -55,13 +55,15 @@ typedef Int32 hsFixed; typedef Int32 hsFract; typedef UInt32 Bool32; +#ifndef __cplusplus #ifndef false - #define false 0 + #define false 0 #endif #ifndef true #define true 1 #endif +#endif #define kPosInfinity32 (0x7fffffff) #define kNegInfinity32 (0x80000000) diff --git a/src/share/native/sun/font/layout/HangulLayoutEngine.cpp b/src/share/native/sun/font/layout/HangulLayoutEngine.cpp index 806f2dc5813c75ba876b38e274fb9fab6f194a0d..adc30bd526d25ff20b01288adfd76aedb143970d 100644 --- a/src/share/native/sun/font/layout/HangulLayoutEngine.cpp +++ b/src/share/native/sun/font/layout/HangulLayoutEngine.cpp @@ -162,7 +162,7 @@ static le_int32 decompose(LEUnicode syllable, LEUnicode &lead, LEUnicode &vowel, return 0; } - lead = LJMO_FIRST + (sIndex / HSYL_LVCNT); + lead = (LEUnicode)(LJMO_FIRST + (sIndex / HSYL_LVCNT)); vowel = VJMO_FIRST + (sIndex % HSYL_LVCNT) / TJMO_COUNT; trail = TJMO_FIRST + (sIndex % TJMO_COUNT); diff --git a/src/share/native/sun/font/layout/MPreFixups.cpp b/src/share/native/sun/font/layout/MPreFixups.cpp index 673ea32ca16e2f153b9d00ffc814c990ae9d7f1e..254b3b01acee45da0e39d5b9422caa60d46101f0 100644 --- a/src/share/native/sun/font/layout/MPreFixups.cpp +++ b/src/share/native/sun/font/layout/MPreFixups.cpp @@ -65,9 +65,9 @@ void MPreFixups::add(le_int32 baseIndex, le_int32 mpreIndex) } } -void MPreFixups::apply(LEGlyphStorage &glyphStorage, LEErrorCode& success) +void MPreFixups::apply(LEGlyphStorage &glyphStorage, LEErrorCode& leSuccess) { - if (LE_FAILURE(success)) { + if (LE_FAILURE(leSuccess)) { return; } diff --git a/src/solaris/classes/sun/awt/X11/XListPeer.java b/src/solaris/classes/sun/awt/X11/XListPeer.java index c8799a1ad07845ad63ac2c37f4fe316466d219de..838899e49b8b57ff919bce60b4553dc6e90d4c3c 100644 --- a/src/solaris/classes/sun/awt/X11/XListPeer.java +++ b/src/solaris/classes/sun/awt/X11/XListPeer.java @@ -1479,16 +1479,19 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { int h = height - (SCROLLBAR_AREA + (2 * MARGIN)); hsb.setValue(hsb.getValue() + x); + int options = PAINT_ITEMS | PAINT_HSCROLL; + Rectangle source = null; Point distance = null; if (x < 0) { source = new Rectangle(MARGIN + SPACE, MARGIN, w + x, h); distance = new Point(-x, 0); + options |= COPY_AREA; } else if (x > 0) { source = new Rectangle(MARGIN + SPACE + x, MARGIN, w - x, h); distance = new Point(-x, 0); + options |= COPY_AREA; } - int options = COPY_AREA | PAINT_ITEMS | PAINT_HSCROLL; repaint(vsb.getValue(), lastItemDisplayed(), options, source, distance); } diff --git a/src/solaris/classes/sun/font/FcFontConfiguration.java b/src/solaris/classes/sun/font/FcFontConfiguration.java index ce2c935ba71b27f2d45ba63a59a84489d28e256f..14d8e7ed2214af49ea83353059a73c8394d79c4f 100644 --- a/src/solaris/classes/sun/font/FcFontConfiguration.java +++ b/src/solaris/classes/sun/font/FcFontConfiguration.java @@ -256,9 +256,9 @@ public class FcFontConfiguration extends FontConfiguration { } if (installedFallbackFontFiles != null) { - System.arraycopy(fileNames, index, - installedFallbackFontFiles, - 0, installedFallbackFontFiles.length); + System.arraycopy(installedFallbackFontFiles, 0, + fileNames, fcFonts.length, + installedFallbackFontFiles.length); } result[fontIndex * NUM_STYLES + styleIndex] diff --git a/src/solaris/classes/sun/nio/ch/EPoll.java b/src/solaris/classes/sun/nio/ch/EPoll.java index 8af24f8c793aea04d3e6832067787a9d9c444716..78bc83c8549f4c6c0e8a12435d0036911a3a159d 100644 --- a/src/solaris/classes/sun/nio/ch/EPoll.java +++ b/src/solaris/classes/sun/nio/ch/EPoll.java @@ -99,8 +99,6 @@ class EPoll { // -- Native methods -- - private static native void init(); - private static native int eventSize(); private static native int eventsOffset(); @@ -116,6 +114,5 @@ class EPoll { static { Util.load(); - init(); } } diff --git a/src/solaris/classes/sun/nio/fs/LinuxWatchService.java b/src/solaris/classes/sun/nio/fs/LinuxWatchService.java index 31d3bf0770fa4965ffabb09a874958adca6b06c1..5726fe317abaf3c9cc47a9d965c350cda41aa37e 100644 --- a/src/solaris/classes/sun/nio/fs/LinuxWatchService.java +++ b/src/solaris/classes/sun/nio/fs/LinuxWatchService.java @@ -432,8 +432,6 @@ class LinuxWatchService // -- native methods -- - private static native void init(); - // sizeof inotify_event private static native int eventSize(); @@ -461,6 +459,5 @@ class LinuxWatchService System.loadLibrary("nio"); return null; }}); - init(); } } diff --git a/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c b/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c index fb2ba3c5da36a940d8d7a7e741bdfac65b44cf85..0c5784bc4966f96ebc7dca2d0e7884394f8ba938 100644 --- a/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c +++ b/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c @@ -239,6 +239,13 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre snd_pcm_close(handle); } +/** Workaround for cr 7033899, 7030629: + * dmix plugin doesn't like flush (snd_pcm_drop) when the buffer is empty + * (just opened, underruned or already flushed). + * Sometimes it causes PCM falls to -EBADFD error, + * sometimes causes bufferSize change. + * To prevent unnecessary flushes AlsaPcmInfo::isRunning & isFlushed are used. + */ /* ******* ALSA PCM INFO ******************** */ typedef struct tag_AlsaPcmInfo { snd_pcm_t* handle; @@ -248,6 +255,8 @@ typedef struct tag_AlsaPcmInfo { int frameSize; // storage size in Bytes unsigned int periods; snd_pcm_uframes_t periodSize; + short int isRunning; // see comment above + short int isFlushed; // see comment above #ifdef GET_POSITION_METHOD2 // to be used exclusively by getBytePosition! snd_pcm_status_t* positionStatus; @@ -432,6 +441,9 @@ void* DAUDIO_Open(INT32 mixerIndex, INT32 deviceID, int isSource, return NULL; } memset(info, 0, sizeof(AlsaPcmInfo)); + // initial values are: stopped, flushed + info->isRunning = 0; + info->isFlushed = 1; ret = openPCMfromDeviceID(deviceID, &(info->handle), isSource, FALSE /* do open device*/); if (ret == 0) { @@ -587,6 +599,14 @@ int DAUDIO_Start(void* id, int isSource) { || (state == SND_PCM_STATE_RUNNING) || (state == SND_PCM_STATE_XRUN) || (state == SND_PCM_STATE_SUSPENDED); + if (ret) { + info->isRunning = 1; + // source line should keep isFlushed value until Write() is called; + // for target data line reset it right now. + if (!isSource) { + info->isFlushed = 0; + } + } TRACE1("< DAUDIO_Start %s\n", ret?"success":"error"); return ret?TRUE:FALSE; } @@ -606,6 +626,7 @@ int DAUDIO_Stop(void* id, int isSource) { ERROR1("ERROR in snd_pcm_pause: %s\n", snd_strerror(ret)); return FALSE; } + info->isRunning = 0; TRACE0("< DAUDIO_Stop success\n"); return TRUE; } @@ -651,8 +672,7 @@ int xrun_recovery(AlsaPcmInfo* info, int err) { return -1; } return 1; - } - else if (err == -ESTRPIPE) { + } else if (err == -ESTRPIPE) { TRACE0("xrun_recovery: suspended.\n"); ret = snd_pcm_resume(info->handle); if (ret < 0) { @@ -667,11 +687,11 @@ int xrun_recovery(AlsaPcmInfo* info, int err) { return -1; } return 1; - } - else if (err == -EAGAIN) { + } else if (err == -EAGAIN) { TRACE0("xrun_recovery: EAGAIN try again flag.\n"); return 0; } + TRACE2("xrun_recovery: unexpected error %d: %s\n", err, snd_strerror(err)); return -1; } @@ -691,6 +711,7 @@ int DAUDIO_Write(void* id, char* data, int byteSize) { TRACE0("< DAUDIO_Write returning -1\n"); return -1; } + count = 2; // maximum number of trials to recover from underrun //frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize); frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize); @@ -712,6 +733,12 @@ int DAUDIO_Write(void* id, char* data, int byteSize) { } } while (TRUE); //ret = snd_pcm_frames_to_bytes(info->handle, writtenFrames); + + if (writtenFrames > 0) { + // reset "flushed" flag + info->isFlushed = 0; + } + ret = (int) (writtenFrames * info->frameSize); TRACE1("< DAUDIO_Write: returning %d bytes.\n", ret); return ret; @@ -736,6 +763,11 @@ int DAUDIO_Read(void* id, char* data, int byteSize) { TRACE0("< DAUDIO_Read returning -1\n"); return -1; } + if (!info->isRunning && info->isFlushed) { + // PCM has nothing to read + return 0; + } + count = 2; // maximum number of trials to recover from error //frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize); frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize); @@ -784,12 +816,22 @@ int DAUDIO_Flush(void* id, int isSource) { int ret; TRACE0("DAUDIO_Flush\n"); + + if (info->isFlushed) { + // nothing to drop + return 1; + } + ret = snd_pcm_drop(info->handle); if (ret != 0) { ERROR1("ERROR in snd_pcm_drop: %s\n", snd_strerror(ret)); return FALSE; } - ret = DAUDIO_Start(id, isSource); + + info->isFlushed = 1; + if (info->isRunning) { + ret = DAUDIO_Start(id, isSource); + } return ret; } @@ -800,7 +842,7 @@ int DAUDIO_GetAvailable(void* id, int isSource) { int ret; state = snd_pcm_state(info->handle); - if (state == SND_PCM_STATE_XRUN) { + if (info->isFlushed || state == SND_PCM_STATE_XRUN) { // if in xrun state then we have the entire buffer available, // not 0 as alsa reports ret = info->bufferSizeInBytes; @@ -841,7 +883,7 @@ INT64 DAUDIO_GetBytePosition(void* id, int isSource, INT64 javaBytePos) { snd_pcm_state_t state; state = snd_pcm_state(info->handle); - if (state != SND_PCM_STATE_XRUN) { + if (!info->isFlushed && state != SND_PCM_STATE_XRUN) { #ifdef GET_POSITION_METHOD2 snd_timestamp_t* ts; snd_pcm_uframes_t framesAvail; diff --git a/src/solaris/native/sun/awt/fontpath.c b/src/solaris/native/sun/awt/fontpath.c index 68c352db16c61672b96aa45545b796865bc6f930..98d6f1419fc3e07060853ba2eb321df23f1106c1 100644 --- a/src/solaris/native/sun/awt/fontpath.c +++ b/src/solaris/native/sun/awt/fontpath.c @@ -1107,7 +1107,8 @@ Java_sun_font_FontConfigManager_getFontConfig arrlen = (*env)->GetArrayLength(env, fcCompFontArray); for (i=0; i #include #include - -#ifdef __cplusplus -extern "C" { -#endif - -/* epoll_wait(2) man page */ - -typedef union epoll_data { - void *ptr; - int fd; - __uint32_t u32; - __uint64_t u64; -} epoll_data_t; - -struct epoll_event { - __uint32_t events; /* Epoll events */ - epoll_data_t data; /* User data variable */ -} __attribute__ ((__packed__)); - -#ifdef __cplusplus -} -#endif - -/* - * epoll event notification is new in 2.6 kernel. As the offical build - * platform for the JDK is on a 2.4-based distribution then we must - * obtain the addresses of the epoll functions dynamically. - */ -typedef int (*epoll_create_t)(int size); -typedef int (*epoll_ctl_t) (int epfd, int op, int fd, struct epoll_event *event); -typedef int (*epoll_wait_t) (int epfd, struct epoll_event *events, int maxevents, int timeout); - -static epoll_create_t epoll_create_func; -static epoll_ctl_t epoll_ctl_func; -static epoll_wait_t epoll_wait_func; - - -JNIEXPORT void JNICALL -Java_sun_nio_ch_EPoll_init(JNIEnv *env, jclass this) -{ - epoll_create_func = (epoll_create_t) dlsym(RTLD_DEFAULT, "epoll_create"); - epoll_ctl_func = (epoll_ctl_t) dlsym(RTLD_DEFAULT, "epoll_ctl"); - epoll_wait_func = (epoll_wait_t) dlsym(RTLD_DEFAULT, "epoll_wait"); - - if ((epoll_create_func == NULL) || (epoll_ctl_func == NULL) || - (epoll_wait_func == NULL)) { - JNU_ThrowInternalError(env, "unable to get address of epoll functions, pre-2.6 kernel?"); - } -} +#include JNIEXPORT jint JNICALL Java_sun_nio_ch_EPoll_eventSize(JNIEnv* env, jclass this) @@ -108,7 +60,7 @@ Java_sun_nio_ch_EPoll_epollCreate(JNIEnv *env, jclass c) { * epoll_create expects a size as a hint to the kernel about how to * dimension internal structures. We can't predict the size in advance. */ - int epfd = (*epoll_create_func)(256); + int epfd = epoll_create(256); if (epfd < 0) { JNU_ThrowIOExceptionWithLastError(env, "epoll_create failed"); } @@ -125,7 +77,7 @@ Java_sun_nio_ch_EPoll_epollCtl(JNIEnv *env, jclass c, jint epfd, event.events = events; event.data.fd = fd; - RESTARTABLE((*epoll_ctl_func)(epfd, (int)opcode, (int)fd, &event), res); + RESTARTABLE(epoll_ctl(epfd, (int)opcode, (int)fd, &event), res); return (res == 0) ? 0 : errno; } @@ -137,7 +89,7 @@ Java_sun_nio_ch_EPoll_epollWait(JNIEnv *env, jclass c, struct epoll_event *events = jlong_to_ptr(address); int res; - RESTARTABLE((*epoll_wait_func)(epfd, events, numfds, -1), res); + RESTARTABLE(epoll_wait(epfd, events, numfds, -1), res); if (res < 0) { JNU_ThrowIOExceptionWithLastError(env, "epoll_wait failed"); } diff --git a/src/solaris/native/sun/nio/fs/LinuxWatchService.c b/src/solaris/native/sun/nio/fs/LinuxWatchService.c index 0b48180cd705ea46384d1455b539f1417a3f428a..ca4ce5e6f6280406b06860f1a98eda8e32cd4d21 100644 --- a/src/solaris/native/sun/nio/fs/LinuxWatchService.c +++ b/src/solaris/native/sun/nio/fs/LinuxWatchService.c @@ -33,33 +33,10 @@ #include #include #include +#include #include "sun_nio_fs_LinuxWatchService.h" -/* inotify.h may not be available at build time */ -#ifdef __cplusplus -extern "C" { -#endif -struct inotify_event -{ - int wd; - uint32_t mask; - uint32_t cookie; - uint32_t len; - char name __flexarr; -}; -#ifdef __cplusplus -} -#endif - -typedef int inotify_init_func(void); -typedef int inotify_add_watch_func(int fd, const char* path, uint32_t mask); -typedef int inotify_rm_watch_func(int fd, uint32_t wd); - -inotify_init_func* my_inotify_init_func = NULL; -inotify_add_watch_func* my_inotify_add_watch_func = NULL; -inotify_rm_watch_func* my_inotify_rm_watch_func = NULL; - static void throwUnixException(JNIEnv* env, int errnum) { jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", "(I)V", errnum); @@ -68,22 +45,6 @@ static void throwUnixException(JNIEnv* env, int errnum) { } } -JNIEXPORT void JNICALL -Java_sun_nio_fs_LinuxWatchService_init(JNIEnv *env, jclass clazz) -{ - my_inotify_init_func = (inotify_init_func*) - dlsym(RTLD_DEFAULT, "inotify_init"); - my_inotify_add_watch_func = - (inotify_add_watch_func*) dlsym(RTLD_DEFAULT, "inotify_add_watch"); - my_inotify_rm_watch_func = - (inotify_rm_watch_func*) dlsym(RTLD_DEFAULT, "inotify_rm_watch"); - - if ((my_inotify_init_func == NULL) || (my_inotify_add_watch_func == NULL) || - (my_inotify_rm_watch_func == NULL)) { - JNU_ThrowInternalError(env, "unable to get address of inotify functions"); - } -} - JNIEXPORT jint JNICALL Java_sun_nio_fs_LinuxWatchService_eventSize(JNIEnv *env, jclass clazz) { @@ -111,7 +72,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_fs_LinuxWatchService_inotifyInit (JNIEnv* env, jclass clazz) { - int ifd = (*my_inotify_init_func)(); + int ifd = inotify_init(); if (ifd == -1) { throwUnixException(env, errno); } @@ -125,7 +86,7 @@ Java_sun_nio_fs_LinuxWatchService_inotifyAddWatch int wfd = -1; const char* path = (const char*)jlong_to_ptr(address); - wfd = (*my_inotify_add_watch_func)((int)fd, path, mask); + wfd = inotify_add_watch((int)fd, path, mask); if (wfd == -1) { throwUnixException(env, errno); } @@ -136,7 +97,7 @@ JNIEXPORT void JNICALL Java_sun_nio_fs_LinuxWatchService_inotifyRmWatch (JNIEnv* env, jclass clazz, jint fd, jint wd) { - int err = (*my_inotify_rm_watch_func)((int)fd, (int)wd); + int err = inotify_rm_watch((int)fd, (int)wd); if (err == -1) throwUnixException(env, errno); } @@ -166,7 +127,6 @@ Java_sun_nio_fs_LinuxWatchService_socketpair res[1] = (jint)sp[1]; (*env)->SetIntArrayRegion(env, sv, 0, 2, &res[0]); } - } JNIEXPORT jint JNICALL @@ -190,6 +150,4 @@ Java_sun_nio_fs_LinuxWatchService_poll } } return (jint)n; - - } diff --git a/src/windows/classes/java/lang/ProcessEnvironment.java b/src/windows/classes/java/lang/ProcessEnvironment.java index b5a4383019e185a81c478614beede6ea62e00089..89e468999998a911ddadd821848ffca9d1fad636 100644 --- a/src/windows/classes/java/lang/ProcessEnvironment.java +++ b/src/windows/classes/java/lang/ProcessEnvironment.java @@ -143,7 +143,7 @@ final class ProcessEnvironment extends HashMap public void remove() { i.remove();} }; } - private static Map.Entry checkedEntry (Object o) { + private static Map.Entry checkedEntry(Object o) { Map.Entry e = (Map.Entry) o; nonNullString(e.getKey()); nonNullString(e.getValue()); @@ -285,7 +285,7 @@ final class ProcessEnvironment extends HashMap return (Map) theEnvironment.clone(); } - // Only for use by Runtime.exec(...String[]envp...) + // Only for use by ProcessBuilder.environment(String[] envp) static Map emptyEnvironment(int capacity) { return new ProcessEnvironment(capacity); } @@ -299,19 +299,46 @@ final class ProcessEnvironment extends HashMap Collections.sort(list, entryComparator); StringBuilder sb = new StringBuilder(size()*30); - for (Map.Entry e : list) - sb.append(e.getKey()) - .append('=') - .append(e.getValue()) - .append('\u0000'); - // Ensure double NUL termination, - // even if environment is empty. - if (sb.length() == 0) + int cmp = -1; + + // Some versions of MSVCRT.DLL require SystemRoot to be set. + // So, we make sure that it is always set, even if not provided + // by the caller. + final String SYSTEMROOT = "SystemRoot"; + + for (Map.Entry e : list) { + String key = e.getKey(); + String value = e.getValue(); + if (cmp < 0 && (cmp = nameComparator.compare(key, SYSTEMROOT)) > 0) { + // Not set, so add it here + addToEnvIfSet(sb, SYSTEMROOT); + } + addToEnv(sb, key, value); + } + if (cmp < 0) { + // Got to end of list and still not found + addToEnvIfSet(sb, SYSTEMROOT); + } + if (sb.length() == 0) { + // Environment was empty and SystemRoot not set in parent sb.append('\u0000'); + } + // Block is double NUL terminated sb.append('\u0000'); return sb.toString(); } + // add the environment variable to the child, if it exists in parent + private static void addToEnvIfSet(StringBuilder sb, String name) { + String s = getenv(name); + if (s != null) + addToEnv(sb, name, s); + } + + private static void addToEnv(StringBuilder sb, String name, String val) { + sb.append(name).append('=').append(val).append('\u0000'); + } + static String toEnvironmentBlock(Map map) { return map == null ? null : ((ProcessEnvironment)map).toEnvironmentBlock(); diff --git a/src/windows/classes/sun/awt/windows/WDataTransferer.java b/src/windows/classes/sun/awt/windows/WDataTransferer.java index 21c1945140fc9fb3d2f738ec7aca31b7717fce6e..47dcf2754305b26b0b645f236f64b5d3ed29041a 100644 --- a/src/windows/classes/sun/awt/windows/WDataTransferer.java +++ b/src/windows/classes/sun/awt/windows/WDataTransferer.java @@ -830,7 +830,14 @@ class HTMLCodec extends InputStream { if( -1 == iStartOffset ){ throw new IOException(FAILURE_MSG + "invalid HTML format."); } - iReadCount = bufferedStream.skip(iStartOffset); + + int curOffset = 0; + while (curOffset < iStartOffset){ + curOffset += bufferedStream.skip(iStartOffset - curOffset); + } + + iReadCount = curOffset; + if( iStartOffset != iReadCount ){ throw new IOException(FAILURE_MSG + "Byte stream ends in description."); } diff --git a/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java b/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java index f6c53f81f1ebe2fb538604a116ec556fb98fe4d6..41354c88a74badaa62451cef202a9e1d6d2d928a 100644 --- a/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java +++ b/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,12 +30,15 @@ package sun.security.krb5.internal.tools; +import java.io.File; import sun.security.krb5.*; import sun.security.krb5.internal.*; import sun.security.krb5.internal.ccache.*; import java.io.IOException; import java.util.Arrays; +import javax.security.auth.kerberos.KerberosPrincipal; import sun.security.util.Password; +import javax.security.auth.kerberos.KeyTab; /** * Kinit tool for obtaining Kerberos v5 tickets. @@ -153,7 +156,6 @@ public class Kinit { System.out.println("Principal is " + principal); } char[] psswd = options.password; - EncryptionKey[] skeys = null; boolean useKeytab = options.useKeytabFile(); if (!useKeytab) { if (princName == null) { @@ -186,17 +188,9 @@ public class Kinit { } } - // assert princName and principal are nonnull - skeys = EncryptionKey.acquireSecretKeys(principal, ktabName); - - if (skeys == null || skeys.length == 0) { - String msg = "No supported key found in keytab"; - if (princName != null) { - msg += " for principal " + princName; - } - throw new KrbException(msg); - } - builder = new KrbAsReqBuilder(principal, skeys); + builder = new KrbAsReqBuilder(principal, ktabName == null + ? KeyTab.getInstance() + : KeyTab.getInstance(new File(ktabName))); } KDCOptions opt = new KDCOptions(); diff --git a/src/windows/classes/sun/security/krb5/internal/tools/Klist.java b/src/windows/classes/sun/security/krb5/internal/tools/Klist.java index ad5c8aa34f06563f980440eeba87b5c663affb9e..6cbc8a3fa61f5506ab0ede6c9503307742f0c23b 100644 --- a/src/windows/classes/sun/security/krb5/internal/tools/Klist.java +++ b/src/windows/classes/sun/security/krb5/internal/tools/Klist.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,16 +95,15 @@ public class Klist { } break; case 'k': - if (klist.name == null) { - klist.target = KeyTab.getInstance(); - klist.name = KeyTab.tabName(); - } else klist.target = KeyTab.getInstance(klist.name); - if (klist.target != null) { - klist.displayTab(); - } else { + try { + KeyTab ktab = KeyTab.getInstance(klist.name); + klist.target = ktab; + klist.name = ktab.tabName(); + } catch (Exception e) { klist.displayMessage("KeyTab"); System.exit(-1); } + klist.displayTab(); break; default: if (klist.name != null) { @@ -295,9 +294,10 @@ public class Klist { void displayMessage(String target) { if (name == null) { - name = ""; + System.out.println("Default " + target + " not found."); + } else { + System.out.println(target + " " + name + " not found."); } - System.out.println(target + " " + name + " not found."); } /** * Reformats the date from the form - diff --git a/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java b/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java index 216c3a30c1273b908801649438ce18d7bbc04a45..fe29462add57f4a46e2fbdcab057456902459ce5 100644 --- a/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java +++ b/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -321,7 +321,7 @@ public class Ktab { * Lists key table name and entries in it. */ void listKt() { - System.out.println("Keytab name: " + KeyTab.tabName()); + System.out.println("Keytab name: " + table.tabName()); KeyTabEntry[] entries = table.getEntries(); if ((entries != null) && (entries.length > 0)) { String[][] output = new String[entries.length+1][showTime?3:2]; diff --git a/src/windows/classes/sun/security/mscapi/KeyStore.java b/src/windows/classes/sun/security/mscapi/KeyStore.java index a89aae18e2985e630624802d4106a2ba3b6f6227..55ac616107420db946a100132d185d29f38d0f53 100644 --- a/src/windows/classes/sun/security/mscapi/KeyStore.java +++ b/src/windows/classes/sun/security/mscapi/KeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.math.BigInteger; import java.security.AccessController; +import java.security.InvalidKeyException; import java.security.KeyStoreSpi; import java.security.KeyStoreException; import java.security.UnrecoverableKeyException; @@ -123,6 +124,7 @@ abstract class KeyStore extends KeyStoreSpi { * Sets the private key for the keystore entry. */ void setPrivateKey(RSAPrivateCrtKey key) + throws InvalidKeyException, KeyStoreException { byte[] modulusBytes = key.getModulus().toByteArray(); @@ -158,7 +160,7 @@ abstract class KeyStore extends KeyStoreSpi { * Sets the certificate chain for the keystore entry. */ void setCertificateChain(X509Certificate[] chain) - throws CertificateException + throws CertificateException, KeyStoreException { for (int i = 0; i < chain.length; i++) { byte[] encoding = chain[i].getEncoded(); @@ -404,13 +406,16 @@ abstract class KeyStore extends KeyStoreSpi { } entry.setAlias(alias); - entry.setPrivateKey((RSAPrivateCrtKey) key); try { + entry.setPrivateKey((RSAPrivateCrtKey) key); entry.setCertificateChain((X509Certificate[]) chain); } catch (CertificateException ce) { throw new KeyStoreException(ce); + + } catch (InvalidKeyException ike) { + throw new KeyStoreException(ike); } } else { @@ -537,7 +542,7 @@ abstract class KeyStore extends KeyStoreSpi { removeCertificate(getName(), alias, encoding, encoding.length); - } catch (CertificateEncodingException e) { + } catch (CertificateException e) { throw new KeyStoreException("Cannot remove entry: " + e); } @@ -754,8 +759,14 @@ abstract class KeyStore extends KeyStoreSpi { // Clear all key entries entries.clear(); - // Load keys and/or certificate chains - loadKeysOrCertificateChains(getName(), entries); + try { + + // Load keys and/or certificate chains + loadKeysOrCertificateChains(getName(), entries); + + } catch (KeyStoreException e) { + throw new IOException(e); + } } /** @@ -868,7 +879,7 @@ abstract class KeyStore extends KeyStoreSpi { * @param entries Collection of key/certificate. */ private native void loadKeysOrCertificateChains(String name, - Collection entries); + Collection entries) throws KeyStoreException; /** * Stores a DER-encoded certificate into the certificate store @@ -879,7 +890,7 @@ abstract class KeyStore extends KeyStoreSpi { */ private native void storeCertificate(String name, String alias, byte[] encoding, int encodingLength, long hCryptProvider, - long hCryptKey); + long hCryptKey) throws CertificateException, KeyStoreException; /** * Removes the certificate from the certificate store @@ -889,14 +900,16 @@ abstract class KeyStore extends KeyStoreSpi { * @param encoding DER-encoded certificate. */ private native void removeCertificate(String name, String alias, - byte[] encoding, int encodingLength); + byte[] encoding, int encodingLength) + throws CertificateException, KeyStoreException; /** * Destroys the key container. * * @param keyContainerName The name of the key container. */ - private native void destroyKeyContainer(String keyContainerName); + private native void destroyKeyContainer(String keyContainerName) + throws KeyStoreException; /** * Generates a private-key BLOB from a key's components. @@ -910,8 +923,8 @@ abstract class KeyStore extends KeyStoreSpi { byte[] primeQ, byte[] exponentP, byte[] exponentQ, - byte[] crtCoefficient); + byte[] crtCoefficient) throws InvalidKeyException; private native RSAPrivateKey storePrivateKey(byte[] keyBlob, - String keyContainerName, int keySize); + String keyContainerName, int keySize) throws KeyStoreException; } diff --git a/src/windows/classes/sun/security/mscapi/RSACipher.java b/src/windows/classes/sun/security/mscapi/RSACipher.java index 8838cbe8e482e232376e15ce789632b9bcbbd4bc..4b146539caffbcff627fb312664ac9be1929677f 100644 --- a/src/windows/classes/sun/security/mscapi/RSACipher.java +++ b/src/windows/classes/sun/security/mscapi/RSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package sun.security.mscapi; +import java.math.BigInteger; import java.security.*; import java.security.Key; import java.security.interfaces.*; @@ -33,6 +34,8 @@ import java.security.spec.*; import javax.crypto.*; import javax.crypto.spec.*; +import sun.security.rsa.RSAKeyFactory; + /** * RSA cipher implementation using the Microsoft Crypto API. * Supports RSA en/decryption and signing/verifying using PKCS#1 v1.5 padding. @@ -189,8 +192,43 @@ public final class RSACipher extends CipherSpi { default: throw new InvalidKeyException("Unknown mode: " + opmode); } + if (!(key instanceof sun.security.mscapi.Key)) { - throw new InvalidKeyException("Unsupported key type: " + key); + if (key instanceof java.security.interfaces.RSAPublicKey) { + java.security.interfaces.RSAPublicKey rsaKey = + (java.security.interfaces.RSAPublicKey) key; + + // Convert key to MSCAPI format + + BigInteger modulus = rsaKey.getModulus(); + BigInteger exponent = rsaKey.getPublicExponent(); + + // Check against the local and global values to make sure + // the sizes are ok. Round up to the nearest byte. + RSAKeyFactory.checkKeyLengths(((modulus.bitLength() + 7) & ~7), + exponent, -1, RSAKeyPairGenerator.KEY_SIZE_MAX); + + byte[] modulusBytes = modulus.toByteArray(); + byte[] exponentBytes = exponent.toByteArray(); + + // Adjust key length due to sign bit + int keyBitLength = (modulusBytes[0] == 0) + ? (modulusBytes.length - 1) * 8 + : modulusBytes.length * 8; + + byte[] keyBlob = RSASignature.generatePublicKeyBlob( + keyBitLength, modulusBytes, exponentBytes); + + try { + key = RSASignature.importPublicKey(keyBlob, keyBitLength); + + } catch (KeyStoreException e) { + throw new InvalidKeyException(e); + } + + } else { + throw new InvalidKeyException("Unsupported key type: " + key); + } } if (key instanceof PublicKey) { @@ -358,6 +396,10 @@ public final class RSACipher extends CipherSpi { if (key instanceof sun.security.mscapi.Key) { return ((sun.security.mscapi.Key) key).bitLength(); + + } else if (key instanceof RSAKey) { + return ((RSAKey) key).getModulus().bitLength(); + } else { throw new InvalidKeyException("Unsupported key type: " + key); } diff --git a/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java b/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java index a5afe5c16e1448e86018eb25ff20dc9ad4313196..f0d193eb8a61a3f1ada5f80d8d160a9e793c8435 100644 --- a/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java +++ b/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,14 +105,20 @@ public final class RSAKeyPairGenerator extends KeyPairGeneratorSpi { // generate the keypair. See JCA doc public KeyPair generateKeyPair() { - // Generate each keypair in a unique key container - RSAKeyPair keys = - generateRSAKeyPair(keySize, - "{" + UUID.randomUUID().toString() + "}"); + try { + + // Generate each keypair in a unique key container + RSAKeyPair keys = + generateRSAKeyPair(keySize, + "{" + UUID.randomUUID().toString() + "}"); - return new KeyPair(keys.getPublic(), keys.getPrivate()); + return new KeyPair(keys.getPublic(), keys.getPrivate()); + + } catch (KeyException e) { + throw new ProviderException(e); + } } private static native RSAKeyPair generateRSAKeyPair(int keySize, - String keyContainerName); + String keyContainerName) throws KeyException; } diff --git a/src/windows/classes/sun/security/mscapi/RSAPublicKey.java b/src/windows/classes/sun/security/mscapi/RSAPublicKey.java index 9e454e75e5dcfffbfa77729bf488807dd0de7325..68148b0e4b566845aacd3987c11fd29460bccd8e 100644 --- a/src/windows/classes/sun/security/mscapi/RSAPublicKey.java +++ b/src/windows/classes/sun/security/mscapi/RSAPublicKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,9 @@ package sun.security.mscapi; import java.math.BigInteger; import java.security.InvalidKeyException; +import java.security.KeyException; import java.security.KeyRep; +import java.security.ProviderException; import java.security.PublicKey; import sun.security.rsa.RSAPublicKeyImpl; @@ -89,9 +91,14 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey public BigInteger getPublicExponent() { if (exponent == null) { - publicKeyBlob = getPublicKeyBlob(hCryptKey); - exponent = new BigInteger(getExponent(publicKeyBlob)); + try { + publicKeyBlob = getPublicKeyBlob(hCryptKey); + exponent = new BigInteger(1, getExponent(publicKeyBlob)); + + } catch (KeyException e) { + throw new ProviderException(e); + } } return exponent; @@ -103,8 +110,14 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey public BigInteger getModulus() { if (modulus == null) { - publicKeyBlob = getPublicKeyBlob(hCryptKey); - modulus = new BigInteger(getModulus(publicKeyBlob)); + + try { + publicKeyBlob = getPublicKeyBlob(hCryptKey); + modulus = new BigInteger(1, getModulus(publicKeyBlob)); + + } catch (KeyException e) { + throw new ProviderException(e); + } } return modulus; @@ -147,7 +160,7 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey encoding = new RSAPublicKeyImpl(getModulus(), getPublicExponent()).getEncoded(); - } catch (InvalidKeyException e) { + } catch (KeyException e) { // ignore } } @@ -164,15 +177,15 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey /* * Returns the Microsoft CryptoAPI representation of the key. */ - private native byte[] getPublicKeyBlob(long hCryptKey); + private native byte[] getPublicKeyBlob(long hCryptKey) throws KeyException; /* * Returns the key's public exponent (in big-endian 2's complement format). */ - private native byte[] getExponent(byte[] keyBlob); + private native byte[] getExponent(byte[] keyBlob) throws KeyException; /* * Returns the key's modulus (in big-endian 2's complement format). */ - private native byte[] getModulus(byte[] keyBlob); + private native byte[] getModulus(byte[] keyBlob) throws KeyException; } diff --git a/src/windows/classes/sun/security/mscapi/RSASignature.java b/src/windows/classes/sun/security/mscapi/RSASignature.java index bb0be095cf6b34df2e2f460a83beb3836323721d..f9419f9ccfcb70f7d6855e407a02df1205affead 100644 --- a/src/windows/classes/sun/security/mscapi/RSASignature.java +++ b/src/windows/classes/sun/security/mscapi/RSASignature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import java.security.PrivateKey; import java.security.InvalidKeyException; import java.security.InvalidParameterException; import java.security.InvalidAlgorithmParameterException; +import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.ProviderException; import java.security.MessageDigest; @@ -48,11 +49,20 @@ import sun.security.rsa.RSAKeyFactory; * Objects should be instantiated by calling Signature.getInstance() using the * following algorithm names: * + * . "NONEwithRSA" * . "SHA1withRSA" + * . "SHA256withRSA" + * . "SHA384withRSA" + * . "SHA512withRSA" * . "MD5withRSA" * . "MD2withRSA" * - * Note: RSA keys must be at least 512 bits long + * NOTE: RSA keys must be at least 512 bits long. + * + * NOTE: NONEwithRSA must be supplied with a pre-computed message digest. + * Only the following digest algorithms are supported: MD5, SHA-1, + * SHA-256, SHA-384, SHA-512 and a special-purpose digest algorithm + * which is a concatenation of SHA-1 and MD5 digests. * * @since 1.6 * @author Stanley Man-Kit Ho @@ -62,7 +72,10 @@ abstract class RSASignature extends java.security.SignatureSpi // message digest implementation we use private final MessageDigest messageDigest; - // flag indicating whether the digest is reset + // message digest name + private String messageDigestAlgorithm; + + // flag indicating whether the digest has been reset private boolean needsReset; // the signing key @@ -71,11 +84,23 @@ abstract class RSASignature extends java.security.SignatureSpi // the verification key private Key publicKey = null; + /** + * Constructs a new RSASignature. Used by Raw subclass. + */ + RSASignature() { + messageDigest = null; + messageDigestAlgorithm = null; + } + /** + * Constructs a new RSASignature. Used by subclasses. + */ RSASignature(String digestName) { try { messageDigest = MessageDigest.getInstance(digestName); + // Get the digest's canonical name + messageDigestAlgorithm = messageDigest.getAlgorithm(); } catch (NoSuchAlgorithmException e) { throw new ProviderException(e); @@ -84,12 +109,118 @@ abstract class RSASignature extends java.security.SignatureSpi needsReset = false; } + // Nested class for NONEwithRSA signatures + public static final class Raw extends RSASignature { + + // the longest supported digest is 512 bits (SHA-512) + private static final int RAW_RSA_MAX = 64; + + private final byte[] precomputedDigest; + private int offset = 0; + + public Raw() { + precomputedDigest = new byte[RAW_RSA_MAX]; + } + + // Stores the precomputed message digest value. + @Override + protected void engineUpdate(byte b) throws SignatureException { + if (offset >= precomputedDigest.length) { + offset = RAW_RSA_MAX + 1; + return; + } + precomputedDigest[offset++] = b; + } + + // Stores the precomputed message digest value. + @Override + protected void engineUpdate(byte[] b, int off, int len) + throws SignatureException { + if (offset + len > precomputedDigest.length) { + offset = RAW_RSA_MAX + 1; + return; + } + System.arraycopy(b, off, precomputedDigest, offset, len); + offset += len; + } + + // Stores the precomputed message digest value. + @Override + protected void engineUpdate(ByteBuffer byteBuffer) { + int len = byteBuffer.remaining(); + if (len <= 0) { + return; + } + if (offset + len > precomputedDigest.length) { + offset = RAW_RSA_MAX + 1; + return; + } + byteBuffer.get(precomputedDigest, offset, len); + offset += len; + } + + @Override + protected void resetDigest(){ + offset = 0; + } + + // Returns the precomputed message digest value. + @Override + protected byte[] getDigestValue() throws SignatureException { + if (offset > RAW_RSA_MAX) { + throw new SignatureException("Message digest is too long"); + } + + // Determine the digest algorithm from the digest length + if (offset == 20) { + setDigestName("SHA1"); + } else if (offset == 36) { + setDigestName("SHA1+MD5"); + } else if (offset == 32) { + setDigestName("SHA-256"); + } else if (offset == 48) { + setDigestName("SHA-384"); + } else if (offset == 64) { + setDigestName("SHA-512"); + } else if (offset == 16) { + setDigestName("MD5"); + } else { + throw new SignatureException( + "Message digest length is not supported"); + } + + byte[] result = new byte[offset]; + System.arraycopy(precomputedDigest, 0, result, 0, offset); + offset = 0; + + return result; + } + } + public static final class SHA1 extends RSASignature { public SHA1() { super("SHA1"); } } + public static final class SHA256 extends RSASignature { + public SHA256() { + super("SHA-256"); + } + } + + public static final class SHA384 extends RSASignature { + public SHA384() { + super("SHA-384"); + } + } + + public static final class SHA512 extends RSASignature { + public SHA512() { + super("SHA-512"); + } + } + public static final class MD5 extends RSASignature { public MD5() { super("MD5"); @@ -102,16 +233,7 @@ abstract class RSASignature extends java.security.SignatureSpi } } - /** - * Initializes this signature object with the specified - * public key for verification operations. - * - * @param publicKey the public key of the identity whose signature is - * going to be verified. - * - * @exception InvalidKeyException if the key is improperly - * encoded, parameters are missing, and so on. - */ + // initialize for signing. See JCA doc protected void engineInitVerify(PublicKey key) throws InvalidKeyException { @@ -146,30 +268,23 @@ abstract class RSASignature extends java.security.SignatureSpi byte[] keyBlob = generatePublicKeyBlob( keyBitLength, modulusBytes, exponentBytes); - publicKey = importPublicKey(keyBlob, keyBitLength); + try { + publicKey = importPublicKey(keyBlob, keyBitLength); + + } catch (KeyStoreException e) { + throw new InvalidKeyException(e); + } } else { publicKey = (sun.security.mscapi.RSAPublicKey) key; } - if (needsReset) { - messageDigest.reset(); - needsReset = false; - } + this.privateKey = null; + resetDigest(); } - /** - * Initializes this signature object with the specified - * private key for signing operations. - * - * @param privateKey the private key of the identity whose signature - * will be generated. - * - * @exception InvalidKeyException if the key is improperly - * encoded, parameters are missing, and so on. - */ - protected void engineInitSign(PrivateKey key) - throws InvalidKeyException + // initialize for signing. See JCA doc + protected void engineInitSign(PrivateKey key) throws InvalidKeyException { // This signature accepts only RSAPrivateKey if ((key instanceof sun.security.mscapi.RSAPrivateKey) == false) { @@ -183,12 +298,29 @@ abstract class RSASignature extends java.security.SignatureSpi null, RSAKeyPairGenerator.KEY_SIZE_MIN, RSAKeyPairGenerator.KEY_SIZE_MAX); + this.publicKey = null; + resetDigest(); + } + + /** + * Resets the message digest if needed. + */ + protected void resetDigest() { if (needsReset) { messageDigest.reset(); needsReset = false; } } + protected byte[] getDigestValue() throws SignatureException { + needsReset = false; + return messageDigest.digest(); + } + + protected void setDigestName(String name) { + messageDigestAlgorithm = name; + } + /** * Updates the data to be signed or verified * using the specified byte. @@ -248,13 +380,15 @@ abstract class RSASignature extends java.security.SignatureSpi */ protected byte[] engineSign() throws SignatureException { - byte[] hash = messageDigest.digest(); - needsReset = false; + byte[] hash = getDigestValue(); + + // Omit the hash OID when generating a Raw signature + boolean noHashOID = this instanceof Raw; // Sign hash using MS Crypto APIs - byte[] result = signHash(hash, hash.length, - messageDigest.getAlgorithm(), privateKey.getHCryptProvider(), + byte[] result = signHash(noHashOID, hash, hash.length, + messageDigestAlgorithm, privateKey.getHCryptProvider(), privateKey.getHCryptKey()); // Convert signature array from little endian to big endian @@ -282,8 +416,8 @@ abstract class RSASignature extends java.security.SignatureSpi * Sign hash using Microsoft Crypto API with HCRYPTKEY. * The returned data is in little-endian. */ - private native static byte[] signHash(byte[] hash, int hashSize, - String hashAlgorithm, long hCryptProv, long hCryptKey) + private native static byte[] signHash(boolean noHashOID, byte[] hash, + int hashSize, String hashAlgorithm, long hCryptProv, long hCryptKey) throws SignatureException; /** @@ -308,11 +442,10 @@ abstract class RSASignature extends java.security.SignatureSpi protected boolean engineVerify(byte[] sigBytes) throws SignatureException { - byte[] hash = messageDigest.digest(); - needsReset = false; + byte[] hash = getDigestValue(); return verifySignedHash(hash, hash.length, - messageDigest.getAlgorithm(), convertEndianArray(sigBytes), + messageDigestAlgorithm, convertEndianArray(sigBytes), sigBytes.length, publicKey.getHCryptProvider(), publicKey.getHCryptKey()); } @@ -379,11 +512,15 @@ abstract class RSASignature extends java.security.SignatureSpi /** * Generates a public-key BLOB from a key's components. */ - private native byte[] generatePublicKeyBlob( - int keyBitLength, byte[] modulus, byte[] publicExponent); + // used by RSACipher + static native byte[] generatePublicKeyBlob( + int keyBitLength, byte[] modulus, byte[] publicExponent) + throws InvalidKeyException; /** * Imports a public-key BLOB. */ - private native RSAPublicKey importPublicKey(byte[] keyBlob, int keySize); + // used by RSACipher + static native RSAPublicKey importPublicKey(byte[] keyBlob, int keySize) + throws KeyStoreException; } diff --git a/src/windows/classes/sun/security/mscapi/SunMSCAPI.java b/src/windows/classes/sun/security/mscapi/SunMSCAPI.java index 55feb7e1d84b653839fc60c72c7260d6824f8eb4..db8b3175c01d099020fe59620014debe048e3912 100644 --- a/src/windows/classes/sun/security/mscapi/SunMSCAPI.java +++ b/src/windows/classes/sun/security/mscapi/SunMSCAPI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,22 +79,40 @@ public final class SunMSCAPI extends Provider { /* * Signature engines */ + // NONEwithRSA must be supplied with a pre-computed message digest. + // Only the following digest algorithms are supported: MD5, SHA-1, + // SHA-256, SHA-384, SHA-512 and a special-purpose digest algorithm + // which is a concatenation of SHA-1 and MD5 digests. + map.put("Signature.NONEwithRSA", + "sun.security.mscapi.RSASignature$Raw"); map.put("Signature.SHA1withRSA", "sun.security.mscapi.RSASignature$SHA1"); + map.put("Signature.SHA256withRSA", + "sun.security.mscapi.RSASignature$SHA256"); + map.put("Signature.SHA384withRSA", + "sun.security.mscapi.RSASignature$SHA384"); + map.put("Signature.SHA512withRSA", + "sun.security.mscapi.RSASignature$SHA512"); map.put("Signature.MD5withRSA", "sun.security.mscapi.RSASignature$MD5"); map.put("Signature.MD2withRSA", "sun.security.mscapi.RSASignature$MD2"); // supported key classes + map.put("Signature.NONEwithRSA SupportedKeyClasses", + "sun.security.mscapi.Key"); map.put("Signature.SHA1withRSA SupportedKeyClasses", "sun.security.mscapi.Key"); + map.put("Signature.SHA256withRSA SupportedKeyClasses", + "sun.security.mscapi.Key"); + map.put("Signature.SHA384withRSA SupportedKeyClasses", + "sun.security.mscapi.Key"); + map.put("Signature.SHA512withRSA SupportedKeyClasses", + "sun.security.mscapi.Key"); map.put("Signature.MD5withRSA SupportedKeyClasses", "sun.security.mscapi.Key"); map.put("Signature.MD2withRSA SupportedKeyClasses", "sun.security.mscapi.Key"); - map.put("Signature.NONEwithRSA SupportedKeyClasses", - "sun.security.mscapi.Key"); /* * Key Pair Generator engines diff --git a/src/windows/native/sun/font/fontpath.c b/src/windows/native/sun/font/fontpath.c index f1437de5afbd005cc6f430621aabf37252fa7e56..074cdeba62762c6e82fde3326e2f7cddcff91d96 100644 --- a/src/windows/native/sun/font/fontpath.c +++ b/src/windows/native/sun/font/fontpath.c @@ -235,7 +235,7 @@ static int CALLBACK EnumFontFacesInFamilyProcW( } fullname = (*env)->NewString(env, lpelfe->elfFullName, - wcslen((LPWSTR)lpelfe->elfFullName)); + (jsize)wcslen((LPWSTR)lpelfe->elfFullName)); fullnameLC = (*env)->CallObjectMethod(env, fullname, fmi->toLowerCaseMID, fmi->locale); (*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname); @@ -314,7 +314,7 @@ static int CALLBACK EnumFamilyNamesW( GdiFontMapInfo *fmi = (GdiFontMapInfo*)lParam; JNIEnv *env = fmi->env; jstring familyLC; - int slen; + size_t slen; LOGFONTW lfw; /* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */ @@ -336,7 +336,7 @@ static int CALLBACK EnumFamilyNamesW( return 1; } slen = wcslen(lpelfe->elfLogFont.lfFaceName); - fmi->family = (*env)->NewString(env,lpelfe->elfLogFont.lfFaceName, slen); + fmi->family = (*env)->NewString(env,lpelfe->elfLogFont.lfFaceName, (jsize)slen); familyLC = (*env)->CallObjectMethod(env, fmi->family, fmi->toLowerCaseMID, fmi->locale); /* check if already seen this family with a different charset */ @@ -386,10 +386,10 @@ static int CALLBACK EnumFamilyNamesW( static BOOL RegistryToBaseTTNameA(LPSTR name) { static const char TTSUFFIX[] = " (TrueType)"; static const char OTSUFFIX[] = " (OpenType)"; - int TTSLEN = strlen(TTSUFFIX); + size_t TTSLEN = strlen(TTSUFFIX); char *suffix; - int len = strlen(name); + size_t len = strlen(name); if (len == 0) { return FALSE; } @@ -412,10 +412,10 @@ static BOOL RegistryToBaseTTNameA(LPSTR name) { static BOOL RegistryToBaseTTNameW(LPWSTR name) { static const wchar_t TTSUFFIX[] = L" (TrueType)"; static const wchar_t OTSUFFIX[] = L" (OpenType)"; - int TTSLEN = wcslen(TTSUFFIX); + size_t TTSLEN = wcslen(TTSUFFIX); wchar_t *suffix; - int len = wcslen(name); + size_t len = wcslen(name); if (len == 0) { return FALSE; } @@ -439,7 +439,7 @@ static void registerFontA(GdiFontMapInfo *fmi, jobject fontToFileMap, LPSTR ptr1, ptr2; jstring fontStr; JNIEnv *env = fmi->env; - int dslen = strlen(data); + size_t dslen = strlen(data); jstring fileStr = JNU_NewStringPlatform(env, data); /* TTC or ttc means it may be a collection. Need to parse out @@ -488,8 +488,8 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap, wchar_t *ptr1, *ptr2; jstring fontStr; JNIEnv *env = fmi->env; - int dslen = wcslen(data); - jstring fileStr = (*env)->NewString(env, data, dslen); + size_t dslen = wcslen(data); + jstring fileStr = (*env)->NewString(env, data, (jsize)dslen); /* TTC or ttc means it may be a collection. Need to parse out * multiple font face names separated by " & " @@ -510,7 +510,7 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap, while ((ptr2 = wcsstr(ptr1, L" & ")) != NULL) { ptr1 = ptr2+3; } - fontStr = (*env)->NewString(env, ptr1, wcslen(ptr1)); + fontStr = (*env)->NewString(env, ptr1, (jsize)wcslen(ptr1)); fontStr = (*env)->CallObjectMethod(env, fontStr, fmi->toLowerCaseMID, fmi->locale); @@ -524,7 +524,7 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap, } } } else { - fontStr = (*env)->NewString(env, name, wcslen(name)); + fontStr = (*env)->NewString(env, name, (jsize)wcslen(name)); fontStr = (*env)->CallObjectMethod(env, fontStr, fmi->toLowerCaseMID, fmi->locale); (*env)->CallObjectMethod(env, fontToFileMap, fmi->putMID, diff --git a/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp b/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp index a7da3f3b38c1d857447a0c0c83c6ba00496ff714..a563c78802b5af58678ec6b555ec1566a34d90f6 100644 --- a/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp +++ b/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp @@ -187,6 +187,7 @@ void D3DPipelineManager::NotifyAdapterEventListeners(UINT adapter, } JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + RETURN_IF_NULL(env); pMgr = D3DPipelineManager::GetInstance(); RETURN_IF_NULL(pMgr); diff --git a/src/windows/native/sun/security/mscapi/security.cpp b/src/windows/native/sun/security/mscapi/security.cpp index ed3b16fbca52622a25e5075d0f2ec1598d81cfc2..1a489d70ecae889b2cd862f621f49329a0ba78c1 100644 --- a/src/windows/native/sun/security/mscapi/security.cpp +++ b/src/windows/native/sun/security/mscapi/security.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,8 @@ #define CERTIFICATE_PARSING_EXCEPTION \ "java/security/cert/CertificateParsingException" +#define INVALID_KEY_EXCEPTION \ + "java/security/InvalidKeyException" #define KEY_EXCEPTION "java/security/KeyException" #define KEYSTORE_EXCEPTION "java/security/KeyStoreException" #define PROVIDER_EXCEPTION "java/security/ProviderException" @@ -79,6 +81,8 @@ ALG_ID MapHashAlgorithm(JNIEnv *env, jstring jHashAlgorithm) { (strcmp("SHA-1", pszHashAlgorithm) == 0)) { algId = CALG_SHA1; + } else if (strcmp("SHA1+MD5", pszHashAlgorithm) == 0) { + algId = CALG_SSL3_SHAMD5; // a 36-byte concatenation of SHA-1 and MD5 } else if (strcmp("SHA-256", pszHashAlgorithm) == 0) { algId = CALG_SHA_256; } else if (strcmp("SHA-384", pszHashAlgorithm) == 0) { @@ -471,16 +475,18 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_Key_cleanUp /* * Class: sun_security_mscapi_RSASignature * Method: signHash - * Signature: ([BILjava/lang/String;JJ)[B + * Signature: (Z[BILjava/lang/String;JJ)[B */ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSASignature_signHash - (JNIEnv *env, jclass clazz, jbyteArray jHash, jint jHashSize, - jstring jHashAlgorithm, jlong hCryptProv, jlong hCryptKey) + (JNIEnv *env, jclass clazz, jboolean noHashOID, jbyteArray jHash, + jint jHashSize, jstring jHashAlgorithm, jlong hCryptProv, + jlong hCryptKey) { HCRYPTHASH hHash = NULL; jbyte* pHashBuffer = NULL; jbyte* pSignedHashBuffer = NULL; jbyteArray jSignedHash = NULL; + HCRYPTPROV hCryptProvAlt = NULL; __try { @@ -490,8 +496,32 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSASignature_signHash // Acquire a hash object handle. if (::CryptCreateHash(HCRYPTPROV(hCryptProv), algId, 0, 0, &hHash) == FALSE) { - ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); - __leave; + // Failover to using the PROV_RSA_AES CSP + + DWORD cbData = 256; + BYTE pbData[256]; + pbData[0] = '\0'; + + // Get name of the key container + ::CryptGetProvParam((HCRYPTPROV)hCryptProv, PP_CONTAINER, + (BYTE *)pbData, &cbData, 0); + + // Acquire an alternative CSP handle + if (::CryptAcquireContext(&hCryptProvAlt, LPCSTR(pbData), NULL, + PROV_RSA_AES, 0) == FALSE) + { + + ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); + __leave; + } + + // Acquire a hash object handle. + if (::CryptCreateHash(HCRYPTPROV(hCryptProvAlt), algId, 0, 0, + &hHash) == FALSE) + { + ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); + __leave; + } } // Copy hash from Java to native buffer @@ -521,14 +551,20 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSASignature_signHash // Determine size of buffer DWORD dwBufLen = 0; - if (::CryptSignHash(hHash, dwKeySpec, NULL, NULL, NULL, &dwBufLen) == FALSE) + DWORD dwFlags = 0; + + if (noHashOID == JNI_TRUE) { + dwFlags = CRYPT_NOHASHOID; // omit hash OID in NONEwithRSA signature + } + + if (::CryptSignHash(hHash, dwKeySpec, NULL, dwFlags, NULL, &dwBufLen) == FALSE) { ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); __leave; } pSignedHashBuffer = new jbyte[dwBufLen]; - if (::CryptSignHash(hHash, dwKeySpec, NULL, NULL, (BYTE*)pSignedHashBuffer, &dwBufLen) == FALSE) + if (::CryptSignHash(hHash, dwKeySpec, NULL, dwFlags, (BYTE*)pSignedHashBuffer, &dwBufLen) == FALSE) { ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); __leave; @@ -544,6 +580,9 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSASignature_signHash } __finally { + if (hCryptProvAlt) + ::CryptReleaseContext(hCryptProvAlt, 0); + if (pSignedHashBuffer) delete [] pSignedHashBuffer; @@ -572,6 +611,7 @@ JNIEXPORT jboolean JNICALL Java_sun_security_mscapi_RSASignature_verifySignedHas jbyte* pSignedHashBuffer = NULL; DWORD dwSignedHashBufferLen = jSignedHashSize; jboolean result = JNI_FALSE; + HCRYPTPROV hCryptProvAlt = NULL; __try { @@ -582,8 +622,32 @@ JNIEXPORT jboolean JNICALL Java_sun_security_mscapi_RSASignature_verifySignedHas if (::CryptCreateHash(HCRYPTPROV(hCryptProv), algId, 0, 0, &hHash) == FALSE) { - ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); - __leave; + // Failover to using the PROV_RSA_AES CSP + + DWORD cbData = 256; + BYTE pbData[256]; + pbData[0] = '\0'; + + // Get name of the key container + ::CryptGetProvParam((HCRYPTPROV)hCryptProv, PP_CONTAINER, + (BYTE *)pbData, &cbData, 0); + + // Acquire an alternative CSP handle + if (::CryptAcquireContext(&hCryptProvAlt, LPCSTR(pbData), NULL, + PROV_RSA_AES, 0) == FALSE) + { + + ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); + __leave; + } + + // Acquire a hash object handle. + if (::CryptCreateHash(HCRYPTPROV(hCryptProvAlt), algId, 0, 0, + &hHash) == FALSE) + { + ThrowException(env, SIGNATURE_EXCEPTION, GetLastError()); + __leave; + } } // Copy hash and signedHash from Java to native buffer @@ -614,6 +678,9 @@ JNIEXPORT jboolean JNICALL Java_sun_security_mscapi_RSASignature_verifySignedHas __finally { + if (hCryptProvAlt) + ::CryptReleaseContext(hCryptProvAlt, 0); + if (pSignedHashBuffer) delete [] pSignedHashBuffer; @@ -646,15 +713,27 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSAKeyPairGenerator_generateR pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL); // Acquire a CSP context (create a new key container). + // Prefer a PROV_RSA_AES CSP, when available, due to its support + // for SHA-2-based signatures. if (::CryptAcquireContext( &hCryptProv, pszKeyContainerName, NULL, - PROV_RSA_FULL, + PROV_RSA_AES, CRYPT_NEWKEYSET) == FALSE) { - ThrowException(env, KEY_EXCEPTION, GetLastError()); - __leave; + // Failover to using the default CSP (PROV_RSA_FULL) + + if (::CryptAcquireContext( + &hCryptProv, + pszKeyContainerName, + NULL, + PROV_RSA_FULL, + CRYPT_NEWKEYSET) == FALSE) + { + ThrowException(env, KEY_EXCEPTION, GetLastError()); + __leave; + } } // Generate an RSA keypair @@ -1398,7 +1477,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getPublicKeyB jbyteArray blob = NULL; DWORD dwBlobLen; - BYTE* pbKeyBlob; + BYTE* pbKeyBlob = NULL; __try { @@ -1656,7 +1735,7 @@ jbyteArray generateKeyBlob( // Sanity check jsize jPublicExponentLength = env->GetArrayLength(jPublicExponent); if (jPublicExponentLength > sizeof(pRsaPubKey->pubexp)) { - ThrowException(env, KEY_EXCEPTION, NTE_BAD_TYPE); + ThrowException(env, INVALID_KEY_EXCEPTION, NTE_BAD_TYPE); __leave; } // The length argument must be the smaller of jPublicExponentLength @@ -1847,15 +1926,27 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSASignature_importPublicKey pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0); // Acquire a CSP context (create a new key container). + // Prefer a PROV_RSA_AES CSP, when available, due to its support + // for SHA-2-based signatures. if (::CryptAcquireContext( &hCryptProv, NULL, NULL, - PROV_RSA_FULL, + PROV_RSA_AES, CRYPT_VERIFYCONTEXT) == FALSE) { - ThrowException(env, KEYSTORE_EXCEPTION, GetLastError()); - __leave; + // Failover to using the default CSP (PROV_RSA_FULL) + + if (::CryptAcquireContext( + &hCryptProv, + NULL, + NULL, + PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT) == FALSE) + { + ThrowException(env, KEYSTORE_EXCEPTION, GetLastError()); + __leave; + } } // Import the public key diff --git a/src/windows/native/sun/windows/ObjectList.cpp b/src/windows/native/sun/windows/ObjectList.cpp index b0614e6b97f654396d6e4c940535d917785f58d9..601c42ce2e3664ce92d53d9884e466cda9f87f13 100644 --- a/src/windows/native/sun/windows/ObjectList.cpp +++ b/src/windows/native/sun/windows/ObjectList.cpp @@ -48,7 +48,7 @@ void AwtObjectList::Add(AwtObject* obj) m_head = item; } -void AwtObjectList::Remove(AwtObject* obj) +BOOL AwtObjectList::Remove(AwtObject* obj) { CriticalSection::Lock l(m_lock); @@ -64,11 +64,14 @@ void AwtObjectList::Remove(AwtObject* obj) } DASSERT(item != NULL); delete item; - return; + return TRUE; } lastItem = item; item = item->next; } + + return FALSE; + // DASSERT(FALSE); // should never get here... // even if it does it shouldn't be fatal. } diff --git a/src/windows/native/sun/windows/ObjectList.h b/src/windows/native/sun/windows/ObjectList.h index 9775d0c9f1e23e0d121da9b4a1cb15892c2b87a0..1e80732ca394b2b028edeb378f7f0c5882cef6b9 100644 --- a/src/windows/native/sun/windows/ObjectList.h +++ b/src/windows/native/sun/windows/ObjectList.h @@ -46,7 +46,7 @@ public: AwtObjectList(); void Add(AwtObject* obj); - void Remove(AwtObject* obj); + BOOL Remove(AwtObject* obj); #ifdef DEBUG /* Used for sanity checks only. */ AwtObject* LookUp(AwtObject* obj); diff --git a/src/windows/native/sun/windows/awt_Clipboard.cpp b/src/windows/native/sun/windows/awt_Clipboard.cpp index d978090b8b3838290f2b70b2c64a52dcdbd368f5..6cea4a715fb4cb10f45f6f3ca0910f1c1a496d7c 100644 --- a/src/windows/native/sun/windows/awt_Clipboard.cpp +++ b/src/windows/native/sun/windows/awt_Clipboard.cpp @@ -294,7 +294,7 @@ Java_sun_awt_windows_WClipboard_publishClipboardData(JNIEnv *env, if (format == CF_HDROP) { DROPFILES *dropfiles = (DROPFILES *)dataout; dropfiles->pFiles = sizeof(DROPFILES); - dropfiles->fWide = FALSE; // good guess! + dropfiles->fWide = TRUE; // we publish only Unicode dataout += sizeof(DROPFILES); } diff --git a/src/windows/native/sun/windows/awt_Component.cpp b/src/windows/native/sun/windows/awt_Component.cpp index fd75b8d52ee75fd5587764ee36e96cccf9e71676..024915fcffcf691044d3442edd6d57f8f302e9c1 100644 --- a/src/windows/native/sun/windows/awt_Component.cpp +++ b/src/windows/native/sun/windows/awt_Component.cpp @@ -549,8 +549,6 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title, m_hwnd = hwnd; - ImmAssociateContext(NULL); - SetDrawState((jint)JAWT_LOCK_SURFACE_CHANGED | (jint)JAWT_LOCK_BOUNDS_CHANGED | (jint)JAWT_LOCK_CLIP_CHANGED); @@ -1203,7 +1201,7 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) { WIN_MSG(WM_IME_COMPOSITIONFULL) WIN_MSG(WM_IME_SELECT) WIN_MSG(WM_IME_CHAR) - FMT_MSG(0x0288, "WM_IME_REQUEST") + FMT_MSG(WM_IME_REQUEST) WIN_MSG(WM_IME_KEYDOWN) WIN_MSG(WM_IME_KEYUP) FMT_MSG(0x02A1, "WM_MOUSEHOVER") @@ -1733,7 +1731,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) case WM_IME_SELECT: case WM_IME_KEYUP: case WM_IME_KEYDOWN: - case 0x0288: // WM_IME_REQUEST + case WM_IME_REQUEST: CallProxyDefWindowProc(message, wParam, lParam, retValue, mr); break; case WM_CHAR: @@ -1969,7 +1967,9 @@ MsgRouting AwtComponent::WmDestroy() { // fix for 6259348: we should enter the SyncCall critical section before // disposing the native object, that is value 1 of lParam is intended for - AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)this, (LPARAM)1); + if(m_peerObject != NULL) { // is not being terminating + AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)m_peerObject, (LPARAM)1); + } return mrConsume; } @@ -2020,25 +2020,6 @@ MsgRouting AwtComponent::WmExitMenuLoop(BOOL isTrackPopupMenu) MsgRouting AwtComponent::WmShowWindow(BOOL show, UINT status) { - // NULL-InputContext is associated to all window just after they created. - // ( see CreateHWnd() ) - // But to TextField and TextArea on Win95, valid InputContext is associated - // by system after that. This is not happen on NT4.0 - // For workaround, force context to NULL here. - - // Fix for 4730228 - // Check if we already have Java-associated input method - HIMC context = 0; - if (m_InputMethod != NULL) { - // If so get the appropriate context from it and use it instead of empty context - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - context = (HIMC)(UINT_PTR)(JNU_GetFieldByName(env, NULL, m_InputMethod, "context", "I").i); - } - - if (ImmGetContext() != 0 && ImmGetContext() != context) { - ImmAssociateContext(context); - } - return mrDoDefault; } @@ -4655,10 +4636,6 @@ void* AwtComponent::SetNativeFocusOwner(void *self) { ret: if (c && ::IsWindow(c->GetHWnd())) { sm_focusOwner = c->GetHWnd(); - AwtFrame *owner = (AwtFrame*)GetComponent(c->GetProxyToplevelContainer()); - if (owner) { - owner->SetLastProxiedFocusOwner(sm_focusOwner); - } } else { sm_focusOwner = NULL; } @@ -6534,8 +6511,7 @@ Java_sun_awt_windows_WComponentPeer__1dispose(JNIEnv *env, jobject self) { TRY_NO_HANG; - PDATA pData = JNI_GET_PDATA(self); - AwtObject::_Dispose(pData); + AwtObject::_Dispose(self); CATCH_BAD_ALLOC; } diff --git a/src/windows/native/sun/windows/awt_DnDDS.cpp b/src/windows/native/sun/windows/awt_DnDDS.cpp index 1aea026c885a03fa64682f213251dda7a4a7218a..2d585e0330a05ba0fd16d23dd099df48e814264d 100644 --- a/src/windows/native/sun/windows/awt_DnDDS.cpp +++ b/src/windows/native/sun/windows/awt_DnDDS.cpp @@ -843,7 +843,7 @@ HRESULT __stdcall AwtDragSource::GetData(FORMATETC __RPC_FAR *pFormatEtc, dropfiles->pt.x = m_dropPoint.x; dropfiles->pt.y = m_dropPoint.y; dropfiles->fNC = m_fNC; - dropfiles->fWide = TRUE; // good guess! + dropfiles->fWide = TRUE; // we publish only Unicode dataout += sizeof(DROPFILES); } diff --git a/src/windows/native/sun/windows/awt_Frame.cpp b/src/windows/native/sun/windows/awt_Frame.cpp index 4d3374e573416e975252c2dddbdb020558cd3da3..6662d6d54c2f887fe92188b10ef58915418ca677 100644 --- a/src/windows/native/sun/windows/awt_Frame.cpp +++ b/src/windows/native/sun/windows/awt_Frame.cpp @@ -109,7 +109,7 @@ AwtFrame::AwtFrame() { m_isMenuDropped = FALSE; m_isInputMethodWindow = FALSE; m_isUndecorated = FALSE; - m_lastProxiedFocusOwner = NULL; + m_imeTargetComponent = NULL; m_actualFocusedWindow = NULL; m_iconic = FALSE; m_zoomed = FALSE; @@ -311,6 +311,8 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms LRESULT retValue = 0L; AwtComponent *focusOwner = NULL; + AwtComponent *imeTargetComponent = NULL; + // IME and input language related messages need to be sent to a window // which has the Java input focus switch (message) { @@ -323,15 +325,29 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms case WM_IME_COMPOSITIONFULL: case WM_IME_SELECT: case WM_IME_CHAR: - case 0x0288: // WM_IME_REQUEST + case WM_IME_REQUEST: case WM_IME_KEYDOWN: case WM_IME_KEYUP: case WM_INPUTLANGCHANGEREQUEST: case WM_INPUTLANGCHANGE: + if (message == WM_IME_STARTCOMPOSITION) { + SetImeTargetComponent(sm_focusOwner); + } + imeTargetComponent = AwtComponent::GetComponent(GetImeTargetComponent()); + if (imeTargetComponent != NULL && + imeTargetComponent != this) // avoid recursive calls + { + retValue = imeTargetComponent->WindowProc(message, wParam, lParam); + mr = mrConsume; + } + if (message == WM_IME_ENDCOMPOSITION) { + SetImeTargetComponent(NULL); + } + break; // TODO: when a Choice's list is dropped down and we're scrolling in // the list WM_MOUSEWHEEL messages come to the poxy, not to the list. Why? case WM_MOUSEWHEEL: - focusOwner = AwtComponent::GetComponent(GetLastProxiedFocusOwner()); + focusOwner = AwtComponent::GetComponent(sm_focusOwner); if (focusOwner != NULL && focusOwner != this) // avoid recursive calls { @@ -340,12 +356,16 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms } break; case WM_SETFOCUS: + if (sm_inSynthesizeFocus) break; // pass it up the WindowProc chain + if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) { AwtSetActiveWindow(); } mr = mrConsume; break; case WM_KILLFOCUS: + if (sm_inSynthesizeFocus) break; // pass it up the WindowProc chain + if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) { AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL); diff --git a/src/windows/native/sun/windows/awt_Frame.h b/src/windows/native/sun/windows/awt_Frame.h index 1adca139bf9abd39c21e0ebaa064d6ed15e40de8..f6d692b87eb359c9e1844a15751e3bb8b86d225b 100644 --- a/src/windows/native/sun/windows/awt_Frame.h +++ b/src/windows/native/sun/windows/awt_Frame.h @@ -150,8 +150,8 @@ public: void CheckRetainActualFocusedWindow(HWND activatedOpositeHWnd); BOOL CheckActivateActualFocusedWindow(HWND deactivatedOpositeHWnd); - INLINE HWND GetLastProxiedFocusOwner() { return m_lastProxiedFocusOwner; } - INLINE void SetLastProxiedFocusOwner(HWND hwnd) { m_lastProxiedFocusOwner = hwnd; } + INLINE HWND GetImeTargetComponent() { return m_imeTargetComponent; } + INLINE void SetImeTargetComponent(HWND hwnd) { m_imeTargetComponent = hwnd; } protected: /* The frame is undecorated. */ @@ -179,9 +179,8 @@ private: /* The frame is an InputMethodWindow */ BOOL m_isInputMethodWindow; - /* Retains the last/current sm_focusOwner proxied. Actually, it should be - * a component of an owned window last/currently active. */ - HWND m_lastProxiedFocusOwner; + // retains the target component for the IME messages + HWND m_imeTargetComponent; /* * Fix for 4823903. diff --git a/src/windows/native/sun/windows/awt_MenuItem.cpp b/src/windows/native/sun/windows/awt_MenuItem.cpp index aeb1021262a4748310ced01ff8ec822a18513e68..97f3e2a7a21ddbc86a9372f4969348156688a038 100644 --- a/src/windows/native/sun/windows/awt_MenuItem.cpp +++ b/src/windows/native/sun/windows/awt_MenuItem.cpp @@ -974,8 +974,7 @@ Java_sun_awt_windows_WMenuItemPeer__1dispose(JNIEnv *env, jobject self) { TRY_NO_HANG; - PDATA pData = JNI_GET_PDATA(self); - AwtObject::_Dispose(pData); + AwtObject::_Dispose(self); CATCH_BAD_ALLOC; } diff --git a/src/windows/native/sun/windows/awt_Object.cpp b/src/windows/native/sun/windows/awt_Object.cpp index b7afe1aa510658c9edd891c2934dfacab112cfda..54ec69a9a1960bb259493b357973991acdce7b82 100644 --- a/src/windows/native/sun/windows/awt_Object.cpp +++ b/src/windows/native/sun/windows/awt_Object.cpp @@ -60,11 +60,20 @@ AwtObject::~AwtObject() void AwtObject::Dispose() { - theAwtObjectList.Remove(this); + AwtToolkit::GetInstance().PostMessage(WM_AWT_DELETEOBJECT, (WPARAM)this, (LPARAM)0); +} + +void AwtObject::_Dispose(jobject self) +{ + TRY_NO_VERIFY; + + CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS()); // value 0 of lParam means that we should not attempt to enter the // SyncCall critical section, as it was entered someshere earlier - AwtToolkit::GetInstance().PostMessage(WM_AWT_DELETEOBJECT, (WPARAM)this, (LPARAM)0); + AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)self, (LPARAM)0); + + CATCH_BAD_ALLOC; } void AwtObject::_Dispose(PDATA pData) @@ -73,14 +82,10 @@ void AwtObject::_Dispose(PDATA pData) CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS()); - if (pData != NULL) { - AwtObject *o = (AwtObject *)pData; - AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)o, (LPARAM)0); - } + AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSEPDATA, (WPARAM)pData, (LPARAM)0); CATCH_BAD_ALLOC; } - /* * Return the peer associated with some target. This information is * maintained in a hashtable at the java level. diff --git a/src/windows/native/sun/windows/awt_Object.h b/src/windows/native/sun/windows/awt_Object.h index 6cfb83ebcc550f7b4c2c991b72a53707d337ce8d..918e95d1c18e15ac5812ca0ac82ab68d14fd17a8 100644 --- a/src/windows/native/sun/windows/awt_Object.h +++ b/src/windows/native/sun/windows/awt_Object.h @@ -66,6 +66,10 @@ public: // After this method has been called, this object must not be used in any way. virtual void Dispose(); + // Static method to be called from JNI methods to dispose AwtObject + // specified by jobject + static void _Dispose(jobject self); + // Static method to be called from JNI methods to dispose AwtObject // specified by pData static void _Dispose(PDATA pData); diff --git a/src/windows/native/sun/windows/awt_Robot.cpp b/src/windows/native/sun/windows/awt_Robot.cpp index cdee9cf600190e521e8cf872d3197fde4e520192..09e12debf3846fc94780d7b31088266703ff0b3a 100644 --- a/src/windows/native/sun/windows/awt_Robot.cpp +++ b/src/windows/native/sun/windows/awt_Robot.cpp @@ -353,8 +353,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WRobotPeer__1dispose( { TRY_NO_VERIFY; - PDATA pData = JNI_GET_PDATA(self); - AwtObject::_Dispose(pData); + AwtObject::_Dispose(self); CATCH_BAD_ALLOC; } diff --git a/src/windows/native/sun/windows/awt_TextComponent.cpp b/src/windows/native/sun/windows/awt_TextComponent.cpp index c1fc17826b0ccd34630948e46623f6e9486416da..5e9a08f46ee0527552e9ffed5cd555ba4c48303c 100644 --- a/src/windows/native/sun/windows/awt_TextComponent.cpp +++ b/src/windows/native/sun/windows/awt_TextComponent.cpp @@ -191,8 +191,11 @@ void AwtTextComponent::SetCompositionWindow(RECT& rc) { HIMC hIMC = ImmGetContext(); // rc is not used for text component. - COMPOSITIONFORM cf = { CFS_POINT, {0,0}, {0,0,0,0} }; + COMPOSITIONFORM cf = { CFS_FORCE_POSITION, {0,0}, {0,0,0,0} }; GetCaretPos(&(cf.ptCurrentPos)); + // the proxy is the native focus owner and it contains the composition window + // let's convert the position to a coordinate space relative to proxy + ::MapWindowPoints(GetHWnd(), GetProxyFocusOwner(), (LPPOINT)&cf.ptCurrentPos, 1); ImmSetCompositionWindow(hIMC, &cf); LOGFONT lf; diff --git a/src/windows/native/sun/windows/awt_Toolkit.cpp b/src/windows/native/sun/windows/awt_Toolkit.cpp index ca2bae8325a9c0d4878feb7aee5ccd1cceec6f6d..d010d6b130c9714c5670533ea0ffa9f2bd857415 100644 --- a/src/windows/native/sun/windows/awt_Toolkit.cpp +++ b/src/windows/native/sun/windows/awt_Toolkit.cpp @@ -740,18 +740,34 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message, canDispose = syncCS.TryEnter(); } if (canDispose) { - AwtObject *o = (AwtObject *)wParam; - o->Dispose(); - if (shouldEnterCriticalSection) { - syncCS.Leave(); + if(wParam != NULL) { + AwtObject *o = (AwtObject *) JNI_GET_PDATA((jobject)wParam); + if(o != NULL && theAwtObjectList.Remove(o)) { + o->Dispose(); + } + if (shouldEnterCriticalSection) { + syncCS.Leave(); + } } } else { AwtToolkit::GetInstance().PostMessage(WM_AWT_DISPOSE, wParam, lParam); } return 0; } + case WM_AWT_DISPOSEPDATA: { + /* + * NOTE: synchronization routine (like in WM_AWT_DISPOSE) was omitted because + * this handler is called ONLY while disposing Cursor and Font objects where + * synchronization takes place. + */ + AwtObject *o = (AwtObject *) wParam; + if(o != NULL && theAwtObjectList.Remove(o)) { + o->Dispose(); + } + return 0; + } case WM_AWT_DELETEOBJECT: { - AwtObject *p = (AwtObject *)wParam; + AwtObject *p = (AwtObject *) wParam; if (p->CanBeDeleted()) { // all the messages for this component are processed, so // it can be deleted diff --git a/src/windows/native/sun/windows/awt_TrayIcon.cpp b/src/windows/native/sun/windows/awt_TrayIcon.cpp index 4156c9cfec16b695bd9abe9c839a97174f726e2e..c2682b3b11364d675ffb1c02884a4d1733667dc8 100644 --- a/src/windows/native/sun/windows/awt_TrayIcon.cpp +++ b/src/windows/native/sun/windows/awt_TrayIcon.cpp @@ -926,8 +926,7 @@ Java_sun_awt_windows_WTrayIconPeer__1dispose(JNIEnv *env, jobject self) { TRY; - PDATA pData = JNI_GET_PDATA(self); - AwtObject::_Dispose(pData); + AwtObject::_Dispose(self); CATCH_BAD_ALLOC; } diff --git a/src/windows/native/sun/windows/awtmsg.h b/src/windows/native/sun/windows/awtmsg.h index 898471b4923e8ae1613b8c859c954c7536987f39..05733c7a6f0efe9a934c8c91606905c11e55ffa6 100644 --- a/src/windows/native/sun/windows/awtmsg.h +++ b/src/windows/native/sun/windows/awtmsg.h @@ -219,6 +219,7 @@ enum { WM_AWT_ENDCOMPOSITION, WM_AWT_DISPOSE, + WM_AWT_DISPOSEPDATA, WM_AWT_DELETEOBJECT, WM_AWT_SETCONVERSIONSTATUS, WM_AWT_GETCONVERSIONSTATUS, diff --git a/test/java/awt/Component/Revalidate/Revalidate.java b/test/java/awt/Component/Revalidate/Revalidate.java new file mode 100644 index 0000000000000000000000000000000000000000..670c374f87d4d151c30041c9cecff0ce16ec5c6a --- /dev/null +++ b/test/java/awt/Component/Revalidate/Revalidate.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 7036669 + @summary Test Component.revalidate() method + @author anthony.petrov@oracle.com: area=awt.component + @run main Revalidate +*/ + +import java.awt.*; + +public class Revalidate { + private static Frame frame = new Frame(); + private static Panel panel = new Panel() { + @Override + public boolean isValidateRoot() { + return true; + } + }; + private static Button button = new Button("Test"); + + private static void sleep() { + try { Thread.sleep(500); } catch (Exception e) {} + } + + private static void printState(String str) { + System.out.println(str + " isValid state: "); + System.out.println(" frame: " + frame.isValid()); + System.out.println(" panel: " + panel.isValid()); + System.out.println(" button: " + button.isValid()); + } + + private static void fail(String msg) { + frame.dispose(); + throw new RuntimeException(msg); + } + + private static void check(String n, Component c, boolean v) { + if (c.isValid() != v) { + fail(n + ".isValid() = " + c.isValid() + "; expected: " + v); + } + } + private static void check(String str, boolean f, boolean p, boolean b) { + printState(str); + + check("frame", frame, f); + check("panel", panel, p); + check("button", button, b); + } + + public static void main(String[] args) { + // setup + frame.add(panel); + panel.add(button); + frame.setBounds(200, 200, 300, 200); + frame.setVisible(true); + sleep(); + check("Upon showing", true, true, true); + + button.setBounds(1, 1, 30, 30); + sleep(); + check("button.setBounds():", true, false, false); + + button.revalidate(); + sleep(); + check("button.revalidate():", true, true, true); + + button.setBounds(1, 1, 30, 30); + sleep(); + check("button.setBounds():", true, false, false); + + panel.revalidate(); + sleep(); + // because the panel's validate root is actually OK + check("panel.revalidate():", true, false, false); + + button.revalidate(); + sleep(); + check("button.revalidate():", true, true, true); + + panel.setBounds(2, 2, 125, 130); + sleep(); + check("panel.setBounds():", false, false, true); + + button.revalidate(); + sleep(); + check("button.revalidate():", false, true, true); + + panel.setBounds(3, 3, 152, 121); + sleep(); + check("panel.setBounds():", false, false, true); + + panel.revalidate(); + sleep(); + check("panel.revalidate():", true, true, true); + + // cleanup + frame.dispose(); + } +} diff --git a/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java b/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java new file mode 100644 index 0000000000000000000000000000000000000000..569af1f3aaf7a955417a7b19380064bb8ce054f1 --- /dev/null +++ b/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 5089429 6982632 + @summary Checks that we don't crash if rendering operations and state + changes are performed on a graphics context from different threads. + + @author Dmitri.Trembovetski@sun.com area=Graphics + @run main MTGraphicsAccessTest + */ + +import java.awt.*; +import java.awt.image.*; +import java.awt.geom.*; + +public class MTGraphicsAccessTest { + + // in seconds + static final long STANDALONE_RUN_TIME = 20; + static final long JTREG_RUN_TIME = 7; + + static boolean standaloneMode; + static boolean allowExceptions = true; + static long testRunTime; + + volatile boolean done; + volatile int stillRunning; + volatile int numexceptions; + + Graphics2D sharedGraphics; + BufferedImage sharedBI = + new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB); + + static final Paint colors[] = { + Color.red, + new Color(0x7f, 0xff, 0x00, 0x7f), + new GradientPaint(0, 0, Color.red, + 50, 50, new Color(0x7f, 0xff, 0x00, 0x7f)), + }; + static final Font fonts[] = { + new Font("Dialog", Font.PLAIN, 12), + new Font("Dialog", Font.BOLD, 16), + new Font("Dialog", Font.ITALIC, 18), + }; + static final AlphaComposite comps[] = { + AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f), + AlphaComposite.Src, + AlphaComposite.Xor, + AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f), + null, + }; + static final Stroke strokes[] = { + new BasicStroke(), + new BasicStroke(0.0f), + new BasicStroke(2.0f), + new BasicStroke(2.0f, BasicStroke.CAP_ROUND, + BasicStroke.JOIN_BEVEL), + new BasicStroke(5.0f, BasicStroke.CAP_SQUARE, + BasicStroke.JOIN_ROUND), + new BasicStroke(0.0f, BasicStroke.CAP_ROUND, + BasicStroke.JOIN_ROUND, 0, + new float[]{0,6,0,6}, 0), + }; + static final AffineTransform transforms[] = { + new AffineTransform(), + AffineTransform.getRotateInstance(10.0), + AffineTransform.getShearInstance(10.0, 4.0), + AffineTransform.getScaleInstance(1.1, 1.2), + AffineTransform.getScaleInstance(3.0, 2.0), + }; + + public MTGraphicsAccessTest() { + BufferedImage bi = + new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB); + sharedGraphics = (Graphics2D)bi.getGraphics(); + + done = false; + numexceptions = 0; + + for (int i = 0; i < (standaloneMode ? stateChangers.length : 3); i++) { + (new TesterThread(stateChangers[i])).start(); + } + for (int i = 0; i < (standaloneMode ? renderTests.length : 5); i++) { + (new TesterThread(renderTests[i])).start(); + } + + mysleep(testRunTime); + done = true; + while (stillRunning > 0) { mysleep(500); } + + if (numexceptions == 0) { + System.err.println("Test passed"); + } else if (!allowExceptions) { + throw new RuntimeException("Test failed with "+ + numexceptions+" exceptions"); + } else { + System.err.println("Test finished with "+ + numexceptions+" exceptions"); + } + } + + private void mysleep(long time) { + try { + // add +/-5ms variance to increase randomness + Thread.sleep(time + (long)(5 - Math.random()*10)); + } catch (InterruptedException e) {}; + } + + public static void usage(String message) { + if (message != null) { + System.err.println(message); + } + System.err.println("Usage: MTGraphicsAccessTest [-full] "+ + "[-time N/forever] [-help]"); + System.err.println(" -full: run full suite of tests "+ + "(default: limited number of tests is run)"); + System.err.println(" -time N: test duration in seconds/forever"+ + " (default: "+JTREG_RUN_TIME+"s for the short suite, "+ + STANDALONE_RUN_TIME+"s for the full suite)"); + System.err.println(" -help: print this help page"); + System.exit(1); + } + + public static void main(String[] args) { + boolean testRunSet = false; + for (int i = 0; i < args.length; i++) { + if ("-full".equals(args[i])) { + standaloneMode = true; + System.err.println("Running complete list of tests"); + } else if ("-noexc".equals(args[i])) { + allowExceptions = false; + } else if ("-time".equals(args[i])) { + try { + String time = args[++i]; + if ("forever".equals(time)) { + testRunTime = (Long.MAX_VALUE - 20)/1000; + } else { + testRunTime = 1000*Integer.parseInt(time); + } + testRunSet = true; + } catch (NumberFormatException e) { + usage("Can't parse number of seconds: " + args[i]); + } catch (ArrayIndexOutOfBoundsException e1) { + usage("Missing the 'seconds' argument for -time parameter"); + } + } else if ("-help".equals(args[i])) { + usage(null); + } else { + usage("Unknown argument:" + args[i]); + } + } + + if (!testRunSet) { + testRunTime = 1000 * + (standaloneMode ? STANDALONE_RUN_TIME : JTREG_RUN_TIME); + } + + System.err.println("Approximate test run time: "+ + testRunTime/1000+" seconds"); + + new MTGraphicsAccessTest(); + } + + class TesterThread extends Thread { + Runnable testRunnable; + + public TesterThread(Runnable testRunnable) { + stillRunning++; + this.testRunnable = testRunnable; + } + + public void run() { + try { + while (!done) { + try { + testRunnable.run(); + yield(); + } catch (Throwable t) { + numexceptions++; + t.printStackTrace(); + } + } + } finally { + stillRunning--; + } + } + } + + final Runnable stateChangers[] = { + new Runnable() { + public void run() { + sharedGraphics.setClip(10, 10, 30, 30); + mysleep(10); + } + }, + new Runnable() { + public void run() { + sharedGraphics.setClip(10, 10, 30, 30); + mysleep(10); + } + }, + new Runnable() { + int c = 0; + public void run() { + sharedGraphics.setPaint(colors[c++ % colors.length]); + mysleep(10); + } + }, + new Runnable() { + boolean AA = false; + public void run() { + if (AA) { + sharedGraphics.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + } else { + sharedGraphics.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_OFF); + } + AA = !AA; + mysleep(10); + } + }, + new Runnable() { + int t = 0; + public void run() { + sharedGraphics.setTransform( + transforms[t++ % transforms.length]); + mysleep(10); + } + }, + new Runnable() { + int c = 0; + public void run() { + AlphaComposite comp = comps[c++ % comps.length]; + if (comp == null) { + sharedGraphics.setXORMode(Color.green); + } else { + sharedGraphics.setComposite(comp); + } + mysleep(10); + } + }, + new Runnable() { + int s = 0; + public void run() { + sharedGraphics.setStroke(strokes[s++ % strokes.length]); + mysleep(10); + } + }, + new Runnable() { + int f = 0; + public void run() { + sharedGraphics.setFont(fonts[f++ % fonts.length]); + mysleep(10); + } + }, + }; + + final Runnable renderTests[] = { + new Runnable() { + public void run() { + sharedGraphics.drawLine(10, 10, 30, 30); + } + }, + new Runnable() { + public void run() { + sharedGraphics.drawLine(10, 10, 30, 30); + } + }, + new Runnable() { + public void run() { + sharedGraphics.drawRect(10, 10, 30, 30); + } + }, + new Runnable() { + public void run() { + sharedGraphics.fillRect(10, 10, 30, 30); + } + }, + new Runnable() { + public void run() { + sharedGraphics.drawString("Stuff", 10, 10); + } + }, + new Runnable() { + public void run() { + sharedGraphics.draw3DRect(10, 10, 30, 30, true); + } + }, + new Runnable() { + public void run() { + sharedGraphics.drawImage(sharedBI, 10, 10, null); + } + }, + new Runnable() { + public void run() { + sharedGraphics.fill3DRect(10, 10, 30, 30, false); + } + }, + // REMIND: copyArea doesn't work when transform is set.. + // new Runnable() { + // public void run() { + // sharedGraphics.copyArea(10, 10, 30, 30, 20, 20); + // } + // }, + new Runnable() { + public void run() { + sharedGraphics.drawRoundRect(10, 10, 30, 30, 20, 20); + } + }, + new Runnable() { + public void run() { + sharedGraphics.fillRoundRect(10, 10, 30, 30, 20, 20); + } + }, + new Runnable() { + public void run() { + sharedGraphics.drawArc(10, 10, 30, 30, 0, 90); + } + }, + new Runnable() { + public void run() { + sharedGraphics.fillArc(10, 10, 30, 30, 0, 90); + } + }, + new Runnable() { + public void run() { + sharedGraphics.drawOval(10, 10, 30, 30); + } + }, + new Runnable() { + public void run() { + sharedGraphics.fillOval(10, 10, 30, 30); + } + } + }; +} diff --git a/test/java/awt/List/ScrollOutside/ScrollOut.java b/test/java/awt/List/ScrollOutside/ScrollOut.java new file mode 100644 index 0000000000000000000000000000000000000000..21b8f848229215c47c7bd2fa00b92974ad5aa4f4 --- /dev/null +++ b/test/java/awt/List/ScrollOutside/ScrollOut.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 7036733 + @summary Regression : NullPointerException when scrolling horizontally on AWT List + @author Andrei Dmitriev area=awt-list + @library ../../regtesthelpers + @build Util + @run main ScrollOut +*/ + +import java.awt.*; +import java.awt.event.*; +import sun.awt.SunToolkit; +import test.java.awt.regtesthelpers.Util; + +public class ScrollOut +{ + public static final void main(String args[]) + { + final Frame frame = new Frame(); + final List list = new List(); + Robot robot = null; + + for (int i = 0; i < 5; i++){ + list.add("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); + } + + frame.add(list); + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + + ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + + try{ + robot = new Robot(); + }catch(AWTException e){ + throw new RuntimeException(e); + } + + //Drag from center to the outside on left + Point from = new Point(list.getLocationOnScreen().x + list.getWidth()/2, + list.getLocationOnScreen().y + list.getHeight()/2); + Point to = new Point(list.getLocationOnScreen().x - 30, + from.y); + + ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + Util.drag(robot, from, to, InputEvent.BUTTON1_MASK); + + ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + + //Drag from center to the outside on up + to = new Point(from.x, + list.getLocationOnScreen().y - 50); + + ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + Util.drag(robot, from, to, InputEvent.BUTTON1_MASK); + + }//End init() +} diff --git a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java index 6ec02ffbf45ae71e71f7678f4a8224fc849ebd88..e5533b4189137f125cac1c997dccd5c1c610e566 100644 --- a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java +++ b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,6 +50,11 @@ import test.java.awt.regtesthelpers.Sysout; public class InfiniteRecursion { final static Robot robot = Util.createRobot(); final static int MOVE_COUNT = 5; + + //*2 for both rotation directions, + //*2 as Java sends the wheel event to every for nested component in hierarchy under cursor + final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2; + static int actualEvents = 0; public static void main(String []s) @@ -96,8 +101,10 @@ public class InfiniteRecursion { Util.waitForIdle(robot); - if (actualEvents != MOVE_COUNT * 2) { - AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); + //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents + //result in a single wheel rotation. + if (actualEvents != EXPECTED_COUNT) { + AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents); } } } diff --git a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java index 3ed18f0e4a2b2ac259496291eea748780fd97429..733af38731d1c2c37cac5cf288dba10e3e5fc4fa 100644 --- a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java +++ b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,6 +50,9 @@ import test.java.awt.regtesthelpers.Sysout; public class InfiniteRecursion_1 { final static Robot robot = Util.createRobot(); final static int MOVE_COUNT = 5; + //*2 for both rotation directions, + //*2 as Java sends the wheel event to every for nested component in hierarchy under cursor + final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2; static int actualEvents = 0; public static void main(String []s) @@ -95,8 +98,10 @@ public class InfiniteRecursion_1 { } Util.waitForIdle(robot); - if (actualEvents != MOVE_COUNT * 2) { - AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); + //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents + //result in a single wheel rotation. + if (actualEvents != EXPECTED_COUNT) { + AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents); } } } diff --git a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_2.java b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_2.java index 4aecedeb83382c98623c3ed4a402267a281f414a..944440886710dbfde1db9008b9aada157b1ed33f 100644 --- a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_2.java +++ b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,9 @@ import java.applet.Applet; public class InfiniteRecursion_2 extends Applet { final static Robot robot = Util.createRobot(); final static int MOVE_COUNT = 5; + //*2 for both rotation directions, + //*2 as Java sends the wheel event to every for nested component in hierarchy under cursor + final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2; static int actualEvents = 0; public void init() @@ -107,8 +110,10 @@ public class InfiniteRecursion_2 extends Applet { } Util.waitForIdle(robot); - if (actualEvents != MOVE_COUNT * 2) { - AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); + //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents + //result in a single wheel rotation. + if (actualEvents != EXPECTED_COUNT) { + AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents); } }// start() } diff --git a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_3.java b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_3.java index 2804b14ce7ed63de306bc80932e96e7032f709fc..c12636acdc57bc4280f2111681b438048196f9b4 100644 --- a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_3.java +++ b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,6 +50,9 @@ import java.applet.Applet; public class InfiniteRecursion_3 extends Applet { final static Robot robot = Util.createRobot(); final static int MOVE_COUNT = 5; + //*2 for both rotation directions, + //*2 as Java sends the wheel event to every for nested component in hierarchy under cursor + final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2; static int actualEvents = 0; public void init() @@ -91,8 +94,10 @@ public class InfiniteRecursion_3 extends Applet { } Util.waitForIdle(robot); - if (actualEvents != MOVE_COUNT * 2) { - AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); + //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents + //result in a single wheel rotation. + if (actualEvents != EXPECTED_COUNT) { + AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents); } }// start() } diff --git a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java index 600e0fa5af30f5f1fcfc4b92b395911e78636304..2fbb3d2e2b0c500475b34980736708891288c66a 100644 --- a/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java +++ b/test/java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,6 +47,8 @@ import test.java.awt.regtesthelpers.Sysout; public class InfiniteRecursion_4 { final static Robot robot = Util.createRobot(); final static int MOVE_COUNT = 5; + //*2 for both rotation directions over a single frame without any siblings + final static int EXPECTED_COUNT = MOVE_COUNT * 2; static int actualEvents = 0; public static void main(String []s) @@ -80,8 +82,10 @@ public class InfiniteRecursion_4 { } Util.waitForIdle(robot); - if (actualEvents != MOVE_COUNT * 2) { - AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); + //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents + //result in a single wheel rotation. + if (actualEvents != EXPECTED_COUNT) { + AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents); } } } diff --git a/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java b/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java new file mode 100644 index 0000000000000000000000000000000000000000..d4acc95ef2b39f8067c358278973110ecc0c3d23 --- /dev/null +++ b/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6799551 + @library ../../regtesthelpers + @build Util Sysout + @summary Extended key codes for small letters undefined + @author Andrei Dmitriev: area=awt.keyboard + @run main EqualKeyCode +*/ + + +import sun.awt.*; +import java.awt.*; +import test.java.awt.regtesthelpers.Util; +import test.java.awt.regtesthelpers.Sysout; + +public class EqualKeyCode { + + final static String LETTERS = "abcdefghijklmnopqrstuvwxyz"; + + public static void main(String []s) { + for (int i = 0; i < LETTERS.length(); i++){ + char cSmall = LETTERS.charAt(i); + char cLarge = Character.toUpperCase(cSmall); + + int iSmall = ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall); + int iLarge = ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge); + + System.out.print(" " + cSmall + ":" + iSmall + " ---- "); + System.out.println(" " + cLarge + " : " + iLarge); + if (ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall) != + ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge)) + { + throw new RuntimeException("ExtendedKeyCode doesn't exist or doesn't match between capital and small letters."); + } + } + } +} diff --git a/test/java/lang/Character/CheckProp.java b/test/java/lang/Character/CheckProp.java new file mode 100644 index 0000000000000000000000000000000000000000..92da9d3ef1b73698df0e0c7c2a213e2180d8bbe1 --- /dev/null +++ b/test/java/lang/Character/CheckProp.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * @test + * @bug 7037261 + * @summary Check j.l.Character.isLowerCase/isUppercase/isAlphabetic/isIdeographic + */ + +import java.util.regex.*; +import java.util.*; +import java.io.*; +import static java.lang.Character.*; + +public class CheckProp { + + public static void main(String[] args) throws IOException { + File fPropList = new File(System.getProperty("test.src", "."), "PropList.txt"); + int i, j; + BufferedReader sbfr = new BufferedReader(new FileReader(fPropList)); + Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s*;\\s+(\\w+)\\s+#.*").matcher(""); + Map> propMap = new LinkedHashMap<>(); + + String line = null; + int lineNo = 0; + while ((line = sbfr.readLine()) != null) { + lineNo++; + if (line.length() <= 1 || line.charAt(0) == '#') { + continue; + } + m.reset(line); + if (m.matches()) { + int start = Integer.parseInt(m.group(1), 16); + int end = (m.group(2)==null)?start + :Integer.parseInt(m.group(2), 16); + String name = m.group(3); + + ArrayList list = propMap.get(name); + if (list == null) { + list = new ArrayList(); + propMap.put(name, list); + } + while (start <= end) + list.add(start++); + } else { + System.out.printf("Warning: Unrecognized line %d <%s>%n", lineNo, line); + } + } + sbfr.close(); + //for (String name: propMap.keySet()) { + // System.out.printf("%s %d%n", name, propMap.get(name).size()); + //} + + Integer[] otherLowercase = propMap.get("Other_Lowercase").toArray(new Integer[0]); + Integer[] otherUppercase = propMap.get("Other_Uppercase").toArray(new Integer[0]); + Integer[] otherAlphabetic = propMap.get("Other_Alphabetic").toArray(new Integer[0]); + Integer[] ideographic = propMap.get("Ideographic").toArray(new Integer[0]); + + int fails = 0; + for (int cp = MIN_CODE_POINT; cp < MAX_CODE_POINT; cp++) { + int type = getType(cp); + if (isLowerCase(cp) != + (type == LOWERCASE_LETTER || + Arrays.binarySearch(otherLowercase, cp) >= 0)) + { + fails++; + System.err.printf("Wrong isLowerCase(U+%04x)\n", cp); + } + if (isUpperCase(cp) != + (type == UPPERCASE_LETTER || + Arrays.binarySearch(otherUppercase, cp) >= 0)) + { + fails++; + System.err.printf("Wrong isUpperCase(U+%04x)\n", cp); + } + if (isAlphabetic(cp) != + (type == UPPERCASE_LETTER || type == LOWERCASE_LETTER || + type == TITLECASE_LETTER || type == MODIFIER_LETTER || + type == OTHER_LETTER || type == OTHER_LETTER || + type == LETTER_NUMBER || + Arrays.binarySearch(otherAlphabetic, cp) >=0)) + { + fails++; + System.err.printf("Wrong isAlphabetic(U+%04x)\n", cp); + } + if (isIdeographic(cp) != + (Arrays.binarySearch(ideographic, cp) >= 0)) + { + fails++; + System.err.printf("Wrong isIdeographic(U+%04x)\n", cp); + } + } + if (fails != 0) + throw new RuntimeException("CheckProp failed=" + fails); + } +} diff --git a/test/java/lang/Character/PropList.txt b/test/java/lang/Character/PropList.txt new file mode 100644 index 0000000000000000000000000000000000000000..eeeb81845e3a809f3af5d22e23dec930c4f2d2cf --- /dev/null +++ b/test/java/lang/Character/PropList.txt @@ -0,0 +1,1296 @@ +# PropList-6.0.0.txt +# Date: 2010-08-19, 00:48:28 GMT [MD] +# +# Unicode Character Database +# Copyright (c) 1991-2010 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# For documentation, see http://www.unicode.org/reports/tr44/ + +# ================================================ + +0009..000D ; White_Space # Cc [5] .. +0020 ; White_Space # Zs SPACE +0085 ; White_Space # Cc +00A0 ; White_Space # Zs NO-BREAK SPACE +1680 ; White_Space # Zs OGHAM SPACE MARK +180E ; White_Space # Zs MONGOLIAN VOWEL SEPARATOR +2000..200A ; White_Space # Zs [11] EN QUAD..HAIR SPACE +2028 ; White_Space # Zl LINE SEPARATOR +2029 ; White_Space # Zp PARAGRAPH SEPARATOR +202F ; White_Space # Zs NARROW NO-BREAK SPACE +205F ; White_Space # Zs MEDIUM MATHEMATICAL SPACE +3000 ; White_Space # Zs IDEOGRAPHIC SPACE + +# Total code points: 26 + +# ================================================ + +200E..200F ; Bidi_Control # Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +202A..202E ; Bidi_Control # Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + +# Total code points: 7 + +# ================================================ + +200C..200D ; Join_Control # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER + +# Total code points: 2 + +# ================================================ + +002D ; Dash # Pd HYPHEN-MINUS +058A ; Dash # Pd ARMENIAN HYPHEN +05BE ; Dash # Pd HEBREW PUNCTUATION MAQAF +1400 ; Dash # Pd CANADIAN SYLLABICS HYPHEN +1806 ; Dash # Pd MONGOLIAN TODO SOFT HYPHEN +2010..2015 ; Dash # Pd [6] HYPHEN..HORIZONTAL BAR +2053 ; Dash # Po SWUNG DASH +207B ; Dash # Sm SUPERSCRIPT MINUS +208B ; Dash # Sm SUBSCRIPT MINUS +2212 ; Dash # Sm MINUS SIGN +2E17 ; Dash # Pd DOUBLE OBLIQUE HYPHEN +2E1A ; Dash # Pd HYPHEN WITH DIAERESIS +301C ; Dash # Pd WAVE DASH +3030 ; Dash # Pd WAVY DASH +30A0 ; Dash # Pd KATAKANA-HIRAGANA DOUBLE HYPHEN +FE31..FE32 ; Dash # Pd [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH +FE58 ; Dash # Pd SMALL EM DASH +FE63 ; Dash # Pd SMALL HYPHEN-MINUS +FF0D ; Dash # Pd FULLWIDTH HYPHEN-MINUS + +# Total code points: 25 + +# ================================================ + +002D ; Hyphen # Pd HYPHEN-MINUS +00AD ; Hyphen # Cf SOFT HYPHEN +058A ; Hyphen # Pd ARMENIAN HYPHEN +1806 ; Hyphen # Pd MONGOLIAN TODO SOFT HYPHEN +2010..2011 ; Hyphen # Pd [2] HYPHEN..NON-BREAKING HYPHEN +2E17 ; Hyphen # Pd DOUBLE OBLIQUE HYPHEN +30FB ; Hyphen # Po KATAKANA MIDDLE DOT +FE63 ; Hyphen # Pd SMALL HYPHEN-MINUS +FF0D ; Hyphen # Pd FULLWIDTH HYPHEN-MINUS +FF65 ; Hyphen # Po HALFWIDTH KATAKANA MIDDLE DOT + +# Total code points: 11 + +# ================================================ + +0022 ; Quotation_Mark # Po QUOTATION MARK +0027 ; Quotation_Mark # Po APOSTROPHE +00AB ; Quotation_Mark # Pi LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00BB ; Quotation_Mark # Pf RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +2018 ; Quotation_Mark # Pi LEFT SINGLE QUOTATION MARK +2019 ; Quotation_Mark # Pf RIGHT SINGLE QUOTATION MARK +201A ; Quotation_Mark # Ps SINGLE LOW-9 QUOTATION MARK +201B..201C ; Quotation_Mark # Pi [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK +201D ; Quotation_Mark # Pf RIGHT DOUBLE QUOTATION MARK +201E ; Quotation_Mark # Ps DOUBLE LOW-9 QUOTATION MARK +201F ; Quotation_Mark # Pi DOUBLE HIGH-REVERSED-9 QUOTATION MARK +2039 ; Quotation_Mark # Pi SINGLE LEFT-POINTING ANGLE QUOTATION MARK +203A ; Quotation_Mark # Pf SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +300C ; Quotation_Mark # Ps LEFT CORNER BRACKET +300D ; Quotation_Mark # Pe RIGHT CORNER BRACKET +300E ; Quotation_Mark # Ps LEFT WHITE CORNER BRACKET +300F ; Quotation_Mark # Pe RIGHT WHITE CORNER BRACKET +301D ; Quotation_Mark # Ps REVERSED DOUBLE PRIME QUOTATION MARK +301E..301F ; Quotation_Mark # Pe [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK +FE41 ; Quotation_Mark # Ps PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET +FE42 ; Quotation_Mark # Pe PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET +FE43 ; Quotation_Mark # Ps PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET +FE44 ; Quotation_Mark # Pe PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET +FF02 ; Quotation_Mark # Po FULLWIDTH QUOTATION MARK +FF07 ; Quotation_Mark # Po FULLWIDTH APOSTROPHE +FF62 ; Quotation_Mark # Ps HALFWIDTH LEFT CORNER BRACKET +FF63 ; Quotation_Mark # Pe HALFWIDTH RIGHT CORNER BRACKET + +# Total code points: 29 + +# ================================================ + +0021 ; Terminal_Punctuation # Po EXCLAMATION MARK +002C ; Terminal_Punctuation # Po COMMA +002E ; Terminal_Punctuation # Po FULL STOP +003A..003B ; Terminal_Punctuation # Po [2] COLON..SEMICOLON +003F ; Terminal_Punctuation # Po QUESTION MARK +037E ; Terminal_Punctuation # Po GREEK QUESTION MARK +0387 ; Terminal_Punctuation # Po GREEK ANO TELEIA +0589 ; Terminal_Punctuation # Po ARMENIAN FULL STOP +05C3 ; Terminal_Punctuation # Po HEBREW PUNCTUATION SOF PASUQ +060C ; Terminal_Punctuation # Po ARABIC COMMA +061B ; Terminal_Punctuation # Po ARABIC SEMICOLON +061F ; Terminal_Punctuation # Po ARABIC QUESTION MARK +06D4 ; Terminal_Punctuation # Po ARABIC FULL STOP +0700..070A ; Terminal_Punctuation # Po [11] SYRIAC END OF PARAGRAPH..SYRIAC CONTRACTION +070C ; Terminal_Punctuation # Po SYRIAC HARKLEAN METOBELUS +07F8..07F9 ; Terminal_Punctuation # Po [2] NKO COMMA..NKO EXCLAMATION MARK +0830..083E ; Terminal_Punctuation # Po [15] SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUNCTUATION ANNAAU +085E ; Terminal_Punctuation # Po MANDAIC PUNCTUATION +0964..0965 ; Terminal_Punctuation # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA +0E5A..0E5B ; Terminal_Punctuation # Po [2] THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT +0F08 ; Terminal_Punctuation # Po TIBETAN MARK SBRUL SHAD +0F0D..0F12 ; Terminal_Punctuation # Po [6] TIBETAN MARK SHAD..TIBETAN MARK RGYA GRAM SHAD +104A..104B ; Terminal_Punctuation # Po [2] MYANMAR SIGN LITTLE SECTION..MYANMAR SIGN SECTION +1361..1368 ; Terminal_Punctuation # Po [8] ETHIOPIC WORDSPACE..ETHIOPIC PARAGRAPH SEPARATOR +166D..166E ; Terminal_Punctuation # Po [2] CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP +16EB..16ED ; Terminal_Punctuation # Po [3] RUNIC SINGLE PUNCTUATION..RUNIC CROSS PUNCTUATION +17D4..17D6 ; Terminal_Punctuation # Po [3] KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH +17DA ; Terminal_Punctuation # Po KHMER SIGN KOOMUUT +1802..1805 ; Terminal_Punctuation # Po [4] MONGOLIAN COMMA..MONGOLIAN FOUR DOTS +1808..1809 ; Terminal_Punctuation # Po [2] MONGOLIAN MANCHU COMMA..MONGOLIAN MANCHU FULL STOP +1944..1945 ; Terminal_Punctuation # Po [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK +1AA8..1AAB ; Terminal_Punctuation # Po [4] TAI THAM SIGN KAAN..TAI THAM SIGN SATKAANKUU +1B5A..1B5B ; Terminal_Punctuation # Po [2] BALINESE PANTI..BALINESE PAMADA +1B5D..1B5F ; Terminal_Punctuation # Po [3] BALINESE CARIK PAMUNGKAH..BALINESE CARIK PAREREN +1C3B..1C3F ; Terminal_Punctuation # Po [5] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK +1C7E..1C7F ; Terminal_Punctuation # Po [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD +203C..203D ; Terminal_Punctuation # Po [2] DOUBLE EXCLAMATION MARK..INTERROBANG +2047..2049 ; Terminal_Punctuation # Po [3] DOUBLE QUESTION MARK..EXCLAMATION QUESTION MARK +2E2E ; Terminal_Punctuation # Po REVERSED QUESTION MARK +3001..3002 ; Terminal_Punctuation # Po [2] IDEOGRAPHIC COMMA..IDEOGRAPHIC FULL STOP +A4FE..A4FF ; Terminal_Punctuation # Po [2] LISU PUNCTUATION COMMA..LISU PUNCTUATION FULL STOP +A60D..A60F ; Terminal_Punctuation # Po [3] VAI COMMA..VAI QUESTION MARK +A6F3..A6F7 ; Terminal_Punctuation # Po [5] BAMUM FULL STOP..BAMUM QUESTION MARK +A876..A877 ; Terminal_Punctuation # Po [2] PHAGS-PA MARK SHAD..PHAGS-PA MARK DOUBLE SHAD +A8CE..A8CF ; Terminal_Punctuation # Po [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA +A92F ; Terminal_Punctuation # Po KAYAH LI SIGN SHYA +A9C7..A9C9 ; Terminal_Punctuation # Po [3] JAVANESE PADA PANGKAT..JAVANESE PADA LUNGSI +AA5D..AA5F ; Terminal_Punctuation # Po [3] CHAM PUNCTUATION DANDA..CHAM PUNCTUATION TRIPLE DANDA +AADF ; Terminal_Punctuation # Po TAI VIET SYMBOL KOI KOI +ABEB ; Terminal_Punctuation # Po MEETEI MAYEK CHEIKHEI +FE50..FE52 ; Terminal_Punctuation # Po [3] SMALL COMMA..SMALL FULL STOP +FE54..FE57 ; Terminal_Punctuation # Po [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK +FF01 ; Terminal_Punctuation # Po FULLWIDTH EXCLAMATION MARK +FF0C ; Terminal_Punctuation # Po FULLWIDTH COMMA +FF0E ; Terminal_Punctuation # Po FULLWIDTH FULL STOP +FF1A..FF1B ; Terminal_Punctuation # Po [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON +FF1F ; Terminal_Punctuation # Po FULLWIDTH QUESTION MARK +FF61 ; Terminal_Punctuation # Po HALFWIDTH IDEOGRAPHIC FULL STOP +FF64 ; Terminal_Punctuation # Po HALFWIDTH IDEOGRAPHIC COMMA +1039F ; Terminal_Punctuation # Po UGARITIC WORD DIVIDER +103D0 ; Terminal_Punctuation # Po OLD PERSIAN WORD DIVIDER +10857 ; Terminal_Punctuation # Po IMPERIAL ARAMAIC SECTION SIGN +1091F ; Terminal_Punctuation # Po PHOENICIAN WORD SEPARATOR +10B3A..10B3F ; Terminal_Punctuation # Po [6] TINY TWO DOTS OVER ONE DOT PUNCTUATION..LARGE ONE RING OVER TWO RINGS PUNCTUATION +11047..1104D ; Terminal_Punctuation # Po [7] BRAHMI DANDA..BRAHMI PUNCTUATION LOTUS +110BE..110C1 ; Terminal_Punctuation # Po [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA +12470..12473 ; Terminal_Punctuation # Po [4] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON + +# Total code points: 169 + +# ================================================ + +005E ; Other_Math # Sk CIRCUMFLEX ACCENT +03D0..03D2 ; Other_Math # L& [3] GREEK BETA SYMBOL..GREEK UPSILON WITH HOOK SYMBOL +03D5 ; Other_Math # L& GREEK PHI SYMBOL +03F0..03F1 ; Other_Math # L& [2] GREEK KAPPA SYMBOL..GREEK RHO SYMBOL +03F4..03F5 ; Other_Math # L& [2] GREEK CAPITAL THETA SYMBOL..GREEK LUNATE EPSILON SYMBOL +2016 ; Other_Math # Po DOUBLE VERTICAL LINE +2032..2034 ; Other_Math # Po [3] PRIME..TRIPLE PRIME +2040 ; Other_Math # Pc CHARACTER TIE +2061..2064 ; Other_Math # Cf [4] FUNCTION APPLICATION..INVISIBLE PLUS +207D ; Other_Math # Ps SUPERSCRIPT LEFT PARENTHESIS +207E ; Other_Math # Pe SUPERSCRIPT RIGHT PARENTHESIS +208D ; Other_Math # Ps SUBSCRIPT LEFT PARENTHESIS +208E ; Other_Math # Pe SUBSCRIPT RIGHT PARENTHESIS +20D0..20DC ; Other_Math # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE +20E1 ; Other_Math # Mn COMBINING LEFT RIGHT ARROW ABOVE +20E5..20E6 ; Other_Math # Mn [2] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING DOUBLE VERTICAL STROKE OVERLAY +20EB..20EF ; Other_Math # Mn [5] COMBINING LONG DOUBLE SOLIDUS OVERLAY..COMBINING RIGHT ARROW BELOW +2102 ; Other_Math # L& DOUBLE-STRUCK CAPITAL C +2107 ; Other_Math # L& EULER CONSTANT +210A..2113 ; Other_Math # L& [10] SCRIPT SMALL G..SCRIPT SMALL L +2115 ; Other_Math # L& DOUBLE-STRUCK CAPITAL N +2119..211D ; Other_Math # L& [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R +2124 ; Other_Math # L& DOUBLE-STRUCK CAPITAL Z +2128 ; Other_Math # L& BLACK-LETTER CAPITAL Z +2129 ; Other_Math # So TURNED GREEK SMALL LETTER IOTA +212C..212D ; Other_Math # L& [2] SCRIPT CAPITAL B..BLACK-LETTER CAPITAL C +212F..2131 ; Other_Math # L& [3] SCRIPT SMALL E..SCRIPT CAPITAL F +2133..2134 ; Other_Math # L& [2] SCRIPT CAPITAL M..SCRIPT SMALL O +2135..2138 ; Other_Math # Lo [4] ALEF SYMBOL..DALET SYMBOL +213C..213F ; Other_Math # L& [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STRUCK CAPITAL PI +2145..2149 ; Other_Math # L& [5] DOUBLE-STRUCK ITALIC CAPITAL D..DOUBLE-STRUCK ITALIC SMALL J +2195..2199 ; Other_Math # So [5] UP DOWN ARROW..SOUTH WEST ARROW +219C..219F ; Other_Math # So [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW +21A1..21A2 ; Other_Math # So [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL +21A4..21A5 ; Other_Math # So [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR +21A7 ; Other_Math # So DOWNWARDS ARROW FROM BAR +21A9..21AD ; Other_Math # So [5] LEFTWARDS ARROW WITH HOOK..LEFT RIGHT WAVE ARROW +21B0..21B1 ; Other_Math # So [2] UPWARDS ARROW WITH TIP LEFTWARDS..UPWARDS ARROW WITH TIP RIGHTWARDS +21B6..21B7 ; Other_Math # So [2] ANTICLOCKWISE TOP SEMICIRCLE ARROW..CLOCKWISE TOP SEMICIRCLE ARROW +21BC..21CD ; Other_Math # So [18] LEFTWARDS HARPOON WITH BARB UPWARDS..LEFTWARDS DOUBLE ARROW WITH STROKE +21D0..21D1 ; Other_Math # So [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW +21D3 ; Other_Math # So DOWNWARDS DOUBLE ARROW +21D5..21DB ; Other_Math # So [7] UP DOWN DOUBLE ARROW..RIGHTWARDS TRIPLE ARROW +21DD ; Other_Math # So RIGHTWARDS SQUIGGLE ARROW +21E4..21E5 ; Other_Math # So [2] LEFTWARDS ARROW TO BAR..RIGHTWARDS ARROW TO BAR +23B4..23B5 ; Other_Math # So [2] TOP SQUARE BRACKET..BOTTOM SQUARE BRACKET +23B7 ; Other_Math # So RADICAL SYMBOL BOTTOM +23D0 ; Other_Math # So VERTICAL LINE EXTENSION +23E2 ; Other_Math # So WHITE TRAPEZIUM +25A0..25A1 ; Other_Math # So [2] BLACK SQUARE..WHITE SQUARE +25AE..25B6 ; Other_Math # So [9] BLACK VERTICAL RECTANGLE..BLACK RIGHT-POINTING TRIANGLE +25BC..25C0 ; Other_Math # So [5] BLACK DOWN-POINTING TRIANGLE..BLACK LEFT-POINTING TRIANGLE +25C6..25C7 ; Other_Math # So [2] BLACK DIAMOND..WHITE DIAMOND +25CA..25CB ; Other_Math # So [2] LOZENGE..WHITE CIRCLE +25CF..25D3 ; Other_Math # So [5] BLACK CIRCLE..CIRCLE WITH UPPER HALF BLACK +25E2 ; Other_Math # So BLACK LOWER RIGHT TRIANGLE +25E4 ; Other_Math # So BLACK UPPER LEFT TRIANGLE +25E7..25EC ; Other_Math # So [6] SQUARE WITH LEFT HALF BLACK..WHITE UP-POINTING TRIANGLE WITH DOT +2605..2606 ; Other_Math # So [2] BLACK STAR..WHITE STAR +2640 ; Other_Math # So FEMALE SIGN +2642 ; Other_Math # So MALE SIGN +2660..2663 ; Other_Math # So [4] BLACK SPADE SUIT..BLACK CLUB SUIT +266D..266E ; Other_Math # So [2] MUSIC FLAT SIGN..MUSIC NATURAL SIGN +27C5 ; Other_Math # Ps LEFT S-SHAPED BAG DELIMITER +27C6 ; Other_Math # Pe RIGHT S-SHAPED BAG DELIMITER +27E6 ; Other_Math # Ps MATHEMATICAL LEFT WHITE SQUARE BRACKET +27E7 ; Other_Math # Pe MATHEMATICAL RIGHT WHITE SQUARE BRACKET +27E8 ; Other_Math # Ps MATHEMATICAL LEFT ANGLE BRACKET +27E9 ; Other_Math # Pe MATHEMATICAL RIGHT ANGLE BRACKET +27EA ; Other_Math # Ps MATHEMATICAL LEFT DOUBLE ANGLE BRACKET +27EB ; Other_Math # Pe MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET +27EC ; Other_Math # Ps MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET +27ED ; Other_Math # Pe MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET +27EE ; Other_Math # Ps MATHEMATICAL LEFT FLATTENED PARENTHESIS +27EF ; Other_Math # Pe MATHEMATICAL RIGHT FLATTENED PARENTHESIS +2983 ; Other_Math # Ps LEFT WHITE CURLY BRACKET +2984 ; Other_Math # Pe RIGHT WHITE CURLY BRACKET +2985 ; Other_Math # Ps LEFT WHITE PARENTHESIS +2986 ; Other_Math # Pe RIGHT WHITE PARENTHESIS +2987 ; Other_Math # Ps Z NOTATION LEFT IMAGE BRACKET +2988 ; Other_Math # Pe Z NOTATION RIGHT IMAGE BRACKET +2989 ; Other_Math # Ps Z NOTATION LEFT BINDING BRACKET +298A ; Other_Math # Pe Z NOTATION RIGHT BINDING BRACKET +298B ; Other_Math # Ps LEFT SQUARE BRACKET WITH UNDERBAR +298C ; Other_Math # Pe RIGHT SQUARE BRACKET WITH UNDERBAR +298D ; Other_Math # Ps LEFT SQUARE BRACKET WITH TICK IN TOP CORNER +298E ; Other_Math # Pe RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +298F ; Other_Math # Ps LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +2990 ; Other_Math # Pe RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER +2991 ; Other_Math # Ps LEFT ANGLE BRACKET WITH DOT +2992 ; Other_Math # Pe RIGHT ANGLE BRACKET WITH DOT +2993 ; Other_Math # Ps LEFT ARC LESS-THAN BRACKET +2994 ; Other_Math # Pe RIGHT ARC GREATER-THAN BRACKET +2995 ; Other_Math # Ps DOUBLE LEFT ARC GREATER-THAN BRACKET +2996 ; Other_Math # Pe DOUBLE RIGHT ARC LESS-THAN BRACKET +2997 ; Other_Math # Ps LEFT BLACK TORTOISE SHELL BRACKET +2998 ; Other_Math # Pe RIGHT BLACK TORTOISE SHELL BRACKET +29D8 ; Other_Math # Ps LEFT WIGGLY FENCE +29D9 ; Other_Math # Pe RIGHT WIGGLY FENCE +29DA ; Other_Math # Ps LEFT DOUBLE WIGGLY FENCE +29DB ; Other_Math # Pe RIGHT DOUBLE WIGGLY FENCE +29FC ; Other_Math # Ps LEFT-POINTING CURVED ANGLE BRACKET +29FD ; Other_Math # Pe RIGHT-POINTING CURVED ANGLE BRACKET +FE61 ; Other_Math # Po SMALL ASTERISK +FE63 ; Other_Math # Pd SMALL HYPHEN-MINUS +FE68 ; Other_Math # Po SMALL REVERSE SOLIDUS +FF3C ; Other_Math # Po FULLWIDTH REVERSE SOLIDUS +FF3E ; Other_Math # Sk FULLWIDTH CIRCUMFLEX ACCENT +1D400..1D454 ; Other_Math # L& [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G +1D456..1D49C ; Other_Math # L& [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A +1D49E..1D49F ; Other_Math # L& [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D +1D4A2 ; Other_Math # L& MATHEMATICAL SCRIPT CAPITAL G +1D4A5..1D4A6 ; Other_Math # L& [2] MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL SCRIPT CAPITAL K +1D4A9..1D4AC ; Other_Math # L& [4] MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL SCRIPT CAPITAL Q +1D4AE..1D4B9 ; Other_Math # L& [12] MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL SCRIPT SMALL D +1D4BB ; Other_Math # L& MATHEMATICAL SCRIPT SMALL F +1D4BD..1D4C3 ; Other_Math # L& [7] MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SCRIPT SMALL N +1D4C5..1D505 ; Other_Math # L& [65] MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL FRAKTUR CAPITAL B +1D507..1D50A ; Other_Math # L& [4] MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL FRAKTUR CAPITAL G +1D50D..1D514 ; Other_Math # L& [8] MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL FRAKTUR CAPITAL Q +1D516..1D51C ; Other_Math # L& [7] MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL FRAKTUR CAPITAL Y +1D51E..1D539 ; Other_Math # L& [28] MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL DOUBLE-STRUCK CAPITAL B +1D53B..1D53E ; Other_Math # L& [4] MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEMATICAL DOUBLE-STRUCK CAPITAL G +1D540..1D544 ; Other_Math # L& [5] MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEMATICAL DOUBLE-STRUCK CAPITAL M +1D546 ; Other_Math # L& MATHEMATICAL DOUBLE-STRUCK CAPITAL O +1D54A..1D550 ; Other_Math # L& [7] MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEMATICAL DOUBLE-STRUCK CAPITAL Y +1D552..1D6A5 ; Other_Math # L& [340] MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMATICAL ITALIC SMALL DOTLESS J +1D6A8..1D6C0 ; Other_Math # L& [25] MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICAL BOLD CAPITAL OMEGA +1D6C2..1D6DA ; Other_Math # L& [25] MATHEMATICAL BOLD SMALL ALPHA..MATHEMATICAL BOLD SMALL OMEGA +1D6DC..1D6FA ; Other_Math # L& [31] MATHEMATICAL BOLD EPSILON SYMBOL..MATHEMATICAL ITALIC CAPITAL OMEGA +1D6FC..1D714 ; Other_Math # L& [25] MATHEMATICAL ITALIC SMALL ALPHA..MATHEMATICAL ITALIC SMALL OMEGA +1D716..1D734 ; Other_Math # L& [31] MATHEMATICAL ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD ITALIC CAPITAL OMEGA +1D736..1D74E ; Other_Math # L& [25] MATHEMATICAL BOLD ITALIC SMALL ALPHA..MATHEMATICAL BOLD ITALIC SMALL OMEGA +1D750..1D76E ; Other_Math # L& [31] MATHEMATICAL BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA +1D770..1D788 ; Other_Math # L& [25] MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA +1D78A..1D7A8 ; Other_Math # L& [31] MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA +1D7AA..1D7C2 ; Other_Math # L& [25] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA +1D7C4..1D7CB ; Other_Math # L& [8] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD SMALL DIGAMMA +1D7CE..1D7FF ; Other_Math # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE + +# Total code points: 1217 + +# ================================================ + +0030..0039 ; Hex_Digit # Nd [10] DIGIT ZERO..DIGIT NINE +0041..0046 ; Hex_Digit # L& [6] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER F +0061..0066 ; Hex_Digit # L& [6] LATIN SMALL LETTER A..LATIN SMALL LETTER F +FF10..FF19 ; Hex_Digit # Nd [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE +FF21..FF26 ; Hex_Digit # L& [6] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER F +FF41..FF46 ; Hex_Digit # L& [6] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER F + +# Total code points: 44 + +# ================================================ + +0030..0039 ; ASCII_Hex_Digit # Nd [10] DIGIT ZERO..DIGIT NINE +0041..0046 ; ASCII_Hex_Digit # L& [6] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER F +0061..0066 ; ASCII_Hex_Digit # L& [6] LATIN SMALL LETTER A..LATIN SMALL LETTER F + +# Total code points: 22 + +# ================================================ + +0345 ; Other_Alphabetic # Mn COMBINING GREEK YPOGEGRAMMENI +05B0..05BD ; Other_Alphabetic # Mn [14] HEBREW POINT SHEVA..HEBREW POINT METEG +05BF ; Other_Alphabetic # Mn HEBREW POINT RAFE +05C1..05C2 ; Other_Alphabetic # Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +05C4..05C5 ; Other_Alphabetic # Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT +05C7 ; Other_Alphabetic # Mn HEBREW POINT QAMATS QATAN +0610..061A ; Other_Alphabetic # Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA +064B..0657 ; Other_Alphabetic # Mn [13] ARABIC FATHATAN..ARABIC INVERTED DAMMA +0659..065F ; Other_Alphabetic # Mn [7] ARABIC ZWARAKAY..ARABIC WAVY HAMZA BELOW +0670 ; Other_Alphabetic # Mn ARABIC LETTER SUPERSCRIPT ALEF +06D6..06DC ; Other_Alphabetic # Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN +06E1..06E4 ; Other_Alphabetic # Mn [4] ARABIC SMALL HIGH DOTLESS HEAD OF KHAH..ARABIC SMALL HIGH MADDA +06E7..06E8 ; Other_Alphabetic # Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON +06ED ; Other_Alphabetic # Mn ARABIC SMALL LOW MEEM +0711 ; Other_Alphabetic # Mn SYRIAC LETTER SUPERSCRIPT ALAPH +0730..073F ; Other_Alphabetic # Mn [16] SYRIAC PTHAHA ABOVE..SYRIAC RWAHA +07A6..07B0 ; Other_Alphabetic # Mn [11] THAANA ABAFILI..THAANA SUKUN +0816..0817 ; Other_Alphabetic # Mn [2] SAMARITAN MARK IN..SAMARITAN MARK IN-ALAF +081B..0823 ; Other_Alphabetic # Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A +0825..0827 ; Other_Alphabetic # Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U +0829..082C ; Other_Alphabetic # Mn [4] SAMARITAN VOWEL SIGN LONG I..SAMARITAN VOWEL SIGN SUKUN +0900..0902 ; Other_Alphabetic # Mn [3] DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANAGARI SIGN ANUSVARA +0903 ; Other_Alphabetic # Mc DEVANAGARI SIGN VISARGA +093A ; Other_Alphabetic # Mn DEVANAGARI VOWEL SIGN OE +093B ; Other_Alphabetic # Mc DEVANAGARI VOWEL SIGN OOE +093E..0940 ; Other_Alphabetic # Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II +0941..0948 ; Other_Alphabetic # Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI +0949..094C ; Other_Alphabetic # Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU +094E..094F ; Other_Alphabetic # Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW +0955..0957 ; Other_Alphabetic # Mn [3] DEVANAGARI VOWEL SIGN CANDRA LONG E..DEVANAGARI VOWEL SIGN UUE +0962..0963 ; Other_Alphabetic # Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL +0981 ; Other_Alphabetic # Mn BENGALI SIGN CANDRABINDU +0982..0983 ; Other_Alphabetic # Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA +09BE..09C0 ; Other_Alphabetic # Mc [3] BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN II +09C1..09C4 ; Other_Alphabetic # Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR +09C7..09C8 ; Other_Alphabetic # Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI +09CB..09CC ; Other_Alphabetic # Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU +09D7 ; Other_Alphabetic # Mc BENGALI AU LENGTH MARK +09E2..09E3 ; Other_Alphabetic # Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL +0A01..0A02 ; Other_Alphabetic # Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI +0A03 ; Other_Alphabetic # Mc GURMUKHI SIGN VISARGA +0A3E..0A40 ; Other_Alphabetic # Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II +0A41..0A42 ; Other_Alphabetic # Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU +0A47..0A48 ; Other_Alphabetic # Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI +0A4B..0A4C ; Other_Alphabetic # Mn [2] GURMUKHI VOWEL SIGN OO..GURMUKHI VOWEL SIGN AU +0A51 ; Other_Alphabetic # Mn GURMUKHI SIGN UDAAT +0A70..0A71 ; Other_Alphabetic # Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK +0A75 ; Other_Alphabetic # Mn GURMUKHI SIGN YAKASH +0A81..0A82 ; Other_Alphabetic # Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA +0A83 ; Other_Alphabetic # Mc GUJARATI SIGN VISARGA +0ABE..0AC0 ; Other_Alphabetic # Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II +0AC1..0AC5 ; Other_Alphabetic # Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E +0AC7..0AC8 ; Other_Alphabetic # Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI +0AC9 ; Other_Alphabetic # Mc GUJARATI VOWEL SIGN CANDRA O +0ACB..0ACC ; Other_Alphabetic # Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU +0AE2..0AE3 ; Other_Alphabetic # Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL +0B01 ; Other_Alphabetic # Mn ORIYA SIGN CANDRABINDU +0B02..0B03 ; Other_Alphabetic # Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA +0B3E ; Other_Alphabetic # Mc ORIYA VOWEL SIGN AA +0B3F ; Other_Alphabetic # Mn ORIYA VOWEL SIGN I +0B40 ; Other_Alphabetic # Mc ORIYA VOWEL SIGN II +0B41..0B44 ; Other_Alphabetic # Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR +0B47..0B48 ; Other_Alphabetic # Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI +0B4B..0B4C ; Other_Alphabetic # Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU +0B56 ; Other_Alphabetic # Mn ORIYA AI LENGTH MARK +0B57 ; Other_Alphabetic # Mc ORIYA AU LENGTH MARK +0B62..0B63 ; Other_Alphabetic # Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL +0B82 ; Other_Alphabetic # Mn TAMIL SIGN ANUSVARA +0BBE..0BBF ; Other_Alphabetic # Mc [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN I +0BC0 ; Other_Alphabetic # Mn TAMIL VOWEL SIGN II +0BC1..0BC2 ; Other_Alphabetic # Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU +0BC6..0BC8 ; Other_Alphabetic # Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI +0BCA..0BCC ; Other_Alphabetic # Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU +0BD7 ; Other_Alphabetic # Mc TAMIL AU LENGTH MARK +0C01..0C03 ; Other_Alphabetic # Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA +0C3E..0C40 ; Other_Alphabetic # Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II +0C41..0C44 ; Other_Alphabetic # Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR +0C46..0C48 ; Other_Alphabetic # Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI +0C4A..0C4C ; Other_Alphabetic # Mn [3] TELUGU VOWEL SIGN O..TELUGU VOWEL SIGN AU +0C55..0C56 ; Other_Alphabetic # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK +0C62..0C63 ; Other_Alphabetic # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL +0C82..0C83 ; Other_Alphabetic # Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA +0CBE ; Other_Alphabetic # Mc KANNADA VOWEL SIGN AA +0CBF ; Other_Alphabetic # Mn KANNADA VOWEL SIGN I +0CC0..0CC4 ; Other_Alphabetic # Mc [5] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN VOCALIC RR +0CC6 ; Other_Alphabetic # Mn KANNADA VOWEL SIGN E +0CC7..0CC8 ; Other_Alphabetic # Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI +0CCA..0CCB ; Other_Alphabetic # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO +0CCC ; Other_Alphabetic # Mn KANNADA VOWEL SIGN AU +0CD5..0CD6 ; Other_Alphabetic # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +0CE2..0CE3 ; Other_Alphabetic # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL +0D02..0D03 ; Other_Alphabetic # Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA +0D3E..0D40 ; Other_Alphabetic # Mc [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II +0D41..0D44 ; Other_Alphabetic # Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR +0D46..0D48 ; Other_Alphabetic # Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI +0D4A..0D4C ; Other_Alphabetic # Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU +0D57 ; Other_Alphabetic # Mc MALAYALAM AU LENGTH MARK +0D62..0D63 ; Other_Alphabetic # Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL +0D82..0D83 ; Other_Alphabetic # Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA +0DCF..0DD1 ; Other_Alphabetic # Mc [3] SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA +0DD2..0DD4 ; Other_Alphabetic # Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA +0DD6 ; Other_Alphabetic # Mn SINHALA VOWEL SIGN DIGA PAA-PILLA +0DD8..0DDF ; Other_Alphabetic # Mc [8] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA +0DF2..0DF3 ; Other_Alphabetic # Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA +0E31 ; Other_Alphabetic # Mn THAI CHARACTER MAI HAN-AKAT +0E34..0E3A ; Other_Alphabetic # Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU +0E4D ; Other_Alphabetic # Mn THAI CHARACTER NIKHAHIT +0EB1 ; Other_Alphabetic # Mn LAO VOWEL SIGN MAI KAN +0EB4..0EB9 ; Other_Alphabetic # Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU +0EBB..0EBC ; Other_Alphabetic # Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO +0ECD ; Other_Alphabetic # Mn LAO NIGGAHITA +0F71..0F7E ; Other_Alphabetic # Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO +0F7F ; Other_Alphabetic # Mc TIBETAN SIGN RNAM BCAD +0F80..0F81 ; Other_Alphabetic # Mn [2] TIBETAN VOWEL SIGN REVERSED I..TIBETAN VOWEL SIGN REVERSED II +0F8D..0F97 ; Other_Alphabetic # Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA +0F99..0FBC ; Other_Alphabetic # Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA +102B..102C ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN TALL AA..MYANMAR VOWEL SIGN AA +102D..1030 ; Other_Alphabetic # Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU +1031 ; Other_Alphabetic # Mc MYANMAR VOWEL SIGN E +1032..1036 ; Other_Alphabetic # Mn [5] MYANMAR VOWEL SIGN AI..MYANMAR SIGN ANUSVARA +1038 ; Other_Alphabetic # Mc MYANMAR SIGN VISARGA +103B..103C ; Other_Alphabetic # Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA +103D..103E ; Other_Alphabetic # Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA +1056..1057 ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR +1058..1059 ; Other_Alphabetic # Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL +105E..1060 ; Other_Alphabetic # Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA +1062 ; Other_Alphabetic # Mc MYANMAR VOWEL SIGN SGAW KAREN EU +1067..1068 ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN WESTERN PWO KAREN EU..MYANMAR VOWEL SIGN WESTERN PWO KAREN UE +1071..1074 ; Other_Alphabetic # Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE +1082 ; Other_Alphabetic # Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA +1083..1084 ; Other_Alphabetic # Mc [2] MYANMAR VOWEL SIGN SHAN AA..MYANMAR VOWEL SIGN SHAN E +1085..1086 ; Other_Alphabetic # Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y +109C ; Other_Alphabetic # Mc MYANMAR VOWEL SIGN AITON A +109D ; Other_Alphabetic # Mn MYANMAR VOWEL SIGN AITON AI +135F ; Other_Alphabetic # Mn ETHIOPIC COMBINING GEMINATION MARK +1712..1713 ; Other_Alphabetic # Mn [2] TAGALOG VOWEL SIGN I..TAGALOG VOWEL SIGN U +1732..1733 ; Other_Alphabetic # Mn [2] HANUNOO VOWEL SIGN I..HANUNOO VOWEL SIGN U +1752..1753 ; Other_Alphabetic # Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U +1772..1773 ; Other_Alphabetic # Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U +17B6 ; Other_Alphabetic # Mc KHMER VOWEL SIGN AA +17B7..17BD ; Other_Alphabetic # Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA +17BE..17C5 ; Other_Alphabetic # Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU +17C6 ; Other_Alphabetic # Mn KHMER SIGN NIKAHIT +17C7..17C8 ; Other_Alphabetic # Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU +18A9 ; Other_Alphabetic # Mn MONGOLIAN LETTER ALI GALI DAGALGA +1920..1922 ; Other_Alphabetic # Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U +1923..1926 ; Other_Alphabetic # Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU +1927..1928 ; Other_Alphabetic # Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O +1929..192B ; Other_Alphabetic # Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA +1930..1931 ; Other_Alphabetic # Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA +1932 ; Other_Alphabetic # Mn LIMBU SMALL LETTER ANUSVARA +1933..1938 ; Other_Alphabetic # Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA +19B0..19C0 ; Other_Alphabetic # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY +19C8..19C9 ; Other_Alphabetic # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2 +1A17..1A18 ; Other_Alphabetic # Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U +1A19..1A1B ; Other_Alphabetic # Mc [3] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN AE +1A55 ; Other_Alphabetic # Mc TAI THAM CONSONANT SIGN MEDIAL RA +1A56 ; Other_Alphabetic # Mn TAI THAM CONSONANT SIGN MEDIAL LA +1A57 ; Other_Alphabetic # Mc TAI THAM CONSONANT SIGN LA TANG LAI +1A58..1A5E ; Other_Alphabetic # Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA +1A61 ; Other_Alphabetic # Mc TAI THAM VOWEL SIGN A +1A62 ; Other_Alphabetic # Mn TAI THAM VOWEL SIGN MAI SAT +1A63..1A64 ; Other_Alphabetic # Mc [2] TAI THAM VOWEL SIGN AA..TAI THAM VOWEL SIGN TALL AA +1A65..1A6C ; Other_Alphabetic # Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW +1A6D..1A72 ; Other_Alphabetic # Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI +1A73..1A74 ; Other_Alphabetic # Mn [2] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN MAI KANG +1B00..1B03 ; Other_Alphabetic # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG +1B04 ; Other_Alphabetic # Mc BALINESE SIGN BISAH +1B35 ; Other_Alphabetic # Mc BALINESE VOWEL SIGN TEDUNG +1B36..1B3A ; Other_Alphabetic # Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA +1B3B ; Other_Alphabetic # Mc BALINESE VOWEL SIGN RA REPA TEDUNG +1B3C ; Other_Alphabetic # Mn BALINESE VOWEL SIGN LA LENGA +1B3D..1B41 ; Other_Alphabetic # Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG +1B42 ; Other_Alphabetic # Mn BALINESE VOWEL SIGN PEPET +1B43 ; Other_Alphabetic # Mc BALINESE VOWEL SIGN PEPET TEDUNG +1B80..1B81 ; Other_Alphabetic # Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR +1B82 ; Other_Alphabetic # Mc SUNDANESE SIGN PANGWISAD +1BA1 ; Other_Alphabetic # Mc SUNDANESE CONSONANT SIGN PAMINGKAL +1BA2..1BA5 ; Other_Alphabetic # Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU +1BA6..1BA7 ; Other_Alphabetic # Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG +1BA8..1BA9 ; Other_Alphabetic # Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG +1BE7 ; Other_Alphabetic # Mc BATAK VOWEL SIGN E +1BE8..1BE9 ; Other_Alphabetic # Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE +1BEA..1BEC ; Other_Alphabetic # Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O +1BED ; Other_Alphabetic # Mn BATAK VOWEL SIGN KARO O +1BEE ; Other_Alphabetic # Mc BATAK VOWEL SIGN U +1BEF..1BF1 ; Other_Alphabetic # Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H +1C24..1C2B ; Other_Alphabetic # Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU +1C2C..1C33 ; Other_Alphabetic # Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T +1C34..1C35 ; Other_Alphabetic # Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG +1CF2 ; Other_Alphabetic # Mc VEDIC SIGN ARDHAVISARGA +24B6..24E9 ; Other_Alphabetic # So [52] CIRCLED LATIN CAPITAL LETTER A..CIRCLED LATIN SMALL LETTER Z +2DE0..2DFF ; Other_Alphabetic # Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS +A823..A824 ; Other_Alphabetic # Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I +A825..A826 ; Other_Alphabetic # Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E +A827 ; Other_Alphabetic # Mc SYLOTI NAGRI VOWEL SIGN OO +A880..A881 ; Other_Alphabetic # Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA +A8B4..A8C3 ; Other_Alphabetic # Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU +A926..A92A ; Other_Alphabetic # Mn [5] KAYAH LI VOWEL UE..KAYAH LI VOWEL O +A947..A951 ; Other_Alphabetic # Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R +A952 ; Other_Alphabetic # Mc REJANG CONSONANT SIGN H +A980..A982 ; Other_Alphabetic # Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR +A983 ; Other_Alphabetic # Mc JAVANESE SIGN WIGNYAN +A9B4..A9B5 ; Other_Alphabetic # Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG +A9B6..A9B9 ; Other_Alphabetic # Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT +A9BA..A9BB ; Other_Alphabetic # Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE +A9BC ; Other_Alphabetic # Mn JAVANESE VOWEL SIGN PEPET +A9BD..A9BF ; Other_Alphabetic # Mc [3] JAVANESE CONSONANT SIGN KERET..JAVANESE CONSONANT SIGN CAKRA +AA29..AA2E ; Other_Alphabetic # Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE +AA2F..AA30 ; Other_Alphabetic # Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI +AA31..AA32 ; Other_Alphabetic # Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE +AA33..AA34 ; Other_Alphabetic # Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA +AA35..AA36 ; Other_Alphabetic # Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA +AA43 ; Other_Alphabetic # Mn CHAM CONSONANT SIGN FINAL NG +AA4C ; Other_Alphabetic # Mn CHAM CONSONANT SIGN FINAL M +AA4D ; Other_Alphabetic # Mc CHAM CONSONANT SIGN FINAL H +AAB0 ; Other_Alphabetic # Mn TAI VIET MAI KANG +AAB2..AAB4 ; Other_Alphabetic # Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U +AAB7..AAB8 ; Other_Alphabetic # Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA +AABE ; Other_Alphabetic # Mn TAI VIET VOWEL AM +ABE3..ABE4 ; Other_Alphabetic # Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP +ABE5 ; Other_Alphabetic # Mn MEETEI MAYEK VOWEL SIGN ANAP +ABE6..ABE7 ; Other_Alphabetic # Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP +ABE8 ; Other_Alphabetic # Mn MEETEI MAYEK VOWEL SIGN UNAP +ABE9..ABEA ; Other_Alphabetic # Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG +FB1E ; Other_Alphabetic # Mn HEBREW POINT JUDEO-SPANISH VARIKA +10A01..10A03 ; Other_Alphabetic # Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R +10A05..10A06 ; Other_Alphabetic # Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O +10A0C..10A0F ; Other_Alphabetic # Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA +11000 ; Other_Alphabetic # Mc BRAHMI SIGN CANDRABINDU +11001 ; Other_Alphabetic # Mn BRAHMI SIGN ANUSVARA +11002 ; Other_Alphabetic # Mc BRAHMI SIGN VISARGA +11038..11045 ; Other_Alphabetic # Mn [14] BRAHMI VOWEL SIGN AA..BRAHMI VOWEL SIGN AU +11082 ; Other_Alphabetic # Mc KAITHI SIGN VISARGA +110B0..110B2 ; Other_Alphabetic # Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II +110B3..110B6 ; Other_Alphabetic # Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI +110B7..110B8 ; Other_Alphabetic # Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + +# Total code points: 795 + +# ================================================ + +3006 ; Ideographic # Lo IDEOGRAPHIC CLOSING MARK +3007 ; Ideographic # Nl IDEOGRAPHIC NUMBER ZERO +3021..3029 ; Ideographic # Nl [9] HANGZHOU NUMERAL ONE..HANGZHOU NUMERAL NINE +3038..303A ; Ideographic # Nl [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY +3400..4DB5 ; Ideographic # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 +4E00..9FCB ; Ideographic # Lo [20940] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCB +F900..FA2D ; Ideographic # Lo [302] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA2D +FA30..FA6D ; Ideographic # Lo [62] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILITY IDEOGRAPH-FA6D +FA70..FAD9 ; Ideographic # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9 +20000..2A6D6 ; Ideographic # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 +2A700..2B734 ; Ideographic # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 +2B740..2B81D ; Ideographic # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D +2F800..2FA1D ; Ideographic # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D + +# Total code points: 75630 + +# ================================================ + +005E ; Diacritic # Sk CIRCUMFLEX ACCENT +0060 ; Diacritic # Sk GRAVE ACCENT +00A8 ; Diacritic # Sk DIAERESIS +00AF ; Diacritic # Sk MACRON +00B4 ; Diacritic # Sk ACUTE ACCENT +00B7 ; Diacritic # Po MIDDLE DOT +00B8 ; Diacritic # Sk CEDILLA +02B0..02C1 ; Diacritic # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP +02C2..02C5 ; Diacritic # Sk [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD +02C6..02D1 ; Diacritic # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON +02D2..02DF ; Diacritic # Sk [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT +02E0..02E4 ; Diacritic # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +02E5..02EB ; Diacritic # Sk [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK +02EC ; Diacritic # Lm MODIFIER LETTER VOICING +02ED ; Diacritic # Sk MODIFIER LETTER UNASPIRATED +02EE ; Diacritic # Lm MODIFIER LETTER DOUBLE APOSTROPHE +02EF..02FF ; Diacritic # Sk [17] MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW +0300..034E ; Diacritic # Mn [79] COMBINING GRAVE ACCENT..COMBINING UPWARDS ARROW BELOW +0350..0357 ; Diacritic # Mn [8] COMBINING RIGHT ARROWHEAD ABOVE..COMBINING RIGHT HALF RING ABOVE +035D..0362 ; Diacritic # Mn [6] COMBINING DOUBLE BREVE..COMBINING DOUBLE RIGHTWARDS ARROW BELOW +0374 ; Diacritic # Lm GREEK NUMERAL SIGN +0375 ; Diacritic # Sk GREEK LOWER NUMERAL SIGN +037A ; Diacritic # Lm GREEK YPOGEGRAMMENI +0384..0385 ; Diacritic # Sk [2] GREEK TONOS..GREEK DIALYTIKA TONOS +0483..0487 ; Diacritic # Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE +0559 ; Diacritic # Lm ARMENIAN MODIFIER LETTER LEFT HALF RING +0591..05A1 ; Diacritic # Mn [17] HEBREW ACCENT ETNAHTA..HEBREW ACCENT PAZER +05A3..05BD ; Diacritic # Mn [27] HEBREW ACCENT MUNAH..HEBREW POINT METEG +05BF ; Diacritic # Mn HEBREW POINT RAFE +05C1..05C2 ; Diacritic # Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +05C4 ; Diacritic # Mn HEBREW MARK UPPER DOT +064B..0652 ; Diacritic # Mn [8] ARABIC FATHATAN..ARABIC SUKUN +0657..0658 ; Diacritic # Mn [2] ARABIC INVERTED DAMMA..ARABIC MARK NOON GHUNNA +06DF..06E0 ; Diacritic # Mn [2] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH UPRIGHT RECTANGULAR ZERO +06E5..06E6 ; Diacritic # Lm [2] ARABIC SMALL WAW..ARABIC SMALL YEH +06EA..06EC ; Diacritic # Mn [3] ARABIC EMPTY CENTRE LOW STOP..ARABIC ROUNDED HIGH STOP WITH FILLED CENTRE +0730..074A ; Diacritic # Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH +07A6..07B0 ; Diacritic # Mn [11] THAANA ABAFILI..THAANA SUKUN +07EB..07F3 ; Diacritic # Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE +07F4..07F5 ; Diacritic # Lm [2] NKO HIGH TONE APOSTROPHE..NKO LOW TONE APOSTROPHE +0818..0819 ; Diacritic # Mn [2] SAMARITAN MARK OCCLUSION..SAMARITAN MARK DAGESH +093C ; Diacritic # Mn DEVANAGARI SIGN NUKTA +094D ; Diacritic # Mn DEVANAGARI SIGN VIRAMA +0951..0954 ; Diacritic # Mn [4] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI ACUTE ACCENT +0971 ; Diacritic # Lm DEVANAGARI SIGN HIGH SPACING DOT +09BC ; Diacritic # Mn BENGALI SIGN NUKTA +09CD ; Diacritic # Mn BENGALI SIGN VIRAMA +0A3C ; Diacritic # Mn GURMUKHI SIGN NUKTA +0A4D ; Diacritic # Mn GURMUKHI SIGN VIRAMA +0ABC ; Diacritic # Mn GUJARATI SIGN NUKTA +0ACD ; Diacritic # Mn GUJARATI SIGN VIRAMA +0B3C ; Diacritic # Mn ORIYA SIGN NUKTA +0B4D ; Diacritic # Mn ORIYA SIGN VIRAMA +0BCD ; Diacritic # Mn TAMIL SIGN VIRAMA +0C4D ; Diacritic # Mn TELUGU SIGN VIRAMA +0CBC ; Diacritic # Mn KANNADA SIGN NUKTA +0CCD ; Diacritic # Mn KANNADA SIGN VIRAMA +0D4D ; Diacritic # Mn MALAYALAM SIGN VIRAMA +0DCA ; Diacritic # Mn SINHALA SIGN AL-LAKUNA +0E47..0E4C ; Diacritic # Mn [6] THAI CHARACTER MAITAIKHU..THAI CHARACTER THANTHAKHAT +0E4E ; Diacritic # Mn THAI CHARACTER YAMAKKAN +0EC8..0ECC ; Diacritic # Mn [5] LAO TONE MAI EK..LAO CANCELLATION MARK +0F18..0F19 ; Diacritic # Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS +0F35 ; Diacritic # Mn TIBETAN MARK NGAS BZUNG NYI ZLA +0F37 ; Diacritic # Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS +0F39 ; Diacritic # Mn TIBETAN MARK TSA -PHRU +0F3E..0F3F ; Diacritic # Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES +0F82..0F84 ; Diacritic # Mn [3] TIBETAN SIGN NYI ZLA NAA DA..TIBETAN MARK HALANTA +0F86..0F87 ; Diacritic # Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS +0FC6 ; Diacritic # Mn TIBETAN SYMBOL PADMA GDAN +1037 ; Diacritic # Mn MYANMAR SIGN DOT BELOW +1039..103A ; Diacritic # Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT +1087..108C ; Diacritic # Mc [6] MYANMAR SIGN SHAN TONE-2..MYANMAR SIGN SHAN COUNCIL TONE-3 +108D ; Diacritic # Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE +108F ; Diacritic # Mc MYANMAR SIGN RUMAI PALAUNG TONE-5 +109A..109B ; Diacritic # Mc [2] MYANMAR SIGN KHAMTI TONE-1..MYANMAR SIGN KHAMTI TONE-3 +17C9..17D3 ; Diacritic # Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT +17DD ; Diacritic # Mn KHMER SIGN ATTHACAN +1939..193B ; Diacritic # Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I +1A75..1A7C ; Diacritic # Mn [8] TAI THAM SIGN TONE-1..TAI THAM SIGN KHUEN-LUE KARAN +1A7F ; Diacritic # Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT +1B34 ; Diacritic # Mn BALINESE SIGN REREKAN +1B44 ; Diacritic # Mc BALINESE ADEG ADEG +1B6B..1B73 ; Diacritic # Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG +1BAA ; Diacritic # Mc SUNDANESE SIGN PAMAAEH +1C36..1C37 ; Diacritic # Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA +1C78..1C7D ; Diacritic # Lm [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD +1CD0..1CD2 ; Diacritic # Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA +1CD3 ; Diacritic # Po VEDIC SIGN NIHSHVASA +1CD4..1CE0 ; Diacritic # Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA +1CE1 ; Diacritic # Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA +1CE2..1CE8 ; Diacritic # Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL +1CED ; Diacritic # Mn VEDIC SIGN TIRYAK +1D2C..1D61 ; Diacritic # Lm [54] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL CHI +1D62..1D6A ; Diacritic # L& [9] LATIN SUBSCRIPT SMALL LETTER I..GREEK SUBSCRIPT SMALL LETTER CHI +1DC4..1DCF ; Diacritic # Mn [12] COMBINING MACRON-ACUTE..COMBINING ZIGZAG BELOW +1DFD..1DFF ; Diacritic # Mn [3] COMBINING ALMOST EQUAL TO BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW +1FBD ; Diacritic # Sk GREEK KORONIS +1FBF..1FC1 ; Diacritic # Sk [3] GREEK PSILI..GREEK DIALYTIKA AND PERISPOMENI +1FCD..1FCF ; Diacritic # Sk [3] GREEK PSILI AND VARIA..GREEK PSILI AND PERISPOMENI +1FDD..1FDF ; Diacritic # Sk [3] GREEK DASIA AND VARIA..GREEK DASIA AND PERISPOMENI +1FED..1FEF ; Diacritic # Sk [3] GREEK DIALYTIKA AND VARIA..GREEK VARIA +1FFD..1FFE ; Diacritic # Sk [2] GREEK OXIA..GREEK DASIA +2CEF..2CF1 ; Diacritic # Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS +2E2F ; Diacritic # Lm VERTICAL TILDE +302A..302F ; Diacritic # Mn [6] IDEOGRAPHIC LEVEL TONE MARK..HANGUL DOUBLE DOT TONE MARK +3099..309A ; Diacritic # Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +309B..309C ; Diacritic # Sk [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +30FC ; Diacritic # Lm KATAKANA-HIRAGANA PROLONGED SOUND MARK +A66F ; Diacritic # Mn COMBINING CYRILLIC VZMET +A67C..A67D ; Diacritic # Mn [2] COMBINING CYRILLIC KAVYKA..COMBINING CYRILLIC PAYEROK +A67F ; Diacritic # Lm CYRILLIC PAYEROK +A6F0..A6F1 ; Diacritic # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS +A717..A71F ; Diacritic # Lm [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK +A720..A721 ; Diacritic # Sk [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE +A788 ; Diacritic # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT +A8C4 ; Diacritic # Mn SAURASHTRA SIGN VIRAMA +A8E0..A8F1 ; Diacritic # Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA +A92B..A92D ; Diacritic # Mn [3] KAYAH LI TONE PLOPHU..KAYAH LI TONE CALYA PLOPHU +A92E ; Diacritic # Po KAYAH LI SIGN CWI +A953 ; Diacritic # Mc REJANG VIRAMA +A9B3 ; Diacritic # Mn JAVANESE SIGN CECAK TELU +A9C0 ; Diacritic # Mc JAVANESE PANGKON +AA7B ; Diacritic # Mc MYANMAR SIGN PAO KAREN TONE +AABF ; Diacritic # Mn TAI VIET TONE MAI EK +AAC0 ; Diacritic # Lo TAI VIET TONE MAI NUENG +AAC1 ; Diacritic # Mn TAI VIET TONE MAI THO +AAC2 ; Diacritic # Lo TAI VIET TONE MAI SONG +ABEC ; Diacritic # Mc MEETEI MAYEK LUM IYEK +ABED ; Diacritic # Mn MEETEI MAYEK APUN IYEK +FB1E ; Diacritic # Mn HEBREW POINT JUDEO-SPANISH VARIKA +FE20..FE26 ; Diacritic # Mn [7] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON +FF3E ; Diacritic # Sk FULLWIDTH CIRCUMFLEX ACCENT +FF40 ; Diacritic # Sk FULLWIDTH GRAVE ACCENT +FF70 ; Diacritic # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK +FF9E..FF9F ; Diacritic # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +FFE3 ; Diacritic # Sk FULLWIDTH MACRON +110B9..110BA ; Diacritic # Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA +1D167..1D169 ; Diacritic # Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 +1D16D..1D172 ; Diacritic # Mc [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5 +1D17B..1D182 ; Diacritic # Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE +1D185..1D18B ; Diacritic # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE +1D1AA..1D1AD ; Diacritic # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + +# Total code points: 639 + +# ================================================ + +00B7 ; Extender # Po MIDDLE DOT +02D0..02D1 ; Extender # Lm [2] MODIFIER LETTER TRIANGULAR COLON..MODIFIER LETTER HALF TRIANGULAR COLON +0640 ; Extender # Lm ARABIC TATWEEL +07FA ; Extender # Lm NKO LAJANYALAN +0E46 ; Extender # Lm THAI CHARACTER MAIYAMOK +0EC6 ; Extender # Lm LAO KO LA +1843 ; Extender # Lm MONGOLIAN LETTER TODO LONG VOWEL SIGN +1AA7 ; Extender # Lm TAI THAM SIGN MAI YAMOK +1C36 ; Extender # Mn LEPCHA SIGN RAN +1C7B ; Extender # Lm OL CHIKI RELAA +3005 ; Extender # Lm IDEOGRAPHIC ITERATION MARK +3031..3035 ; Extender # Lm [5] VERTICAL KANA REPEAT MARK..VERTICAL KANA REPEAT MARK LOWER HALF +309D..309E ; Extender # Lm [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK +30FC..30FE ; Extender # Lm [3] KATAKANA-HIRAGANA PROLONGED SOUND MARK..KATAKANA VOICED ITERATION MARK +A015 ; Extender # Lm YI SYLLABLE WU +A60C ; Extender # Lm VAI SYLLABLE LENGTHENER +A9CF ; Extender # Lm JAVANESE PANGRANGKEP +AA70 ; Extender # Lm MYANMAR MODIFIER LETTER KHAMTI REDUPLICATION +AADD ; Extender # Lm TAI VIET SYMBOL SAM +FF70 ; Extender # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK + +# Total code points: 28 + +# ================================================ + +02B0..02B8 ; Other_Lowercase # Lm [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y +02C0..02C1 ; Other_Lowercase # Lm [2] MODIFIER LETTER GLOTTAL STOP..MODIFIER LETTER REVERSED GLOTTAL STOP +02E0..02E4 ; Other_Lowercase # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +0345 ; Other_Lowercase # Mn COMBINING GREEK YPOGEGRAMMENI +037A ; Other_Lowercase # Lm GREEK YPOGEGRAMMENI +1D2C..1D61 ; Other_Lowercase # Lm [54] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL CHI +1D78 ; Other_Lowercase # Lm MODIFIER LETTER CYRILLIC EN +1D9B..1DBF ; Other_Lowercase # Lm [37] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL THETA +2090..2094 ; Other_Lowercase # Lm [5] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER SCHWA +2170..217F ; Other_Lowercase # Nl [16] SMALL ROMAN NUMERAL ONE..SMALL ROMAN NUMERAL ONE THOUSAND +24D0..24E9 ; Other_Lowercase # So [26] CIRCLED LATIN SMALL LETTER A..CIRCLED LATIN SMALL LETTER Z +2C7D ; Other_Lowercase # Lm MODIFIER LETTER CAPITAL V +A770 ; Other_Lowercase # Lm MODIFIER LETTER US + +# Total code points: 159 + +# ================================================ + +2160..216F ; Other_Uppercase # Nl [16] ROMAN NUMERAL ONE..ROMAN NUMERAL ONE THOUSAND +24B6..24CF ; Other_Uppercase # So [26] CIRCLED LATIN CAPITAL LETTER A..CIRCLED LATIN CAPITAL LETTER Z + +# Total code points: 42 + +# ================================================ + +FDD0..FDEF ; Noncharacter_Code_Point # Cn [32] .. +FFFE..FFFF ; Noncharacter_Code_Point # Cn [2] .. +1FFFE..1FFFF ; Noncharacter_Code_Point # Cn [2] .. +2FFFE..2FFFF ; Noncharacter_Code_Point # Cn [2] .. +3FFFE..3FFFF ; Noncharacter_Code_Point # Cn [2] .. +4FFFE..4FFFF ; Noncharacter_Code_Point # Cn [2] .. +5FFFE..5FFFF ; Noncharacter_Code_Point # Cn [2] .. +6FFFE..6FFFF ; Noncharacter_Code_Point # Cn [2] .. +7FFFE..7FFFF ; Noncharacter_Code_Point # Cn [2] .. +8FFFE..8FFFF ; Noncharacter_Code_Point # Cn [2] .. +9FFFE..9FFFF ; Noncharacter_Code_Point # Cn [2] .. +AFFFE..AFFFF ; Noncharacter_Code_Point # Cn [2] .. +BFFFE..BFFFF ; Noncharacter_Code_Point # Cn [2] .. +CFFFE..CFFFF ; Noncharacter_Code_Point # Cn [2] .. +DFFFE..DFFFF ; Noncharacter_Code_Point # Cn [2] .. +EFFFE..EFFFF ; Noncharacter_Code_Point # Cn [2] .. +FFFFE..FFFFF ; Noncharacter_Code_Point # Cn [2] .. +10FFFE..10FFFF; Noncharacter_Code_Point # Cn [2] .. + +# Total code points: 66 + +# ================================================ + +09BE ; Other_Grapheme_Extend # Mc BENGALI VOWEL SIGN AA +09D7 ; Other_Grapheme_Extend # Mc BENGALI AU LENGTH MARK +0B3E ; Other_Grapheme_Extend # Mc ORIYA VOWEL SIGN AA +0B57 ; Other_Grapheme_Extend # Mc ORIYA AU LENGTH MARK +0BBE ; Other_Grapheme_Extend # Mc TAMIL VOWEL SIGN AA +0BD7 ; Other_Grapheme_Extend # Mc TAMIL AU LENGTH MARK +0CC2 ; Other_Grapheme_Extend # Mc KANNADA VOWEL SIGN UU +0CD5..0CD6 ; Other_Grapheme_Extend # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +0D3E ; Other_Grapheme_Extend # Mc MALAYALAM VOWEL SIGN AA +0D57 ; Other_Grapheme_Extend # Mc MALAYALAM AU LENGTH MARK +0DCF ; Other_Grapheme_Extend # Mc SINHALA VOWEL SIGN AELA-PILLA +0DDF ; Other_Grapheme_Extend # Mc SINHALA VOWEL SIGN GAYANUKITTA +200C..200D ; Other_Grapheme_Extend # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER +FF9E..FF9F ; Other_Grapheme_Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +1D165 ; Other_Grapheme_Extend # Mc MUSICAL SYMBOL COMBINING STEM +1D16E..1D172 ; Other_Grapheme_Extend # Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + +# Total code points: 23 + +# ================================================ + +2FF0..2FF1 ; IDS_Binary_Operator # So [2] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO BELOW +2FF4..2FFB ; IDS_Binary_Operator # So [8] IDEOGRAPHIC DESCRIPTION CHARACTER FULL SURROUND..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID + +# Total code points: 10 + +# ================================================ + +2FF2..2FF3 ; IDS_Trinary_Operator # So [2] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW + +# Total code points: 2 + +# ================================================ + +2E80..2E99 ; Radical # So [26] CJK RADICAL REPEAT..CJK RADICAL RAP +2E9B..2EF3 ; Radical # So [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE +2F00..2FD5 ; Radical # So [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE + +# Total code points: 329 + +# ================================================ + +3400..4DB5 ; Unified_Ideograph # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 +4E00..9FCB ; Unified_Ideograph # Lo [20940] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCB +FA0E..FA0F ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA0E..CJK COMPATIBILITY IDEOGRAPH-FA0F +FA11 ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA11 +FA13..FA14 ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA13..CJK COMPATIBILITY IDEOGRAPH-FA14 +FA1F ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA1F +FA21 ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA21 +FA23..FA24 ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA23..CJK COMPATIBILITY IDEOGRAPH-FA24 +FA27..FA29 ; Unified_Ideograph # Lo [3] CJK COMPATIBILITY IDEOGRAPH-FA27..CJK COMPATIBILITY IDEOGRAPH-FA29 +20000..2A6D6 ; Unified_Ideograph # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 +2A700..2B734 ; Unified_Ideograph # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 +2B740..2B81D ; Unified_Ideograph # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D + +# Total code points: 74616 + +# ================================================ + +034F ; Other_Default_Ignorable_Code_Point # Mn COMBINING GRAPHEME JOINER +115F..1160 ; Other_Default_Ignorable_Code_Point # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER +2065..2069 ; Other_Default_Ignorable_Code_Point # Cn [5] .. +3164 ; Other_Default_Ignorable_Code_Point # Lo HANGUL FILLER +FFA0 ; Other_Default_Ignorable_Code_Point # Lo HALFWIDTH HANGUL FILLER +FFF0..FFF8 ; Other_Default_Ignorable_Code_Point # Cn [9] .. +E0000 ; Other_Default_Ignorable_Code_Point # Cn +E0002..E001F ; Other_Default_Ignorable_Code_Point # Cn [30] .. +E0080..E00FF ; Other_Default_Ignorable_Code_Point # Cn [128] .. +E01F0..E0FFF ; Other_Default_Ignorable_Code_Point # Cn [3600] .. + +# Total code points: 3778 + +# ================================================ + +0149 ; Deprecated # L& LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +0673 ; Deprecated # Lo ARABIC LETTER ALEF WITH WAVY HAMZA BELOW +0F77 ; Deprecated # Mn TIBETAN VOWEL SIGN VOCALIC RR +0F79 ; Deprecated # Mn TIBETAN VOWEL SIGN VOCALIC LL +17A3..17A4 ; Deprecated # Lo [2] KHMER INDEPENDENT VOWEL QAQ..KHMER INDEPENDENT VOWEL QAA +206A..206F ; Deprecated # Cf [6] INHIBIT SYMMETRIC SWAPPING..NOMINAL DIGIT SHAPES +2329 ; Deprecated # Ps LEFT-POINTING ANGLE BRACKET +232A ; Deprecated # Pe RIGHT-POINTING ANGLE BRACKET +E0001 ; Deprecated # Cf LANGUAGE TAG +E0020..E007F ; Deprecated # Cf [96] TAG SPACE..CANCEL TAG + +# Total code points: 111 + +# ================================================ + +0069..006A ; Soft_Dotted # L& [2] LATIN SMALL LETTER I..LATIN SMALL LETTER J +012F ; Soft_Dotted # L& LATIN SMALL LETTER I WITH OGONEK +0249 ; Soft_Dotted # L& LATIN SMALL LETTER J WITH STROKE +0268 ; Soft_Dotted # L& LATIN SMALL LETTER I WITH STROKE +029D ; Soft_Dotted # L& LATIN SMALL LETTER J WITH CROSSED-TAIL +02B2 ; Soft_Dotted # Lm MODIFIER LETTER SMALL J +03F3 ; Soft_Dotted # L& GREEK LETTER YOT +0456 ; Soft_Dotted # L& CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +0458 ; Soft_Dotted # L& CYRILLIC SMALL LETTER JE +1D62 ; Soft_Dotted # L& LATIN SUBSCRIPT SMALL LETTER I +1D96 ; Soft_Dotted # L& LATIN SMALL LETTER I WITH RETROFLEX HOOK +1DA4 ; Soft_Dotted # Lm MODIFIER LETTER SMALL I WITH STROKE +1DA8 ; Soft_Dotted # Lm MODIFIER LETTER SMALL J WITH CROSSED-TAIL +1E2D ; Soft_Dotted # L& LATIN SMALL LETTER I WITH TILDE BELOW +1ECB ; Soft_Dotted # L& LATIN SMALL LETTER I WITH DOT BELOW +2071 ; Soft_Dotted # Lm SUPERSCRIPT LATIN SMALL LETTER I +2148..2149 ; Soft_Dotted # L& [2] DOUBLE-STRUCK ITALIC SMALL I..DOUBLE-STRUCK ITALIC SMALL J +2C7C ; Soft_Dotted # L& LATIN SUBSCRIPT SMALL LETTER J +1D422..1D423 ; Soft_Dotted # L& [2] MATHEMATICAL BOLD SMALL I..MATHEMATICAL BOLD SMALL J +1D456..1D457 ; Soft_Dotted # L& [2] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL ITALIC SMALL J +1D48A..1D48B ; Soft_Dotted # L& [2] MATHEMATICAL BOLD ITALIC SMALL I..MATHEMATICAL BOLD ITALIC SMALL J +1D4BE..1D4BF ; Soft_Dotted # L& [2] MATHEMATICAL SCRIPT SMALL I..MATHEMATICAL SCRIPT SMALL J +1D4F2..1D4F3 ; Soft_Dotted # L& [2] MATHEMATICAL BOLD SCRIPT SMALL I..MATHEMATICAL BOLD SCRIPT SMALL J +1D526..1D527 ; Soft_Dotted # L& [2] MATHEMATICAL FRAKTUR SMALL I..MATHEMATICAL FRAKTUR SMALL J +1D55A..1D55B ; Soft_Dotted # L& [2] MATHEMATICAL DOUBLE-STRUCK SMALL I..MATHEMATICAL DOUBLE-STRUCK SMALL J +1D58E..1D58F ; Soft_Dotted # L& [2] MATHEMATICAL BOLD FRAKTUR SMALL I..MATHEMATICAL BOLD FRAKTUR SMALL J +1D5C2..1D5C3 ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF SMALL I..MATHEMATICAL SANS-SERIF SMALL J +1D5F6..1D5F7 ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF BOLD SMALL I..MATHEMATICAL SANS-SERIF BOLD SMALL J +1D62A..1D62B ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF ITALIC SMALL I..MATHEMATICAL SANS-SERIF ITALIC SMALL J +1D65E..1D65F ; Soft_Dotted # L& [2] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J +1D692..1D693 ; Soft_Dotted # L& [2] MATHEMATICAL MONOSPACE SMALL I..MATHEMATICAL MONOSPACE SMALL J + +# Total code points: 46 + +# ================================================ + +0E40..0E44 ; Logical_Order_Exception # Lo [5] THAI CHARACTER SARA E..THAI CHARACTER SARA AI MAIMALAI +0EC0..0EC4 ; Logical_Order_Exception # Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI +AAB5..AAB6 ; Logical_Order_Exception # Lo [2] TAI VIET VOWEL E..TAI VIET VOWEL O +AAB9 ; Logical_Order_Exception # Lo TAI VIET VOWEL UEA +AABB..AABC ; Logical_Order_Exception # Lo [2] TAI VIET VOWEL AUE..TAI VIET VOWEL AY + +# Total code points: 15 + +# ================================================ + +2118 ; Other_ID_Start # Sm SCRIPT CAPITAL P +212E ; Other_ID_Start # So ESTIMATED SYMBOL +309B..309C ; Other_ID_Start # Sk [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + +# Total code points: 4 + +# ================================================ + +00B7 ; Other_ID_Continue # Po MIDDLE DOT +0387 ; Other_ID_Continue # Po GREEK ANO TELEIA +1369..1371 ; Other_ID_Continue # No [9] ETHIOPIC DIGIT ONE..ETHIOPIC DIGIT NINE +19DA ; Other_ID_Continue # No NEW TAI LUE THAM DIGIT ONE + +# Total code points: 12 + +# ================================================ + +0021 ; STerm # Po EXCLAMATION MARK +002E ; STerm # Po FULL STOP +003F ; STerm # Po QUESTION MARK +055C ; STerm # Po ARMENIAN EXCLAMATION MARK +055E ; STerm # Po ARMENIAN QUESTION MARK +0589 ; STerm # Po ARMENIAN FULL STOP +061F ; STerm # Po ARABIC QUESTION MARK +06D4 ; STerm # Po ARABIC FULL STOP +0700..0702 ; STerm # Po [3] SYRIAC END OF PARAGRAPH..SYRIAC SUBLINEAR FULL STOP +07F9 ; STerm # Po NKO EXCLAMATION MARK +0964..0965 ; STerm # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA +104A..104B ; STerm # Po [2] MYANMAR SIGN LITTLE SECTION..MYANMAR SIGN SECTION +1362 ; STerm # Po ETHIOPIC FULL STOP +1367..1368 ; STerm # Po [2] ETHIOPIC QUESTION MARK..ETHIOPIC PARAGRAPH SEPARATOR +166E ; STerm # Po CANADIAN SYLLABICS FULL STOP +1735..1736 ; STerm # Po [2] PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION +1803 ; STerm # Po MONGOLIAN FULL STOP +1809 ; STerm # Po MONGOLIAN MANCHU FULL STOP +1944..1945 ; STerm # Po [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK +1AA8..1AAB ; STerm # Po [4] TAI THAM SIGN KAAN..TAI THAM SIGN SATKAANKUU +1B5A..1B5B ; STerm # Po [2] BALINESE PANTI..BALINESE PAMADA +1B5E..1B5F ; STerm # Po [2] BALINESE CARIK SIKI..BALINESE CARIK PAREREN +1C3B..1C3C ; STerm # Po [2] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION NYET THYOOM TA-ROL +1C7E..1C7F ; STerm # Po [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD +203C..203D ; STerm # Po [2] DOUBLE EXCLAMATION MARK..INTERROBANG +2047..2049 ; STerm # Po [3] DOUBLE QUESTION MARK..EXCLAMATION QUESTION MARK +2E2E ; STerm # Po REVERSED QUESTION MARK +3002 ; STerm # Po IDEOGRAPHIC FULL STOP +A4FF ; STerm # Po LISU PUNCTUATION FULL STOP +A60E..A60F ; STerm # Po [2] VAI FULL STOP..VAI QUESTION MARK +A6F3 ; STerm # Po BAMUM FULL STOP +A6F7 ; STerm # Po BAMUM QUESTION MARK +A876..A877 ; STerm # Po [2] PHAGS-PA MARK SHAD..PHAGS-PA MARK DOUBLE SHAD +A8CE..A8CF ; STerm # Po [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA +A92F ; STerm # Po KAYAH LI SIGN SHYA +A9C8..A9C9 ; STerm # Po [2] JAVANESE PADA LINGSA..JAVANESE PADA LUNGSI +AA5D..AA5F ; STerm # Po [3] CHAM PUNCTUATION DANDA..CHAM PUNCTUATION TRIPLE DANDA +ABEB ; STerm # Po MEETEI MAYEK CHEIKHEI +FE52 ; STerm # Po SMALL FULL STOP +FE56..FE57 ; STerm # Po [2] SMALL QUESTION MARK..SMALL EXCLAMATION MARK +FF01 ; STerm # Po FULLWIDTH EXCLAMATION MARK +FF0E ; STerm # Po FULLWIDTH FULL STOP +FF1F ; STerm # Po FULLWIDTH QUESTION MARK +FF61 ; STerm # Po HALFWIDTH IDEOGRAPHIC FULL STOP +10A56..10A57 ; STerm # Po [2] KHAROSHTHI PUNCTUATION DANDA..KHAROSHTHI PUNCTUATION DOUBLE DANDA +11047..11048 ; STerm # Po [2] BRAHMI DANDA..BRAHMI DOUBLE DANDA +110BE..110C1 ; STerm # Po [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA + +# Total code points: 76 + +# ================================================ + +180B..180D ; Variation_Selector # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE +FE00..FE0F ; Variation_Selector # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 +E0100..E01EF ; Variation_Selector # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + +# Total code points: 259 + +# ================================================ + +0009..000D ; Pattern_White_Space # Cc [5] .. +0020 ; Pattern_White_Space # Zs SPACE +0085 ; Pattern_White_Space # Cc +200E..200F ; Pattern_White_Space # Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +2028 ; Pattern_White_Space # Zl LINE SEPARATOR +2029 ; Pattern_White_Space # Zp PARAGRAPH SEPARATOR + +# Total code points: 11 + +# ================================================ + +0021..0023 ; Pattern_Syntax # Po [3] EXCLAMATION MARK..NUMBER SIGN +0024 ; Pattern_Syntax # Sc DOLLAR SIGN +0025..0027 ; Pattern_Syntax # Po [3] PERCENT SIGN..APOSTROPHE +0028 ; Pattern_Syntax # Ps LEFT PARENTHESIS +0029 ; Pattern_Syntax # Pe RIGHT PARENTHESIS +002A ; Pattern_Syntax # Po ASTERISK +002B ; Pattern_Syntax # Sm PLUS SIGN +002C ; Pattern_Syntax # Po COMMA +002D ; Pattern_Syntax # Pd HYPHEN-MINUS +002E..002F ; Pattern_Syntax # Po [2] FULL STOP..SOLIDUS +003A..003B ; Pattern_Syntax # Po [2] COLON..SEMICOLON +003C..003E ; Pattern_Syntax # Sm [3] LESS-THAN SIGN..GREATER-THAN SIGN +003F..0040 ; Pattern_Syntax # Po [2] QUESTION MARK..COMMERCIAL AT +005B ; Pattern_Syntax # Ps LEFT SQUARE BRACKET +005C ; Pattern_Syntax # Po REVERSE SOLIDUS +005D ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET +005E ; Pattern_Syntax # Sk CIRCUMFLEX ACCENT +0060 ; Pattern_Syntax # Sk GRAVE ACCENT +007B ; Pattern_Syntax # Ps LEFT CURLY BRACKET +007C ; Pattern_Syntax # Sm VERTICAL LINE +007D ; Pattern_Syntax # Pe RIGHT CURLY BRACKET +007E ; Pattern_Syntax # Sm TILDE +00A1 ; Pattern_Syntax # Po INVERTED EXCLAMATION MARK +00A2..00A5 ; Pattern_Syntax # Sc [4] CENT SIGN..YEN SIGN +00A6..00A7 ; Pattern_Syntax # So [2] BROKEN BAR..SECTION SIGN +00A9 ; Pattern_Syntax # So COPYRIGHT SIGN +00AB ; Pattern_Syntax # Pi LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00AC ; Pattern_Syntax # Sm NOT SIGN +00AE ; Pattern_Syntax # So REGISTERED SIGN +00B0 ; Pattern_Syntax # So DEGREE SIGN +00B1 ; Pattern_Syntax # Sm PLUS-MINUS SIGN +00B6 ; Pattern_Syntax # So PILCROW SIGN +00BB ; Pattern_Syntax # Pf RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +00BF ; Pattern_Syntax # Po INVERTED QUESTION MARK +00D7 ; Pattern_Syntax # Sm MULTIPLICATION SIGN +00F7 ; Pattern_Syntax # Sm DIVISION SIGN +2010..2015 ; Pattern_Syntax # Pd [6] HYPHEN..HORIZONTAL BAR +2016..2017 ; Pattern_Syntax # Po [2] DOUBLE VERTICAL LINE..DOUBLE LOW LINE +2018 ; Pattern_Syntax # Pi LEFT SINGLE QUOTATION MARK +2019 ; Pattern_Syntax # Pf RIGHT SINGLE QUOTATION MARK +201A ; Pattern_Syntax # Ps SINGLE LOW-9 QUOTATION MARK +201B..201C ; Pattern_Syntax # Pi [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK +201D ; Pattern_Syntax # Pf RIGHT DOUBLE QUOTATION MARK +201E ; Pattern_Syntax # Ps DOUBLE LOW-9 QUOTATION MARK +201F ; Pattern_Syntax # Pi DOUBLE HIGH-REVERSED-9 QUOTATION MARK +2020..2027 ; Pattern_Syntax # Po [8] DAGGER..HYPHENATION POINT +2030..2038 ; Pattern_Syntax # Po [9] PER MILLE SIGN..CARET +2039 ; Pattern_Syntax # Pi SINGLE LEFT-POINTING ANGLE QUOTATION MARK +203A ; Pattern_Syntax # Pf SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +203B..203E ; Pattern_Syntax # Po [4] REFERENCE MARK..OVERLINE +2041..2043 ; Pattern_Syntax # Po [3] CARET INSERTION POINT..HYPHEN BULLET +2044 ; Pattern_Syntax # Sm FRACTION SLASH +2045 ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH QUILL +2046 ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH QUILL +2047..2051 ; Pattern_Syntax # Po [11] DOUBLE QUESTION MARK..TWO ASTERISKS ALIGNED VERTICALLY +2052 ; Pattern_Syntax # Sm COMMERCIAL MINUS SIGN +2053 ; Pattern_Syntax # Po SWUNG DASH +2055..205E ; Pattern_Syntax # Po [10] FLOWER PUNCTUATION MARK..VERTICAL FOUR DOTS +2190..2194 ; Pattern_Syntax # Sm [5] LEFTWARDS ARROW..LEFT RIGHT ARROW +2195..2199 ; Pattern_Syntax # So [5] UP DOWN ARROW..SOUTH WEST ARROW +219A..219B ; Pattern_Syntax # Sm [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE +219C..219F ; Pattern_Syntax # So [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW +21A0 ; Pattern_Syntax # Sm RIGHTWARDS TWO HEADED ARROW +21A1..21A2 ; Pattern_Syntax # So [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL +21A3 ; Pattern_Syntax # Sm RIGHTWARDS ARROW WITH TAIL +21A4..21A5 ; Pattern_Syntax # So [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR +21A6 ; Pattern_Syntax # Sm RIGHTWARDS ARROW FROM BAR +21A7..21AD ; Pattern_Syntax # So [7] DOWNWARDS ARROW FROM BAR..LEFT RIGHT WAVE ARROW +21AE ; Pattern_Syntax # Sm LEFT RIGHT ARROW WITH STROKE +21AF..21CD ; Pattern_Syntax # So [31] DOWNWARDS ZIGZAG ARROW..LEFTWARDS DOUBLE ARROW WITH STROKE +21CE..21CF ; Pattern_Syntax # Sm [2] LEFT RIGHT DOUBLE ARROW WITH STROKE..RIGHTWARDS DOUBLE ARROW WITH STROKE +21D0..21D1 ; Pattern_Syntax # So [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW +21D2 ; Pattern_Syntax # Sm RIGHTWARDS DOUBLE ARROW +21D3 ; Pattern_Syntax # So DOWNWARDS DOUBLE ARROW +21D4 ; Pattern_Syntax # Sm LEFT RIGHT DOUBLE ARROW +21D5..21F3 ; Pattern_Syntax # So [31] UP DOWN DOUBLE ARROW..UP DOWN WHITE ARROW +21F4..22FF ; Pattern_Syntax # Sm [268] RIGHT ARROW WITH SMALL CIRCLE..Z NOTATION BAG MEMBERSHIP +2300..2307 ; Pattern_Syntax # So [8] DIAMETER SIGN..WAVY LINE +2308..230B ; Pattern_Syntax # Sm [4] LEFT CEILING..RIGHT FLOOR +230C..231F ; Pattern_Syntax # So [20] BOTTOM RIGHT CROP..BOTTOM RIGHT CORNER +2320..2321 ; Pattern_Syntax # Sm [2] TOP HALF INTEGRAL..BOTTOM HALF INTEGRAL +2322..2328 ; Pattern_Syntax # So [7] FROWN..KEYBOARD +2329 ; Pattern_Syntax # Ps LEFT-POINTING ANGLE BRACKET +232A ; Pattern_Syntax # Pe RIGHT-POINTING ANGLE BRACKET +232B..237B ; Pattern_Syntax # So [81] ERASE TO THE LEFT..NOT CHECK MARK +237C ; Pattern_Syntax # Sm RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW +237D..239A ; Pattern_Syntax # So [30] SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL +239B..23B3 ; Pattern_Syntax # Sm [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM +23B4..23DB ; Pattern_Syntax # So [40] TOP SQUARE BRACKET..FUSE +23DC..23E1 ; Pattern_Syntax # Sm [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET +23E2..23F3 ; Pattern_Syntax # So [18] WHITE TRAPEZIUM..HOURGLASS WITH FLOWING SAND +23F4..23FF ; Pattern_Syntax # Cn [12] .. +2400..2426 ; Pattern_Syntax # So [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO +2427..243F ; Pattern_Syntax # Cn [25] .. +2440..244A ; Pattern_Syntax # So [11] OCR HOOK..OCR DOUBLE BACKSLASH +244B..245F ; Pattern_Syntax # Cn [21] .. +2500..25B6 ; Pattern_Syntax # So [183] BOX DRAWINGS LIGHT HORIZONTAL..BLACK RIGHT-POINTING TRIANGLE +25B7 ; Pattern_Syntax # Sm WHITE RIGHT-POINTING TRIANGLE +25B8..25C0 ; Pattern_Syntax # So [9] BLACK RIGHT-POINTING SMALL TRIANGLE..BLACK LEFT-POINTING TRIANGLE +25C1 ; Pattern_Syntax # Sm WHITE LEFT-POINTING TRIANGLE +25C2..25F7 ; Pattern_Syntax # So [54] BLACK LEFT-POINTING SMALL TRIANGLE..WHITE CIRCLE WITH UPPER RIGHT QUADRANT +25F8..25FF ; Pattern_Syntax # Sm [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE +2600..266E ; Pattern_Syntax # So [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN +266F ; Pattern_Syntax # Sm MUSIC SHARP SIGN +2670..26FF ; Pattern_Syntax # So [144] WEST SYRIAC CROSS..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE +2700 ; Pattern_Syntax # Cn +2701..2767 ; Pattern_Syntax # So [103] UPPER BLADE SCISSORS..ROTATED FLORAL HEART BULLET +2768 ; Pattern_Syntax # Ps MEDIUM LEFT PARENTHESIS ORNAMENT +2769 ; Pattern_Syntax # Pe MEDIUM RIGHT PARENTHESIS ORNAMENT +276A ; Pattern_Syntax # Ps MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT +276B ; Pattern_Syntax # Pe MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT +276C ; Pattern_Syntax # Ps MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT +276D ; Pattern_Syntax # Pe MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT +276E ; Pattern_Syntax # Ps HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT +276F ; Pattern_Syntax # Pe HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT +2770 ; Pattern_Syntax # Ps HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT +2771 ; Pattern_Syntax # Pe HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT +2772 ; Pattern_Syntax # Ps LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT +2773 ; Pattern_Syntax # Pe LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT +2774 ; Pattern_Syntax # Ps MEDIUM LEFT CURLY BRACKET ORNAMENT +2775 ; Pattern_Syntax # Pe MEDIUM RIGHT CURLY BRACKET ORNAMENT +2794..27BF ; Pattern_Syntax # So [44] HEAVY WIDE-HEADED RIGHTWARDS ARROW..DOUBLE CURLY LOOP +27C0..27C4 ; Pattern_Syntax # Sm [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET +27C5 ; Pattern_Syntax # Ps LEFT S-SHAPED BAG DELIMITER +27C6 ; Pattern_Syntax # Pe RIGHT S-SHAPED BAG DELIMITER +27C7..27CA ; Pattern_Syntax # Sm [4] OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE +27CB ; Pattern_Syntax # Cn +27CC ; Pattern_Syntax # Sm LONG DIVISION +27CD ; Pattern_Syntax # Cn +27CE..27E5 ; Pattern_Syntax # Sm [24] SQUARED LOGICAL AND..WHITE SQUARE WITH RIGHTWARDS TICK +27E6 ; Pattern_Syntax # Ps MATHEMATICAL LEFT WHITE SQUARE BRACKET +27E7 ; Pattern_Syntax # Pe MATHEMATICAL RIGHT WHITE SQUARE BRACKET +27E8 ; Pattern_Syntax # Ps MATHEMATICAL LEFT ANGLE BRACKET +27E9 ; Pattern_Syntax # Pe MATHEMATICAL RIGHT ANGLE BRACKET +27EA ; Pattern_Syntax # Ps MATHEMATICAL LEFT DOUBLE ANGLE BRACKET +27EB ; Pattern_Syntax # Pe MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET +27EC ; Pattern_Syntax # Ps MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET +27ED ; Pattern_Syntax # Pe MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET +27EE ; Pattern_Syntax # Ps MATHEMATICAL LEFT FLATTENED PARENTHESIS +27EF ; Pattern_Syntax # Pe MATHEMATICAL RIGHT FLATTENED PARENTHESIS +27F0..27FF ; Pattern_Syntax # Sm [16] UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW +2800..28FF ; Pattern_Syntax # So [256] BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678 +2900..2982 ; Pattern_Syntax # Sm [131] RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..Z NOTATION TYPE COLON +2983 ; Pattern_Syntax # Ps LEFT WHITE CURLY BRACKET +2984 ; Pattern_Syntax # Pe RIGHT WHITE CURLY BRACKET +2985 ; Pattern_Syntax # Ps LEFT WHITE PARENTHESIS +2986 ; Pattern_Syntax # Pe RIGHT WHITE PARENTHESIS +2987 ; Pattern_Syntax # Ps Z NOTATION LEFT IMAGE BRACKET +2988 ; Pattern_Syntax # Pe Z NOTATION RIGHT IMAGE BRACKET +2989 ; Pattern_Syntax # Ps Z NOTATION LEFT BINDING BRACKET +298A ; Pattern_Syntax # Pe Z NOTATION RIGHT BINDING BRACKET +298B ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH UNDERBAR +298C ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH UNDERBAR +298D ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH TICK IN TOP CORNER +298E ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +298F ; Pattern_Syntax # Ps LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER +2990 ; Pattern_Syntax # Pe RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER +2991 ; Pattern_Syntax # Ps LEFT ANGLE BRACKET WITH DOT +2992 ; Pattern_Syntax # Pe RIGHT ANGLE BRACKET WITH DOT +2993 ; Pattern_Syntax # Ps LEFT ARC LESS-THAN BRACKET +2994 ; Pattern_Syntax # Pe RIGHT ARC GREATER-THAN BRACKET +2995 ; Pattern_Syntax # Ps DOUBLE LEFT ARC GREATER-THAN BRACKET +2996 ; Pattern_Syntax # Pe DOUBLE RIGHT ARC LESS-THAN BRACKET +2997 ; Pattern_Syntax # Ps LEFT BLACK TORTOISE SHELL BRACKET +2998 ; Pattern_Syntax # Pe RIGHT BLACK TORTOISE SHELL BRACKET +2999..29D7 ; Pattern_Syntax # Sm [63] DOTTED FENCE..BLACK HOURGLASS +29D8 ; Pattern_Syntax # Ps LEFT WIGGLY FENCE +29D9 ; Pattern_Syntax # Pe RIGHT WIGGLY FENCE +29DA ; Pattern_Syntax # Ps LEFT DOUBLE WIGGLY FENCE +29DB ; Pattern_Syntax # Pe RIGHT DOUBLE WIGGLY FENCE +29DC..29FB ; Pattern_Syntax # Sm [32] INCOMPLETE INFINITY..TRIPLE PLUS +29FC ; Pattern_Syntax # Ps LEFT-POINTING CURVED ANGLE BRACKET +29FD ; Pattern_Syntax # Pe RIGHT-POINTING CURVED ANGLE BRACKET +29FE..2AFF ; Pattern_Syntax # Sm [258] TINY..N-ARY WHITE VERTICAL BAR +2B00..2B2F ; Pattern_Syntax # So [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE +2B30..2B44 ; Pattern_Syntax # Sm [21] LEFT ARROW WITH SMALL CIRCLE..RIGHTWARDS ARROW THROUGH SUPERSET +2B45..2B46 ; Pattern_Syntax # So [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW +2B47..2B4C ; Pattern_Syntax # Sm [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR +2B4D..2B4F ; Pattern_Syntax # Cn [3] .. +2B50..2B59 ; Pattern_Syntax # So [10] WHITE MEDIUM STAR..HEAVY CIRCLED SALTIRE +2B5A..2BFF ; Pattern_Syntax # Cn [166] .. +2E00..2E01 ; Pattern_Syntax # Po [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER +2E02 ; Pattern_Syntax # Pi LEFT SUBSTITUTION BRACKET +2E03 ; Pattern_Syntax # Pf RIGHT SUBSTITUTION BRACKET +2E04 ; Pattern_Syntax # Pi LEFT DOTTED SUBSTITUTION BRACKET +2E05 ; Pattern_Syntax # Pf RIGHT DOTTED SUBSTITUTION BRACKET +2E06..2E08 ; Pattern_Syntax # Po [3] RAISED INTERPOLATION MARKER..DOTTED TRANSPOSITION MARKER +2E09 ; Pattern_Syntax # Pi LEFT TRANSPOSITION BRACKET +2E0A ; Pattern_Syntax # Pf RIGHT TRANSPOSITION BRACKET +2E0B ; Pattern_Syntax # Po RAISED SQUARE +2E0C ; Pattern_Syntax # Pi LEFT RAISED OMISSION BRACKET +2E0D ; Pattern_Syntax # Pf RIGHT RAISED OMISSION BRACKET +2E0E..2E16 ; Pattern_Syntax # Po [9] EDITORIAL CORONIS..DOTTED RIGHT-POINTING ANGLE +2E17 ; Pattern_Syntax # Pd DOUBLE OBLIQUE HYPHEN +2E18..2E19 ; Pattern_Syntax # Po [2] INVERTED INTERROBANG..PALM BRANCH +2E1A ; Pattern_Syntax # Pd HYPHEN WITH DIAERESIS +2E1B ; Pattern_Syntax # Po TILDE WITH RING ABOVE +2E1C ; Pattern_Syntax # Pi LEFT LOW PARAPHRASE BRACKET +2E1D ; Pattern_Syntax # Pf RIGHT LOW PARAPHRASE BRACKET +2E1E..2E1F ; Pattern_Syntax # Po [2] TILDE WITH DOT ABOVE..TILDE WITH DOT BELOW +2E20 ; Pattern_Syntax # Pi LEFT VERTICAL BAR WITH QUILL +2E21 ; Pattern_Syntax # Pf RIGHT VERTICAL BAR WITH QUILL +2E22 ; Pattern_Syntax # Ps TOP LEFT HALF BRACKET +2E23 ; Pattern_Syntax # Pe TOP RIGHT HALF BRACKET +2E24 ; Pattern_Syntax # Ps BOTTOM LEFT HALF BRACKET +2E25 ; Pattern_Syntax # Pe BOTTOM RIGHT HALF BRACKET +2E26 ; Pattern_Syntax # Ps LEFT SIDEWAYS U BRACKET +2E27 ; Pattern_Syntax # Pe RIGHT SIDEWAYS U BRACKET +2E28 ; Pattern_Syntax # Ps LEFT DOUBLE PARENTHESIS +2E29 ; Pattern_Syntax # Pe RIGHT DOUBLE PARENTHESIS +2E2A..2E2E ; Pattern_Syntax # Po [5] TWO DOTS OVER ONE DOT PUNCTUATION..REVERSED QUESTION MARK +2E2F ; Pattern_Syntax # Lm VERTICAL TILDE +2E30..2E31 ; Pattern_Syntax # Po [2] RING POINT..WORD SEPARATOR MIDDLE DOT +2E32..2E7F ; Pattern_Syntax # Cn [78] .. +3001..3003 ; Pattern_Syntax # Po [3] IDEOGRAPHIC COMMA..DITTO MARK +3008 ; Pattern_Syntax # Ps LEFT ANGLE BRACKET +3009 ; Pattern_Syntax # Pe RIGHT ANGLE BRACKET +300A ; Pattern_Syntax # Ps LEFT DOUBLE ANGLE BRACKET +300B ; Pattern_Syntax # Pe RIGHT DOUBLE ANGLE BRACKET +300C ; Pattern_Syntax # Ps LEFT CORNER BRACKET +300D ; Pattern_Syntax # Pe RIGHT CORNER BRACKET +300E ; Pattern_Syntax # Ps LEFT WHITE CORNER BRACKET +300F ; Pattern_Syntax # Pe RIGHT WHITE CORNER BRACKET +3010 ; Pattern_Syntax # Ps LEFT BLACK LENTICULAR BRACKET +3011 ; Pattern_Syntax # Pe RIGHT BLACK LENTICULAR BRACKET +3012..3013 ; Pattern_Syntax # So [2] POSTAL MARK..GETA MARK +3014 ; Pattern_Syntax # Ps LEFT TORTOISE SHELL BRACKET +3015 ; Pattern_Syntax # Pe RIGHT TORTOISE SHELL BRACKET +3016 ; Pattern_Syntax # Ps LEFT WHITE LENTICULAR BRACKET +3017 ; Pattern_Syntax # Pe RIGHT WHITE LENTICULAR BRACKET +3018 ; Pattern_Syntax # Ps LEFT WHITE TORTOISE SHELL BRACKET +3019 ; Pattern_Syntax # Pe RIGHT WHITE TORTOISE SHELL BRACKET +301A ; Pattern_Syntax # Ps LEFT WHITE SQUARE BRACKET +301B ; Pattern_Syntax # Pe RIGHT WHITE SQUARE BRACKET +301C ; Pattern_Syntax # Pd WAVE DASH +301D ; Pattern_Syntax # Ps REVERSED DOUBLE PRIME QUOTATION MARK +301E..301F ; Pattern_Syntax # Pe [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK +3020 ; Pattern_Syntax # So POSTAL MARK FACE +3030 ; Pattern_Syntax # Pd WAVY DASH +FD3E ; Pattern_Syntax # Ps ORNATE LEFT PARENTHESIS +FD3F ; Pattern_Syntax # Pe ORNATE RIGHT PARENTHESIS +FE45..FE46 ; Pattern_Syntax # Po [2] SESAME DOT..WHITE SESAME DOT + +# Total code points: 2760 + +# EOF diff --git a/test/java/lang/Double/ParseDouble.java b/test/java/lang/Double/ParseDouble.java index e67c3d86beac8e56c8fd445d432a57acc20c98c7..504f5bc3dc0fd711e59cc5a24cc4731f3dc7330a 100644 --- a/test/java/lang/Double/ParseDouble.java +++ b/test/java/lang/Double/ParseDouble.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568 + * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568 7039369 * @summary Test for Double.parseDouble method and acceptance regex */ diff --git a/test/java/lang/ProcessBuilder/Basic.java b/test/java/lang/ProcessBuilder/Basic.java index 22916929561f687084fe60dbf44ea144a5220d32..677735474a83f3b69a81b0f0aafe90ae2daf1a6b 100644 --- a/test/java/lang/ProcessBuilder/Basic.java +++ b/test/java/lang/ProcessBuilder/Basic.java @@ -26,7 +26,7 @@ * @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689 * 5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313 * 6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958 - * 4947220 7018606 + * 4947220 7018606 7034570 * @summary Basic tests for Process and Environment Variable code * @run main/othervm/timeout=300 Basic * @author Martin Buchholz @@ -1440,11 +1440,12 @@ public class Basic { // Check for sort order of environment variables on Windows. //---------------------------------------------------------------- try { + String systemRoot = "SystemRoot=" + System.getenv("SystemRoot"); // '+' < 'A' < 'Z' < '_' < 'a' < 'z' < '~' String[]envp = {"FOO=BAR","BAZ=GORP","QUUX=", - "+=+", "_=_", "~=~"}; + "+=+", "_=_", "~=~", systemRoot}; String output = nativeEnv(envp); - String expected = "+=+\nBAZ=GORP\nFOO=BAR\nQUUX=\n_=_\n~=~\n"; + String expected = "+=+\nBAZ=GORP\nFOO=BAR\nQUUX=\n"+systemRoot+"\n_=_\n~=~\n"; // On Windows, Java must keep the environment sorted. // Order is random on Unix, so this test does the sort. if (! Windows.is()) @@ -1452,6 +1453,21 @@ public class Basic { equal(output, expected); } catch (Throwable t) { unexpected(t); } + //---------------------------------------------------------------- + // Test Runtime.exec(...envp...) + // and check SystemRoot gets set automatically on Windows + //---------------------------------------------------------------- + try { + if (Windows.is()) { + String systemRoot = "SystemRoot=" + System.getenv("SystemRoot"); + String[]envp = {"FOO=BAR","BAZ=GORP","QUUX=", + "+=+", "_=_", "~=~"}; + String output = nativeEnv(envp); + String expected = "+=+\nBAZ=GORP\nFOO=BAR\nQUUX=\n"+systemRoot+"\n_=_\n~=~\n"; + equal(output, expected); + } + } catch (Throwable t) { unexpected(t); } + //---------------------------------------------------------------- // System.getenv() must be consistent with System.getenv(String) //---------------------------------------------------------------- diff --git a/test/java/lang/Throwable/ChainedExceptions.java b/test/java/lang/Throwable/ChainedExceptions.java index a6577ba469382f524c0e8c800296db3cced7fba9..2c2fa398d11f0e101eac3fcfbb653f48dc1fb025 100644 --- a/test/java/lang/Throwable/ChainedExceptions.java +++ b/test/java/lang/Throwable/ChainedExceptions.java @@ -13,28 +13,28 @@ public class ChainedExceptions { StackTraceElement[] highTrace = e.getStackTrace(); int depthTrim = highTrace.length - 2; - check(highTrace[0], "a", 48); - check(highTrace[1], "main", 11); + check(e, highTrace[0], "a", 48); + check(e, highTrace[1], "main", 11); Throwable mid = e.getCause(); StackTraceElement[] midTrace = mid.getStackTrace(); if (midTrace.length - depthTrim != 4) throw new RuntimeException("Mid depth"); - check(midTrace[0], "c", 58); - check(midTrace[1], "b", 52); - check(midTrace[2], "a", 46); - check(midTrace[3], "main", 11); + check(mid, midTrace[0], "c", 58); + check(mid, midTrace[1], "b", 52); + check(mid, midTrace[2], "a", 46); + check(mid, midTrace[3], "main", 11); Throwable low = mid.getCause(); StackTraceElement[] lowTrace = low.getStackTrace(); if (lowTrace.length - depthTrim != 6) throw new RuntimeException("Low depth"); - check(lowTrace[0], "e", 65); - check(lowTrace[1], "d", 62); - check(lowTrace[2], "c", 56); - check(lowTrace[3], "b", 52); - check(lowTrace[4], "a", 46); - check(lowTrace[5], "main", 11); + check(low, lowTrace[0], "e", 65); + check(low, lowTrace[1], "d", 62); + check(low, lowTrace[2], "c", 56); + check(low, lowTrace[3], "b", 52); + check(low, lowTrace[4], "a", 46); + check(low, lowTrace[5], "main", 11); if (low.getCause() != null) throw new RuntimeException("Low cause != null"); @@ -68,15 +68,15 @@ public class ChainedExceptions { private static final String OUR_CLASS = ChainedExceptions.class.getName(); private static final String OUR_FILE_NAME = "ChainedExceptions.java"; - private static void check(StackTraceElement e, String methodName, int n) { + private static void check(Throwable t, StackTraceElement e, String methodName, int n) { if (!e.getClassName().equals(OUR_CLASS)) - throw new RuntimeException("Class: " + e); + throw new RuntimeException("Class: " + e, t); if (!e.getMethodName().equals(methodName)) - throw new RuntimeException("Method name: " + e); + throw new RuntimeException("Method name: " + e, t); if (!e.getFileName().equals(OUR_FILE_NAME)) - throw new RuntimeException("File name: " + e); + throw new RuntimeException("File name: " + e, t); if (e.getLineNumber() != n) - throw new RuntimeException("Line number: " + e); + throw new RuntimeException("Line number: " + e, t); } } diff --git a/test/java/lang/Throwable/StackTraceSerialization.java b/test/java/lang/Throwable/StackTraceSerialization.java index 2d2f4f42a232ebfc7fc330fd0530d09acc1cc44b..29a4d2a8c133faa149a53c295172a8f293b42650 100644 --- a/test/java/lang/Throwable/StackTraceSerialization.java +++ b/test/java/lang/Throwable/StackTraceSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ import java.util.*; /* * @test - * @bug 4202914 4363318 6991528 + * @bug 4202914 4363318 6991528 6998871 * @summary Basic test of serialization of stack trace information * @author Josh Bloch */ @@ -37,14 +37,52 @@ public class StackTraceSerialization { testWithFillInStackTrace(); } - private static void testWithSetStackTrace() throws Exception { - Throwable t = new Throwable(); + private static void testWithSetStackTrace() { + StackTraceElement[] stackTrace = {new StackTraceElement("foo", "bar", "baz", -1)}; - t.setStackTrace(new StackTraceElement[] - {new StackTraceElement("foo", "bar", "baz", -1)}); + Throwable t = new TestThrowable(true, false); // Immutable and empty stack + assertEmptyStackTrace(t); + + // Verify fillInStackTrace is now a no-op. + t.fillInStackTrace(); + assertEmptyStackTrace(t); + + // Verify setStackTrace is now a no-op. + t.setStackTrace(stackTrace); + assertEmptyStackTrace(t); + + // Verify null-handling + try { + t.setStackTrace(null); + throw new RuntimeException("No NPE on a null stack trace."); + } catch(NullPointerException npe) { + assertEmptyStackTrace(t); + } + + try { + t.setStackTrace(new StackTraceElement[]{null}); + throw new RuntimeException("No NPE on a null stack trace element."); + } catch(NullPointerException npe) { + assertEmptyStackTrace(t); + } if (!equal(t, reconstitute(t))) - throw new Exception("Unequal Throwables with set stacktrace"); + throw new RuntimeException("Unequal Throwables with set stacktrace"); + + Throwable t2 = new Throwable(); + t2.setStackTrace(stackTrace); + if (!equal(t2, reconstitute(t2))) + throw new RuntimeException("Unequal Throwables with set stacktrace"); + + } + + private static class TestThrowable extends Throwable { + public TestThrowable(boolean enableSuppression, + boolean writableStackTrace) { + super("the medium", null, + enableSuppression, + writableStackTrace); + } } private static void assertEmptyStackTrace(Throwable t) { @@ -52,7 +90,7 @@ public class StackTraceSerialization { throw new AssertionError("Nonempty stacktrace."); } - private static void testWithFillInStackTrace() throws Exception { + private static void testWithFillInStackTrace() { Throwable original = null; try { a(); @@ -61,16 +99,14 @@ public class StackTraceSerialization { } if (!equal(original, reconstitute(original))) - throw new Exception("Unequal Throwables with filled-in stacktrace"); + throw new RuntimeException("Unequal Throwables with filled-in stacktrace"); } - /** * Serialize the argument and return the deserialized result. */ - private static Throwable reconstitute(Throwable t) throws Exception { + private static Throwable reconstitute(Throwable t) { Throwable result = null; - try(ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bout)) { out.writeObject(t); @@ -80,8 +116,9 @@ public class StackTraceSerialization { ObjectInputStream in = new ObjectInputStream(bin)) { result = (Throwable) in.readObject(); } + } catch(IOException | ClassNotFoundException e) { + throw new RuntimeException(e); } - return result; } diff --git a/test/java/lang/Throwable/SuppressedExceptions.java b/test/java/lang/Throwable/SuppressedExceptions.java index b987600dca39e45133752007cf94f6f4b879303e..f92fee4e57d4d9a7452b77b90ae107b027bba61c 100644 --- a/test/java/lang/Throwable/SuppressedExceptions.java +++ b/test/java/lang/Throwable/SuppressedExceptions.java @@ -193,6 +193,7 @@ public class SuppressedExceptions { // Make sure addSuppressed(null) throws an NPE try { t.addSuppressed(null); + throw new RuntimeException("NPE not thrown!"); } catch(NullPointerException e) { ; // Expected } @@ -204,7 +205,7 @@ public class SuppressedExceptions { private static class NoSuppression extends Throwable { public NoSuppression(boolean enableSuppression) { - super("The medium.", null, enableSuppression); + super("The medium.", null, enableSuppression, true); } } } diff --git a/test/java/nio/charset/StandardCharset/Standard.java b/test/java/nio/charset/StandardCharset/Standard.java new file mode 100644 index 0000000000000000000000000000000000000000..cae083ed5398691e0a65e782be4e8182ff9fe4d8 --- /dev/null +++ b/test/java/nio/charset/StandardCharset/Standard.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4884238 + * @summary Test standard charset name constants. + * @author Mike Duigou + * @run main Standard + */ + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.io.*; +import java.nio.charset.*; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class Standard { + + private final static String standardCharsets[] = { + "US-ASCII", "ISO-8859-1", "UTF-8", + "UTF-16BE", "UTF-16LE", "UTF-16" }; + + public static void realMain(String[] args) { + check(StandardCharset.US_ASCII instanceof Charset); + check(StandardCharset.ISO_8859_1 instanceof Charset); + check(StandardCharset.UTF_8 instanceof Charset); + check(StandardCharset.UTF_16BE instanceof Charset); + check(StandardCharset.UTF_16LE instanceof Charset); + check(StandardCharset.UTF_16 instanceof Charset); + + check("US-ASCII".equals(StandardCharset.US_ASCII.name())); + check("ISO-8859-1".equals(StandardCharset.ISO_8859_1.name())); + check("UTF-8".equals(StandardCharset.UTF_8.name())); + check("UTF-16BE".equals(StandardCharset.UTF_16BE.name())); + check("UTF-16LE".equals(StandardCharset.UTF_16LE.name())); + check("UTF-16".equals(StandardCharset.UTF_16.name())); + + Set charsets = new HashSet<>(); + Field standardCharsetFields[] = StandardCharset.class.getFields(); + + for(Field charsetField : standardCharsetFields) { + check(StandardCharset.class == charsetField.getDeclaringClass()); + check(Modifier.isFinal(charsetField.getModifiers())); + check(Modifier.isStatic(charsetField.getModifiers())); + check(Modifier.isPublic(charsetField.getModifiers())); + Object value; + try { + value = charsetField.get(null); + } catch(IllegalAccessException failure) { + unexpected(failure); + continue; + } + check(value instanceof Charset); + charsets.add(((Charset)value).name()); + } + + check(charsets.containsAll(Arrays.asList(standardCharsets))); + charsets.removeAll(Arrays.asList(standardCharsets)); + check(charsets.isEmpty()); + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() { passed++; } + static void fail() { failed++; Thread.dumpStack(); } + static void fail(String msg) { System.out.println(msg); fail(); } + static void unexpected(Throwable t) { failed++; t.printStackTrace(); } + static void check(boolean cond) { if (cond) pass(); else fail(); } + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else {System.out.println(x + " not equal to " + y); fail();}} + static void equal2(Object x, Object y) {equal(x, y); equal(y, x);} + public static void main(String[] args) throws Throwable { + try { realMain(args); } catch (Throwable t) { unexpected(t); } + + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new Exception("Some tests failed"); + } + private static abstract class Fun {abstract void f() throws Throwable;} + private static void THROWS(Class k, Fun... fs) { + for (Fun f : fs) + try { f.f(); fail("Expected " + k.getName() + " not thrown"); } + catch (Throwable t) { + if (k.isAssignableFrom(t.getClass())) pass(); + else unexpected(t);}} + static byte[] serializedForm(Object obj) { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + new ObjectOutputStream(baos).writeObject(obj); + return baos.toByteArray(); + } catch (IOException e) { throw new Error(e); }} + static Object readObject(byte[] bytes) + throws IOException, ClassNotFoundException { + InputStream is = new ByteArrayInputStream(bytes); + return new ObjectInputStream(is).readObject();} + @SuppressWarnings("unchecked") + static T serialClone(T obj) { + try { return (T) readObject(serializedForm(obj)); } + catch (Exception e) { throw new Error(e); }} + +} diff --git a/test/java/util/regex/POSIX_ASCII.java b/test/java/util/regex/POSIX_ASCII.java new file mode 100644 index 0000000000000000000000000000000000000000..07d3fcd7010bc35a9bd490d4b87e5029b78be76c --- /dev/null +++ b/test/java/util/regex/POSIX_ASCII.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +final class POSIX_ASCII { + + static final int UPPER = 0x00000100; + + static final int LOWER = 0x00000200; + + static final int DIGIT = 0x00000400; + + static final int SPACE = 0x00000800; + + static final int PUNCT = 0x00001000; + + static final int CNTRL = 0x00002000; + + static final int BLANK = 0x00004000; + + static final int HEX = 0x00008000; + + static final int UNDER = 0x00010000; + + static final int ASCII = 0x0000FF00; + + static final int ALPHA = (UPPER|LOWER); + + static final int ALNUM = (UPPER|LOWER|DIGIT); + + static final int GRAPH = (PUNCT|UPPER|LOWER|DIGIT); + + static final int WORD = (UPPER|LOWER|UNDER|DIGIT); + + static final int XDIGIT = (HEX); + + private static final int[] ctype = new int[] { + CNTRL, /* 00 (NUL) */ + CNTRL, /* 01 (SOH) */ + CNTRL, /* 02 (STX) */ + CNTRL, /* 03 (ETX) */ + CNTRL, /* 04 (EOT) */ + CNTRL, /* 05 (ENQ) */ + CNTRL, /* 06 (ACK) */ + CNTRL, /* 07 (BEL) */ + CNTRL, /* 08 (BS) */ + SPACE+CNTRL+BLANK, /* 09 (HT) */ + SPACE+CNTRL, /* 0A (LF) */ + SPACE+CNTRL, /* 0B (VT) */ + SPACE+CNTRL, /* 0C (FF) */ + SPACE+CNTRL, /* 0D (CR) */ + CNTRL, /* 0E (SI) */ + CNTRL, /* 0F (SO) */ + CNTRL, /* 10 (DLE) */ + CNTRL, /* 11 (DC1) */ + CNTRL, /* 12 (DC2) */ + CNTRL, /* 13 (DC3) */ + CNTRL, /* 14 (DC4) */ + CNTRL, /* 15 (NAK) */ + CNTRL, /* 16 (SYN) */ + CNTRL, /* 17 (ETB) */ + CNTRL, /* 18 (CAN) */ + CNTRL, /* 19 (EM) */ + CNTRL, /* 1A (SUB) */ + CNTRL, /* 1B (ESC) */ + CNTRL, /* 1C (FS) */ + CNTRL, /* 1D (GS) */ + CNTRL, /* 1E (RS) */ + CNTRL, /* 1F (US) */ + SPACE+BLANK, /* 20 SPACE */ + PUNCT, /* 21 ! */ + PUNCT, /* 22 " */ + PUNCT, /* 23 # */ + PUNCT, /* 24 $ */ + PUNCT, /* 25 % */ + PUNCT, /* 26 & */ + PUNCT, /* 27 ' */ + PUNCT, /* 28 ( */ + PUNCT, /* 29 ) */ + PUNCT, /* 2A * */ + PUNCT, /* 2B + */ + PUNCT, /* 2C , */ + PUNCT, /* 2D - */ + PUNCT, /* 2E . */ + PUNCT, /* 2F / */ + DIGIT+HEX+0, /* 30 0 */ + DIGIT+HEX+1, /* 31 1 */ + DIGIT+HEX+2, /* 32 2 */ + DIGIT+HEX+3, /* 33 3 */ + DIGIT+HEX+4, /* 34 4 */ + DIGIT+HEX+5, /* 35 5 */ + DIGIT+HEX+6, /* 36 6 */ + DIGIT+HEX+7, /* 37 7 */ + DIGIT+HEX+8, /* 38 8 */ + DIGIT+HEX+9, /* 39 9 */ + PUNCT, /* 3A : */ + PUNCT, /* 3B ; */ + PUNCT, /* 3C < */ + PUNCT, /* 3D = */ + PUNCT, /* 3E > */ + PUNCT, /* 3F ? */ + PUNCT, /* 40 @ */ + UPPER+HEX+10, /* 41 A */ + UPPER+HEX+11, /* 42 B */ + UPPER+HEX+12, /* 43 C */ + UPPER+HEX+13, /* 44 D */ + UPPER+HEX+14, /* 45 E */ + UPPER+HEX+15, /* 46 F */ + UPPER+16, /* 47 G */ + UPPER+17, /* 48 H */ + UPPER+18, /* 49 I */ + UPPER+19, /* 4A J */ + UPPER+20, /* 4B K */ + UPPER+21, /* 4C L */ + UPPER+22, /* 4D M */ + UPPER+23, /* 4E N */ + UPPER+24, /* 4F O */ + UPPER+25, /* 50 P */ + UPPER+26, /* 51 Q */ + UPPER+27, /* 52 R */ + UPPER+28, /* 53 S */ + UPPER+29, /* 54 T */ + UPPER+30, /* 55 U */ + UPPER+31, /* 56 V */ + UPPER+32, /* 57 W */ + UPPER+33, /* 58 X */ + UPPER+34, /* 59 Y */ + UPPER+35, /* 5A Z */ + PUNCT, /* 5B [ */ + PUNCT, /* 5C \ */ + PUNCT, /* 5D ] */ + PUNCT, /* 5E ^ */ + PUNCT|UNDER, /* 5F _ */ + PUNCT, /* 60 ` */ + LOWER+HEX+10, /* 61 a */ + LOWER+HEX+11, /* 62 b */ + LOWER+HEX+12, /* 63 c */ + LOWER+HEX+13, /* 64 d */ + LOWER+HEX+14, /* 65 e */ + LOWER+HEX+15, /* 66 f */ + LOWER+16, /* 67 g */ + LOWER+17, /* 68 h */ + LOWER+18, /* 69 i */ + LOWER+19, /* 6A j */ + LOWER+20, /* 6B k */ + LOWER+21, /* 6C l */ + LOWER+22, /* 6D m */ + LOWER+23, /* 6E n */ + LOWER+24, /* 6F o */ + LOWER+25, /* 70 p */ + LOWER+26, /* 71 q */ + LOWER+27, /* 72 r */ + LOWER+28, /* 73 s */ + LOWER+29, /* 74 t */ + LOWER+30, /* 75 u */ + LOWER+31, /* 76 v */ + LOWER+32, /* 77 w */ + LOWER+33, /* 78 x */ + LOWER+34, /* 79 y */ + LOWER+35, /* 7A z */ + PUNCT, /* 7B { */ + PUNCT, /* 7C | */ + PUNCT, /* 7D } */ + PUNCT, /* 7E ~ */ + CNTRL, /* 7F (DEL) */ + }; + + static int getType(int ch) { + return ((ch & 0xFFFFFF80) == 0 ? ctype[ch] : 0); + } + + static boolean isType(int ch, int type) { + return (getType(ch) & type) != 0; + } + + static boolean isAscii(int ch) { + return ((ch & 0xFFFFFF80) == 0); + } + + static boolean isAlpha(int ch) { + return isType(ch, ALPHA); + } + + static boolean isDigit(int ch) { + return ((ch-'0')|('9'-ch)) >= 0; + } + + static boolean isAlnum(int ch) { + return isType(ch, ALNUM); + } + + static boolean isGraph(int ch) { + return isType(ch, GRAPH); + } + + static boolean isPrint(int ch) { + return ((ch-0x20)|(0x7E-ch)) >= 0; + } + + static boolean isPunct(int ch) { + return isType(ch, PUNCT); + } + + static boolean isSpace(int ch) { + return isType(ch, SPACE); + } + + static boolean isHexDigit(int ch) { + return isType(ch, HEX); + } + + static boolean isCntrl(int ch) { + return isType(ch, CNTRL); + } + + static boolean isLower(int ch) { + return ((ch-'a')|('z'-ch)) >= 0; + } + + static boolean isUpper(int ch) { + return ((ch-'A')|('Z'-ch)) >= 0; + } + + static boolean isWord(int ch) { + return isType(ch, WORD); + } +} diff --git a/test/java/util/regex/POSIX_Unicode.java b/test/java/util/regex/POSIX_Unicode.java new file mode 100644 index 0000000000000000000000000000000000000000..da691fe6b57aab6bdadbfa8164faa207c81b8672 --- /dev/null +++ b/test/java/util/regex/POSIX_Unicode.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.HashMap; +import java.util.Locale; + +final public class POSIX_Unicode { + + public static boolean isAlpha(int ch) { + return Character.isAlphabetic(ch); + } + + public static boolean isLower(int ch) { + return Character.isLowerCase(ch); + } + + public static boolean isUpper(int ch) { + return Character.isUpperCase(ch); + } + + // \p{Whitespace} + public static boolean isSpace(int ch) { + return ((((1 << Character.SPACE_SEPARATOR) | + (1 << Character.LINE_SEPARATOR) | + (1 << Character.PARAGRAPH_SEPARATOR)) >> Character.getType(ch)) & 1) + != 0 || + (ch >= 0x9 && ch <= 0xd) || + (ch == 0x85); + } + + // \p{gc=Control} + public static boolean isCntrl(int ch) { + return Character.getType(ch) == Character.CONTROL; + } + + // \p{gc=Punctuation} + public static boolean isPunct(int ch) { + return ((((1 << Character.CONNECTOR_PUNCTUATION) | + (1 << Character.DASH_PUNCTUATION) | + (1 << Character.START_PUNCTUATION) | + (1 << Character.END_PUNCTUATION) | + (1 << Character.OTHER_PUNCTUATION) | + (1 << Character.INITIAL_QUOTE_PUNCTUATION) | + (1 << Character.FINAL_QUOTE_PUNCTUATION)) >> Character.getType(ch)) & 1) + != 0; + } + + // \p{gc=Decimal_Number} + // \p{Hex_Digit} -> PropList.txt: Hex_Digit + public static boolean isHexDigit(int ch) { + return Character.isDigit(ch) || + (ch >= 0x0030 && ch <= 0x0039) || + (ch >= 0x0041 && ch <= 0x0046) || + (ch >= 0x0061 && ch <= 0x0066) || + (ch >= 0xFF10 && ch <= 0xFF19) || + (ch >= 0xFF21 && ch <= 0xFF26) || + (ch >= 0xFF41 && ch <= 0xFF46); + } + + // \p{gc=Decimal_Number} + public static boolean isDigit(int ch) { + return Character.isDigit(ch); + }; + + // \p{alpha} + // \p{digit} + public static boolean isAlnum(int ch) { + return Character.isAlphabetic(ch) || Character.isDigit(ch); + } + + // \p{Whitespace} -- + // [\N{LF} \N{VT} \N{FF} \N{CR} \N{NEL} -> 0xa, 0xb, 0xc, 0xd, 0x85 + // \p{gc=Line_Separator} + // \p{gc=Paragraph_Separator}] + public static boolean isBlank(int ch) { + int type = Character.getType(ch); + return isSpace(ch) && + ch != 0xa & ch != 0xb && ch !=0xc && ch != 0xd && ch != 0x85 && + type != Character.LINE_SEPARATOR && + type != Character.PARAGRAPH_SEPARATOR; + } + + // [^ + // \p{space} + // \p{gc=Control} + // \p{gc=Surrogate} + // \p{gc=Unassigned}] + public static boolean isGraph(int ch) { + int type = Character.getType(ch); + return !(isSpace(ch) || + Character.CONTROL == type || + Character.SURROGATE == type || + Character.UNASSIGNED == type); + } + + // \p{graph} + // \p{blank} + // -- \p{cntrl} + public static boolean isPrint(int ch) { + return (isGraph(ch) || isBlank(ch)) && !isCntrl(ch); + } + + // PropList.txt:Noncharacter_Code_Point + public static boolean isNoncharacterCodePoint(int ch) { + return (ch & 0xfffe) == 0xfffe || (ch >= 0xfdd0 && ch <= 0xfdef); + } + + // \p{alpha} + // \p{gc=Mark} + // \p{digit} + // \p{gc=Connector_Punctuation} + public static boolean isWord(int ch) { + return isAlpha(ch) || + ((((1 << Character.NON_SPACING_MARK) | + (1 << Character.ENCLOSING_MARK) | + (1 << Character.COMBINING_SPACING_MARK) | + (1 << Character.CONNECTOR_PUNCTUATION)) >> Character.getType(ch)) & 1) + != 0 || + isDigit(ch); + } +} diff --git a/test/java/util/regex/RegExTest.java b/test/java/util/regex/RegExTest.java index b444ab4816cf4a352a01f9a55f7c423701e90c2a..10644e491aa11bf89aaebe71bb0642fb7cfa2edf 100644 --- a/test/java/util/regex/RegExTest.java +++ b/test/java/util/regex/RegExTest.java @@ -32,7 +32,7 @@ * 4872664 4803179 4892980 4900747 4945394 4938995 4979006 4994840 4997476 * 5013885 5003322 4988891 5098443 5110268 6173522 4829857 5027748 6376940 * 6358731 6178785 6284152 6231989 6497148 6486934 6233084 6504326 6635133 - * 6350801 6676425 6878475 6919132 6931676 6948903 7014645 + * 6350801 6676425 6878475 6919132 6931676 6948903 7014645 7039066 */ import java.util.regex.*; @@ -137,6 +137,7 @@ public class RegExTest { nonBmpClassComplementTest(); unicodePropertiesTest(); unicodeHexNotationTest(); + unicodeClassesTest(); if (failure) throw new RuntimeException("Failure in the RE handling."); else @@ -3656,5 +3657,146 @@ public class RegExTest { failCount++; } report("unicodeHexNotation"); - } + } + + private static void unicodeClassesTest() throws Exception { + + Matcher lower = Pattern.compile("\\p{Lower}").matcher(""); + Matcher upper = Pattern.compile("\\p{Upper}").matcher(""); + Matcher ASCII = Pattern.compile("\\p{ASCII}").matcher(""); + Matcher alpha = Pattern.compile("\\p{Alpha}").matcher(""); + Matcher digit = Pattern.compile("\\p{Digit}").matcher(""); + Matcher alnum = Pattern.compile("\\p{Alnum}").matcher(""); + Matcher punct = Pattern.compile("\\p{Punct}").matcher(""); + Matcher graph = Pattern.compile("\\p{Graph}").matcher(""); + Matcher print = Pattern.compile("\\p{Print}").matcher(""); + Matcher blank = Pattern.compile("\\p{Blank}").matcher(""); + Matcher cntrl = Pattern.compile("\\p{Cntrl}").matcher(""); + Matcher xdigit = Pattern.compile("\\p{XDigit}").matcher(""); + Matcher space = Pattern.compile("\\p{Space}").matcher(""); + Matcher bound = Pattern.compile("\\b").matcher(""); + Matcher word = Pattern.compile("\\w++").matcher(""); + // UNICODE_CHARACTER_CLASS + Matcher lowerU = Pattern.compile("\\p{Lower}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher upperU = Pattern.compile("\\p{Upper}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher ASCIIU = Pattern.compile("\\p{ASCII}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher alphaU = Pattern.compile("\\p{Alpha}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher digitU = Pattern.compile("\\p{Digit}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher alnumU = Pattern.compile("\\p{Alnum}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher punctU = Pattern.compile("\\p{Punct}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher graphU = Pattern.compile("\\p{Graph}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher printU = Pattern.compile("\\p{Print}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher blankU = Pattern.compile("\\p{Blank}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher cntrlU = Pattern.compile("\\p{Cntrl}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher xdigitU = Pattern.compile("\\p{XDigit}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher spaceU = Pattern.compile("\\p{Space}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher boundU = Pattern.compile("\\b", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher wordU = Pattern.compile("\\w", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + // embedded flag (?U) + Matcher lowerEU = Pattern.compile("(?U)\\p{Lower}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher graphEU = Pattern.compile("(?U)\\p{Graph}", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher wordEU = Pattern.compile("(?U)\\w", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + + Matcher bwb = Pattern.compile("\\b\\w\\b").matcher(""); + Matcher bwbU = Pattern.compile("\\b\\w++\\b", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + Matcher bwbEU = Pattern.compile("(?U)\\b\\w++\\b", Pattern.UNICODE_CHARACTER_CLASS).matcher(""); + // properties + Matcher lowerP = Pattern.compile("\\p{IsLowerCase}").matcher(""); + Matcher upperP = Pattern.compile("\\p{IsUpperCase}").matcher(""); + Matcher titleP = Pattern.compile("\\p{IsTitleCase}").matcher(""); + Matcher letterP = Pattern.compile("\\p{IsLetter}").matcher(""); + Matcher alphaP = Pattern.compile("\\p{IsAlphabetic}").matcher(""); + Matcher ideogP = Pattern.compile("\\p{IsIdeographic}").matcher(""); + Matcher cntrlP = Pattern.compile("\\p{IsControl}").matcher(""); + Matcher spaceP = Pattern.compile("\\p{IsWhiteSpace}").matcher(""); + Matcher definedP = Pattern.compile("\\p{IsAssigned}").matcher(""); + Matcher nonCCPP = Pattern.compile("\\p{IsNoncharacterCodePoint}").matcher(""); + + // javaMethod + Matcher lowerJ = Pattern.compile("\\p{javaLowerCase}").matcher(""); + Matcher upperJ = Pattern.compile("\\p{javaUpperCase}").matcher(""); + Matcher alphaJ = Pattern.compile("\\p{javaAlphabetic}").matcher(""); + Matcher ideogJ = Pattern.compile("\\p{javaIdeographic}").matcher(""); + + for (int cp = 1; cp < 0x30000; cp++) { + String str = new String(Character.toChars(cp)); + int type = Character.getType(cp); + if (// lower + POSIX_ASCII.isLower(cp) != lower.reset(str).matches() || + Character.isLowerCase(cp) != lowerU.reset(str).matches() || + Character.isLowerCase(cp) != lowerP.reset(str).matches() || + Character.isLowerCase(cp) != lowerEU.reset(str).matches()|| + Character.isLowerCase(cp) != lowerJ.reset(str).matches()|| + // upper + POSIX_ASCII.isUpper(cp) != upper.reset(str).matches() || + POSIX_Unicode.isUpper(cp) != upperU.reset(str).matches() || + Character.isUpperCase(cp) != upperP.reset(str).matches() || + Character.isUpperCase(cp) != upperJ.reset(str).matches() || + // alpha + POSIX_ASCII.isAlpha(cp) != alpha.reset(str).matches() || + POSIX_Unicode.isAlpha(cp) != alphaU.reset(str).matches() || + Character.isAlphabetic(cp)!= alphaP.reset(str).matches() || + Character.isAlphabetic(cp)!= alphaJ.reset(str).matches() || + // digit + POSIX_ASCII.isDigit(cp) != digit.reset(str).matches() || + Character.isDigit(cp) != digitU.reset(str).matches() || + // alnum + POSIX_ASCII.isAlnum(cp) != alnum.reset(str).matches() || + POSIX_Unicode.isAlnum(cp) != alnumU.reset(str).matches() || + // punct + POSIX_ASCII.isPunct(cp) != punct.reset(str).matches() || + POSIX_Unicode.isPunct(cp) != punctU.reset(str).matches() || + // graph + POSIX_ASCII.isGraph(cp) != graph.reset(str).matches() || + POSIX_Unicode.isGraph(cp) != graphU.reset(str).matches() || + POSIX_Unicode.isGraph(cp) != graphEU.reset(str).matches()|| + // blank + POSIX_ASCII.isType(cp, POSIX_ASCII.BLANK) + != blank.reset(str).matches() || + POSIX_Unicode.isBlank(cp) != blankU.reset(str).matches() || + // print + POSIX_ASCII.isPrint(cp) != print.reset(str).matches() || + POSIX_Unicode.isPrint(cp) != printU.reset(str).matches() || + // cntrl + POSIX_ASCII.isCntrl(cp) != cntrl.reset(str).matches() || + POSIX_Unicode.isCntrl(cp) != cntrlU.reset(str).matches() || + (Character.CONTROL == type) != cntrlP.reset(str).matches() || + // hexdigit + POSIX_ASCII.isHexDigit(cp) != xdigit.reset(str).matches() || + POSIX_Unicode.isHexDigit(cp) != xdigitU.reset(str).matches() || + // space + POSIX_ASCII.isSpace(cp) != space.reset(str).matches() || + POSIX_Unicode.isSpace(cp) != spaceU.reset(str).matches() || + POSIX_Unicode.isSpace(cp) != spaceP.reset(str).matches() || + // word + POSIX_ASCII.isWord(cp) != word.reset(str).matches() || + POSIX_Unicode.isWord(cp) != wordU.reset(str).matches() || + POSIX_Unicode.isWord(cp) != wordEU.reset(str).matches()|| + // bwordb + POSIX_ASCII.isWord(cp) != bwb.reset(str).matches() || + POSIX_Unicode.isWord(cp) != bwbU.reset(str).matches() || + // properties + Character.isTitleCase(cp) != titleP.reset(str).matches() || + Character.isLetter(cp) != letterP.reset(str).matches()|| + Character.isIdeographic(cp) != ideogP.reset(str).matches() || + Character.isIdeographic(cp) != ideogJ.reset(str).matches() || + (Character.UNASSIGNED == type) == definedP.reset(str).matches() || + POSIX_Unicode.isNoncharacterCodePoint(cp) != nonCCPP.reset(str).matches()) + failCount++; + } + + // bounds/word align + twoFindIndexes(" \u0180sherman\u0400 ", bound, 1, 10); + if (!bwbU.reset("\u0180sherman\u0400").matches()) + failCount++; + twoFindIndexes(" \u0180sh\u0345erman\u0400 ", bound, 1, 11); + if (!bwbU.reset("\u0180sh\u0345erman\u0400").matches()) + failCount++; + twoFindIndexes(" \u0724\u0739\u0724 ", bound, 1, 4); + if (!bwbU.reset("\u0724\u0739\u0724").matches()) + failCount++; + if (!bwbEU.reset("\u0724\u0739\u0724").matches()) + failCount++; + report("unicodePredefinedClasses"); + } } diff --git a/test/javax/swing/JFileChooser/7036025/bug7036025.java b/test/javax/swing/JFileChooser/7036025/bug7036025.java new file mode 100644 index 0000000000000000000000000000000000000000..dd7b003a01f9c59c59137787d668f9f59025a439 --- /dev/null +++ b/test/javax/swing/JFileChooser/7036025/bug7036025.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 7036025 + @summary java.security.AccessControlException when creating JFileChooser in signed applet + @author Pavel Porvatov + @run main/othervm/policy=security.policy bug7036025 +*/ + +import javax.swing.*; +import java.io.File; + +public class bug7036025 { + public static final String DIR = "c:/temp"; + + public static void main(String[] args) throws Exception { + String systemLookAndFeelClassName = UIManager.getSystemLookAndFeelClassName(); + + if (!systemLookAndFeelClassName.toLowerCase().contains("windows")) { + System.out.println("The test is only for Windows OS."); + + return; + } + + File file = new File(DIR); + + if (!file.exists()) { + if (!file.mkdir()) { + throw new RuntimeException("Cannot create " + DIR); + } + + file.deleteOnExit(); + } + + UIManager.setLookAndFeel(systemLookAndFeelClassName); + + new JFileChooser(file); + + System.out.println("Test passed for LookAndFeel " + UIManager.getLookAndFeel().getName()); + } +} diff --git a/test/javax/swing/JFileChooser/7036025/security.policy b/test/javax/swing/JFileChooser/7036025/security.policy new file mode 100644 index 0000000000000000000000000000000000000000..57e0bd2af52160e07b3f99c351cc7b46a81b252f --- /dev/null +++ b/test/javax/swing/JFileChooser/7036025/security.policy @@ -0,0 +1,5 @@ +grant { + permission java.io.FilePermission "C:\\temp\\*", "read"; + permission java.io.FilePermission "C:\\temp", "read,write,delete"; + permission java.util.PropertyPermission "*", "read"; +}; diff --git a/test/javax/swing/JLabel/6596966/bug6596966.java b/test/javax/swing/JLabel/6596966/bug6596966.java index 5cf0110f70008f7289fc777f9152fcd8581a8ff5..5e94459bcb721dc845dca7ebe604eae9cdc9d080 100644 --- a/test/javax/swing/JLabel/6596966/bug6596966.java +++ b/test/javax/swing/JLabel/6596966/bug6596966.java @@ -24,13 +24,13 @@ /* @test @bug 6596966 @summary Some JFileChooser mnemonics do not work with sticky keys - * @library ../../regtesthelpers - * @build Util @run main bug6596966 @author Pavel Porvatov */ +import sun.awt.SunToolkit; + import javax.swing.*; import java.awt.*; import java.awt.event.KeyEvent; @@ -44,6 +44,7 @@ public class bug6596966 { public static void main(String[] args) throws Exception { Robot robot = new Robot(); + SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { @@ -68,17 +69,17 @@ public class bug6596966 { } }); - Util.blockTillDisplayed(frame); + toolkit.realSync(); robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_L); - robot.waitForIdle(); + toolkit.realSync(); - Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED, + toolkit.getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED, EventQueue.getMostRecentEventTime(), 0, KeyEvent.VK_L, 'L')); - robot.waitForIdle(); + toolkit.realSync(); try { SwingUtilities.invokeAndWait(new Runnable() { diff --git a/test/sun/java2d/pipe/Test7027667.java b/test/sun/java2d/pipe/Test7027667.java index 08f478f60b132937fca5175bd87b99925606216b..e30c72c0504421020dd365a6510ea75630e29f66 100644 --- a/test/sun/java2d/pipe/Test7027667.java +++ b/test/sun/java2d/pipe/Test7027667.java @@ -23,7 +23,7 @@ /** * @test - * @bug 7027667, 7023591 + * @bug 7027667 7023591 7037091 * * @summary Verifies that aa clipped rectangles are drawn, not filled. * diff --git a/test/sun/java2d/pisces/Test7036754.java b/test/sun/java2d/pisces/Test7036754.java new file mode 100644 index 0000000000000000000000000000000000000000..1dd39ddc8b94a520c104b1cb4b3726eab9403c6a --- /dev/null +++ b/test/sun/java2d/pisces/Test7036754.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7036754 + * + * @summary Verifies that there are no non-finite numbers when stroking + * certain quadratic curves. + * + * @author Jim Graham + * @run main Test7036754 + */ + +import java.awt.*; +import java.awt.geom.*; + +public class Test7036754 { + public static void main(String argv[]) { + Shape s = new QuadCurve2D.Float(839.24677f, 508.97888f, + 839.2953f, 508.97122f, + 839.3438f, 508.96353f); + s = new BasicStroke(10f).createStrokedShape(s); + float nsegs[] = {2, 2, 4, 6, 0}; + float coords[] = new float[6]; + PathIterator pi = s.getPathIterator(null); + while (!pi.isDone()) { + int type = pi.currentSegment(coords); + for (int i = 0; i < nsegs[type]; i++) { + float c = coords[i]; + if (Float.isNaN(c) || Float.isInfinite(c)) { + throw new RuntimeException("bad value in stroke"); + } + } + pi.next(); + } + } +} diff --git a/test/sun/nio/cs/StrCodingBenchmarkUTF8.java b/test/sun/nio/cs/StrCodingBenchmarkUTF8.java new file mode 100644 index 0000000000000000000000000000000000000000..eecc6ec2d1de9d4bfb5fd937cdf085e080d8cfa8 --- /dev/null +++ b/test/sun/nio/cs/StrCodingBenchmarkUTF8.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.*; +import java.nio.*; +import java.nio.charset.*; + +public class StrCodingBenchmarkUTF8 { + + public static void main(String[] args) throws Throwable { + + final int itrs = Integer.getInteger("iterations", 100000); + final int size = 2048; + final int subsize = Integer.getInteger("subsize", 128); + final Random rnd = new Random(); + final int maxchar = 0x7f; + + Charset charset = Charset.forName("UTF-8"); + final String csn = charset.name(); + final Charset cs = charset; + + int[] starts = new int[] { 0, 0x80, 0x800, 0x10000}; + for (int nb = 1; nb <= 4; nb++) { + + final CharsetEncoder enc = cs.newEncoder(); + + char[] cc = new char[size]; + int i = 0; + while (i < size - 3) { + i += Character.toChars(starts[nb - 1] + rnd.nextInt(maxchar), cc, i); + } + + final String string = new String(cc); + final byte[] bytes = string.getBytes(cs); + + System.out.printf("%n--------%s[nb=%d]---------%n", csn, nb); + int sz = 12; + while (sz < size) { + System.out.printf(" [len=%d]%n", sz); + final byte[] bs = Arrays.copyOf(bytes, sz); + final String str = new String(bs, csn); + StrCodingBenchmark.Job[] jobs = { + new StrCodingBenchmark.Job("String decode: csn") { + public void work() throws Throwable { + for (int i = 0; i < itrs; i++) + new String(bs, csn); + }}, + + new StrCodingBenchmark.Job("String decode: cs") { + public void work() throws Throwable { + for (int i = 0; i < itrs; i++) + new String(bs, cs); + }}, + + new StrCodingBenchmark.Job("String encode: csn") { + public void work() throws Throwable { + for (int i = 0; i < itrs; i++) + str.getBytes(csn); + }}, + + new StrCodingBenchmark.Job("String encode: cs") { + public void work() throws Throwable { + for (int i = 0; i < itrs; i++) + str.getBytes(cs); + }}, + }; + StrCodingBenchmark.time(StrCodingBenchmark.filter(null, jobs)); + sz <<= 1; + } + } + } +} diff --git a/test/sun/nio/cs/TestStringCoding.java b/test/sun/nio/cs/TestStringCoding.java index 4ab707310358ab354463f4250e1eeebe5f777cf9..c4837e956ae14a465a9bccb23b882cbd0bc0ba71 100644 --- a/test/sun/nio/cs/TestStringCoding.java +++ b/test/sun/nio/cs/TestStringCoding.java @@ -24,7 +24,7 @@ */ /* @test - @bug 6636323 6636319 + @bug 6636323 6636319 7040220 @summary Test if StringCoding and NIO result have the same de/encoding result * @run main/othervm/timeout=2000 TestStringCoding */ @@ -111,6 +111,8 @@ public class TestStringCoding { //encode unmappable surrogates if (enc instanceof sun.nio.cs.ArrayEncoder && cs.contains(Charset.forName("ASCII"))) { + if (cs.name().equals("UTF-8")) // utf8 handles surrogates + return; enc.replaceWith(new byte[] { (byte)'A'}); sun.nio.cs.ArrayEncoder cae = (sun.nio.cs.ArrayEncoder)enc; diff --git a/test/sun/nio/cs/TestStringCodingUTF8.java b/test/sun/nio/cs/TestStringCodingUTF8.java new file mode 100644 index 0000000000000000000000000000000000000000..fdc204849b7a9bb2035f2bb0f5aa543efea667ed --- /dev/null +++ b/test/sun/nio/cs/TestStringCodingUTF8.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 7040220 + @summary Test if StringCoding and NIO result have the same de/encoding result for UTF-8 + * @run main/othervm/timeout=2000 TestStringCodingUTF8 + */ + +import java.util.*; +import java.nio.*; +import java.nio.charset.*; + +public class TestStringCodingUTF8 { + public static void main(String[] args) throws Throwable { + test(); + // security manager on + System.setSecurityManager(new PermissiveSecurityManger()); + test(); + } + + static void test() throws Throwable { + Charset cs = Charset.forName("UTF-8"); + char[] bmp = new char[0x10000]; + for (int i = 0; i < 0x10000; i++) { + bmp[i] = (char)i; + } + test(cs, bmp, 0, bmp.length); + + ArrayList list = new ArrayList<>(0x20000); + for (int i = 0; i < 0x20000; i++) { + list.add(i, i); + } + Collections.shuffle(list); + int j = 0; + char[] bmpsupp = new char[0x30000]; + for (int i = 0; i < 0x20000; i++) { + j += Character.toChars(list.get(i), bmpsupp, j); + } + assert (j == bmpsupp.length); + test(cs, bmpsupp, 0, bmpsupp.length); + + // randomed "off" and "len" on shuffled data + Random rnd = new Random(); + int maxlen = 1000; + int itr = 5000; + for (int i = 0; i < itr; i++) { + int off = rnd.nextInt(bmpsupp.length - maxlen); + int len = rnd.nextInt(maxlen); + test(cs, bmpsupp, off, len); + } + + // random length of bytes, test the edge corner case + for (int i = 0; i < itr; i++) { + byte[] ba = new byte[rnd.nextInt(maxlen)]; + rnd.nextBytes(ba); + //new String(csn); + if (!new String(ba, cs.name()).equals( + new String(decode(cs, ba, 0, ba.length)))) + throw new RuntimeException("new String(csn) failed"); + //new String(cs); + if (!new String(ba, cs).equals( + new String(decode(cs, ba, 0, ba.length)))) + throw new RuntimeException("new String(cs) failed"); + } + System.out.println("done!"); + } + + static void test(Charset cs, char[] ca, int off, int len) throws Throwable { + String str = new String(ca, off, len); + byte[] ba = encode(cs, ca, off, len); + + //getBytes(csn); + byte[] baStr = str.getBytes(cs.name()); + if (!Arrays.equals(ba, baStr)) + throw new RuntimeException("getBytes(csn) failed"); + + //getBytes(cs); + baStr = str.getBytes(cs); + if (!Arrays.equals(ba, baStr)) + throw new RuntimeException("getBytes(cs) failed"); + + //new String(csn); + if (!new String(ba, cs.name()).equals(new String(decode(cs, ba, 0, ba.length)))) + throw new RuntimeException("new String(csn) failed"); + + //new String(cs); + if (!new String(ba, cs).equals(new String(decode(cs, ba, 0, ba.length)))) + throw new RuntimeException("new String(cs) failed"); + } + + // copy/paste of the StringCoding.decode() + static char[] decode(Charset cs, byte[] ba, int off, int len) { + CharsetDecoder cd = cs.newDecoder(); + int en = (int)(len * cd.maxCharsPerByte()); + char[] ca = new char[en]; + if (len == 0) + return ca; + cd.onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE) + .reset(); + + ByteBuffer bb = ByteBuffer.wrap(ba, off, len); + CharBuffer cb = CharBuffer.wrap(ca); + try { + CoderResult cr = cd.decode(bb, cb, true); + if (!cr.isUnderflow()) + cr.throwException(); + cr = cd.flush(cb); + if (!cr.isUnderflow()) + cr.throwException(); + } catch (CharacterCodingException x) { + throw new Error(x); + } + return Arrays.copyOf(ca, cb.position()); + } + + // copy/paste of the StringCoding.encode() + static byte[] encode(Charset cs, char[] ca, int off, int len) { + CharsetEncoder ce = cs.newEncoder(); + int en = (int)(len * ce.maxBytesPerChar()); + byte[] ba = new byte[en]; + if (len == 0) + return ba; + ce.onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE) + .reset(); + ByteBuffer bb = ByteBuffer.wrap(ba); + CharBuffer cb = CharBuffer.wrap(ca, off, len); + try { + CoderResult cr = ce.encode(cb, bb, true); + if (!cr.isUnderflow()) + cr.throwException(); + cr = ce.flush(bb); + if (!cr.isUnderflow()) + cr.throwException(); + } catch (CharacterCodingException x) { + throw new Error(x); + } + return Arrays.copyOf(ba, bb.position()); + } + + static class PermissiveSecurityManger extends SecurityManager { + @Override public void checkPermission(java.security.Permission p) {} + } +} diff --git a/test/sun/nio/cs/TestUTF8.java b/test/sun/nio/cs/TestUTF8.java index 34a999fb28311bd56fa8685b51272f3acf025c1e..f339eae046b5a6134a6a7fb136984caf5f4af0f3 100644 --- a/test/sun/nio/cs/TestUTF8.java +++ b/test/sun/nio/cs/TestUTF8.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4486841 + * @bug 4486841 7040220 * @summary Test UTF-8 charset */ @@ -70,6 +70,32 @@ public class TestUTF8 { return dec.decode(bbf, cbf, true); } + // copy/paste of the StringCoding.decode() + static char[] decode(Charset cs, byte[] ba, int off, int len) { + CharsetDecoder cd = cs.newDecoder(); + int en = (int)(len * cd.maxCharsPerByte()); + char[] ca = new char[en]; + if (len == 0) + return ca; + cd.onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE) + .reset(); + + ByteBuffer bb = ByteBuffer.wrap(ba, off, len); + CharBuffer cb = CharBuffer.wrap(ca); + try { + CoderResult cr = cd.decode(bb, cb, true); + if (!cr.isUnderflow()) + cr.throwException(); + cr = cd.flush(cb); + if (!cr.isUnderflow()) + cr.throwException(); + } catch (CharacterCodingException x) { + throw new Error(x); + } + return Arrays.copyOf(ca, cb.position()); + } + static byte[] encode(char[] cc, String csn, boolean testDirect) throws Exception { ByteBuffer bbf; @@ -142,7 +168,14 @@ public class TestUTF8 { bb = encode(cc, csn, true); ccO = decode(bb, csn, true); if (!Arrays.equals(cc, ccO)) { - System.out.printf(" (direct) failed"); + System.out.print(" (direct) failed"); + } + // String.getBytes()/toCharArray() goes to ArrayDe/Encoder path + if (!Arrays.equals(bb, new String(cc).getBytes(csn))) { + System.out.printf(" String.getBytes() failed"); + } + if (!Arrays.equals(cc, new String(bb, csn).toCharArray())) { + System.out.printf(" String.toCharArray() failed"); } System.out.println(); } @@ -168,6 +201,12 @@ public class TestUTF8 { if (!Arrays.equals(cc, ccO)) { System.out.printf(" decoding(direct) failed%n"); } + // new String(bb, csn).getBytes(csn) will not return + // the 6 bytes surrogates as in bb, so only test + // toCharArray() here. + if (!Arrays.equals(cc, new String(bb, csn).toCharArray())) { + System.out.printf(" String.toCharArray() failed"); + } } static void compare(String csn1, String csn2) throws Exception { @@ -274,6 +313,7 @@ public class TestUTF8 { static void checkMalformed(String csn) throws Exception { boolean failed = false; System.out.printf(" Check malformed <%s>...%n", csn); + Charset cs = Charset.forName(csn); for (boolean direct: new boolean[] {false, true}) { for (byte[] bins : malformed) { int mlen = bins[0]; @@ -285,10 +325,15 @@ public class TestUTF8 { ashex += Integer.toBinaryString((int)bin[i] & 0xff); } if (!cr.isMalformed()) { - System.out.printf(" FAIL(direct=%b): [%s] not malformed.\n", direct, ashex); + System.out.printf(" FAIL(direct=%b): [%s] not malformed.%n", direct, ashex); failed = true; } else if (cr.length() != mlen) { - System.out.printf(" FAIL(direct=%b): [%s] malformed[len=%d].\n", direct, ashex, cr.length()); + System.out.printf(" FAIL(direct=%b): [%s] malformed[len=%d].%n", direct, ashex, cr.length()); + failed = true; + } + if (!Arrays.equals(decode(cs, bin, 0, bin.length), + new String(bin, csn).toCharArray())) { + System.out.printf(" FAIL(new String(bb, %s)) failed%n", csn); failed = true; } } diff --git a/test/sun/security/jgss/spnego/NegTokenTargFields.java b/test/sun/security/jgss/spnego/NegTokenTargFields.java new file mode 100644 index 0000000000000000000000000000000000000000..b6efa27631801c9c1fc0cfd06797b02c690c6e67 --- /dev/null +++ b/test/sun/security/jgss/spnego/NegTokenTargFields.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7040151 + * @summary SPNEGO GSS code does not parse tokens in accordance to RFC 2478 + * @compile -XDignore.symbol.file NegTokenTargFields.java + * @run main NegTokenTargFields nomech + * @run main/fail NegTokenTargFields badorder + */ + +import sun.security.jgss.spnego.NegTokenTarg; + +public class NegTokenTargFields { + + // A hand-crafted NegTokenTarg with negResult and responseToken only + public static byte[] nomech = { + (byte)0xA1, (byte)0x0F, (byte)0x30, (byte)0x0D, + (byte)0xA0, (byte)0x03, (byte)0x0A, (byte)0x01, + (byte)0x02, (byte)0xA2, (byte)0x02, (byte)0x04, + (byte)0x00, (byte)0xA3, (byte)0x02, (byte)0x04, + (byte)0x00, + }; + + // A hand-crafted NegTokenTarg with negResult and supportedMech in wrong order + public static byte[] badorder = { + (byte)0xA1, (byte)0x1E, (byte)0x30, (byte)0x1C, + (byte)0xA1, (byte)0x0B, (byte)0x06, (byte)0x09, + (byte)0x2A, (byte)0x86, (byte)0x48, (byte)0x86, + (byte)0xF7, (byte)0x12, (byte)0x01, (byte)0x02, + (byte)0x02, (byte)0xA0, (byte)0x03, (byte)0x0A, + (byte)0x01, (byte)0x00, (byte)0xA2, (byte)0x03, + (byte)0x04, (byte)0x01, (byte)0x00, (byte)0xA3, + (byte)0x03, (byte)0x04, (byte)0x01, (byte)0x00, + }; + + public static void main(String[] args) throws Exception { + byte[] buf = (byte[])NegTokenTargFields.class.getField(args[0]).get(null); + new NegTokenTarg(buf); + } +} diff --git a/test/sun/security/krb5/auto/BadKdc.java b/test/sun/security/krb5/auto/BadKdc.java index 0b175129d1f5b2ed3b68c8701a30f0317945ac8a..55a4d9926f24fa287fc2ab4d723ddd01929836c1 100644 --- a/test/sun/security/krb5/auto/BadKdc.java +++ b/test/sun/security/krb5/auto/BadKdc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,8 +22,14 @@ */ import java.io.*; +import java.net.BindException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.security.auth.login.LoginException; +import sun.security.krb5.Asn1Exception; import sun.security.krb5.Config; public class BadKdc { @@ -34,8 +40,51 @@ public class BadKdc { static final Pattern re = Pattern.compile( ">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., " + "timeout=(\\d)000,"); + + /* + * There are several cases this test fails: + * + * 1. The random selected port is used by another process. No good way to + * prevent this happening, coz krb5.conf must be written before KDC starts. + * There are two different outcomes: + * + * a. Cannot start the KDC. A BindException thrown. + * b. When trying to access a non-existing KDC, a response is received! + * Most likely a Asn1Exception thrown + * + * 2. Even if a KDC is started, and more than 20 seconds pass by, a timeout + * can still happens for the first UDP request. In fact, the KDC did not + * received it at all. This happens on almost all platforms, especially + * solaris-i586 and solaris-x64. + * + * To avoid them: + * + * 1. Catch those exceptions and ignore + * + * 2. a. Make the timeout longer? useless + * b. Read the output carefully, if there is a timeout, it's OK. + * Just make sure the retries times and KDCs are correct. + * This is tough. + * c. Feed the KDC a UDP packet first. The current "solution". + */ public static void go(int[]... expected) throws Exception { + try { + go0(expected); + } catch (BindException be) { + System.out.println("The random port is used by another process"); + } catch (LoginException le) { + Throwable cause = le.getCause(); + if (cause instanceof Asn1Exception) { + System.out.println("Bad packet possibly from another process"); + return; + } + throw le; + } + } + + public static void go0(int[]... expected) + throws Exception { System.setProperty("sun.security.krb5.debug", "true"); // Make sure KDCs' ports starts with 1 and 2 and 3, @@ -78,20 +127,39 @@ public class BadKdc { KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, p, true); k.addPrincipal(OneKDC.USER, OneKDC.PASS); k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); + // Feed a packet to newly started KDC to warm it up + System.err.println("-------- IGNORE THIS ERROR MESSAGE --------"); + new DatagramSocket().send( + new DatagramPacket("Hello".getBytes(), 5, + InetAddress.getByName(OneKDC.KDCHOST), p)); return k; } + private static void test(int... expected) throws Exception { + ByteArrayOutputStream bo = new ByteArrayOutputStream(); + try { + test0(bo, expected); + } catch (Exception e) { + System.out.println("----------------- ERROR -----------------"); + System.out.println(new String(bo.toByteArray())); + System.out.println("--------------- ERROR END ---------------"); + throw e; + } + } + /** * One round of test for max_retries and timeout. - * @param timeout the expected timeout * @param expected the expected kdc# timeout kdc# timeout... */ - private static void test(int... expected) throws Exception { - ByteArrayOutputStream bo = new ByteArrayOutputStream(); + private static void test0(ByteArrayOutputStream bo, int... expected) + throws Exception { PrintStream oldout = System.out; System.setOut(new PrintStream(bo)); - Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - System.setOut(oldout); + try { + Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + } finally { + System.setOut(oldout); + } String[] lines = new String(bo.toByteArray()).split("\n"); System.out.println("----------------- TEST -----------------"); diff --git a/test/sun/security/krb5/auto/Context.java b/test/sun/security/krb5/auto/Context.java index 676042ba993dd04fe9fa46a66d81d9ee95ec6ab5..1739f876f08714b4c626ab550a63856b027110e6 100644 --- a/test/sun/security/krb5/auto/Context.java +++ b/test/sun/security/krb5/auto/Context.java @@ -44,6 +44,7 @@ import com.sun.security.jgss.InquireType; import com.sun.security.jgss.AuthorizationDataEntry; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import javax.security.auth.kerberos.KeyTab; /** * Context of a JGSS subject, encapsulating Subject and GSSContext. @@ -107,15 +108,19 @@ public class Context { return out; } + public static Context fromUserPass( + String user, char[] pass, boolean storeKey) throws Exception { + return fromUserPass(null, user, pass, storeKey); + } /** * Logins with a username and a password, using Krb5LoginModule directly * @param storeKey true if key should be saved, used on acceptor side */ - public static Context fromUserPass(String user, char[] pass, boolean storeKey) - throws Exception { + public static Context fromUserPass(Subject s, + String user, char[] pass, boolean storeKey) throws Exception { Context out = new Context(); out.name = user; - out.s = new Subject(); + out.s = s == null ? new Subject() : s; Krb5LoginModule krb5 = new Krb5LoginModule(); Map map = new HashMap<>(); Map shared = new HashMap<>(); @@ -198,12 +203,25 @@ public class Context { * @throws java.lang.Exception */ public void startAsServer(final Oid mech) throws Exception { + startAsServer(null, mech); + } + + /** + * Starts as a server with the specified service name + * @param name the service name + * @param mech GSS mech + * @throws java.lang.Exception + */ + public void startAsServer(final String name, final Oid mech) throws Exception { doAs(new Action() { @Override public byte[] run(Context me, byte[] dummy) throws Exception { GSSManager m = GSSManager.getInstance(); me.x = (ExtendedGSSContext)m.createContext(m.createCredential( - null, + name == null ? null : + (name.indexOf('@') < 0 ? + m.createName(name, null) : + m.createName(name, GSSName.NT_HOSTBASED_SERVICE)), GSSCredential.INDEFINITE_LIFETIME, mech, GSSCredential.ACCEPT_ONLY)); @@ -229,6 +247,14 @@ public class Context { return x; } + /** + * Accesses the internal subject. + * @return the subject + */ + public Subject s() { + return s; + } + /** * Disposes the GSSContext within * @throws org.ietf.jgss.GSSException @@ -297,7 +323,7 @@ public class Context { } catch (Exception e) { ;// Don't care } - System.out.println("====================================="); + System.out.println("====== Private Credentials Set ======"); for (Object o : s.getPrivateCredentials()) { System.out.println(" " + o.getClass()); if (o instanceof KerberosTicket) { @@ -315,6 +341,8 @@ public class Context { for (Object k : map.keySet()) { System.out.println(" " + k + ": " + map.get(k)); } + } else { + System.out.println(" " + o); } } if (x != null && x instanceof ExtendedGSSContext) { diff --git a/test/sun/security/krb5/auto/DynamicKeytab.java b/test/sun/security/krb5/auto/DynamicKeytab.java new file mode 100644 index 0000000000000000000000000000000000000000..2565d61d47ee7fa261b314448ddf1cd0a38d6f5b --- /dev/null +++ b/test/sun/security/krb5/auto/DynamicKeytab.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6894072 + * @run main/othervm DynamicKeytab + * @summary always refresh keytab + */ + +import java.io.File; +import java.io.FileOutputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import org.ietf.jgss.GSSException; +import sun.security.jgss.GSSUtil; +import sun.security.krb5.KrbException; +import sun.security.krb5.internal.Krb5; + +public class DynamicKeytab { + + Context c, s; + public static void main(String[] args) + throws Exception { + new DynamicKeytab().go(); + } + + void go() throws Exception { + OneKDC k = new OneKDC(null); + k.writeJAASConf(); + + Files.delete(Paths.get(OneKDC.KTAB)); + + // Starts with no keytab + c = Context.fromJAAS("client"); + s = Context.fromJAAS("com.sun.security.jgss.krb5.accept"); + + // Test 1: read new key 1 from keytab + k.addPrincipal(OneKDC.SERVER, "pass1".toCharArray()); + k.writeKtab(OneKDC.KTAB); + connect(); + + // Test 2: service key cached, find 1 in keytab (now contains 1 and 2) + k.addPrincipal(OneKDC.SERVER, "pass2".toCharArray()); + k.appendKtab(OneKDC.KTAB); + connect(); + + // Test 3: re-login. Now find 2 in keytab + c = Context.fromJAAS("client"); + connect(); + + // Test 4: re-login, KDC use 3 this time. + c = Context.fromJAAS("client"); + // Put 3 and 4 into keytab but keep the real key back to 3. + k.addPrincipal(OneKDC.SERVER, "pass3".toCharArray()); + k.appendKtab(OneKDC.KTAB); + k.addPrincipal(OneKDC.SERVER, "pass4".toCharArray()); + k.appendKtab(OneKDC.KTAB); + k.addPrincipal(OneKDC.SERVER, "pass3".toCharArray()); + connect(); + + // Test 5: invalid keytab file, should ignore + try (FileOutputStream fos = new FileOutputStream(OneKDC.KTAB)) { + fos.write("BADBADBAD".getBytes()); + } + connect(); + + // Test 6: delete keytab file, identical to revoke all + Files.delete(Paths.get(OneKDC.KTAB)); + try { + connect(); + throw new Exception("Should not success"); + } catch (GSSException gsse) { + System.out.println(gsse); + KrbException ke = (KrbException)gsse.getCause(); + // KrbApReq.authenticate(*) if (dkey == null)... + // This should have been Krb5.KRB_AP_ERR_NOKEY + if (ke.returnCode() != Krb5.API_INVALID_ARG) { + throw new Exception("Not expected failure code: " + + ke.returnCode()); + } + } + + // Test 7: 3 revoked, should fail (now contains only 5) + k.addPrincipal(OneKDC.SERVER, "pass5".toCharArray()); + k.writeKtab(OneKDC.KTAB); // overwrite keytab, which means + // old key is revoked + try { + connect(); + throw new Exception("Should not success"); + } catch (GSSException gsse) { + System.out.println(gsse); + KrbException ke = (KrbException)gsse.getCause(); + if (ke.returnCode() != Krb5.KRB_AP_ERR_BADKEYVER) { + throw new Exception("Not expected failure code: " + + ke.returnCode()); + } + } + + // Test 8: an empty KDC means revoke all + KDC.create("EMPTY.REALM").writeKtab(OneKDC.KTAB); + try { + connect(); + throw new Exception("Should not success"); + } catch (GSSException gsse) { + System.out.println(gsse); + KrbException ke = (KrbException)gsse.getCause(); + // KrbApReq.authenticate(*) if (dkey == null)... + // This should have been Krb5.KRB_AP_ERR_NOKEY + if (ke.returnCode() != Krb5.API_INVALID_ARG) { + throw new Exception("Not expected failure code: " + + ke.returnCode()); + } + } + } + + void connect() throws Exception { + Thread.sleep(2000); // make sure ktab timestamp is different + c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID); + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + Context.handshake(c, s); + } +} diff --git a/test/sun/security/krb5/auto/KDC.java b/test/sun/security/krb5/auto/KDC.java index 8d01dd346cdf3a2bd39c538719064e1e6105f41b..45a3d530c4b57a0b1a4b34f787393aac9e82e1e5 100644 --- a/test/sun/security/krb5/auto/KDC.java +++ b/test/sun/security/krb5/auto/KDC.java @@ -228,7 +228,33 @@ public class KDC { } /** - * Write all principals' keys from multiple KDCsinto one keytab file. + * Writes or appends KDC keys into a keytab. See doc for writeMultiKtab. + * @param append true if append, otherwise, overwrite. + */ + private static void writeKtab0(String tab, boolean append, KDC... kdcs) + throws IOException, KrbException { + KeyTab ktab = append ? KeyTab.getInstance(tab) : KeyTab.create(tab); + for (KDC kdc: kdcs) { + for (String name : kdc.passwords.keySet()) { + char[] pass = kdc.passwords.get(name); + int kvno = 0; + if (Character.isDigit(pass[pass.length-1])) { + kvno = pass[pass.length-1] - '0'; + } + ktab.addEntry(new PrincipalName(name, + name.indexOf('/') < 0 ? + PrincipalName.KRB_NT_UNKNOWN : + PrincipalName.KRB_NT_SRV_HST), + pass, + kvno, + true); + } + } + ktab.save(); + } + + /** + * Writes all principals' keys from multiple KDCs into one keytab file. * Note that the keys for the krbtgt principals will not be written. *

        * Attention: This method references krb5.conf settings. If you need to @@ -252,17 +278,16 @@ public class KDC { */ public static void writeMultiKtab(String tab, KDC... kdcs) throws IOException, KrbException { - KeyTab ktab = KeyTab.create(tab); - for (KDC kdc: kdcs) { - for (String name : kdc.passwords.keySet()) { - ktab.addEntry(new PrincipalName(name, - name.indexOf('/') < 0 ? - PrincipalName.KRB_NT_UNKNOWN : - PrincipalName.KRB_NT_SRV_HST), - kdc.passwords.get(name), -1, true); - } - } - ktab.save(); + writeKtab0(tab, false, kdcs); + } + + /** + * Appends all principals' keys from multiple KDCs to one keytab file. + * See writeMultiKtab for details. + */ + public static void appendMultiKtab(String tab, KDC... kdcs) + throws IOException, KrbException { + writeKtab0(tab, true, kdcs); } /** @@ -272,6 +297,13 @@ public class KDC { KDC.writeMultiKtab(tab, this); } + /** + * Appends keys in this KDC to a ktab. + */ + public void appendKtab(String tab) throws IOException, KrbException { + KDC.appendMultiKtab(tab, this); + } + /** * Adds a new principal to this realm with a given password. * @param user the principal's name. For a service principal, use the diff --git a/test/sun/security/krb5/auto/KeyTabCompat.java b/test/sun/security/krb5/auto/KeyTabCompat.java new file mode 100644 index 0000000000000000000000000000000000000000..f6763510fd261233e0dff38df26572917066c4b4 --- /dev/null +++ b/test/sun/security/krb5/auto/KeyTabCompat.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6894072 + * @compile -XDignore.symbol.file KeyTabCompat.java + * @run main/othervm KeyTabCompat + * @summary always refresh keytab + */ + +import javax.security.auth.kerberos.KerberosKey; +import sun.security.jgss.GSSUtil; + +/* + * There are 2 compat issues to check: + * + * 1. If there is only KerberosKeys in private credential set and no + * KerberosPrincipal. JAAS login should go on. + * 2. Even if KeyTab is used, user can still get KerberosKeys from + * private credentials set. + */ +public class KeyTabCompat { + + public static void main(String[] args) + throws Exception { + OneKDC kdc = new OneKDC("aes128-cts"); + kdc.writeJAASConf(); + kdc.addPrincipal(OneKDC.SERVER, "pass1".toCharArray()); + kdc.writeKtab(OneKDC.KTAB); + + Context c, s; + + // Part 1 + c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + s = Context.fromUserPass(OneKDC.USER2, OneKDC.PASS2, true); + + s.s().getPrincipals().clear(); + + c.startAsClient(OneKDC.USER2, GSSUtil.GSS_KRB5_MECH_OID); + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + + Context.handshake(c, s); + + // Part 2 + c = Context.fromJAAS("client"); + s = Context.fromJAAS("server"); + + c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID); + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + s.status(); + + if (s.s().getPrivateCredentials(KerberosKey.class).size() != 1) { + throw new Exception("There should be one KerberosKey"); + } + + Thread.sleep(2000); // make sure ktab timestamp is different + + kdc.addPrincipal(OneKDC.SERVER, "pass2".toCharArray()); + kdc.writeKtab(OneKDC.KTAB); + + Context.handshake(c, s); + s.status(); + + if (s.s().getPrivateCredentials(KerberosKey.class).size() != 1) { + throw new Exception("There should be only one KerberosKey"); + } + + } +} diff --git a/test/sun/security/krb5/auto/LoginModuleOptions.java b/test/sun/security/krb5/auto/LoginModuleOptions.java index a6dd33b80298782084c53b7d2ebaeb81c5b876c6..2c77451d74875b63079f8533eecda8a10389369e 100644 --- a/test/sun/security/krb5/auto/LoginModuleOptions.java +++ b/test/sun/security/krb5/auto/LoginModuleOptions.java @@ -28,7 +28,6 @@ * @summary Krb5LoginModule a little too restrictive, and the doc is not clear. */ import com.sun.security.auth.module.Krb5LoginModule; -import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.security.auth.Subject; @@ -36,7 +35,6 @@ import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; public class LoginModuleOptions { @@ -61,10 +59,12 @@ public class LoginModuleOptions { // 1. ccache -> keytab login(null, "useTicketCache", "true", "ticketCache", "krbcc_non_exists", "useKeyTab", "true", "principal", "dummy"); + // 2. keytab -> shared login(null, "useKeyTab", "true", "principal", "dummy", "keyTab", "ktab_non_exist", "tryFirstPass", "true", NAME, OneKDC.USER, PWD, OneKDC.PASS); + // 3. shared -> callback // 3.1. useFirstPass, no callback boolean failed = false; diff --git a/test/sun/security/krb5/auto/SPNEGO.java b/test/sun/security/krb5/auto/SPNEGO.java new file mode 100644 index 0000000000000000000000000000000000000000..250a942f0d4b2f25870e7277898a00c10c710bfc --- /dev/null +++ b/test/sun/security/krb5/auto/SPNEGO.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7040151 + * @summary SPNEGO GSS code does not parse tokens in accordance to RFC 2478 + * @compile -XDignore.symbol.file SPNEGO.java + * @run main/othervm SPNEGO + */ + +import sun.security.jgss.GSSUtil; + +// The basic krb5 test skeleton you can copy from +public class SPNEGO { + + public static void main(String[] args) throws Exception { + + new OneKDC(null).writeJAASConf(); + + Context c, s; + c = Context.fromJAAS("client"); + s = Context.fromJAAS("server"); + + c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID); + s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID); + + Context.handshake(c, s); + + Context.transmit("i say high --", c, s); + Context.transmit(" you say low", s, c); + + s.dispose(); + c.dispose(); + } +} diff --git a/test/sun/security/krb5/auto/SSL.java b/test/sun/security/krb5/auto/SSL.java index 7bd4601481e4abdf7b66c91c9ec650d070a0ba77..eca535051fc88726f03f8acec15862daeedf53e9 100644 --- a/test/sun/security/krb5/auto/SSL.java +++ b/test/sun/security/krb5/auto/SSL.java @@ -48,7 +48,7 @@ import sun.security.krb5.internal.ktab.KeyTab; public class SSL { private static String krb5Cipher; - private static final int LOOP_LIMIT = 1; + private static final int LOOP_LIMIT = 3; private static int loopCount = 0; private static volatile String server; private static volatile int port; @@ -98,13 +98,13 @@ public class SSL { fos.close(); f.deleteOnExit(); - final Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + Context c; final Context s = Context.fromJAAS("ssl"); - c.startAsClient("host/" + server, GSSUtil.GSS_KRB5_MECH_OID); + // There's no keytab file when server starts. s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); - new Thread(new Runnable() { + Thread server = new Thread(new Runnable() { public void run() { try { s.doAs(new JsseServerAction(), null); @@ -112,12 +112,57 @@ public class SSL { e.printStackTrace(); } } - }).start(); + }); + server.setDaemon(true); + server.start(); // Warm the server Thread.sleep(2000); + // Now create the keytab + + /* + // Add 3 versions of keys into keytab + KeyTab ktab = KeyTab.create(OneKDC.KTAB); + PrincipalName service = new PrincipalName( + "host/" + server, PrincipalName.KRB_NT_SRV_HST); + ktab.addEntry(service, "pass1".toCharArray(), 1); + ktab.addEntry(service, "pass2".toCharArray(), 2); + ktab.addEntry(service, "pass3".toCharArray(), 3); + ktab.save(); + + // and use the middle one as the real key + kdc.addPrincipal("host/" + server, "pass2".toCharArray()); + */ + c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + c.startAsClient("host/" + server, GSSUtil.GSS_KRB5_MECH_OID); c.doAs(new JsseClientAction(), null); + + // Add another version of key, make sure it can be loaded + Thread.sleep(2000); + ktab = KeyTab.getInstance(OneKDC.KTAB); + ktab.addEntry(service, "pass4".toCharArray(), 4, true); + ktab.save(); + kdc.addPrincipal("host/" + server, "pass4".toCharArray()); + + c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + c.startAsClient("host/" + server, GSSUtil.GSS_KRB5_MECH_OID); + c.doAs(new JsseClientAction(), null); + + // Revoke the old key + /*Thread.sleep(2000); + ktab = KeyTab.create(OneKDC.KTAB); + ktab.addEntry(service, "pass5".toCharArray(), 5, false); + ktab.save(); + + c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + c.startAsClient("host/" + server, GSSUtil.GSS_KRB5_MECH_OID); + try { + c.doAs(new JsseClientAction(), null); + throw new Exception("Should fail this time."); + } catch (SSLException e) { + // Correct behavior. + }*/ } // Following codes copied from @@ -126,6 +171,7 @@ public class SSL { public byte[] run(Context s, byte[] input) throws Exception { SSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory.getDefault(); + System.out.println("Connecting " + server + ":" + port); SSLSocket sslSocket = (SSLSocket) sslsf.createSocket(server, port); // Enable only a KRB5 cipher suite. @@ -154,6 +200,9 @@ public class SSL { System.out.println("Server is: " + peer.toString()); sslSocket.close(); + // This line should not be needed. It's the server's duty to + // forget the old key + //sslSocket.getSession().invalidate(); return null; } } @@ -165,6 +214,7 @@ public class SSL { SSLServerSocket sslServerSocket = (SSLServerSocket) sslssf.createServerSocket(0); // any port port = sslServerSocket.getLocalPort(); + System.out.println("Listening on " + port); // Enable only a KRB5 cipher suite. String enabledSuites[] = {krb5Cipher}; diff --git a/test/sun/security/krb5/auto/TwoPrinces.java b/test/sun/security/krb5/auto/TwoPrinces.java new file mode 100644 index 0000000000000000000000000000000000000000..30f16e96a2558f16e57bb3b70349a0aa147b172e --- /dev/null +++ b/test/sun/security/krb5/auto/TwoPrinces.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6894072 + * @compile -XDignore.symbol.file TwoPrinces.java + * @run main/othervm TwoPrinces + * @summary always refresh keytab + */ + +import java.io.File; +import java.io.FileOutputStream; +import sun.security.jgss.GSSUtil; +import sun.security.krb5.Config; + +public class TwoPrinces { + + public static void main(String[] args) + throws Exception { + + KDC k1 = KDC.create("R1"); + k1.addPrincipal("u1", "hello".toCharArray()); + k1.addPrincipalRandKey("krbtgt/R1"); + k1.addPrincipalRandKey("host/same.host"); + + KDC k2 = KDC.create("R2"); + k2.addPrincipal("u2", "hello".toCharArray()); + k2.addPrincipalRandKey("krbtgt/R2"); + k2.addPrincipalRandKey("host/same.host"); + + System.setProperty("java.security.krb5.conf", "krb5.conf"); + + // R1 is the default realm now + KDC.saveConfig("krb5.conf", k1, k2); + Config.refresh(); + + k1.writeKtab("ktab1"); + k2.writeKtab("ktab2"); + + // A JAAS config file with 2 Krb5LoginModules, after commit, the + // subject with have principals and keytabs from both sides + System.setProperty("java.security.auth.login.config", "jaas.conf"); + File f = new File("jaas.conf"); + FileOutputStream fos = new FileOutputStream(f); + fos.write(( + "me {\n" + + " com.sun.security.auth.module.Krb5LoginModule required" + + " isInitiator=true principal=\"host/same.host@R1\"" + + " useKeyTab=true keyTab=ktab1 storeKey=true;\n" + + " com.sun.security.auth.module.Krb5LoginModule required" + + " isInitiator=true principal=\"host/same.host@R2\"" + + " useKeyTab=true keyTab=ktab2 storeKey=true;\n" + + "};\n" + ).getBytes()); + fos.close(); + + /* + * This server side context will be able to act as services in both + * realms. Please note that we still don't support a single instance + * of server to accept connections from two realms at the same time. + * Therefore, we must call startAsServer in a given realm to start + * working there. The same Subject never changes anyway. + */ + Context s = Context.fromJAAS("me"); + + // Default realm still R1 + s.startAsServer("host@same.host", GSSUtil.GSS_KRB5_MECH_OID); + Context c1 = Context.fromUserPass("u1", "hello".toCharArray(), false); + c1.startAsClient("host@same.host", GSSUtil.GSS_KRB5_MECH_OID); + Context.handshake(c1, s); + + KDC.saveConfig("krb5.conf", k2, k1); + Config.refresh(); + + // Default realm now R2 + s.startAsServer("host@same.host", GSSUtil.GSS_KRB5_MECH_OID); + Context c2 = Context.fromUserPass("u2", "hello".toCharArray(), false); + c2.startAsClient("host@same.host", GSSUtil.GSS_KRB5_MECH_OID); + Context.handshake(c2, s); + } +} diff --git a/test/sun/security/krb5/ktab/KeyTabIndex.java b/test/sun/security/krb5/ktab/KeyTabIndex.java index f0cd88e6a651a03c84b485b2f582311b929638e3..26eb5621939358c0e3c107d10b3382c69b06717c 100644 --- a/test/sun/security/krb5/ktab/KeyTabIndex.java +++ b/test/sun/security/krb5/ktab/KeyTabIndex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,6 @@ public class KeyTabIndex { KeyTab.getInstance("ktab").getClass(); } }; - KeyTab.refresh(); for (int i=0; i<10; i++) { new Thread(t).start(); } diff --git a/test/sun/security/mscapi/AccessKeyStore.sh b/test/sun/security/mscapi/AccessKeyStore.sh index 5adef063cdb0eabc77e78496ede58d999c26b94f..6706aa3ff399494259304adff387abeac9709f77 100644 --- a/test/sun/security/mscapi/AccessKeyStore.sh +++ b/test/sun/security/mscapi/AccessKeyStore.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,9 @@ # @test -# @bug 6324295 +# @bug 6324295 6931562 # @run shell AccessKeyStore.sh # @summary Confirm that permission must be granted to access keystores. -# -# Run only on non-64-bit Windows platform. OS=`uname -s` case "$OS" in diff --git a/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh b/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh index b712dd7ddb53384630d944067929840cf6e278f5..197ee37b134ee3ccda90970a4cdfc4917a864ab8 100644 --- a/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh +++ b/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,9 @@ # @test -# @bug 6318171 +# @bug 6318171 6931562 # @run shell IsSunMSCAPIAvailable.sh # @summary Basic test of the Microsoft CryptoAPI provider. -# -# Run only on non-64-bit Windows platform. OS=`uname -s` case "$OS" in diff --git a/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh b/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh index 7d0f1b47ba0bfe2ea30d60edc8243492b2616f32..ee0c6c3609f306800df2b7f26f5a82dac4338140 100644 --- a/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh +++ b/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,12 +25,10 @@ # @test -# @bug 6324294 +# @bug 6324294 6931562 # @run shell KeyStoreCompatibilityMode.sh # @summary Confirm that a null stream or password is not permitted when # compatibility mode is enabled (and vice versa). -# -# Run only on non-64-bit Windows platform. OS=`uname -s` case "$OS" in diff --git a/test/sun/security/mscapi/KeytoolChangeAlias.sh b/test/sun/security/mscapi/KeytoolChangeAlias.sh index b42c51dddee7b4af7e52794607a5dd1b929d42aa..0012a93af528a41547f41c86c41113643742c676 100644 --- a/test/sun/security/mscapi/KeytoolChangeAlias.sh +++ b/test/sun/security/mscapi/KeytoolChangeAlias.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,9 @@ # @test -# @bug 6415696 +# @bug 6415696 6931562 # @run shell KeytoolChangeAlias.sh # @summary Test "keytool -changealias" using the Microsoft CryptoAPI provider. -# -# Run only on non-64-bit Windows platform. # set a few environment variables so that the shell-script can run stand-alone # in the source directory diff --git a/test/sun/security/mscapi/PublicKeyInterop.java b/test/sun/security/mscapi/PublicKeyInterop.java new file mode 100644 index 0000000000000000000000000000000000000000..53d5b0946811dfbf659a1249d946464123b0b369 --- /dev/null +++ b/test/sun/security/mscapi/PublicKeyInterop.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @see PublicKeyInterop.sh + */ + +import java.security.*; +import java.util.*; +import javax.crypto.*; + +import sun.misc.HexDumpEncoder; + +/* + * Confirm interoperability of RSA public keys between SunMSCAPI and SunJCE + * security providers. + */ +public class PublicKeyInterop { + + public static void main(String[] arg) throws Exception { + PrivateKey privKey = null; + Certificate cert = null; + KeyStore ks = KeyStore.getInstance("Windows-MY"); + ks.load(null, null); + System.out.println("Loaded keystore: Windows-MY"); + + PublicKey myPuKey = + (PublicKey) ks.getCertificate("6888925").getPublicKey(); + System.out.println("Public key is a " + myPuKey.getClass().getName()); + PrivateKey myPrKey = (PrivateKey) ks.getKey("6888925", null); + System.out.println("Private key is a " + myPrKey.getClass().getName()); + System.out.println(); + + byte[] plain = new byte[] {0x01, 0x02, 0x03, 0x04, 0x05}; + HexDumpEncoder hde = new HexDumpEncoder(); + System.out.println("Plaintext:\n" + hde.encode(plain) + "\n"); + + Cipher rsa = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + rsa.init(Cipher.ENCRYPT_MODE, myPuKey); + byte[] encrypted = rsa.doFinal(plain); + System.out.println("Encrypted plaintext using RSA Cipher from " + + rsa.getProvider().getName() + " JCE provider\n"); + System.out.println(hde.encode(encrypted) + "\n"); + + Cipher rsa2 = Cipher.getInstance("RSA/ECB/PKCS1Padding", "SunMSCAPI"); + rsa2.init(Cipher.ENCRYPT_MODE, myPuKey); + byte[] encrypted2 = rsa2.doFinal(plain); + System.out.println("Encrypted plaintext using RSA Cipher from " + + rsa2.getProvider().getName() + " JCE provider\n"); + System.out.println(hde.encode(encrypted2) + "\n"); + + Cipher rsa3 = Cipher.getInstance("RSA/ECB/PKCS1Padding", "SunMSCAPI"); + rsa3.init(Cipher.DECRYPT_MODE, myPrKey); + byte[] decrypted = rsa3.doFinal(encrypted); + System.out.println("Decrypted first ciphertext using RSA Cipher from " + + rsa3.getProvider().getName() + " JCE provider\n"); + System.out.println(hde.encode(decrypted) + "\n"); + if (! Arrays.equals(plain, decrypted)) { + throw new Exception("First decrypted ciphertext does not match " + + "original plaintext"); + } + + decrypted = rsa3.doFinal(encrypted2); + System.out.println("Decrypted second ciphertext using RSA Cipher from " + + rsa3.getProvider().getName() + " JCE provider\n"); + System.out.println(hde.encode(decrypted) + "\n"); + if (! Arrays.equals(plain, decrypted)) { + throw new Exception("Second decrypted ciphertext does not match " + + "original plaintext"); + } + } +} diff --git a/test/sun/security/mscapi/PublicKeyInterop.sh b/test/sun/security/mscapi/PublicKeyInterop.sh new file mode 100644 index 0000000000000000000000000000000000000000..1967e63d26618dc0217c6aa1c28594590e18cf0c --- /dev/null +++ b/test/sun/security/mscapi/PublicKeyInterop.sh @@ -0,0 +1,84 @@ +#!/bin/sh + +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# @test +# @bug 6888925 +# @run shell PublicKeyInterop.sh +# @summary SunMSCAPI's Cipher can't use RSA public keys obtained from other +# sources. +# + +# set a few environment variables so that the shell-script can run stand-alone +# in the source directory +if [ "${TESTSRC}" = "" ] ; then + TESTSRC="." +fi + +if [ "${TESTCLASSES}" = "" ] ; then + TESTCLASSES="." +fi + +if [ "${TESTJAVA}" = "" ] ; then + echo "TESTJAVA not set. Test cannot execute." + echo "FAILED!!!" + exit 1 +fi + +OS=`uname -s` +case "$OS" in + Windows* | CYGWIN* ) + + echo "Creating a temporary RSA keypair in the Windows-My store..." + ${TESTJAVA}/bin/keytool \ + -genkeypair \ + -storetype Windows-My \ + -keyalg RSA \ + -alias 6888925 \ + -dname "cn=6888925,c=US" \ + -noprompt + + echo + echo "Running the test..." + ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\PublicKeyInterop.java + ${TESTJAVA}/bin/java PublicKeyInterop + + rc=$? + + echo + echo "Removing the temporary RSA keypair from the Windows-My store..." + ${TESTJAVA}/bin/keytool \ + -delete \ + -storetype Windows-My \ + -alias 6888925 + + echo done. + exit $rc + ;; + + * ) + echo "This test is not intended for '$OS' - passing test" + exit 0 + ;; +esac diff --git a/test/sun/security/mscapi/RSAEncryptDecrypt.sh b/test/sun/security/mscapi/RSAEncryptDecrypt.sh index 4191fb1b0c0fd92728b44c63f1780292c0bef41a..19add0a7356bb232c4edbd29e360eee611a3de5f 100644 --- a/test/sun/security/mscapi/RSAEncryptDecrypt.sh +++ b/test/sun/security/mscapi/RSAEncryptDecrypt.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,13 +24,11 @@ # # @test -# @bug 6457422 +# @bug 6457422 6931562 # @run shell RSAEncryptDecrypt.sh # @summary Confirm that plaintext can be encrypted and then decrypted using the # RSA cipher in the SunMSCAPI crypto provider. NOTE: The RSA cipher is # absent from the SunMSCAPI provider in OpenJDK builds. -# -# Run only on non-64-bit Windows platform. # set a few environment variables so that the shell-script can run stand-alone # in the source directory diff --git a/test/sun/security/mscapi/SignUsingNONEwithRSA.java b/test/sun/security/mscapi/SignUsingNONEwithRSA.java new file mode 100644 index 0000000000000000000000000000000000000000..58934767cd88e9172dd8fbb6f6661d6341b868b5 --- /dev/null +++ b/test/sun/security/mscapi/SignUsingNONEwithRSA.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @see SignUsingNONEwithRSA.sh + */ + +import java.security.*; +import java.util.*; + +public class SignUsingNONEwithRSA { + + private static final List precomputedHashes = Arrays.asList( + // A MD5 hash + new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 + }, + // A SHA-1 hash + new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20 + }, + // A concatenation of SHA-1 and MD5 hashes (used during SSL handshake) + new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, + 0x31, 0x32, 0x33, 0x34, 0x35, 0x36 + }, + // A SHA-256 hash + new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, + 0x31, 0x32 + }, + // A SHA-384 hash + new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, + 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 + }, + // A SHA-512 hash + new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, + 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x60, + 0x61, 0x62, 0x63, 0x64 + }); + + private static List generatedSignatures = new ArrayList<>(); + + public static void main(String[] args) throws Exception { + + Provider[] providers = Security.getProviders("Signature.NONEwithRSA"); + if (providers == null) { + System.out.println("No JCE providers support the " + + "'Signature.NONEwithRSA' algorithm"); + System.out.println("Skipping this test..."); + return; + + } else { + System.out.println("The following JCE providers support the " + + "'Signature.NONEwithRSA' algorithm: "); + for (Provider provider : providers) { + System.out.println(" " + provider.getName()); + } + } + System.out.println("-------------------------------------------------"); + + KeyPair keys = getKeysFromKeyStore(); + signAllUsing("SunMSCAPI", keys.getPrivate()); + System.out.println("-------------------------------------------------"); + + verifyAllUsing("SunMSCAPI", keys.getPublic()); + System.out.println("-------------------------------------------------"); + + verifyAllUsing("SunJCE", keys.getPublic()); + System.out.println("-------------------------------------------------"); + + keys = generateKeys(); + signAllUsing("SunJCE", keys.getPrivate()); + System.out.println("-------------------------------------------------"); + + verifyAllUsing("SunMSCAPI", keys.getPublic()); + System.out.println("-------------------------------------------------"); + + } + + private static KeyPair getKeysFromKeyStore() throws Exception { + KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI"); + ks.load(null, null); + System.out.println("Loaded keystore: Windows-MY"); + + Enumeration e = ks.aliases(); + PrivateKey privateKey = null; + PublicKey publicKey = null; + + while (e.hasMoreElements()) { + String alias = (String) e.nextElement(); + if (alias.equals("6578658")) { + System.out.println("Loaded entry: " + alias); + privateKey = (PrivateKey) ks.getKey(alias, null); + publicKey = (PublicKey) ks.getCertificate(alias).getPublicKey(); + } + } + if (privateKey == null || publicKey == null) { + throw new Exception("Cannot load the keys need to run this test"); + } + + return new KeyPair(publicKey, privateKey); + } + + + private static KeyPair generateKeys() throws Exception { + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); + keyGen.initialize(1024, null); + KeyPair pair = keyGen.generateKeyPair(); + PrivateKey privateKey = pair.getPrivate(); + PublicKey publicKey = pair.getPublic(); + + if (privateKey == null || publicKey == null) { + throw new Exception("Cannot load the keys need to run this test"); + } + + return new KeyPair(publicKey, privateKey); + } + + private static void signAllUsing(String providerName, PrivateKey privateKey) + throws Exception { + Signature sig1 = Signature.getInstance("NONEwithRSA", providerName); + if (sig1 == null) { + throw new Exception("'NONEwithRSA' is not supported"); + } + if (sig1.getProvider() != null) { + System.out.println("Using NONEwithRSA signer from the " + + sig1.getProvider().getName() + " JCE provider"); + } else { + System.out.println( + "Using NONEwithRSA signer from the internal JCE provider"); + } + + System.out.println("Using key: " + privateKey); + generatedSignatures.clear(); + for (byte[] hash : precomputedHashes) { + sig1.initSign(privateKey); + sig1.update(hash); + + try { + + byte [] sigBytes = sig1.sign(); + System.out.println("\nGenerated RSA signature over a " + + hash.length + "-byte hash (signature length: " + + sigBytes.length * 8 + " bits)"); + System.out.println(String.format("0x%0" + + (sigBytes.length * 2) + "x", + new java.math.BigInteger(1, sigBytes))); + generatedSignatures.add(sigBytes); + + } catch (SignatureException se) { + System.out.println("Error generating RSA signature: " + se); + } + } + } + + private static void verifyAllUsing(String providerName, PublicKey publicKey) + throws Exception { + Signature sig1 = Signature.getInstance("NONEwithRSA", providerName); + if (sig1.getProvider() != null) { + System.out.println("\nUsing NONEwithRSA verifier from the " + + sig1.getProvider().getName() + " JCE provider"); + } else { + System.out.println( + "\nUsing NONEwithRSA verifier from the internal JCE provider"); + } + + System.out.println("Using key: " + publicKey); + + int i = 0; + for (byte[] hash : precomputedHashes) { + + byte[] sigBytes = generatedSignatures.get(i++); + System.out.println("\nVerifying RSA Signature over a " + + hash.length + "-byte hash (signature length: " + + sigBytes.length * 8 + " bits)"); + System.out.println(String.format("0x%0" + + (sigBytes.length * 2) + "x", + new java.math.BigInteger(1, sigBytes))); + + sig1.initVerify(publicKey); + sig1.update(hash); + if (sig1.verify(sigBytes)) { + System.out.println("Verify PASSED"); + } else { + throw new Exception("Verify FAILED"); + } + } + } +} diff --git a/test/sun/security/mscapi/SignUsingNONEwithRSA.sh b/test/sun/security/mscapi/SignUsingNONEwithRSA.sh new file mode 100644 index 0000000000000000000000000000000000000000..c89a8687877f6dc5e6353cc7619c3be7be22c3cf --- /dev/null +++ b/test/sun/security/mscapi/SignUsingNONEwithRSA.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + + +# @test +# @bug 6578658 +# @run shell SignUsingNONEwithRSA.sh +# @summary Sign using the NONEwithRSA signature algorithm from SunMSCAPI + +# set a few environment variables so that the shell-script can run stand-alone +# in the source directory +if [ "${TESTSRC}" = "" ] ; then + TESTSRC="." +fi + +if [ "${TESTCLASSES}" = "" ] ; then + TESTCLASSES="." +fi + +if [ "${TESTJAVA}" = "" ] ; then + echo "TESTJAVA not set. Test cannot execute." + echo "FAILED!!!" + exit 1 +fi + +OS=`uname -s` +case "$OS" in + Windows* | CYGWIN* ) + + echo "Creating a temporary RSA keypair in the Windows-My store..." + ${TESTJAVA}/bin/keytool \ + -genkeypair \ + -storetype Windows-My \ + -keyalg RSA \ + -alias 6578658 \ + -dname "cn=6578658,c=US" \ + -noprompt + + echo + echo "Running the test..." + ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingNONEwithRSA.java + ${TESTJAVA}/bin/java SignUsingNONEwithRSA + + rc=$? + + echo + echo "Removing the temporary RSA keypair from the Windows-My store..." + ${TESTJAVA}/bin/keytool \ + -delete \ + -storetype Windows-My \ + -alias 6578658 + + echo done. + exit $rc + ;; + + * ) + echo "This test is not intended for '$OS' - passing test" + exit 0 + ;; +esac diff --git a/test/sun/security/mscapi/SignUsingSHA2withRSA.java b/test/sun/security/mscapi/SignUsingSHA2withRSA.java new file mode 100644 index 0000000000000000000000000000000000000000..e2bd06b1905ce59ef8594ba2932a4939c6aff535 --- /dev/null +++ b/test/sun/security/mscapi/SignUsingSHA2withRSA.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @see SignUsingSHA2withRSA.sh + */ + +import java.security.*; +import java.util.*; + +public class SignUsingSHA2withRSA { + + private static final byte[] toBeSigned = new byte[] { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10 + }; + + private static List generatedSignatures = new ArrayList<>(); + + public static void main(String[] args) throws Exception { + + Provider[] providers = Security.getProviders("Signature.SHA256withRSA"); + if (providers == null) { + System.out.println("No JCE providers support the " + + "'Signature.SHA256withRSA' algorithm"); + System.out.println("Skipping this test..."); + return; + + } else { + System.out.println("The following JCE providers support the " + + "'Signature.SHA256withRSA' algorithm: "); + for (Provider provider : providers) { + System.out.println(" " + provider.getName()); + } + } + System.out.println("-------------------------------------------------"); + + KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI"); + ks.load(null, null); + System.out.println("Loaded keystore: Windows-MY"); + + Enumeration e = ks.aliases(); + PrivateKey privateKey = null; + PublicKey publicKey = null; + + while (e.hasMoreElements()) { + String alias = (String) e.nextElement(); + if (alias.equals("6753664")) { + System.out.println("Loaded entry: " + alias); + privateKey = (PrivateKey) ks.getKey(alias, null); + publicKey = (PublicKey) ks.getCertificate(alias).getPublicKey(); + } + } + if (privateKey == null || publicKey == null) { + throw new Exception("Cannot load the keys need to run this test"); + } + System.out.println("-------------------------------------------------"); + + generatedSignatures.add(signUsing("SHA256withRSA", privateKey)); + generatedSignatures.add(signUsing("SHA384withRSA", privateKey)); + generatedSignatures.add(signUsing("SHA512withRSA", privateKey)); + + System.out.println("-------------------------------------------------"); + + verifyUsing("SHA256withRSA", publicKey, generatedSignatures.get(0)); + verifyUsing("SHA384withRSA", publicKey, generatedSignatures.get(1)); + verifyUsing("SHA512withRSA", publicKey, generatedSignatures.get(2)); + + System.out.println("-------------------------------------------------"); + } + + private static byte[] signUsing(String signAlgorithm, + PrivateKey privateKey) throws Exception { + + // Must explicitly specify the SunMSCAPI JCE provider + // (otherwise SunJCE is chosen because it appears earlier in the list) + Signature sig1 = Signature.getInstance(signAlgorithm, "SunMSCAPI"); + if (sig1 == null) { + throw new Exception("'" + signAlgorithm + "' is not supported"); + } + System.out.println("Using " + signAlgorithm + " signer from the " + + sig1.getProvider().getName() + " JCE provider"); + + System.out.println("Using key: " + privateKey); + sig1.initSign(privateKey); + sig1.update(toBeSigned); + byte [] sigBytes = null; + + try { + sigBytes = sig1.sign(); + System.out.println("Generated RSA signature over a " + + toBeSigned.length + "-byte data (signature length: " + + sigBytes.length * 8 + " bits)"); + System.out.println(String.format("0x%0" + + (sigBytes.length * 2) + "x", + new java.math.BigInteger(1, sigBytes))); + + } catch (SignatureException se) { + System.out.println("Error generating RSA signature: " + se); + } + + return sigBytes; + } + + private static void verifyUsing(String signAlgorithm, PublicKey publicKey, + byte[] signature) throws Exception { + + // Must explicitly specify the SunMSCAPI JCE provider + // (otherwise SunJCE is chosen because it appears earlier in the list) + Signature sig1 = Signature.getInstance(signAlgorithm, "SunMSCAPI"); + if (sig1 == null) { + throw new Exception("'" + signAlgorithm + "' is not supported"); + } + System.out.println("Using " + signAlgorithm + " verifier from the " + + sig1.getProvider().getName() + " JCE provider"); + + System.out.println("Using key: " + publicKey); + + System.out.println("\nVerifying RSA Signature over a " + + toBeSigned.length + "-byte data (signature length: " + + signature.length * 8 + " bits)"); + System.out.println(String.format("0x%0" + (signature.length * 2) + + "x", new java.math.BigInteger(1, signature))); + + sig1.initVerify(publicKey); + sig1.update(toBeSigned); + + if (sig1.verify(signature)) { + System.out.println("Verify PASSED\n"); + } else { + throw new Exception("Verify FAILED"); + } + } +} diff --git a/test/sun/security/mscapi/SignUsingSHA2withRSA.sh b/test/sun/security/mscapi/SignUsingSHA2withRSA.sh new file mode 100644 index 0000000000000000000000000000000000000000..c939fb39e3f99989fa65dfe79e84daa7aa168405 --- /dev/null +++ b/test/sun/security/mscapi/SignUsingSHA2withRSA.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + + +# @test +# @bug 6753664 +# @run shell SignUsingSHA2withRSA.sh +# @summary Support SHA256 (and higher) in SunMSCAPI + +# set a few environment variables so that the shell-script can run stand-alone +# in the source directory +if [ "${TESTSRC}" = "" ] ; then + TESTSRC="." +fi + +if [ "${TESTCLASSES}" = "" ] ; then + TESTCLASSES="." +fi + +if [ "${TESTJAVA}" = "" ] ; then + echo "TESTJAVA not set. Test cannot execute." + echo "FAILED!!!" + exit 1 +fi + +OS=`uname -s` +case "$OS" in + Windows* | CYGWIN* ) + + echo "Creating a temporary RSA keypair in the Windows-My store..." + ${TESTJAVA}/bin/keytool \ + -genkeypair \ + -storetype Windows-My \ + -keyalg RSA \ + -alias 6753664 \ + -dname "cn=6753664,c=US" \ + -noprompt + + echo + echo "Running the test..." + ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingSHA2withRSA.java + ${TESTJAVA}/bin/java SignUsingSHA2withRSA + + rc=$? + + echo + echo "Removing the temporary RSA keypair from the Windows-My store..." + ${TESTJAVA}/bin/keytool \ + -delete \ + -storetype Windows-My \ + -alias 6753664 + + echo done. + exit $rc + ;; + + * ) + echo "This test is not intended for '$OS' - passing test" + exit 0 + ;; +esac