diff --git a/.hgtags-top-repo b/.hgtags-top-repo index fa57d754762..bd47c1a0596 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -359,3 +359,4 @@ f900d5afd9c83a0df8f36161c27c5e4c86a66f4c jdk-9+111 1d992540870ff33fe6cc550443388588df9b9e4f jdk-9+114 09617ce980b99d49abfd54dacfed353c47e2a115 jdk-9+115 6743a8e0cab7b5f6f4a0575f6664892f0ab740af jdk-9+116 +e882bcdbdac436523f3d5681611d3118a3804ea7 jdk-9+117 diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4 index f264c510fde..f4f57fb8c24 100644 --- a/common/autoconf/boot-jdk.m4 +++ b/common/autoconf/boot-jdk.m4 @@ -435,6 +435,9 @@ AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK], elif test ! -x "$BUILD_JDK/bin/jlink"; then AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring]) BUILD_JDK_FOUND=no + elif test ! -x "$BUILD_JDK/bin/jmod"; then + AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring]) + BUILD_JDK_FOUND=no elif test ! -x "$BUILD_JDK/bin/javac"; then # Do we have a bin/javac? AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring]) @@ -474,7 +477,8 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk], [path to JDK of same version as is being built@<:@the newly built JDK@:>@])]) - CREATE_BUILDJDK_FOR_HOST=false + CREATE_BUILDJDK=false + EXTERNAL_BUILDJDK=false BUILD_JDK_FOUND="no" if test "x$with_build_jdk" != "x"; then BOOTJDK_CHECK_BUILD_JDK([ @@ -483,6 +487,7 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], BUILD_JDK_FOUND=maybe AC_MSG_NOTICE([Found potential Build JDK using configure arguments]) fi]) + EXTERNAL_BUILDJDK=true else if test "x$COMPILE_TYPE" = "xcross"; then BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" @@ -498,6 +503,11 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], fi fi + JMOD="$BUILD_JDK/bin/jmod" + JLINK="$BUILD_JDK/bin/jlink" + AC_SUBST(JMOD) + AC_SUBST(JLINK) + if test "x$BUILD_JDK_FOUND" != "xyes"; then AC_MSG_CHECKING([for Build JDK]) AC_MSG_RESULT([no]) @@ -506,4 +516,5 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], AC_SUBST(CREATE_BUILDJDK) AC_SUBST(BUILD_JDK) + AC_SUBST(EXTERNAL_BUILDJDK) ]) diff --git a/common/autoconf/buildjdk-spec.gmk.in b/common/autoconf/buildjdk-spec.gmk.in index 89167a388fb..818f21eed95 100644 --- a/common/autoconf/buildjdk-spec.gmk.in +++ b/common/autoconf/buildjdk-spec.gmk.in @@ -46,6 +46,7 @@ HOTSPOT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPO HOTSPOT_DIST := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_DIST)) SUPPORT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR)) JDK_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR)) +IMAGES_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(IMAGES_OUTPUTDIR)) OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@ OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@ diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index f68d8437643..548ab680d2a 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -896,8 +896,11 @@ JAXWS_TOPDIR JAXP_TOPDIR CORBA_TOPDIR LANGTOOLS_TOPDIR +EXTERNAL_BUILDJDK BUILD_JDK CREATE_BUILDJDK +JLINK +JMOD BOOT_JDK_BITS JAVAC_FLAGS BOOT_JDK_MODULAR @@ -5070,7 +5073,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1462204427 +DATE_WHEN_GENERATED=1462806878 ############################################################################### # @@ -30171,7 +30174,8 @@ if test "${with_build_jdk+set}" = set; then : fi - CREATE_BUILDJDK_FOR_HOST=false + CREATE_BUILDJDK=false + EXTERNAL_BUILDJDK=false BUILD_JDK_FOUND="no" if test "x$with_build_jdk" != "x"; then @@ -30196,6 +30200,10 @@ $as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/ja { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&5 $as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&6;} BUILD_JDK_FOUND=no + elif test ! -x "$BUILD_JDK/bin/jmod"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring" >&5 +$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring" >&6;} + BUILD_JDK_FOUND=no elif test ! -x "$BUILD_JDK/bin/javac"; then # Do we have a bin/javac? { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring" >&5 @@ -30364,6 +30372,7 @@ $as_echo "$BUILD_JDK_VERSION" >&6; } fi # end check build jdk found fi + EXTERNAL_BUILDJDK=true else if test "x$COMPILE_TYPE" = "xcross"; then BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" @@ -30383,6 +30392,11 @@ $as_echo "yes, will use output dir" >&6; } fi fi + JMOD="$BUILD_JDK/bin/jmod" + JLINK="$BUILD_JDK/bin/jlink" + + + if test "x$BUILD_JDK_FOUND" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 $as_echo_n "checking for Build JDK... " >&6; } @@ -30395,6 +30409,7 @@ $as_echo "no" >&6; } + ############################################################################### # # Configure the sources to use. We can add or override individual directories. diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index c72e9d54100..467cc304b20 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -283,6 +283,7 @@ BOOT_JDK:=@BOOT_JDK@ BUILD_JDK:=@BUILD_JDK@ CREATE_BUILDJDK:=@CREATE_BUILDJDK@ +EXTERNAL_BUILDJDK:=@EXTERNAL_BUILDJDK@ # When compiling Java source to be run by the boot jdk # use these extra flags, eg -source 6 -target 6 @@ -542,6 +543,8 @@ JAVA_CMD:=@JAVA@ JAVAC_CMD:=@JAVAC@ JAVAH_CMD:=@JAVAH@ JAR_CMD:=@JAR@ +JLINK_CMD := @JLINK@ +JMOD_CMD := @JMOD@ JARSIGNER_CMD:=@JARSIGNER@ SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@ # These variables are meant to be used. They are defined with = instead of := to make @@ -552,6 +555,8 @@ JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS) JAVAC=@FIXPATH@ $(JAVAC_CMD) JAVAH=@FIXPATH@ $(JAVAH_CMD) JAR=@FIXPATH@ $(JAR_CMD) +JLINK = @FIXPATH@ $(JLINK_CMD) $(JAVA_TOOL_FLAGS_SMALL) +JMOD = @FIXPATH@ $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL) JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD) # A specific java binary with specific options can be used to run # the long running background sjavac servers and other long running tasks. @@ -569,14 +574,15 @@ BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS) # Use ?= as this can be overridden from bootcycle-spec.gmk BOOT_JDK_MODULAR ?= @BOOT_JDK_MODULAR@ +INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \ + jdk.jdeps jdk.javadoc jdk.rmic ifeq ($(BOOT_JDK_MODULAR), true) - INTERIM_OVERRIDE_MODULES_ARGS = -Xpatch:$(BUILDTOOLS_OUTPUTDIR)/override_modules + INTERIM_OVERRIDE_MODULES_ARGS = $(foreach m, $(INTERIM_OVERRIDE_MODULES), \ + -Xpatch:$m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m) INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main else - INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \ - jdk.jdeps jdk.javadoc jdk.rmic INTERIM_OVERRIDE_MODULES_ARGS = \ -Xbootclasspath/p:$(call PathList, \ $(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \ @@ -591,12 +597,8 @@ endif NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS) NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS) -# JLink/Jmod are run using the BUILD_JDK, which is normally the jdk output dir. JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@ -JLINK = @FIXPATH@ $(BUILD_JDK)/bin/jlink $(JAVA_TOOL_FLAGS_SMALL) -JMOD = @FIXPATH@ $(BUILD_JDK)/bin/jmod $(JAVA_TOOL_FLAGS_SMALL) - # Base flags for RC # Guarding this against resetting value. Legacy make files include spec multiple # times. @@ -776,6 +778,9 @@ TEST_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR) SYMBOLS_IMAGE_SUBDIR:=symbols SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR) +# Interim image +INTERIM_IMAGE_DIR := $(SUPPORT_OUTPUTDIR)/interim-image + # Macosx bundles directory definitions JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk-$(VERSION_NUMBER).jdk/Contents JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre-$(VERSION_NUMBER).jre/Contents diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index 39196ac553a..2b7164741b1 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -404,7 +404,7 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "javare", revision: "4.2", - build_number: "b01", + build_number: "b02", checksum_file: "MD5_VALUES", file: "jtreg_bin-4.2.zip", environment_name: "JT_HOME" diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 23786130f3e..d308ce9a4c0 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -519,3 +519,4 @@ c569f8d89269fb6205b90f727581eb8cc04132f9 jdk-9+113 b64432bae5271735fd53300b2005b713e98ef411 jdk-9+114 88dd08d7be0fe7fb9f1914b1628f0aae9bf56e25 jdk-9+115 61a214186dae6811dd989e9165e42f7dbf02acde jdk-9+116 +88170d3642905b9e6cac03e8efcc976885a7e6da jdk-9+117 diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 19b0f460a9d..ebd7d84b457 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -140,9 +140,10 @@ PerfCounter* ClassLoader::_unsafe_defineClassCallCounter = NULL; PerfCounter* ClassLoader::_isUnsyncloadClass = NULL; PerfCounter* ClassLoader::_load_instance_class_failCounter = NULL; -ClassPathEntry* ClassLoader::_first_entry = NULL; -ClassPathEntry* ClassLoader::_last_entry = NULL; -int ClassLoader::_num_entries = 0; +GrowableArray* ClassLoader::_xpatch_entries = NULL; +ClassPathEntry* ClassLoader::_first_entry = NULL; +ClassPathEntry* ClassLoader::_last_entry = NULL; +int ClassLoader::_num_entries = 0; ClassPathEntry* ClassLoader::_first_append_entry = NULL; bool ClassLoader::_has_jimage = false; #if INCLUDE_CDS @@ -179,6 +180,44 @@ bool ClassLoader::string_ends_with(const char* str, const char* str_to_find) { return (strncmp(str + (str_len - str_to_find_len), str_to_find, str_to_find_len) == 0); } +// Used to obtain the package name from a fully qualified class name. +// It is the responsibility of the caller to establish ResourceMark. +const char* ClassLoader::package_from_name(const char* class_name) { + const char* last_slash = strrchr(class_name, '/'); + if (last_slash == NULL) { + // No package name + return NULL; + } + int length = last_slash - class_name; + + // A class name could have just the slash character in the name, + // resulting in a negative length. + if (length <= 0) { + // No package name + return NULL; + } + + // drop name after last slash (including slash) + // Ex., "java/lang/String.class" => "java/lang" + char* pkg_name = NEW_RESOURCE_ARRAY(char, length + 1); + strncpy(pkg_name, class_name, length); + *(pkg_name+length) = '\0'; + + return (const char *)pkg_name; +} + +// Given a fully qualified class name, find its defining package in the class loader's +// package entry table. +static PackageEntry* get_package_entry(const char* class_name, ClassLoaderData* loader_data, TRAPS) { + ResourceMark rm(THREAD); + const char *pkg_name = ClassLoader::package_from_name(class_name); + if (pkg_name == NULL) { + return NULL; + } + PackageEntryTable* pkgEntryTable = loader_data->packages(); + TempNewSymbol pkg_symbol = SymbolTable::new_symbol(pkg_name, CHECK_NULL); + return pkgEntryTable->lookup_only(pkg_symbol); +} ClassPathDirEntry::ClassPathDirEntry(const char* dir) : ClassPathEntry() { char* copy = NEW_C_HEAP_ARRAY(char, strlen(dir)+1, mtClass); @@ -281,8 +320,7 @@ u1* ClassPathZipEntry::open_entry(const char* name, jint* filesize, bool nul_ter #if INCLUDE_CDS u1* ClassPathZipEntry::open_versioned_entry(const char* name, jint* filesize, TRAPS) { u1* buffer = NULL; - if (!_is_boot_append) { - assert(DumpSharedSpaces, "Should be called only for non-boot entries during dump time"); + if (DumpSharedSpaces) { // We presume default is multi-release enabled const char* multi_ver = Arguments::get_property("jdk.util.jar.enableMultiRelease"); const char* verstr = Arguments::get_property("jdk.util.jar.version"); @@ -402,31 +440,6 @@ ClassPathImageEntry::~ClassPathImageEntry() { } } -void ClassPathImageEntry::name_to_package(const char* name, char* buffer, int length) { - const char *pslash = strrchr(name, '/'); - if (pslash == NULL) { - buffer[0] = '\0'; - return; - } - int len = pslash - name; -#if INCLUDE_CDS - if (len <= 0 && DumpSharedSpaces) { - buffer[0] = '\0'; - return; - } -#endif - assert(len > 0, "Bad length for package name"); - if (len >= length) { - buffer[0] = '\0'; - return; - } - // drop name after last slash (including slash) - // Ex., "java/lang/String.class" => "java/lang" - strncpy(buffer, name, len); - // ensure string termination (strncpy does not guarantee) - buffer[len] = '\0'; -} - // For a class in a named module, look it up in the jimage file using this syntax: // /// // @@ -439,15 +452,10 @@ ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) { JImageLocationRef location = (*JImageFindResource)(_jimage, "", get_jimage_version_string(), name, &size); if (location == 0) { - char package[JIMAGE_MAX_PATH]; - name_to_package(name, package, JIMAGE_MAX_PATH); + ResourceMark rm; + const char* pkg_name = ClassLoader::package_from_name(name); -#if INCLUDE_CDS - if (package[0] == '\0' && DumpSharedSpaces) { - return NULL; - } -#endif - if (package[0] != '\0') { + if (pkg_name != NULL) { if (!Universe::is_module_initialized()) { location = (*JImageFindResource)(_jimage, "java.base", get_jimage_version_string(), name, &size); #if INCLUDE_CDS @@ -455,7 +463,7 @@ ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) { // modules defined for other class loaders. So, for now, get their module // names from the "modules" jimage file. if (DumpSharedSpaces && location == 0) { - const char* module_name = (*JImagePackageToModule)(_jimage, package); + const char* module_name = (*JImagePackageToModule)(_jimage, pkg_name); if (module_name != NULL) { location = (*JImageFindResource)(_jimage, module_name, get_jimage_version_string(), name, &size); } @@ -463,13 +471,7 @@ ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) { #endif } else { - // Get boot class loader's package entry table - PackageEntryTable* pkgEntryTable = - ClassLoaderData::the_null_class_loader_data()->packages(); - // Get package's package entry - TempNewSymbol pkg_symbol = SymbolTable::new_symbol(package, CHECK_NULL); - PackageEntry* package_entry = pkgEntryTable->lookup_only(pkg_symbol); - + PackageEntry* package_entry = get_package_entry(name, ClassLoaderData::the_null_class_loader_data(), THREAD); if (package_entry != NULL) { ResourceMark rm; // Get the module name @@ -542,6 +544,33 @@ void ClassLoader::exit_with_path_failure(const char* error, const char* message) } #endif +ModuleClassPathList::ModuleClassPathList(Symbol* module_name) { + _module_name = module_name; + _module_first_entry = NULL; + _module_last_entry = NULL; +} + +ModuleClassPathList::~ModuleClassPathList() { + // Clean out each ClassPathEntry on list + ClassPathEntry* e = _module_first_entry; + while (e != NULL) { + ClassPathEntry* next_entry = e->next(); + delete e; + e = next_entry; + } +} + +void ModuleClassPathList::add_to_list(ClassPathEntry* new_entry) { + if (new_entry != NULL) { + if (_module_last_entry == NULL) { + _module_first_entry = _module_last_entry = new_entry; + } else { + _module_last_entry->set_next(new_entry); + _module_last_entry = new_entry; + } + } +} + void ClassLoader::trace_class_path(const char* msg, const char* name) { if (log_is_enabled(Info, classpath)) { ResourceMark rm; @@ -619,6 +648,61 @@ bool ClassLoader::check_shared_paths_misc_info(void *buf, int size) { } #endif +// Construct the array of module/path pairs as specified to -Xpatch +// for the boot loader to search ahead of the jimage, if the class being +// loaded is defined to a module that has been specified to -Xpatch. +void ClassLoader::setup_xpatch_entries() { + Thread* THREAD = Thread::current(); + GrowableArray* xpatch_args = Arguments::get_xpatchprefix(); + int num_of_entries = xpatch_args->length(); + + // Set up the boot loader's xpatch_entries list + _xpatch_entries = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(num_of_entries, true); + + for (int i = 0; i < num_of_entries; i++) { + const char* module_name = (xpatch_args->at(i))->module_name(); + Symbol* const module_sym = SymbolTable::lookup(module_name, (int)strlen(module_name), CHECK); + assert(module_sym != NULL, "Failed to obtain Symbol for module name"); + ModuleClassPathList* module_cpl = new ModuleClassPathList(module_sym); + + char* class_path = (xpatch_args->at(i))->path_string(); + int len = (int)strlen(class_path); + int end = 0; + // Iterate over the module's class path entries + for (int start = 0; start < len; start = end) { + while (class_path[end] && class_path[end] != os::path_separator()[0]) { + end++; + } + EXCEPTION_MARK; + ResourceMark rm(THREAD); + char* path = NEW_RESOURCE_ARRAY(char, end - start + 1); + strncpy(path, &class_path[start], end - start); + path[end - start] = '\0'; + + struct stat st; + if (os::stat(path, &st) == 0) { + // File or directory found + Thread* THREAD = Thread::current(); + ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK); + // If the path specification is valid, enter it into this module's list + if (new_entry != NULL) { + module_cpl->add_to_list(new_entry); + } + } + + while (class_path[end] == os::path_separator()[0]) { + end++; + } + } + + // Record the module into the list of -Xpatch entries only if + // valid ClassPathEntrys have been created + if (module_cpl->module_first_entry() != NULL) { + _xpatch_entries->push(module_cpl); + } + } +} + void ClassLoader::setup_search_path(const char *class_path, bool bootstrap_search) { int offset = 0; int len = (int)strlen(class_path); @@ -850,8 +934,29 @@ bool ClassLoader::update_class_path_entry_list(const char *path, } void ClassLoader::print_bootclasspath() { - ClassPathEntry* e = _first_entry; + ClassPathEntry* e; tty->print("[bootclasspath= "); + + // Print -Xpatch module/path specifications first + if (_xpatch_entries != NULL) { + ResourceMark rm; + int num_of_entries = _xpatch_entries->length(); + for (int i = 0; i < num_of_entries; i++) { + ModuleClassPathList* mpl = _xpatch_entries->at(i); + tty->print("%s=", mpl->module_name()->as_C_string()); + e = mpl->module_first_entry(); + while (e != NULL) { + tty->print("%s", e->name()); + e = e->next(); + if (e != NULL) { + tty->print("%s", os::path_separator()); + } + } + tty->print(" ;"); + } + } + + e = _first_entry; while (e != NULL) { tty->print("%s ;", e->name()); e = e->next(); @@ -941,6 +1046,7 @@ int ClassLoader::crc32(int crc, const char* buf, int len) { #if INCLUDE_CDS void ClassLoader::initialize_module_loader_map(JImageFile* jimage) { + ResourceMark rm; jlong size; JImageLocationRef location = (*JImageFindResource)(jimage, "java.base", get_jimage_version_string(), MODULE_LOADER_MAP, &size); if (location == 0) { @@ -985,7 +1091,6 @@ void ClassLoader::initialize_module_loader_map(JImageFile* jimage) { begin_ptr = ++end_ptr; end_ptr = strchr(begin_ptr, '\n'); } - FREE_RESOURCE_ARRAY(u1, buffer, size); } #endif @@ -1106,8 +1211,7 @@ s2 ClassLoader::module_to_classloader(const char* module_name) { } #endif -s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e, - int classpath_index, TRAPS) { +s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e, int classpath_index, TRAPS) { #if INCLUDE_CDS // obtain the classloader type based on the class name. // First obtain the package name based on the class name. Then obtain @@ -1157,12 +1261,11 @@ const char* ClassLoader::file_name_for_class_name(const char* class_name, } instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) { - assert(name != NULL, "invariant"); assert(THREAD->is_Java_thread(), "must be a JavaThread"); - ResourceMark rm; - HandleMark hm; + ResourceMark rm(THREAD); + HandleMark hm(THREAD); const char* const class_name = name->as_C_string(); @@ -1178,30 +1281,101 @@ instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_onl // Lookup stream for parsing .class file ClassFileStream* stream = NULL; s2 classpath_index = 0; + ClassPathEntry* e = NULL; // If DumpSharedSpaces is true, boot loader visibility boundaries are set - // to be _first_entry to the end (all path entries). + // to be _first_entry to the end (all path entries). No -Xpatch entries are + // included since CDS and AppCDS are not supported if -Xpatch is specified. // // If search_append_only is true, boot loader visibility boundaries are - // set to be _fist_append_entry to the end. This includes: + // set to be _first_append_entry to the end. This includes: // [-Xbootclasspath/a]; [jvmti appended entries] // // If both DumpSharedSpaces and search_append_only are false, boot loader // visibility boundaries are set to be _first_entry to the entry before // the _first_append_entry. This would include: - // [-Xpatch:]; [exploded build | modules] + // [-Xpatch:=()*]; [exploded build | jimage] // // DumpSharedSpaces and search_append_only are mutually exclusive and cannot // be true at the same time. - ClassPathEntry* e = (search_append_only ? _first_append_entry : _first_entry); - ClassPathEntry* last_e = - (search_append_only || DumpSharedSpaces ? NULL : _first_append_entry); + assert(!(DumpSharedSpaces && search_append_only), "DumpSharedSpaces and search_append_only are both true"); - { + // Load Attempt #1: -Xpatch + // Determine the class' defining module. If it appears in the _xpatch_entries, + // attempt to load the class from those locations specific to the module. + // Note: The -Xpatch entries are never searched if the boot loader's + // visibility boundary is limited to only searching the append entries. + if (_xpatch_entries != NULL && !search_append_only && !DumpSharedSpaces) { + // Find the module in the boot loader's module entry table + PackageEntry* pkg_entry = get_package_entry(class_name, ClassLoaderData::the_null_class_loader_data(), THREAD); + ModuleEntry* mod_entry = (pkg_entry != NULL) ? pkg_entry->module() : NULL; + + // If the module system has not defined java.base yet, then + // classes loaded are assumed to be defined to java.base. + // When java.base is eventually defined by the module system, + // all packages of classes that have been previously loaded + // are verified in ModuleEntryTable::verify_javabase_packages(). + if (!Universe::is_module_initialized() && + !ModuleEntryTable::javabase_defined() && + mod_entry == NULL) { + mod_entry = ModuleEntryTable::javabase_module(); + } + + // The module must be a named module + if (mod_entry != NULL && mod_entry->is_named()) { + int num_of_entries = _xpatch_entries->length(); + const Symbol* class_module_name = mod_entry->name(); + + // Loop through all the xpatch entries looking for module + for (int i = 0; i < num_of_entries; i++) { + ModuleClassPathList* module_cpl = _xpatch_entries->at(i); + Symbol* module_cpl_name = module_cpl->module_name(); + + if (module_cpl_name->fast_compare(class_module_name) == 0) { + // Class' module has been located, attempt to load + // the class from the module's ClassPathEntry list. + e = module_cpl->module_first_entry(); + while (e != NULL) { + stream = e->open_stream(file_name, CHECK_NULL); + // No context.check is required since both CDS + // and AppCDS are turned off if -Xpatch is specified. + if (NULL != stream) { + break; + } + e = e->next(); + } + // If the module was located in the xpatch entries, break out + // even if the class was not located successfully from that module's + // ClassPathEntry list. There will not be another valid entry for + // that module in the _xpatch_entries array. + break; + } + } + } + } + + // Load Attempt #2: [exploded build | jimage] + if (!search_append_only && (NULL == stream)) { + e = _first_entry; + while ((e != NULL) && (e != _first_append_entry)) { + stream = e->open_stream(file_name, CHECK_NULL); + if (!context.check(stream, classpath_index)) { + return NULL; + } + if (NULL != stream) { + break; + } + e = e->next(); + ++classpath_index; + } + } + + // Load Attempt #3: [-Xbootclasspath/a]; [jvmti appended entries] + if ((search_append_only || DumpSharedSpaces) && (NULL == stream)) { + // For the boot loader append path search, must calculate + // the starting classpath_index prior to attempting to + // load the classfile. if (search_append_only) { - // For the boot loader append path search, must calculate - // the starting classpath_index prior to attempting to - // load the classfile. ClassPathEntry *tmp_e = _first_entry; while ((tmp_e != NULL) && (tmp_e != _first_append_entry)) { tmp_e = tmp_e->next(); @@ -1209,11 +1383,8 @@ instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_onl } } - // Attempt to load the classfile from either: - // - [-Xpatch:dir]; exploded build | modules - // or - // - [-Xbootclasspath/a]; [jvmti appended entries] - while ((e != NULL) && (e != last_e)) { + e = _first_append_entry; + while (e != NULL) { stream = e->open_stream(file_name, CHECK_NULL); if (!context.check(stream, classpath_index)) { return NULL; @@ -1384,10 +1555,23 @@ int ClassLoader::compute_Object_vtable() { } -void classLoader_init() { +void classLoader_init1() { ClassLoader::initialize(); } +// Complete the ClassPathEntry setup for the boot loader +void classLoader_init2() { + // Setup the list of module/path pairs for -Xpatch processing + // This must be done after the SymbolTable is created in order + // to use fast_compare on module names instead of a string compare. + if (Arguments::get_xpatchprefix() != NULL) { + ClassLoader::setup_xpatch_entries(); + } + + // Determine if this is an exploded build + ClassLoader::set_has_jimage(); +} + bool ClassLoader::get_canonical_path(const char* orig, char* out, int len) { assert(orig != NULL && out != NULL && len > 0, "bad arguments"); @@ -1431,17 +1615,19 @@ void ClassLoader::create_javabase() { } ModuleEntryTable::set_javabase_module(jb_module); } +} - // When looking for the jimage file, only - // search the boot loader's module path which - // can consist of [-Xpatch]; exploded build | modules - // Do not search the boot loader's append path. +void ClassLoader::set_has_jimage() { + // Determine if this is an exploded build. When looking for + // the jimage file, only search the piece of the boot + // loader's boot class path which contains [exploded build | jimage]. + // Do not search the boot loader's xpatch entries or append path. ClassPathEntry* e = _first_entry; ClassPathEntry* last_e = _first_append_entry; while ((e != NULL) && (e != last_e)) { JImageFile *jimage = e->jimage(); if (jimage != NULL && e->is_jrt()) { - set_has_jimage(true); + _has_jimage = true; #if INCLUDE_CDS ClassLoader::initialize_module_loader_map(jimage); #endif diff --git a/hotspot/src/share/vm/classfile/classLoader.hpp b/hotspot/src/share/vm/classfile/classLoader.hpp index fc1d335b7ab..1168f322486 100644 --- a/hotspot/src/share/vm/classfile/classLoader.hpp +++ b/hotspot/src/share/vm/classfile/classLoader.hpp @@ -142,13 +142,30 @@ public: JImageFile* jimage() const { return _jimage; } ClassPathImageEntry(JImageFile* jimage, const char* name); ~ClassPathImageEntry(); - void name_to_package(const char* name, char* package, int length); ClassFileStream* open_stream(const char* name, TRAPS); // Debugging NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);) }; +// ModuleClassPathList contains a linked list of ClassPathEntry's +// that have been specified for a specific module. Currently, +// the only way to specify a module/path pair is via the -Xpatch +// command line option. +class ModuleClassPathList : public CHeapObj { +private: + Symbol* _module_name; + // First and last entries of class path entries for a specific module + ClassPathEntry* _module_first_entry; + ClassPathEntry* _module_last_entry; +public: + Symbol* module_name() const { return _module_name; } + ClassPathEntry* module_first_entry() const { return _module_first_entry; } + ModuleClassPathList(Symbol* module_name); + ~ModuleClassPathList(); + void add_to_list(ClassPathEntry* new_entry); +}; + class SharedPathsMiscInfo; class ClassLoader: AllStatic { @@ -195,21 +212,31 @@ class ClassLoader: AllStatic { static PerfCounter* _isUnsyncloadClass; static PerfCounter* _load_instance_class_failCounter; - // First entry in linked list of ClassPathEntry instances. - // This consists of entries made up by: - // - boot loader modules - // [-Xpatch]; exploded build | modules; - // - boot loader append path - // [-Xbootclasspath/a]; [jvmti appended entries] + // The boot class path consists of 3 ordered pieces: + // 1. the module/path pairs specified to -Xpatch + // -Xpatch:=()* + // 2. the base piece + // [exploded build | jimage] + // 3. boot loader append path + // [-Xbootclasspath/a]; [jvmti appended entries] + // + // The boot loader must obey this order when attempting + // to load a class. + + // Contains the module/path pairs specified to -Xpatch + static GrowableArray* _xpatch_entries; + + // Contains the ClassPathEntry instances that include + // both the base piece and the boot loader append path. static ClassPathEntry* _first_entry; // Last entry in linked list of ClassPathEntry instances static ClassPathEntry* _last_entry; static int _num_entries; - // Pointer into the linked list of ClassPathEntry instances. // Marks the start of: // - the boot loader's append path // [-Xbootclasspath/a]; [jvmti appended entries] + // within the linked list of ClassPathEntry instances. static ClassPathEntry* _first_append_entry; static const char* _shared_archive; @@ -325,11 +352,11 @@ class ClassLoader: AllStatic { return _load_instance_class_failCounter; } - // Sets _has_jimage to TRUE if "modules" jimage file exists - static void set_has_jimage(bool val) { - _has_jimage = val; - } + // Set up the module/path pairs as specified to -Xpatch + static void setup_xpatch_entries(); + // Sets _has_jimage to TRUE if "modules" jimage file exists + static void set_has_jimage(); static bool has_jimage() { return _has_jimage; } // Create the ModuleEntry for java.base @@ -416,6 +443,9 @@ class ClassLoader: AllStatic { static bool string_ends_with(const char* str, const char* str_to_find); + // obtain package name from a fully qualified class name + static const char* package_from_name(const char* class_name); + static bool is_jrt(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); } // Debugging diff --git a/hotspot/src/share/vm/classfile/modules.cpp b/hotspot/src/share/vm/classfile/modules.cpp index 6d47db68c7d..10319b1c499 100644 --- a/hotspot/src/share/vm/classfile/modules.cpp +++ b/hotspot/src/share/vm/classfile/modules.cpp @@ -133,68 +133,31 @@ static PackageEntry* get_package_entry_by_name(Symbol* package, return NULL; } -// Check if -Xpatch: was specified. If so, prepend each /module_name, -// if it exists, to bootpath so boot loader can find the class files. Also, if -// using exploded modules, append /modules/module_name, if it exists, -// to bootpath so that its class files can be found by the boot loader. -static void add_to_boot_loader_list(char *module_name, TRAPS) { - // java.base should be handled by argument parsing. +// If using exploded build, append /modules/module_name, if it exists, +// to the system boot class path in order for the boot loader to locate class files. +static void add_to_exploded_build_list(char *module_name, TRAPS) { + assert(!ClassLoader::has_jimage(), "Exploded build not applicable"); + // java.base is handled by os::set_boot_path assert(strcmp(module_name, "java.base") != 0, "Unexpected java.base module name"); + char file_sep = os::file_separator()[0]; size_t module_len = strlen(module_name); - // If -Xpatch is set then add /module_name paths. - char** patch_dirs = Arguments::patch_dirs(); - if (patch_dirs != NULL) { - int dir_count = Arguments::patch_dirs_count(); - for (int x = 0; x < dir_count; x++) { - // Really shouldn't be NULL, but check can't hurt - if (patch_dirs[x] != NULL) { - size_t len = strlen(patch_dirs[x]); - if (len != 0) { // Ignore empty strings. - len = len + module_len + 2; - char* prefix_path = NEW_C_HEAP_ARRAY(char, len, mtInternal); - jio_snprintf(prefix_path, len, "%s%c%s", patch_dirs[x], file_sep, module_name); - - // See if Xpatch module path exists. - struct stat st; - if ((os::stat(prefix_path, &st) != 0)) { - FREE_C_HEAP_ARRAY(char, prefix_path); - } else { - { - HandleMark hm; - Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock()); - ObjectLocker ol(loader_lock, THREAD); - ClassLoader::prepend_to_list(prefix_path); - } - log_info(classload)("opened: -Xpatch %s", prefix_path); - } - } - } - } - } - - // If "modules" jimage does not exist then assume exploded form - // ${java.home}/modules/ - char* path = NULL; - if (!ClassLoader::has_jimage()) { - const char* home = Arguments::get_java_home(); - size_t len = strlen(home) + module_len + 32; - path = NEW_C_HEAP_ARRAY(char, len, mtInternal); - jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name); - struct stat st; - // See if exploded module path exists. - if ((os::stat(path, &st) != 0)) { - FREE_C_HEAP_ARRAY(char, path); - path = NULL; - } + const char* home = Arguments::get_java_home(); + size_t len = strlen(home) + module_len + 32; + char* path = NEW_C_HEAP_ARRAY(char, len, mtInternal); + jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name); + struct stat st; + // See if exploded module path exists + if ((os::stat(path, &st) != 0)) { + FREE_C_HEAP_ARRAY(char, path); + path = NULL; } if (path != NULL) { HandleMark hm; Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock()); ObjectLocker ol(loader_lock, THREAD); - log_info(classload)("opened: %s", path); ClassLoader::add_to_list(path); } @@ -493,13 +456,12 @@ void Modules::define_module(jobject module, jstring version, } } - if (loader == NULL && !Universe::is_module_initialized()) { - // Now that the module is defined, if it is in the bootloader, make sure that - // its classes can be found. Check if -Xpatch: was specified. If - // so prepend /module_name, if it exists, to bootpath. Also, if using - // exploded modules, prepend /modules/module_name, if it exists, - // to bootpath. - add_to_boot_loader_list(module_name, CHECK); + // If the module is defined to the boot loader and an exploded build is being + // used, prepend /modules/modules_name, if it exists, to the system boot class path. + if (loader == NULL && + !Universe::is_module_initialized() && + !ClassLoader::has_jimage()) { + add_to_exploded_build_list(module_name, CHECK); } } diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index ec3b9462959..f952b3d5511 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -880,7 +880,7 @@ bool FileMapInfo::FileMapHeader::validate() { return false; } - if (Arguments::patch_dirs() != NULL) { + if (Arguments::get_xpatchprefix() != NULL) { FileMapInfo::fail_continue("The shared archive file cannot be used with -Xpatch."); return false; } diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp index e759464591d..7c39f63e092 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.hpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp @@ -43,10 +43,10 @@ // for the x64 platform #define DEFAULT_VTBL_COMMON_CODE_SIZE (1*K) // conservative size of the "common_code" for the x64 platform -#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(12*M) LP64_ONLY(16*M)) -#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(7*M) LP64_ONLY(12*M)) +#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(8*M) LP64_ONLY(10*M)) +#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(7*M) LP64_ONLY(10*M)) -#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(12*M) LP64_ONLY(16*M)) +#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(8*M) LP64_ONLY(10*M)) #define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(8*M) LP64_ONLY(9*M)) // the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index 1e8c1a465dc..ce7e6d1df5d 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -415,8 +415,12 @@ static bool check_inlined_mh_linker_info(ciMethod* symbolic_info, ciMethod* reso if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) { return false; // Total size of arguments on stack mismatch. } - if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) { - return false; // Return value size or type mismatch encountered. + if (!symbolic_info->return_type()->is_void()) { + // Only check the return type if the symbolic method is not void + // i.e. the return value of the resolved method can be dropped + if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) { + return false; // Return value size or type mismatch encountered. + } } switch (symbolic_info->intrinsic_id()) { diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 7fa2ea8a7ad..8fb0519bb35 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -84,8 +84,6 @@ const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG; const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER; int Arguments::_sun_java_launcher_pid = -1; bool Arguments::_sun_java_launcher_is_altjvm = false; -int Arguments::_patch_dirs_count = 0; -char** Arguments::_patch_dirs = NULL; int Arguments::_bootclassloader_append_index = -1; // These parameters are reset in method parse_vm_init_args() @@ -112,6 +110,7 @@ SystemProperty *Arguments::_java_home = NULL; SystemProperty *Arguments::_java_class_path = NULL; SystemProperty *Arguments::_jdk_boot_class_path_append = NULL; +GrowableArray *Arguments::_xpatchprefix = NULL; PathString *Arguments::_system_boot_class_path = NULL; char* Arguments::_ext_dirs = NULL; @@ -579,204 +578,6 @@ static bool verify_special_jvm_flags() { } #endif -// Constructs the system boot class path from the following components, in order: -// -// prefix // from -Xpatch:... -// base // from os::get_system_properties() -// suffix // from -Xbootclasspath/a:... -// -// This could be AllStatic, but it isn't needed after argument processing is -// complete. After argument processing, the combined components are copied -// to Arguments::_system_boot_class_path via a call to Arguments::set_sysclasspath. -class ArgumentBootClassPath: public StackObj { -public: - ArgumentBootClassPath(const char* base); - ~ArgumentBootClassPath(); - - inline void set_base(const char* base); - inline void add_prefix(const char* prefix); - inline void add_suffix_to_prefix(const char* suffix); - inline void add_suffix(const char* suffix); - inline void reset_path(const char* base); - - inline const char* get_base() const { return _items[_bcp_base]; } - inline const char* get_prefix() const { return _items[_bcp_prefix]; } - inline const char* get_suffix() const { return _items[_bcp_suffix]; } - - // Combine all the components into a single c-heap-allocated string; caller - // must free the string if/when no longer needed. - char* combined_path(); - -private: - // Utility routines. - static char* add_to_path(const char* path, const char* str, bool prepend); - static char* add_jars_to_path(char* path, const char* directory); - - inline void reset_item_at(int index); - - // Array indices for the items that make up the sysclasspath. All except the - // base are allocated in the C heap and freed by this class. - enum { - _bcp_prefix, // was -Xpatch:... - _bcp_base, // the default system boot class path - _bcp_suffix, // from -Xbootclasspath/a:... - _bcp_nitems // the number of items, must be last. - }; - - const char* _items[_bcp_nitems]; -}; - -ArgumentBootClassPath::ArgumentBootClassPath(const char* base) { - memset(_items, 0, sizeof(_items)); - _items[_bcp_base] = base; -} - -ArgumentBootClassPath::~ArgumentBootClassPath() { - // Free everything except the base. - for (int i = 0; i < _bcp_nitems; ++i) { - if (i != _bcp_base) reset_item_at(i); - } -} - -inline void ArgumentBootClassPath::set_base(const char* base) { - _items[_bcp_base] = base; -} - -inline void ArgumentBootClassPath::add_prefix(const char* prefix) { - _items[_bcp_prefix] = add_to_path(_items[_bcp_prefix], prefix, true); -} - -inline void ArgumentBootClassPath::add_suffix_to_prefix(const char* suffix) { - _items[_bcp_prefix] = add_to_path(_items[_bcp_prefix], suffix, false); -} - -inline void ArgumentBootClassPath::add_suffix(const char* suffix) { - _items[_bcp_suffix] = add_to_path(_items[_bcp_suffix], suffix, false); -} - -inline void ArgumentBootClassPath::reset_item_at(int index) { - assert(index < _bcp_nitems && index != _bcp_base, "just checking"); - if (_items[index] != NULL) { - FREE_C_HEAP_ARRAY(char, _items[index]); - _items[index] = NULL; - } -} - -inline void ArgumentBootClassPath::reset_path(const char* base) { - // Clear the prefix and suffix. - reset_item_at(_bcp_prefix); - reset_item_at(_bcp_suffix); - set_base(base); -} - -//------------------------------------------------------------------------------ - - -// Combine the bootclasspath elements, some of which may be null, into a single -// c-heap-allocated string. -char* ArgumentBootClassPath::combined_path() { - assert(_items[_bcp_base] != NULL, "empty default sysclasspath"); - - size_t lengths[_bcp_nitems]; - size_t total_len = 0; - - const char separator = *os::path_separator(); - - // Get the lengths. - int i; - for (i = 0; i < _bcp_nitems; ++i) { - if (i == _bcp_suffix) { - // Record index of boot loader's append path. - Arguments::set_bootclassloader_append_index((int)total_len); - } - if (_items[i] != NULL) { - lengths[i] = strlen(_items[i]); - // Include space for the separator char (or a NULL for the last item). - total_len += lengths[i] + 1; - } - } - assert(total_len > 0, "empty sysclasspath not allowed"); - - // Copy the _items to a single string. - char* cp = NEW_C_HEAP_ARRAY(char, total_len, mtArguments); - char* cp_tmp = cp; - for (i = 0; i < _bcp_nitems; ++i) { - if (_items[i] != NULL) { - memcpy(cp_tmp, _items[i], lengths[i]); - cp_tmp += lengths[i]; - *cp_tmp++ = separator; - } - } - *--cp_tmp = '\0'; // Replace the extra separator. - return cp; -} - -// Note: path must be c-heap-allocated (or NULL); it is freed if non-null. -char* -ArgumentBootClassPath::add_to_path(const char* path, const char* str, bool prepend) { - char *cp; - - assert(str != NULL, "just checking"); - if (path == NULL) { - size_t len = strlen(str) + 1; - cp = NEW_C_HEAP_ARRAY(char, len, mtArguments); - memcpy(cp, str, len); // copy the trailing null - } else { - const char separator = *os::path_separator(); - size_t old_len = strlen(path); - size_t str_len = strlen(str); - size_t len = old_len + str_len + 2; - - if (prepend) { - cp = NEW_C_HEAP_ARRAY(char, len, mtArguments); - char* cp_tmp = cp; - memcpy(cp_tmp, str, str_len); - cp_tmp += str_len; - *cp_tmp = separator; - memcpy(++cp_tmp, path, old_len + 1); // copy the trailing null - FREE_C_HEAP_ARRAY(char, path); - } else { - cp = REALLOC_C_HEAP_ARRAY(char, path, len, mtArguments); - char* cp_tmp = cp + old_len; - *cp_tmp = separator; - memcpy(++cp_tmp, str, str_len + 1); // copy the trailing null - } - } - return cp; -} - -// Scan the directory and append any jar or zip files found to path. -// Note: path must be c-heap-allocated (or NULL); it is freed if non-null. -char* ArgumentBootClassPath::add_jars_to_path(char* path, const char* directory) { - DIR* dir = os::opendir(directory); - if (dir == NULL) return path; - - char dir_sep[2] = { '\0', '\0' }; - size_t directory_len = strlen(directory); - const char fileSep = *os::file_separator(); - if (directory[directory_len - 1] != fileSep) dir_sep[0] = fileSep; - - /* Scan the directory for jars/zips, appending them to path. */ - struct dirent *entry; - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtArguments); - while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { - const char* name = entry->d_name; - const char* ext = name + strlen(name) - 4; - bool isJarOrZip = ext > name && - (os::file_name_strcmp(ext, ".jar") == 0 || - os::file_name_strcmp(ext, ".zip") == 0); - if (isJarOrZip) { - char* jarpath = NEW_C_HEAP_ARRAY(char, directory_len + 2 + strlen(name), mtArguments); - sprintf(jarpath, "%s%s%s", directory, dir_sep, name); - path = add_to_path(path, jarpath, false); - FREE_C_HEAP_ARRAY(char, jarpath); - } - } - FREE_C_HEAP_ARRAY(char, dbuf); - os::closedir(dir); - return path; -} - // Parses a memory size specification string. static bool atomull(const char *s, julong* result) { julong n = 0; @@ -2687,9 +2488,7 @@ Arguments::ArgsRange Arguments::parse_memory_size(const char* s, jint Arguments::parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, const JavaVMInitArgs *java_options_args, const JavaVMInitArgs *cmd_line_args) { - // For components of the system classpath. - ArgumentBootClassPath bcp(Arguments::get_sysclasspath()); - bool bcp_assembly_required = false; + bool xpatch_javabase = false; // Save default settings for some mode flags Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; @@ -2706,29 +2505,26 @@ jint Arguments::parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, // Parse args structure generated from JAVA_TOOL_OPTIONS environment // variable (if present). - jint result = parse_each_vm_init_arg( - java_tool_options_args, &bcp, &bcp_assembly_required, Flag::ENVIRON_VAR); + jint result = parse_each_vm_init_arg(java_tool_options_args, &xpatch_javabase, Flag::ENVIRON_VAR); if (result != JNI_OK) { return result; } // Parse args structure generated from the command line flags. - result = parse_each_vm_init_arg(cmd_line_args, &bcp, &bcp_assembly_required, - Flag::COMMAND_LINE); + result = parse_each_vm_init_arg(cmd_line_args, &xpatch_javabase, Flag::COMMAND_LINE); if (result != JNI_OK) { return result; } // Parse args structure generated from the _JAVA_OPTIONS environment // variable (if present) (mimics classic VM) - result = parse_each_vm_init_arg( - java_options_args, &bcp, &bcp_assembly_required, Flag::ENVIRON_VAR); + result = parse_each_vm_init_arg(java_options_args, &xpatch_javabase, Flag::ENVIRON_VAR); if (result != JNI_OK) { return result; } // Do final processing now that all arguments have been parsed - result = finalize_vm_init_args(&bcp, bcp_assembly_required); + result = finalize_vm_init_args(); if (result != JNI_OK) { return result; } @@ -2781,10 +2577,7 @@ bool valid_jdwp_agent(char *name, bool is_path) { return false; } -jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, - ArgumentBootClassPath* bcp_p, - bool* bcp_assembly_required_p, - Flag::Flags origin) { +jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* xpatch_javabase, Flag::Flags origin) { // For match_option to return remaining or value part of option string const char* tail; @@ -2840,8 +2633,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_EINVAL; // -bootclasspath/a: } else if (match_option(option, "-Xbootclasspath/a:", &tail)) { - bcp_p->add_suffix(tail); - *bcp_assembly_required_p = true; + Arguments::set_bootclassloader_append_index((int)strlen(Arguments::get_sysclasspath())+1); + Arguments::append_sysclasspath(tail); // -bootclasspath/p: } else if (match_option(option, "-Xbootclasspath/p:", &tail)) { jio_fprintf(defaultStream::output_stream(), @@ -2901,9 +2694,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, if (tail != NULL) { char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtArguments), tail); add_init_agent("instrument", options, false); - // java agents need module java.instrument. Also -addmods ALL-SYSTEM because - // the java agent is in the unmamed module of the application class loader - if (!Arguments::append_to_addmods_property("java.instrument,ALL-SYSTEM")) { + // java agents need module java.instrument + if (!Arguments::append_to_addmods_property("java.instrument")) { return JNI_ENOMEM; } } @@ -3181,37 +2973,30 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_ERR; #endif } - if (match_option(option, "-Djdk.launcher.patch.0=", &tail)) { - // -Xpatch - int dir_count; - char** patch_dirs = os::split_path(tail, &dir_count); - if (patch_dirs == NULL) { - jio_fprintf(defaultStream::output_stream(), - "Bad value for -Xpatch.\n"); + if (match_option(option, "-Djdk.launcher.patch.", &tail)) { + // -Djdk.launcher.patch.#==()* + // The number, #, specified will be increasing with each -Xpatch + // specified on the command line. + // Pick up module name, following the -D property's equal sign. + const char* property_equal = strchr(tail, '='); + if (property_equal == NULL) { + jio_fprintf(defaultStream::output_stream(), "Missing '=' in -Xpatch specification\n"); return JNI_ERR; - } - set_patch_dirs(patch_dirs); - set_patch_dirs_count(dir_count); - - // Create a path for each patch dir consisting of dir/java.base. - char file_sep = os::file_separator()[0]; - for (int x = 0; x < dir_count; x++) { - // Really shouldn't be NULL, but check can't hurt - if (patch_dirs[x] != NULL) { - size_t len = strlen(patch_dirs[x]); - if (len != 0) { // Ignore empty strings. - len += 11; // file_sep + "java.base" + null terminator. - char* dir = NEW_C_HEAP_ARRAY(char, len, mtArguments); - jio_snprintf(dir, len, "%s%cjava.base", patch_dirs[x], file_sep); - - // See if Xpatch module path exists. - struct stat st; - if ((os::stat(dir, &st) == 0)) { - bcp_p->add_prefix(dir); - *bcp_assembly_required_p = true; - } - FREE_C_HEAP_ARRAY(char, dir); - } + } else { + // Find the equal sign between the module name and the path specification + const char* module_equal = strchr(property_equal + 1, '='); + if (module_equal == NULL) { + jio_fprintf(defaultStream::output_stream(), "Bad value for -Xpatch, no module name specified\n"); + return JNI_ERR; + } else { + // Pick out the module name, in between the two equal signs + size_t module_len = module_equal - property_equal - 1; + char* module_name = NEW_C_HEAP_ARRAY(char, module_len+1, mtArguments); + memcpy(module_name, property_equal + 1, module_len); + *(module_name + module_len) = '\0'; + // The path piece begins one past the module_equal sign + Arguments::add_xpatchprefix(module_name, module_equal + 1, xpatch_javabase); + FREE_C_HEAP_ARRAY(char, module_name); } } } @@ -3474,6 +3259,27 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_OK; } +void Arguments::add_xpatchprefix(const char* module_name, const char* path, bool* xpatch_javabase) { + // For java.base check for duplicate -Xpatch options being specified on the command line. + // This check is only required for java.base, all other duplicate module specifications + // will be checked during module system initialization. The module system initialization + // will throw an ExceptionInInitializerError if this situation occurs. + if (strcmp(module_name, "java.base") == 0) { + if (*xpatch_javabase) { + vm_exit_during_initialization("Cannot specify java.base more than once to -Xpatch"); + } else { + *xpatch_javabase = true; + } + } + + // Create GrowableArray lazily, only if -Xpatch has been specified + if (_xpatchprefix == NULL) { + _xpatchprefix = new (ResourceObj::C_HEAP, mtArguments) GrowableArray(10, true); + } + + _xpatchprefix->push(new ModuleXPatchPath(module_name, path)); +} + // Set property jdk.boot.class.path.append to the contents of the bootclasspath // that follows either the jimage file or exploded module directories. The // property will contain -Xbootclasspath/a and/or jvmti appended additions. @@ -3572,7 +3378,7 @@ static int check_non_empty_dirs(const char* path) { return nonEmptyDirs; } -jint Arguments::finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_assembly_required) { +jint Arguments::finalize_vm_init_args() { // check if the default lib/endorsed directory exists; if so, error char path[JVM_MAXPATHLEN]; const char* fileSep = os::file_separator(); @@ -3608,17 +3414,7 @@ jint Arguments::finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_ass return JNI_ERR; } - if (bcp_assembly_required) { - // Assemble the bootclasspath elements into the final path. - char *combined_path = bcp_p->combined_path(); - Arguments::set_sysclasspath(combined_path); - FREE_C_HEAP_ARRAY(char, combined_path); - } else { - // At this point in sysclasspath processing anything - // added would be considered in the boot loader's append path. - // Record this index, including +1 for the file separator character. - Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1); - } + Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1); // This must be done after all arguments have been processed. // java_compiler() true means set to "NONE" or empty. @@ -3667,6 +3463,12 @@ jint Arguments::finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_ass UNSUPPORTED_OPTION(TieredCompilation); #endif +#if INCLUDE_JVMCI + if (EnableJVMCI && !append_to_addmods_property("jdk.vm.ci")) { + return JNI_ENOMEM; + } +#endif + // If we are running in a headless jre, force java.awt.headless property // to be true unless the property has already been set. // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state. @@ -3968,7 +3770,7 @@ jint Arguments::parse_options_buffer(const char* name, char* buffer, const size_ void Arguments::set_shared_spaces_flags() { if (DumpSharedSpaces) { - if (Arguments::patch_dirs() != NULL) { + if (Arguments::get_xpatchprefix() != NULL) { vm_exit_during_initialization( "Cannot use the following option when dumping the shared archive", "-Xpatch"); } diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 4df23a5b485..9fd8ae093b2 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -41,17 +41,15 @@ extern "C" { typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0); } -// Forward declarations -class ArgumentBootClassPath; - -// PathString is used as the underlying value container for a -// SystemProperty and for the string that represents the system -// boot class path, Arguments::_system_boot_class_path. +// PathString is used as: +// - the underlying value for a SystemProperty +// - the path portion of an -Xpatch module/path pair +// - the string that represents the system boot class path, Arguments::_system_boot_class_path. class PathString : public CHeapObj { protected: - char* _value; + char* _value; public: - char* value() const { return _value; } + char* value() const { return _value; } bool set_value(const char *value) { if (_value != NULL) { @@ -92,7 +90,6 @@ class PathString : public CHeapObj { } } - // Constructor PathString(const char* value) { if (value == NULL) { _value = NULL; @@ -101,6 +98,43 @@ class PathString : public CHeapObj { strcpy(_value, value); } } + + ~PathString() { + if (_value != NULL) { + FreeHeap(_value); + _value = NULL; + } + } +}; + +// ModuleXPatchPath records the module/path pair as specified to -Xpatch. +class ModuleXPatchPath : public CHeapObj { +private: + char* _module_name; + PathString* _path; +public: + ModuleXPatchPath(const char* module_name, const char* path) { + assert(module_name != NULL && path != NULL, "Invalid module name or path value"); + size_t len = strlen(module_name) + 1; + _module_name = AllocateHeap(len, mtInternal); + strncpy(_module_name, module_name, len); // copy the trailing null + _path = new PathString(path); + } + + ~ModuleXPatchPath() { + if (_module_name != NULL) { + FreeHeap(_module_name); + _module_name = NULL; + } + if (_path != NULL) { + delete _path; + _path = NULL; + } + } + + inline void set_path(const char* path) { _path->set_value(path); } + inline const char* module_name() const { return _module_name; } + inline char* path_string() const { return _path->value(); } }; // Element describing System and User (-Dkey=value flags) defined property. @@ -114,7 +148,7 @@ class SystemProperty : public PathString { SystemProperty* _next; bool _internal; bool _writeable; - bool writeable() { return _writeable; } + bool writeable() { return _writeable; } public: // Accessors @@ -314,10 +348,19 @@ class Arguments : AllStatic { static SystemProperty *_java_class_path; static SystemProperty *_jdk_boot_class_path_append; + // -Xpatch:module=()* + // Each element contains the associated module name, path + // string pair as specified to -Xpatch. + static GrowableArray* _xpatchprefix; + // The constructed value of the system class path after // argument processing and JVMTI OnLoad additions via // calls to AddToBootstrapClassLoaderSearch. This is the // final form before ClassLoader::setup_bootstrap_search(). + // Note: since -Xpatch is a module name/path pair, the system + // boot class path string no longer contains the "prefix" to + // the boot class path base piece as it did when + // -Xbootclasspath/p was supported. static PathString *_system_boot_class_path; // temporary: to emit warning if the default ext dirs are not empty. @@ -373,12 +416,6 @@ class Arguments : AllStatic { // mark the boot loader's append path observability boundary. static int _bootclassloader_append_index; - // -Xpatch flag - static char** _patch_dirs; - static int _patch_dirs_count; - static void set_patch_dirs(char** dirs) { _patch_dirs = dirs; } - static void set_patch_dirs_count(int count) { _patch_dirs_count = count; } - // -Xdebug flag static bool _xdebug_mode; static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; } @@ -465,8 +502,8 @@ class Arguments : AllStatic { static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, const JavaVMInitArgs *java_options_args, const JavaVMInitArgs *cmd_line_args); - static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, ArgumentBootClassPath* bcp_p, bool* bcp_assembly_required_p, Flag::Flags origin); - static jint finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_assembly_required); + static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* xpatch_javabase, Flag::Flags origin); + static jint finalize_vm_init_args(); static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type); static bool is_bad_option(const JavaVMOption* option, jboolean ignore) { @@ -637,13 +674,12 @@ class Arguments : AllStatic { return _bootclassloader_append_index; } static void set_bootclassloader_append_index(int value) { - _bootclassloader_append_index = value; + // Set only if the index has not been set yet + if (_bootclassloader_append_index == -1) { + _bootclassloader_append_index = value; + } } - // -Xpatch - static char** patch_dirs() { return _patch_dirs; } - static int patch_dirs_count() { return _patch_dirs_count; } - // -Xrun static AgentLibrary* libraries() { return _libraryList.first(); } static bool init_libraries_at_startup() { return !_libraryList.is_empty(); } @@ -701,8 +737,8 @@ class Arguments : AllStatic { static void set_library_path(const char *value) { _java_library_path->set_value(value); } static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); } - // Set up of the underlying system boot class path - static void set_jdkbootclasspath_append(); + // Set up the underlying pieces of the system boot class path + static void add_xpatchprefix(const char *module_name, const char *path, bool* xpatch_javabase); static void set_sysclasspath(const char *value) { _system_boot_class_path->set_value(value); set_jdkbootclasspath_append(); @@ -711,11 +747,15 @@ class Arguments : AllStatic { _system_boot_class_path->append_value(value); set_jdkbootclasspath_append(); } + static void set_jdkbootclasspath_append(); - static char* get_java_home() { return _java_home->value(); } - static char* get_dll_dir() { return _sun_boot_library_path->value(); } + static GrowableArray* get_xpatchprefix() { return _xpatchprefix; } static char* get_sysclasspath() { return _system_boot_class_path->value(); } - static char* get_ext_dirs() { return _ext_dirs; } + static char* get_jdk_boot_class_path_append() { return _jdk_boot_class_path_append->value(); } + + static char* get_java_home() { return _java_home->value(); } + static char* get_dll_dir() { return _sun_boot_library_path->value(); } + static char* get_ext_dirs() { return _ext_dirs; } static char* get_appclasspath() { return _java_class_path->value(); } static void fix_appclasspath(); diff --git a/hotspot/src/share/vm/runtime/init.cpp b/hotspot/src/share/vm/runtime/init.cpp index 64313d825e1..b74a3daf040 100644 --- a/hotspot/src/share/vm/runtime/init.cpp +++ b/hotspot/src/share/vm/runtime/init.cpp @@ -52,7 +52,8 @@ void SuspendibleThreadSet_init() NOT_ALL_GCS_RETURN; // Initialization done by Java thread in init_globals() void management_init(); void bytecodes_init(); -void classLoader_init(); +void classLoader_init1(); +void classLoader_init2(); // note: ClassLoader need 2-phase init void compilationPolicy_init(); void codeCache_init(); void VM_Version_init(); @@ -102,7 +103,7 @@ jint init_globals() { HandleMark hm; management_init(); bytecodes_init(); - classLoader_init(); + classLoader_init1(); compilationPolicy_init(); codeCache_init(); CodeCacheExtensions::initialize(); @@ -116,6 +117,7 @@ jint init_globals() { if (status != JNI_OK) return status; + classLoader_init2(); // after SymbolTable creation, set up -Xpatch entries CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Universe); interpreter_init(); // before any methods loaded CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Interpreter); diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT index 29c9696e7be..e52c1b1a3ff 100644 --- a/hotspot/test/TEST.ROOT +++ b/hotspot/test/TEST.ROOT @@ -36,9 +36,12 @@ groups=TEST.groups [closed/TEST.groups] requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java requires.properties=sun.arch.data.model -# Tests using jtreg 4.2 b01 features -requiredVersion=4.2 b01 +# Tests using jtreg 4.2 b02 features +requiredVersion=4.2 b02 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them external.lib.roots = ../../ + +# Use new form of -Xpatch +useNewXpatch=true diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java index fa72d45b0d1..f70f40503d7 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,7 +30,7 @@ * @build AndnTestI * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/bootclasspath -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestI */ diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java index 5bd9ebdb057..32b43afc038 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,7 +30,7 @@ * @build AndnTestL * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/bootclasspath -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestL */ diff --git a/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java b/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java index 78ee7131476..c19705f3a44 100644 --- a/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java +++ b/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java @@ -27,7 +27,7 @@ * @modules java.base/jdk.internal.org.objectweb.asm * @library patches * @build java.base/java.lang.invoke.MethodHandleHelper - * @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:classunload + * @run main/bootclasspath/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:classunload * -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC * -verbose:gc compiler.jsr292.CallSiteDepContextTest */ diff --git a/hotspot/test/compiler/jsr292/InvokerGC.java b/hotspot/test/compiler/jsr292/InvokerGC.java index c0a47184f06..35884f431f5 100644 --- a/hotspot/test/compiler/jsr292/InvokerGC.java +++ b/hotspot/test/compiler/jsr292/InvokerGC.java @@ -25,7 +25,7 @@ * @test * @bug 8067247 * @library /test/lib /compiler/whitebox / - * @run main/bootclasspath -Xcomp -Xbatch + * @run main/bootclasspath/othervm -Xcomp -Xbatch * -XX:CompileCommand=compileonly,InvokerGC::test * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * InvokerGC diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java index fc705850e00..8cf3c14ff69 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -28,7 +28,7 @@ * @modules java.base/jdk.internal.vm.annotation * @build java.base/java.lang.invoke.MethodHandleHelper * @build sun.hotspot.WhiteBox - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 225db6018ce..fbd57cd4b96 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -29,7 +29,7 @@ * @build java.base/java.lang.invoke.MethodHandleHelper * @build sun.hotspot.WhiteBox * @build compiler.jsr292.NonInlinedCall.InvokeTest - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 * compiler.jsr292.NonInlinedCall.InvokeTest diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index 6607ec19c6c..27bc5c9a238 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -35,7 +35,7 @@ * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * compiler.jsr292.NonInlinedCall.RedefineTest - * @run main/bootclasspath -javaagent:agent.jar + * @run main/bootclasspath/othervm -javaagent:agent.jar * -XX:+IgnoreUnrecognizedVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 diff --git a/hotspot/test/compiler/jsr292/VMAnonymousClasses.java b/hotspot/test/compiler/jsr292/VMAnonymousClasses.java index 50bb3432642..953deafe871 100644 --- a/hotspot/test/compiler/jsr292/VMAnonymousClasses.java +++ b/hotspot/test/compiler/jsr292/VMAnonymousClasses.java @@ -26,7 +26,7 @@ * @bug 8058828 * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc - * @run main/bootclasspath -Xbatch VMAnonymousClasses + * @run main/bootclasspath/othervm -Xbatch VMAnonymousClasses */ import jdk.internal.org.objectweb.asm.ClassWriter; diff --git a/hotspot/test/compiler/stable/TestStableBoolean.java b/hotspot/test/compiler/stable/TestStableBoolean.java index ee92c9c0a8a..5dbcef7f87a 100644 --- a/hotspot/test/compiler/stable/TestStableBoolean.java +++ b/hotspot/test/compiler/stable/TestStableBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableBoolean * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableBoolean - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:-FoldStableValues * compiler.stable.TestStableBoolean * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 * -XX:+FoldStableValues * compiler.stable.TestStableBoolean - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 * -XX:-FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableByte.java b/hotspot/test/compiler/stable/TestStableByte.java index eb193b4a3e3..0a5d46b4092 100644 --- a/hotspot/test/compiler/stable/TestStableByte.java +++ b/hotspot/test/compiler/stable/TestStableByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableByte * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableByte - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableByte * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableByte - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableChar.java b/hotspot/test/compiler/stable/TestStableChar.java index 7f291070c7e..7aeb1725767 100644 --- a/hotspot/test/compiler/stable/TestStableChar.java +++ b/hotspot/test/compiler/stable/TestStableChar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableChar * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableChar - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableChar * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableChar - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableDouble.java b/hotspot/test/compiler/stable/TestStableDouble.java index df71febc523..30617b9f2c4 100644 --- a/hotspot/test/compiler/stable/TestStableDouble.java +++ b/hotspot/test/compiler/stable/TestStableDouble.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableDouble * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableDouble - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableDouble * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableDouble - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableFloat.java b/hotspot/test/compiler/stable/TestStableFloat.java index 33e1bed2433..d17ee9b2bb2 100644 --- a/hotspot/test/compiler/stable/TestStableFloat.java +++ b/hotspot/test/compiler/stable/TestStableFloat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableFloat * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableFloat - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableFloat * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableFloat - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableInt.java b/hotspot/test/compiler/stable/TestStableInt.java index 023c8737397..24f6a5613ee 100644 --- a/hotspot/test/compiler/stable/TestStableInt.java +++ b/hotspot/test/compiler/stable/TestStableInt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableInt * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableInt - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableInt * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableInt - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableLong.java b/hotspot/test/compiler/stable/TestStableLong.java index 67ddedc0257..4f4f210ce31 100644 --- a/hotspot/test/compiler/stable/TestStableLong.java +++ b/hotspot/test/compiler/stable/TestStableLong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableLong * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableLong - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableLong * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableLong - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java index 6b413401a8a..313dac28308 100644 --- a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java +++ b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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,7 +30,7 @@ * @library /testlibrary /test/lib * @modules java.base/jdk.internal.vm.annotation * - * @run main/bootclasspath -Xcomp -XX:CompileOnly=::testCompile + * @run main/bootclasspath/othervm -Xcomp -XX:CompileOnly=::testCompile * compiler.stable.TestStableMemoryBarrier * * @author hui.shi@linaro.org diff --git a/hotspot/test/compiler/stable/TestStableObject.java b/hotspot/test/compiler/stable/TestStableObject.java index 31e0a5c6a40..c08afa8b943 100644 --- a/hotspot/test/compiler/stable/TestStableObject.java +++ b/hotspot/test/compiler/stable/TestStableObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableObject * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableObject - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableObject * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableObject - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableShort.java b/hotspot/test/compiler/stable/TestStableShort.java index 107c8c7537c..bab170a1c46 100644 --- a/hotspot/test/compiler/stable/TestStableShort.java +++ b/hotspot/test/compiler/stable/TestStableShort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,23 +31,23 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableShort * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableShort - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableShort * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues * compiler.stable.TestStableShort - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 * -XX:-TieredCompilation * -XX:+FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableUByte.java b/hotspot/test/compiler/stable/TestStableUByte.java index 285b0274588..b1c68daaf05 100644 --- a/hotspot/test/compiler/stable/TestStableUByte.java +++ b/hotspot/test/compiler/stable/TestStableUByte.java @@ -31,26 +31,26 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableUByte * - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:-TieredCompilation * -XX:+FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUByte - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:-TieredCompilation * -XX:-FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUByte * - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 * -XX:+FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUByte - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 * -XX:-FoldStableValues diff --git a/hotspot/test/compiler/stable/TestStableUShort.java b/hotspot/test/compiler/stable/TestStableUShort.java index b450582f854..2f9d44a0396 100644 --- a/hotspot/test/compiler/stable/TestStableUShort.java +++ b/hotspot/test/compiler/stable/TestStableUShort.java @@ -31,26 +31,26 @@ * @build sun.hotspot.WhiteBox * @build compiler.stable.TestStableUShort * - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:-TieredCompilation * -XX:+FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUShort - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:-TieredCompilation * -XX:-FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUShort * - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 * -XX:+FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUShort - * @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 * -XX:-FoldStableValues diff --git a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java index fead52fd530..2ffc5ec51e6 100644 --- a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java +++ b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java @@ -33,21 +33,23 @@ * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.vm.annotation * java.base/jdk.internal.misc - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions * -Xbatch -XX:-TieredCompilation * -XX:+FoldStableValues * -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress() * -XX:CompileCommand=dontinline,*.test* * -XX:+UseUnalignedAccesses + * -XaddReads:java.base=ALL-UNNAMED * compiler.unsafe.UnsafeGetConstantField * - * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions + * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions * -Xbatch -XX:-TieredCompilation * -XX:+FoldStableValues * -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress() * -XX:CompileCommand=dontinline,*.test* * -XX:CompileCommand=inline,*Unsafe.get* * -XX:-UseUnalignedAccesses + * -XaddReads:java.base=ALL-UNNAMED * compiler.unsafe.UnsafeGetConstantField */ package compiler.unsafe; diff --git a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java index 71ce6643bbc..e23a6920796 100644 --- a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java +++ b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -48,7 +48,7 @@ public class BootstrapRedefine { "-Xmodule:java.base"), "mods/java.base"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:mods", "-version"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.base=mods/java.base", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Incompatible definition of java.lang.Object") .shouldHaveExitValue(1); diff --git a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java index 7de1521cc07..8cef6b787e2 100644 --- a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java +++ b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java @@ -35,7 +35,7 @@ import jdk.test.lib.*; public class MaxMetaspaceSize { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:MaxMetaspaceSize=20m", "-Xshare:dump"); + "-XX:MaxMetaspaceSize=10m", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("is not large enough.\nEither don't specify the -XX:MaxMetaspaceSize=\nor increase the size to at least"); output.shouldHaveExitValue(2); diff --git a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java index 7e3930137e7..94b6368f7db 100644 --- a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java +++ b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java @@ -119,9 +119,9 @@ public class GetSysPkgTest { getPkg("java/nio/charset", "jrt:/java.base"); // Test a package in a module not owned by boot loader. - Class clss = Class.forName("javax.activation.DataHandler"); + Class clss = Class.forName("jdk.nio.zipfs.ZipPath"); if (clss == null) - throw new RuntimeException("Could not find class javax.activation.DataHandler"); + throw new RuntimeException("Could not find class jdk.nio.zipfs.ZipPath"); getPkg("javax/activation", null); // Not owned by boot loader // Test a package not in jimage file. diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java index 6df74bfa689..d40911fe438 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java @@ -209,9 +209,9 @@ public class DiffCL_Umod { // now use the same loader to load class p1.c1Loose Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1Loose"); - // change m1 to be a loose module + // change m1 to read all unnamed modules Module m1 = layer.findModule("m1").get(); - jdk.internal.module.Modules.addReads(m1, null); + jdk.internal.module.Modules.addReadsAllUnnamed(m1); try { p1_c1_class.newInstance(); diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod.java b/hotspot/test/runtime/modules/AccessCheck/Umod.java index 639891b4339..7bea0a51d2f 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod.java @@ -200,9 +200,9 @@ public class Umod { // now use the same loader to load class p1.c1Loose Class p1_c1_class = loader.loadClass("p1.c1Loose"); - // change m1 to be a loose module + // change m1 to read all unnamed modules Module m1 = layer.findModule("m1").get(); - jdk.internal.module.Modules.addReads(m1, null); + jdk.internal.module.Modules.addReadsAllUnnamed(m1); try { p1_c1_class.newInstance(); diff --git a/hotspot/test/runtime/modules/JVMAddReadsModule.java b/hotspot/test/runtime/modules/JVMAddReadsModule.java index 78f1d3bf62e..9d5e2adcacf 100644 --- a/hotspot/test/runtime/modules/JVMAddReadsModule.java +++ b/hotspot/test/runtime/modules/JVMAddReadsModule.java @@ -48,26 +48,27 @@ public class JVMAddReadsModule { assertNotNull(to_module, "Module should not be null"); ModuleHelper.DefineModule(to_module, "9.0", "to_module/here", new String[] { "yourpackage" }); - // Null from_module argument, expect an NPE + // Null from_module argument, expect NPE try { ModuleHelper.AddReadsModule(null, to_module); throw new RuntimeException("Failed to get the expected NPE"); - } catch(NullPointerException e) { + } catch (NullPointerException e) { // Expected } - // Null to_module argument, do not expect an NPE + // Null to_module argument, expect NPE try { ModuleHelper.AddReadsModule(from_module, null); - } catch(NullPointerException e) { throw new RuntimeException("Unexpected NPE was thrown"); + } catch (NullPointerException e) { + // Expected } - // Null from_module and to_module arguments, expect an NPE + // Null from_module and to_module arguments, expect NPE try { ModuleHelper.AddReadsModule(null, null); throw new RuntimeException("Failed to get the expected NPE"); - } catch(NullPointerException e) { + } catch (NullPointerException e) { // Expected } diff --git a/hotspot/test/runtime/modules/Visibility/XpatchVisibility.java b/hotspot/test/runtime/modules/Visibility/XpatchVisibility.java index 0b38f7727ad..a49fd997515 100644 --- a/hotspot/test/runtime/modules/Visibility/XpatchVisibility.java +++ b/hotspot/test/runtime/modules/Visibility/XpatchVisibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -83,7 +83,7 @@ public class XpatchVisibility { "p2" + File.separator + "Vis2_B.class")); new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( - "-Xpatch:mods2", + "-Xpatch:java.base=mods2/java.base", "-XaddExports:java.base/p2=ALL-UNNAMED", "Vis2_A") .start()).shouldHaveExitValue(0); diff --git a/hotspot/test/runtime/modules/Xpatch/BasicJarBuilder.java b/hotspot/test/runtime/modules/Xpatch/BasicJarBuilder.java new file mode 100644 index 00000000000..ab8955cb0f7 --- /dev/null +++ b/hotspot/test/runtime/modules/Xpatch/BasicJarBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2015, 2016, 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. + */ + +/* + * @summary Simple jar builder + * Input: jarName className1 className2 ... + * do not specify extensions, just the names + * E.g. prot_domain ProtDomainA ProtDomainB + * Output: A jar containing compiled classes, placed in a test classes folder + */ + +import jdk.test.lib.*; + +import java.io.File; +import java.util.ArrayList; +import sun.tools.jar.Main; + +// Using JarBuilder requires that all to-be-jarred classes should be placed +// in the current working directory, aka "." +public class BasicJarBuilder { + private static final String classDir = System.getProperty("test.classes"); + + public static void build(boolean classesInWorkDir, String jarName, + String ...classNames) throws Exception { + + if (classesInWorkDir) { + createSimpleJar(".", classDir + File.separator + jarName + ".jar", classNames); + } else { + build(jarName, classNames); + } + } + + public static void build(String jarName, String ...classNames) throws Exception { + createSimpleJar(classDir, classDir + File.separator + jarName + ".jar", + classNames); + } + + private static void createSimpleJar(String jarclassDir, String jarName, + String[] classNames) throws Exception { + ArrayList args = new ArrayList(); + args.add("cf"); + args.add(jarName); + addClassArgs(args, jarclassDir, classNames); + createJar(args); + } + + private static void addClassArgs(ArrayList args, String jarclassDir, + String[] classNames) { + + for (String name : classNames) { + args.add("-C"); + args.add(jarclassDir); + args.add(name + ".class"); + } + } + + private static void createJar(ArrayList args) { + Main jarTool = new Main(System.out, System.err, "jar"); + if (!jarTool.run(args.toArray(new String[1]))) { + throw new RuntimeException("jar operation failed"); + } + } + + // Get full path to the test jar + public static String getTestJar(String jar) { + File dir = new File(System.getProperty("test.classes", ".")); + File jarFile = new File(dir, jar); + if (!jarFile.exists()) { + throw new RuntimeException("Cannot find " + jarFile.getPath()); + } + if (!jarFile.isFile()) { + throw new RuntimeException("Not a regular file: " + jarFile.getPath()); + } + return jarFile.getPath(); + } +} diff --git a/hotspot/test/runtime/modules/Xpatch/Xpatch2Dirs.java b/hotspot/test/runtime/modules/Xpatch/Xpatch2Dirs.java index 014476cbd6e..b0dbfcfb309 100644 --- a/hotspot/test/runtime/modules/Xpatch/Xpatch2Dirs.java +++ b/hotspot/test/runtime/modules/Xpatch/Xpatch2Dirs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -57,7 +57,8 @@ public class Xpatch2Dirs { "mods2/java.desktop"); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xpatch:mods" + File.pathSeparator + "mods2", + "-Xpatch:java.naming=mods/java.naming", + "-Xpatch:java.desktop=mods2/java.desktop", "Xpatch2DirsMain", "javax.naming.spi.NamingManager", "java.beans.Encoder"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchDupJavaBase.java b/hotspot/test/runtime/modules/Xpatch/XpatchDupJavaBase.java new file mode 100644 index 00000000000..93935df3ce4 --- /dev/null +++ b/hotspot/test/runtime/modules/Xpatch/XpatchDupJavaBase.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016, 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 + * @summary VM exit initialization results if java.base is specificed more than once to Xpatch. + * @library /testlibrary + */ + +import jdk.test.lib.*; + +public class XpatchDupJavaBase { + // The VM should exit initialization if java.base is specified + // more than once to -Xpatch. + public static void main(String args[]) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xpatch:java.base=javabase_dir", + "-Xpatch:java.base=javabase_dir", + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Cannot specify java.base more than once to -Xpatch"); + output.shouldHaveExitValue(1); + } +} + diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchDupModule.java b/hotspot/test/runtime/modules/Xpatch/XpatchDupModule.java new file mode 100644 index 00000000000..2a44b97932b --- /dev/null +++ b/hotspot/test/runtime/modules/Xpatch/XpatchDupModule.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016, 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 + * @summary Module system initialization exception results if a module is specificed twice to Xpatch. + * @library /testlibrary + */ + +import jdk.test.lib.*; + +public class XpatchDupModule { + + // The module system initialization should generate an ExceptionInInitializerError + // if -Xpatch is specified with the same module more than once. + + public static void main(String args[]) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xpatch:module1=module1_dir", + "-Xpatch:module1=module1_dir", + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("java.lang.ExceptionInInitializerError"); + output.shouldHaveExitValue(1); + } +} + diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchJavaBase.java b/hotspot/test/runtime/modules/Xpatch/XpatchJavaBase.java new file mode 100644 index 00000000000..53a056e760c --- /dev/null +++ b/hotspot/test/runtime/modules/Xpatch/XpatchJavaBase.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016, 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 8130399 + * @summary Make sure -Xpatch works for java.base. + * @library /testlibrary + * @compile XpatchMain.java + * @run main XpatchJavaBase + */ + +import jdk.test.lib.*; + +public class XpatchJavaBase { + + public static void main(String[] args) throws Exception { + String source = "package java.lang; " + + "public class NewClass { " + + " static { " + + " System.out.println(\"I pass!\"); " + + " } " + + "}"; + + ClassFileInstaller.writeClassToDisk("java/lang/NewClass", + InMemoryJavaCompiler.compile("java.lang.NewClass", source, "-Xmodule:java.base"), + "mods/java.base"); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.base=mods/java.base", + "XpatchMain", "java.lang.NewClass"); + + new OutputAnalyzer(pb.start()) + .shouldContain("I pass!") + .shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchTest.java b/hotspot/test/runtime/modules/Xpatch/XpatchTest.java index ddc873feca5..e72be0e184e 100644 --- a/hotspot/test/runtime/modules/Xpatch/XpatchTest.java +++ b/hotspot/test/runtime/modules/Xpatch/XpatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -46,7 +46,7 @@ public class XpatchTest { InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"), "mods/java.naming"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:mods", + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=mods/java.naming", "XpatchMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchTestJar.java b/hotspot/test/runtime/modules/Xpatch/XpatchTestJar.java new file mode 100644 index 00000000000..ad1675a15f0 --- /dev/null +++ b/hotspot/test/runtime/modules/Xpatch/XpatchTestJar.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016, 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 + * @summary Make sure -Xpatch works when a jar file is specified for a module + * @library /testlibrary + * @modules java.base/jdk.internal.misc + * jdk.jartool/sun.tools.jar + * @build BasicJarBuilder + * @compile XpatchMain.java + * @run main XpatchTestJar + */ + +import jdk.test.lib.*; + +public class XpatchTestJar { + private static String moduleJar; + + public static void main(String[] args) throws Exception { + + // Create a class file in the module java.naming. This class file + // will be put in the javanaming.jar file. + String source = "package javax.naming.spi; " + + "public class NamingManager { " + + " static { " + + " System.out.println(\"I pass!\"); " + + " } " + + "}"; + + ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager", + InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"), + System.getProperty("test.classes")); + + // Build the jar file that will be used for the module "java.naming". + BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager"); + moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); + + // Just to make sure we are not fooled by the class file being on the + // class path where all the test classes are stored, write the NamingManager.class + // file out again with output that does not contain what OutputAnalyzer + // expects. This will provide confidence that the contents of the class + // is truly coming from the jar file and not the class file. + source = "package javax.naming.spi; " + + "public class NamingManager { " + + " static { " + + " System.out.println(\"Fail!\"); " + + " } " + + "}"; + + ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager", + InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"), + System.getProperty("test.classes")); + + // Supply -Xpatch with the name of the jar file for the module java.naming. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=" + moduleJar, + "XpatchMain", "javax.naming.spi.NamingManager"); + + new OutputAnalyzer(pb.start()) + .shouldContain("I pass!") + .shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchTestJarDir.java b/hotspot/test/runtime/modules/Xpatch/XpatchTestJarDir.java new file mode 100644 index 00000000000..a5329b6349d --- /dev/null +++ b/hotspot/test/runtime/modules/Xpatch/XpatchTestJarDir.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2016, 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 + * @summary Make sure -Xpatch works when a jar file and a directory is specified for a module + * @library /testlibrary + * @modules java.base/jdk.internal.misc + * jdk.jartool/sun.tools.jar + * @build BasicJarBuilder + * @compile Xpatch2DirsMain.java + * @run main XpatchTestJarDir + */ + +import java.io.File; +import java.nio.file.Files; +import jdk.test.lib.*; + +public class XpatchTestJarDir { + private static String moduleJar; + + public static void main(String[] args) throws Exception { + + // Create a class file in the module java.naming. This class file + // will be put in the javanaming.jar file. + String source = "package javax.naming.spi; " + + "public class NamingManager1 { " + + " static { " + + " System.out.println(\"I pass one!\"); " + + " } " + + "}"; + + ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1", + InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"), + System.getProperty("test.classes")); + + // Build the jar file that will be used for the module "java.naming". + BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager1"); + moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); + + // Just to make sure we are not fooled by the class file being on the + // class path where all the test classes are stored, write the NamingManager.class + // file out again with output that does not contain what OutputAnalyzer + // expects. This will provide confidence that the contents of the class + // is truly coming from the jar file and not the class file. + source = "package javax.naming.spi; " + + "public class NamingManager1 { " + + " static { " + + " System.out.println(\"Fail!\"); " + + " } " + + "}"; + + ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1", + InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"), + System.getProperty("test.classes")); + + // Create a second class file in the module java.naming. This class file + // will be put in the mods/java.naming directory. + source = "package javax.naming.spi; " + + "public class NamingManager2 { " + + " static { " + + " System.out.println(\"I pass two!\"); " + + " } " + + "}"; + + ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager2", + InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager2", source, "-Xmodule:java.naming"), + (System.getProperty("test.classes") + "/mods/java.naming")); + + + // Supply -Xpatch with the name of the jar file for the module java.naming. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=" + + moduleJar + + File.pathSeparator + + System.getProperty("test.classes") + "/mods/java.naming", + "Xpatch2DirsMain", + "javax.naming.spi.NamingManager1", + "javax.naming.spi.NamingManager2"); + + new OutputAnalyzer(pb.start()) + .shouldContain("I pass one!") + .shouldContain("I pass two!") + .shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/runtime/modules/Xpatch/XpatchTraceCL.java b/hotspot/test/runtime/modules/Xpatch/XpatchTraceCL.java index 02edebf60c0..1a961679bca 100644 --- a/hotspot/test/runtime/modules/Xpatch/XpatchTraceCL.java +++ b/hotspot/test/runtime/modules/Xpatch/XpatchTraceCL.java @@ -24,7 +24,7 @@ /* * @test * @bug 8069469 - * @summary Make sure -XX:+TraceClassLoading works properly with "modules" jimage, + * @summary Make sure -Xlog:classload=info works properly with "modules" jimage, -Xpatch, and with -Xbootclasspath/a * @library /testlibrary * @compile XpatchMain.java @@ -44,24 +44,23 @@ public class XpatchTraceCL { " } " + "}"; - // Test -XX:+TraceClassLoading output for -Xpatch + // Test -Xlog:classload=info output for -Xpatch ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager", InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"), "mods/java.naming"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:mods", - "-XX:+TraceClassLoading", "XpatchMain", "javax.naming.spi.NamingManager"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=mods/java.naming", + "-Xlog:classload=info", "XpatchMain", "javax.naming.spi.NamingManager"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // "modules" jimage case. output.shouldContain("[classload] java.lang.Thread source: jrt:/java.base"); // -Xpatch case. - output.shouldContain("[classload] javax.naming.spi.NamingManager source: mods" + - File.separator + "java.naming"); + output.shouldContain("[classload] javax.naming.spi.NamingManager source: mods/java.naming"); // -cp case. output.shouldContain("[classload] XpatchMain source: file"); - // Test -XX:+TraceClassLoading output for -Xbootclasspath/a + // Test -Xlog:classload=info output for -Xbootclasspath/a source = "package XpatchTraceCL_pkg; " + "public class ItIsI { " + " static { " + @@ -74,7 +73,7 @@ public class XpatchTraceCL { "xbcp"); pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:xbcp", - "-XX:+TraceClassLoading", "XpatchMain", "XpatchTraceCL_pkg.ItIsI"); + "-Xlog:classload=info", "XpatchMain", "XpatchTraceCL_pkg.ItIsI"); output = new OutputAnalyzer(pb.start()); // -Xbootclasspath/a case. output.shouldContain("[classload] XpatchTraceCL_pkg.ItIsI source: xbcp"); diff --git a/hotspot/test/runtime/modules/XpatchCDS.java b/hotspot/test/runtime/modules/XpatchCDS.java index eda178759cb..53ef3cf74e6 100644 --- a/hotspot/test/runtime/modules/XpatchCDS.java +++ b/hotspot/test/runtime/modules/XpatchCDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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,7 +35,7 @@ public class XpatchCDS { public static void main(String args[]) throws Throwable { System.out.println("Test that -Xpatch and -Xshare:dump are incompatibable"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:.", "-Xshare:dump"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=mods/java.naming", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Cannot use the following option when dumping the shared archive: -Xpatch"); @@ -52,7 +52,7 @@ public class XpatchCDS { "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:on", - "-Xpatch:.", + "-Xpatch:java.naming=mods/java.naming", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("The shared archive file cannot be used with -Xpatch"); diff --git a/jdk/.hgtags b/jdk/.hgtags index 68f3b996bfc..59c7f91c625 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -359,3 +359,4 @@ b2a69d66dc65ad1d3aeb3bd362cf5bb0deba040e jdk-9+111 bb8379287f3736f38c52b2d1418784e2592461d1 jdk-9+114 35225b837d66582037eeadeb471c13235dfd793d jdk-9+115 baeb5edb38939cdb78ae0ac6f4fd368465cbf188 jdk-9+116 +4da0f73ce03aaf245b92cc040cc0ab0e3fa54dc2 jdk-9+117 diff --git a/jdk/make/GenerateClasslist.gmk b/jdk/make/GenerateClasslist.gmk new file mode 100644 index 00000000000..279cf9da012 --- /dev/null +++ b/jdk/make/GenerateClasslist.gmk @@ -0,0 +1,74 @@ +# +# Copyright (c) 2016, 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. +# + +################################################################################ +# Generate classlist +################################################################################ + +default: all + +include $(SPEC) +include MakeBase.gmk +include Tools.gmk +include JarArchive.gmk + +################################################################################ +# Create a jar with our generator class. Using a jar is intentional since it +# will load more classes + +$(eval $(call SetupJarArchive, CLASSLIST_JAR, \ + SRCS := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ + INCLUDES := build/tools/classlist, \ + JAR := $(SUPPORT_OUTPUTDIR)/classlist.jar, \ +)) + +TARGETS += $(CLASSLIST_JAR) + +################################################################################ + +CLASSLIST_FILE := $(SUPPORT_OUTPUTDIR)/classlist/classlist + +# If an external buildjdk has been supplied, we don't build a separate interim +# image, so just use the external build jdk instead. +ifeq ($(EXTERNAL_BUILDJDK), true) + INTERIM_IMAGE_DIR := $(BUILD_JDK) +endif + +$(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR) + $(call MakeDir, $(@D)) + $(call LogInfo, Generating lib/classlist) + $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.tmp \ + -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ + build.tools.classlist.HelloClasslist $(LOG_DEBUG) 2>&1 + # Filter out generated classes, remove after JDK-8149977 + $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \ + -Xshare:dump -XX:SharedClassListFile=$@.tmp $(LOG_DEBUG) 2>&1 + $(RM) $@.tmp + +TARGETS += $(CLASSLIST_FILE) + +################################################################################ + +all: $(TARGETS) diff --git a/jdk/make/Tools.gmk b/jdk/make/Tools.gmk index 1ae471d72b3..62e5f3042e2 100644 --- a/jdk/make/Tools.gmk +++ b/jdk/make/Tools.gmk @@ -96,7 +96,13 @@ TOOL_CHARSETMAPPING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classe TOOL_SPP = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.spp.Spp # Nimbus is used somewhere in the swing build. + +ifeq ($(BOOT_JDK_MODULAR), true) + COMPILENIMBUS_ADD_MODS := -addmods java.xml.bind +endif + TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ + $(COMPILENIMBUS_ADD_MODS) \ build.tools.generatenimbus.Generator TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ diff --git a/jdk/make/data/classlist/classlist.aix b/jdk/make/data/classlist/classlist.aix deleted file mode 100644 index d07236da9e9..00000000000 --- a/jdk/make/data/classlist/classlist.aix +++ /dev/null @@ -1,2406 +0,0 @@ -java/lang/Object -java/lang/String -java/io/Serializable -java/lang/Comparable -java/lang/CharSequence -java/lang/Class -java/lang/reflect/GenericDeclaration -java/lang/reflect/Type -java/lang/reflect/AnnotatedElement -java/lang/Cloneable -java/lang/ClassLoader -java/lang/System -java/lang/Throwable -java/lang/Error -java/lang/ThreadDeath -java/lang/Exception -java/lang/RuntimeException -java/security/ProtectionDomain -java/security/AccessControlContext -java/lang/ClassNotFoundException -java/lang/NoClassDefFoundError -java/lang/LinkageError -java/lang/ClassCastException -java/lang/ArrayStoreException -java/lang/VirtualMachineError -java/lang/OutOfMemoryError -java/lang/StackOverflowError -java/lang/IllegalMonitorStateException -java/lang/ref/Reference -java/lang/ref/SoftReference -java/lang/ref/WeakReference -java/lang/ref/FinalReference -java/lang/ref/PhantomReference -java/lang/ref/Finalizer -java/lang/Thread -java/lang/Runnable -java/lang/ThreadGroup -java/lang/Thread$UncaughtExceptionHandler -java/util/Properties -java/util/Hashtable -java/util/Map -java/util/Dictionary -java/lang/reflect/AccessibleObject -java/lang/reflect/Field -java/lang/reflect/Member -java/lang/reflect/Method -java/lang/reflect/Constructor -sun/reflect/MagicAccessorImpl -sun/reflect/MethodAccessorImpl -sun/reflect/MethodAccessor -sun/reflect/ConstructorAccessorImpl -sun/reflect/ConstructorAccessor -sun/reflect/DelegatingClassLoader -sun/reflect/ConstantPool -sun/reflect/UnsafeStaticFieldAccessorImpl -sun/reflect/UnsafeFieldAccessorImpl -sun/reflect/FieldAccessorImpl -sun/reflect/FieldAccessor -java/util/Vector -java/util/List -java/util/Collection -java/lang/Iterable -java/util/RandomAccess -java/util/AbstractList -java/util/AbstractCollection -java/lang/StringBuffer -java/lang/AbstractStringBuilder -java/lang/Appendable -java/lang/StackTraceElement -java/nio/Buffer -java/lang/Boolean -java/lang/Character -java/lang/Float -java/lang/Number -java/lang/Double -java/lang/Byte -java/lang/Short -java/lang/Integer -java/lang/Long -java/lang/NullPointerException -java/lang/ArithmeticException -java/io/ObjectStreamField -java/lang/String$CaseInsensitiveComparator -java/util/Comparator -java/lang/RuntimePermission -java/security/BasicPermission -java/security/Permission -java/security/Guard -sun/misc/SoftCache -java/util/AbstractMap -java/lang/ref/ReferenceQueue -java/lang/ref/ReferenceQueue$Null -java/lang/ref/ReferenceQueue$Lock -java/util/HashMap -java/lang/annotation/Annotation -java/util/HashMap$Entry -java/util/Map$Entry -java/security/AccessController -java/lang/reflect/ReflectPermission -sun/reflect/ReflectionFactory$GetReflectionFactoryAction -java/security/PrivilegedAction -java/util/Stack -sun/reflect/ReflectionFactory -java/lang/ref/Reference$Lock -java/lang/ref/Reference$ReferenceHandler -java/lang/ref/Finalizer$FinalizerThread -java/util/Hashtable$EmptyEnumerator -java/util/Enumeration -java/util/Hashtable$EmptyIterator -java/util/Iterator -java/util/Hashtable$Entry -java/nio/charset/Charset -sun/nio/cs/StandardCharsets -sun/nio/cs/FastCharsetProvider -java/nio/charset/spi/CharsetProvider -sun/nio/cs/StandardCharsets$Aliases -sun/util/PreHashedMap -sun/nio/cs/StandardCharsets$Classes -sun/nio/cs/StandardCharsets$Cache -java/lang/ThreadLocal -java/util/concurrent/atomic/AtomicInteger -sun/misc/Unsafe -java/lang/NoSuchMethodError -java/lang/IncompatibleClassChangeError -sun/reflect/Reflection -java/util/Collections -java/util/Collections$EmptySet -java/util/AbstractSet -java/util/Set -java/util/Collections$EmptyList -java/util/Collections$EmptyMap -java/util/Collections$ReverseComparator -java/util/Collections$SynchronizedMap -java/lang/Class$3 -java/lang/reflect/Modifier -java/lang/reflect/ReflectAccess -sun/reflect/LangReflectAccess -java/util/Arrays -java/lang/Math -sun/nio/cs/US_ASCII -sun/nio/cs/HistoricallyNamedCharset -sun/misc/VM -java/lang/StringCoding -java/lang/ThreadLocal$ThreadLocalMap -java/lang/ThreadLocal$ThreadLocalMap$Entry -java/lang/StringCoding$StringDecoder -sun/nio/cs/US_ASCII$Decoder -java/nio/charset/CharsetDecoder -java/nio/charset/CodingErrorAction -java/nio/ByteBuffer -java/nio/HeapByteBuffer -java/nio/Bits -java/nio/ByteOrder -java/nio/CharBuffer -java/lang/Readable -java/nio/HeapCharBuffer -java/nio/charset/CoderResult -java/nio/charset/CoderResult$1 -java/nio/charset/CoderResult$Cache -java/nio/charset/CoderResult$2 -sun/misc/Version -java/io/FileInputStream -java/io/InputStream -java/io/Closeable -java/io/FileDescriptor -java/io/FileOutputStream -java/io/OutputStream -java/io/Flushable -java/io/BufferedInputStream -java/io/FilterInputStream -java/util/concurrent/atomic/AtomicReferenceFieldUpdater -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl -sun/reflect/misc/ReflectUtil -java/io/PrintStream -java/io/FilterOutputStream -java/io/BufferedOutputStream -java/io/OutputStreamWriter -java/io/Writer -sun/nio/cs/StreamEncoder -sun/security/action/GetPropertyAction -sun/nio/cs/US_ASCII$Encoder -java/nio/charset/CharsetEncoder -sun/nio/cs/Surrogate$Parser -sun/nio/cs/Surrogate -java/io/BufferedWriter -java/lang/Runtime -java/io/File -java/io/FileSystem -java/io/UnixFileSystem -java/io/ExpiringCache -java/io/ExpiringCache$1 -java/util/LinkedHashMap -java/util/LinkedHashMap$Entry -java/lang/StringBuilder -java/io/File$1 -sun/misc/JavaIODeleteOnExitAccess -sun/misc/SharedSecrets -java/lang/ClassLoader$3 -java/lang/StringCoding$StringEncoder -java/io/ExpiringCache$Entry -java/lang/ClassLoader$NativeLibrary -java/lang/Terminator -java/lang/Terminator$1 -sun/misc/SignalHandler -sun/misc/Signal -sun/misc/NativeSignalHandler -java/io/Console -java/io/Console$1 -sun/misc/JavaIOAccess -java/io/Console$1$1 -java/lang/Shutdown -java/util/ArrayList -java/lang/Shutdown$Lock -java/lang/ApplicationShutdownHooks -java/util/IdentityHashMap -sun/misc/OSEnvironment -java/lang/System$2 -sun/misc/JavaLangAccess -java/lang/Compiler -java/lang/Compiler$1 -sun/misc/Launcher -sun/misc/Launcher$Factory -java/net/URLStreamHandlerFactory -sun/misc/Launcher$ExtClassLoader -java/net/URLClassLoader -java/security/SecureClassLoader -sun/security/util/Debug -java/net/URLClassLoader$7 -sun/misc/JavaNetAccess -java/util/StringTokenizer -sun/misc/Launcher$ExtClassLoader$1 -java/security/PrivilegedExceptionAction -sun/misc/MetaIndex -java/io/BufferedReader -java/io/Reader -java/io/FileReader -java/io/InputStreamReader -sun/nio/cs/StreamDecoder -java/lang/reflect/Array -sun/net/www/ParseUtil -java/util/BitSet -java/io/ObjectStreamClass -java/net/URL -java/util/Locale -java/util/concurrent/ConcurrentHashMap -java/util/concurrent/ConcurrentMap -java/util/concurrent/ConcurrentHashMap$Segment -java/util/concurrent/locks/ReentrantLock -java/util/concurrent/locks/Lock -java/util/concurrent/locks/ReentrantLock$NonfairSync -java/util/concurrent/locks/ReentrantLock$Sync -java/util/concurrent/locks/AbstractQueuedSynchronizer -java/util/concurrent/locks/AbstractOwnableSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer$Node -java/util/concurrent/ConcurrentHashMap$HashEntry -java/lang/CharacterDataLatin1 -java/net/Parts -sun/net/www/protocol/file/Handler -java/net/URLStreamHandler -java/lang/Class$1 -sun/reflect/ReflectionFactory$1 -sun/reflect/NativeConstructorAccessorImpl -sun/reflect/DelegatingConstructorAccessorImpl -java/util/HashSet -sun/misc/URLClassPath -sun/net/www/protocol/jar/Handler -sun/misc/Launcher$AppClassLoader -sun/misc/Launcher$AppClassLoader$1 -java/lang/SystemClassLoaderAction -java/net/URLClassLoader$1 -sun/misc/URLClassPath$3 -sun/misc/URLClassPath$JarLoader -sun/misc/URLClassPath$Loader -java/security/PrivilegedActionException -sun/misc/URLClassPath$FileLoader -sun/misc/URLClassPath$FileLoader$1 -sun/misc/Resource -sun/nio/ByteBuffered -java/security/CodeSource -java/security/Permissions -java/security/PermissionCollection -sun/net/www/protocol/file/FileURLConnection -sun/net/www/URLConnection -java/net/URLConnection -java/net/UnknownContentHandler -java/net/ContentHandler -sun/net/www/MessageHeader -java/io/FilePermission -java/io/FilePermission$1 -sun/security/provider/PolicyFile -java/security/Policy -java/security/Policy$UnsupportedEmptyCollection -java/io/FilePermissionCollection -java/security/AllPermission -java/security/UnresolvedPermission -java/security/BasicPermissionCollection -java/security/Principal -java/security/cert/Certificate -java/util/AbstractList$Itr -java/util/IdentityHashMap$KeySet -java/util/IdentityHashMap$KeyIterator -java/util/IdentityHashMap$IdentityHashMapIterator -java/io/DeleteOnExitHook -java/util/LinkedHashSet -java/util/HashMap$KeySet -java/util/LinkedHashMap$KeyIterator -java/util/LinkedHashMap$LinkedHashIterator -java/awt/Frame -java/awt/MenuContainer -java/awt/Window -javax/accessibility/Accessible -java/awt/Container -java/awt/Component -java/awt/image/ImageObserver -java/lang/InterruptedException -java/awt/Label -java/util/logging/Logger -java/util/logging/Handler -java/util/logging/Level -java/util/logging/LogManager -java/util/logging/LogManager$1 -java/beans/PropertyChangeSupport -java/util/logging/LogManager$LogNode -java/util/logging/LoggingPermission -java/util/logging/LogManager$Cleaner -java/util/logging/LogManager$RootLogger -java/util/logging/LogManager$2 -java/util/Properties$LineReader -java/util/Hashtable$Enumerator -java/beans/PropertyChangeEvent -java/util/EventObject -java/awt/Component$AWTTreeLock -sun/awt/DebugHelper -sun/awt/NativeLibLoader -sun/security/action/LoadLibraryAction -java/awt/GraphicsEnvironment -java/awt/GraphicsEnvironment$1 -java/lang/ProcessEnvironment -java/lang/ProcessEnvironment$Variable -java/lang/ProcessEnvironment$ExternalData -java/lang/ProcessEnvironment$Value -java/lang/ProcessEnvironment$StringEnvironment -java/util/Collections$UnmodifiableMap -sun/awt/DebugHelperStub -java/awt/Toolkit -java/awt/Toolkit$3 -sun/util/CoreResourceBundleControl -java/util/ResourceBundle$Control -java/util/Arrays$ArrayList -java/util/Collections$UnmodifiableRandomAccessList -java/util/Collections$UnmodifiableList -java/util/Collections$UnmodifiableCollection -java/util/ResourceBundle -java/util/ResourceBundle$1 -java/util/ResourceBundle$RBClassLoader -java/util/ResourceBundle$RBClassLoader$1 -java/util/ResourceBundle$CacheKey -java/util/ResourceBundle$LoaderReference -java/util/ResourceBundle$CacheKeyReference -java/util/ResourceBundle$SingleFormatControl -sun/awt/resources/awt -java/util/ListResourceBundle -java/awt/Toolkit$1 -java/io/FileNotFoundException -java/io/IOException -java/awt/event/KeyEvent -java/awt/event/InputEvent -java/awt/event/ComponentEvent -java/awt/AWTEvent -java/awt/event/NativeLibLoader -java/util/WeakHashMap -java/util/WeakHashMap$Entry -java/awt/Component$DummyRequestFocusController -sun/awt/RequestFocusController -java/awt/LayoutManager -java/awt/LightweightDispatcher -java/awt/event/AWTEventListener -java/util/EventListener -java/awt/Dimension -java/awt/geom/Dimension2D -java/util/concurrent/atomic/AtomicBoolean -java/awt/ComponentOrientation -java/awt/Component$2 -java/lang/NoSuchMethodException -sun/awt/AppContext -sun/awt/AppContext$1 -sun/awt/AppContext$2 -sun/awt/MostRecentKeyValue -java/awt/Cursor -sun/awt/X11GraphicsEnvironment -sun/java2d/SunGraphicsEnvironment -sun/java2d/FontSupport -sun/awt/DisplayChangedListener -sun/java2d/SunGraphicsEnvironment$TTFilter -java/io/FilenameFilter -sun/java2d/SunGraphicsEnvironment$T1Filter -sun/awt/X11GraphicsEnvironment$1 -sun/awt/SunToolkit -sun/awt/WindowClosingSupport -sun/awt/WindowClosingListener -sun/awt/ComponentFactory -sun/awt/InputMethodSupport -java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject -java/util/concurrent/locks/Condition -sun/awt/AWTAutoShutdown -sun/awt/AWTAutoShutdown$PeerMap -sun/awt/SunToolkit$6 -java/awt/Dialog$ModalExclusionType -java/lang/Enum -java/awt/Dialog -java/awt/Dialog$ModalityType -java/awt/ModalEventFilter -java/awt/EventFilter -sun/reflect/UnsafeFieldAccessorFactory -sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl -sun/awt/SunDisplayChanger -sun/java2d/SunGraphicsEnvironment$1 -java/io/StreamTokenizer -sun/font/FontManager -sun/font/FileFont -sun/font/PhysicalFont -sun/font/Font2D -sun/font/CompositeFont -java/util/HashMap$Values -java/util/HashMap$ValueIterator -java/util/HashMap$HashIterator -sun/font/FontManager$1 -java/awt/Font -java/awt/geom/AffineTransform -sun/font/AttributeValues -sun/font/EAttribute -java/text/AttributedCharacterIterator$Attribute -java/lang/Class$4 -sun/reflect/NativeMethodAccessorImpl -sun/reflect/DelegatingMethodAccessorImpl -java/awt/font/TextAttribute -java/lang/Integer$IntegerCache -sun/font/TrueTypeFont -java/awt/font/FontRenderContext -java/awt/RenderingHints -sun/awt/SunHints -sun/awt/SunHints$Key -java/awt/RenderingHints$Key -sun/awt/SunHints$Value -sun/awt/SunHints$LCDContrastKey -sun/font/Type1Font -java/awt/geom/Point2D$Float -java/awt/geom/Point2D -sun/font/StrikeMetrics -java/awt/geom/Rectangle2D$Float -java/awt/geom/Rectangle2D -java/awt/geom/RectangularShape -java/awt/Shape -java/awt/geom/GeneralPath -java/awt/geom/Path2D$Float -java/awt/geom/Path2D -sun/font/CharToGlyphMapper -sun/font/PhysicalStrike -sun/font/FontStrike -sun/font/GlyphList -sun/font/StrikeCache -sun/java2d/Disposer -sun/java2d/Disposer$1 -sun/font/StrikeCache$1 -sun/font/FontManager$FontRegistrationInfo -sun/awt/motif/MFontConfiguration -sun/awt/FontConfiguration -sun/awt/FontDescriptor -java/util/Scanner -java/util/regex/Pattern -java/util/regex/Pattern$8 -java/util/regex/Pattern$Node -java/util/regex/Pattern$LastNode -java/util/regex/Pattern$GroupHead -java/util/regex/Pattern$CharPropertyNames -java/util/regex/Pattern$CharPropertyNames$1 -java/util/regex/Pattern$CharPropertyNames$CharPropertyFactory -java/util/regex/Pattern$CharPropertyNames$2 -java/util/regex/Pattern$CharPropertyNames$5 -java/util/regex/Pattern$CharPropertyNames$3 -java/util/regex/Pattern$CharPropertyNames$6 -java/util/regex/Pattern$CharPropertyNames$CloneableProperty -java/util/regex/Pattern$CharProperty -java/util/regex/Pattern$CharPropertyNames$4 -java/util/regex/Pattern$CharPropertyNames$7 -java/util/regex/Pattern$CharPropertyNames$8 -java/util/regex/Pattern$CharPropertyNames$9 -java/util/regex/Pattern$CharPropertyNames$10 -java/util/regex/Pattern$CharPropertyNames$11 -java/util/regex/Pattern$CharPropertyNames$12 -java/util/regex/Pattern$CharPropertyNames$13 -java/util/regex/Pattern$CharPropertyNames$14 -java/util/regex/Pattern$CharPropertyNames$15 -java/util/regex/Pattern$CharPropertyNames$16 -java/util/regex/Pattern$CharPropertyNames$17 -java/util/regex/Pattern$CharPropertyNames$18 -java/util/regex/Pattern$CharPropertyNames$19 -java/util/regex/Pattern$CharPropertyNames$20 -java/util/regex/Pattern$CharPropertyNames$21 -java/util/regex/Pattern$Curly -java/util/regex/Pattern$Slice -java/util/regex/Pattern$Begin -java/util/regex/Pattern$First -java/util/regex/Pattern$Start -java/util/regex/Pattern$TreeInfo -java/util/regex/Pattern$All -java/util/regex/Pattern$BitClass -java/util/regex/Pattern$BmpCharProperty -java/util/regex/Pattern$6 -java/util/regex/Pattern$CharProperty$1 -java/util/regex/Pattern$10 -sun/nio/ch/FileChannelImpl -java/nio/channels/FileChannel -java/nio/channels/ByteChannel -java/nio/channels/ReadableByteChannel -java/nio/channels/Channel -java/nio/channels/WritableByteChannel -java/nio/channels/GatheringByteChannel -java/nio/channels/ScatteringByteChannel -java/nio/channels/spi/AbstractInterruptibleChannel -java/nio/channels/InterruptibleChannel -sun/nio/ch/Util -sun/nio/ch/IOUtil -sun/nio/ch/FileDispatcher -sun/nio/ch/NativeDispatcher -sun/nio/ch/Reflect -java/nio/MappedByteBuffer -sun/nio/ch/Reflect$1 -sun/nio/ch/NativeThreadSet -java/nio/channels/Channels -java/util/Scanner$1 -sun/misc/LRUCache -java/util/regex/Matcher -java/util/regex/MatchResult -java/text/NumberFormat -java/text/Format -java/text/spi/NumberFormatProvider -java/util/spi/LocaleServiceProvider -sun/util/LocaleServiceProviderPool -sun/util/LocaleServiceProviderPool$1 -java/util/ServiceLoader -java/util/ServiceLoader$LazyIterator -java/util/ServiceLoader$1 -java/util/HashMap$EntrySet -java/util/LinkedHashMap$EntryIterator -sun/misc/Launcher$1 -sun/misc/URLClassPath$2 -java/lang/ClassLoader$2 -sun/misc/URLClassPath$1 -java/net/URLClassLoader$3 -sun/misc/CompoundEnumeration -sun/misc/URLClassPath$JarLoader$1 -sun/misc/FileURLMapper -java/net/URLClassLoader$3$1 -sun/util/resources/LocaleData -sun/util/resources/LocaleData$1 -sun/util/resources/LocaleData$LocaleDataResourceBundleControl -sun/util/LocaleDataMetaInfo -sun/text/resources/FormatData -java/util/ResourceBundle$BundleReference -sun/text/resources/FormatData_en -sun/text/resources/FormatData_en_US -java/text/DecimalFormatSymbols -java/text/spi/DecimalFormatSymbolsProvider -java/util/Currency -java/util/Currency$1 -java/util/CurrencyData -java/util/spi/CurrencyNameProvider -sun/util/resources/CurrencyNames -sun/util/resources/LocaleNamesBundle -sun/util/resources/OpenListResourceBundle -sun/util/resources/CurrencyNames_en_US -java/text/DecimalFormat -java/text/FieldPosition -java/text/DigitList -java/math/RoundingMode -java/util/regex/Pattern$GroupTail -java/util/regex/Pattern$Ctype -java/util/regex/Pattern$Ques -java/util/regex/Pattern$GroupCurly -java/util/regex/Pattern$5 -java/util/regex/Pattern$Loop -java/util/regex/Pattern$Prolog -java/util/regex/Pattern$9 -java/util/regex/Pattern$BranchConn -java/util/regex/Pattern$Branch -java/nio/channels/spi/AbstractInterruptibleChannel$1 -sun/nio/ch/Interruptible -sun/nio/ch/NativeThread -sun/nio/ch/DirectBuffer -java/nio/DirectByteBuffer -java/nio/DirectByteBuffer$Deallocator -sun/misc/Cleaner -sun/nio/ch/IOStatus -java/util/regex/ASCII -java/io/DataInputStream -java/io/DataInput -java/lang/Short$ShortCache -java/util/HashMap$KeyIterator -sun/font/CompositeFontDescriptor -sun/font/Font2DHandle -sun/font/FontFamily -java/awt/GraphicsDevice -sun/awt/X11GraphicsDevice -sun/awt/X11GraphicsConfig -java/awt/GraphicsConfiguration -java/awt/ImageCapabilities -sun/java2d/x11/X11SurfaceData -sun/java2d/SurfaceData -java/awt/Transparency -sun/java2d/DisposerTarget -sun/java2d/InvalidPipeException -java/lang/IllegalStateException -sun/java2d/NullSurfaceData -sun/java2d/loops/SurfaceType -sun/awt/image/PixelConverter -sun/awt/image/PixelConverter$Xrgb -sun/awt/image/PixelConverter$Argb -sun/awt/image/PixelConverter$ArgbPre -sun/awt/image/PixelConverter$Xbgr -sun/awt/image/PixelConverter$Rgba -sun/awt/image/PixelConverter$RgbaPre -sun/awt/image/PixelConverter$Ushort565Rgb -sun/awt/image/PixelConverter$Ushort555Rgb -sun/awt/image/PixelConverter$Ushort555Rgbx -sun/awt/image/PixelConverter$Ushort4444Argb -sun/awt/image/PixelConverter$ByteGray -sun/awt/image/PixelConverter$UshortGray -sun/awt/image/PixelConverter$Rgbx -sun/awt/image/PixelConverter$Bgrx -sun/awt/image/PixelConverter$ArgbBm -java/awt/image/ColorModel -java/awt/image/DirectColorModel -java/awt/image/PackedColorModel -java/awt/color/ColorSpace -java/awt/color/ICC_Profile -sun/awt/color/ProfileDeferralInfo -sun/awt/color/ProfileDeferralMgr -java/awt/color/ICC_ProfileRGB -java/awt/color/ICC_Profile$1 -sun/awt/color/ProfileActivator -java/awt/color/ICC_ColorSpace -sun/java2d/pipe/NullPipe -sun/java2d/pipe/PixelDrawPipe -sun/java2d/pipe/PixelFillPipe -sun/java2d/pipe/ShapeDrawPipe -sun/java2d/pipe/TextPipe -sun/java2d/pipe/DrawImagePipe -java/awt/image/IndexColorModel -sun/java2d/pipe/LoopPipe -sun/java2d/pipe/OutlineTextRenderer -sun/java2d/pipe/SolidTextRenderer -sun/java2d/pipe/GlyphListLoopPipe -sun/java2d/pipe/GlyphListPipe -sun/java2d/pipe/AATextRenderer -sun/java2d/pipe/LCDTextRenderer -sun/java2d/pipe/AlphaColorPipe -sun/java2d/pipe/CompositePipe -sun/java2d/pipe/PixelToShapeConverter -sun/java2d/pipe/TextRenderer -sun/java2d/pipe/SpanClipRenderer -sun/java2d/pipe/Region -sun/java2d/pipe/RegionIterator -sun/java2d/pipe/DuctusShapeRenderer -sun/java2d/pipe/DuctusRenderer -sun/java2d/pipe/AlphaPaintPipe -sun/java2d/pipe/SpanShapeRenderer$Composite -sun/java2d/pipe/SpanShapeRenderer -sun/java2d/pipe/GeneralCompositePipe -sun/java2d/pipe/DrawImage -sun/java2d/loops/RenderCache -sun/java2d/loops/RenderCache$Entry -sun/java2d/loops/XORComposite -java/awt/Composite -sun/font/X11TextRenderer -sun/java2d/loops/GraphicsPrimitive -sun/java2d/x11/X11PMBlitLoops -sun/java2d/loops/Blit -sun/java2d/loops/GraphicsPrimitiveMgr -sun/java2d/loops/CompositeType -sun/java2d/SunGraphics2D -sun/awt/ConstrainableGraphics -java/awt/Graphics2D -java/awt/Graphics -java/awt/Color -java/awt/Paint -java/awt/AlphaComposite -sun/java2d/loops/BlitBg -sun/java2d/loops/ScaledBlit -sun/java2d/loops/FillRect -sun/java2d/loops/FillSpans -sun/java2d/loops/DrawLine -sun/java2d/loops/DrawRect -sun/java2d/loops/DrawPolygons -sun/java2d/loops/DrawPath -sun/java2d/loops/FillPath -sun/java2d/loops/MaskBlit -sun/java2d/loops/MaskFill -sun/java2d/loops/DrawGlyphList -sun/java2d/loops/DrawGlyphListAA -sun/java2d/loops/DrawGlyphListLCD -sun/java2d/loops/TransformHelper -java/awt/BasicStroke -java/awt/Stroke -sun/misc/PerformanceLogger -sun/misc/PerformanceLogger$TimeData -sun/java2d/pipe/ValidatePipe -sun/java2d/loops/CustomComponent -sun/java2d/loops/GraphicsPrimitiveProxy -sun/java2d/loops/GeneralRenderer -sun/java2d/loops/GraphicsPrimitiveMgr$1 -sun/java2d/loops/GraphicsPrimitiveMgr$2 -sun/java2d/x11/X11PMBlitLoops$DelegateBlitLoop -sun/java2d/x11/X11PMBlitBgLoops -sun/java2d/x11/X11SurfaceData$LazyPipe -sun/awt/X11GraphicsConfig$X11GCDisposerRecord -sun/java2d/DisposerRecord -java/awt/BorderLayout -java/awt/LayoutManager2 -java/awt/Rectangle -java/awt/Toolkit$2 -sun/awt/X11/XToolkit -sun/awt/X11/XConstants -sun/awt/UNIXToolkit -java/util/TreeMap -java/util/NavigableMap -java/util/SortedMap -sun/awt/X11/XlibWrapper -sun/awt/X11/XUtilConstants -sun/awt/X11/XProtocolConstants -sun/awt/X11/XCursorFontConstants -sun/awt/X11/XlibWrapper$1 -sun/awt/X11/XToolkit$4 -sun/awt/X11/XModifierKeymap -sun/awt/X11/XWrapperBase -sun/awt/X11/Native -sun/awt/X11/Native$1 -java/awt/EventQueue -sun/awt/X11/XToolkit$7 -java/util/EmptyStackException -java/lang/reflect/InvocationTargetException -java/awt/EventDispatchThread -java/awt/event/PaintEvent -java/awt/event/MouseEvent -sun/awt/PeerEvent -java/awt/event/InvocationEvent -java/awt/ActiveEvent -java/awt/EventQueueItem -sun/awt/X11/XToolkit$1 -sun/awt/X11/XToolkit$XErrorHandler -sun/awt/X11/XToolkit$5 -sun/awt/X11/XEventDispatcher -sun/awt/SunToolkit$ModalityListenerList -sun/awt/ModalityListener -sun/awt/SunToolkit$1 -java/util/MissingResourceException -java/awt/Queue -sun/awt/PostEventQueue -java/util/LinkedList -java/util/Deque -java/util/Queue -java/util/AbstractSequentialList -java/util/LinkedList$Entry -sun/awt/X11/AwtScreenData -sun/awt/X11/XWM -sun/awt/X11/MWMConstants -sun/awt/X11/XAtom -java/awt/Insets -sun/awt/X11/XWM$1 -sun/awt/X11/XWM$2 -sun/awt/X11/XSetWindowAttributes -sun/awt/X11/XErrorEvent -sun/awt/X11/XNETProtocol -sun/awt/X11/XStateProtocol -sun/awt/X11/XLayerProtocol -sun/awt/X11/XProtocol -sun/awt/X11/XProtocol$1 -sun/awt/X11/WindowPropertyGetter -sun/awt/X11/UnsafeXDisposerRecord -sun/awt/X11/XPropertyCache -sun/awt/X11/XWINProtocol -sun/awt/X11/XAtomList -sun/awt/X11/XToolkit$3 -sun/awt/X11/XAnyEvent -sun/awt/X11/IXAnyEvent -java/awt/Window$WindowDisposerRecord -java/awt/KeyboardFocusManager -java/awt/KeyEventDispatcher -java/awt/KeyEventPostProcessor -java/awt/AWTKeyStroke -java/awt/AWTKeyStroke$1 -java/awt/DefaultKeyboardFocusManager -java/awt/DefaultFocusTraversalPolicy -java/awt/ContainerOrderFocusTraversalPolicy -java/awt/FocusTraversalPolicy -java/awt/MutableBoolean -java/util/Collections$UnmodifiableSet -sun/awt/HeadlessToolkit -sun/awt/X11/XKeyboardFocusManagerPeer -java/awt/peer/KeyboardFocusManagerPeer -sun/awt/X11/XKeyboardFocusManagerPeer$1 -sun/awt/X11/XFramePeer -java/awt/peer/FramePeer -java/awt/peer/WindowPeer -java/awt/peer/ContainerPeer -java/awt/peer/ComponentPeer -sun/awt/X11/XDecoratedPeer -sun/awt/X11/XWindowPeer -sun/awt/X11/XPanelPeer -java/awt/peer/PanelPeer -sun/awt/X11/XCanvasPeer -java/awt/peer/CanvasPeer -sun/awt/X11/XComponentPeer -java/awt/dnd/peer/DropTargetPeer -sun/awt/X11/XWindow -sun/awt/X11ComponentPeer -sun/awt/X11/XBaseWindow -sun/awt/X11/XCreateWindowParams -java/lang/Long$LongCache -sun/awt/X11/XBaseWindow$InitialiseState -sun/awt/X11/XBaseWindow$StateLock -sun/awt/X11/AwtGraphicsConfigData -sun/awt/X11/XVisualInfo -java/awt/SystemColor -sun/awt/X11/MotifColorUtilities -java/lang/StrictMath -sun/awt/X11/XRepaintArea -sun/awt/RepaintArea -sun/awt/X11/XWindowAttributesData -java/util/concurrent/locks/LockSupport -sun/awt/X11/WindowDimensions -java/awt/Point -java/util/TreeMap$Entry -sun/nio/cs/UTF_8 -sun/nio/cs/Unicode -sun/nio/cs/UTF_8$Encoder -sun/nio/cs/UTF_8$Decoder -sun/nio/cs/Surrogate$Generator -sun/awt/X11/XPropertyEvent -sun/awt/X11/XDropTargetEventProcessor -sun/awt/X11/XDragSourceContextPeer -sun/awt/X11/XDragSourceProtocolListener -sun/awt/dnd/SunDragSourceContextPeer -java/awt/dnd/peer/DragSourceContextPeer -sun/awt/X11/XAwtState -sun/awt/X11/XBaseWindow$1 -sun/awt/X11/XRootWindow -sun/nio/cs/ISO_8859_1 -sun/nio/cs/ISO_8859_1$Encoder -sun/nio/cs/ISO_8859_1$Decoder -sun/java2d/x11/X11SurfaceData$X11WindowSurfaceData -sun/java2d/loops/RenderLoops -sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec -sun/java2d/DefaultDisposerRecord -sun/java2d/x11/X11Renderer -sun/awt/X11/XGlobalCursorManager -sun/awt/GlobalCursorManager -sun/awt/X11/XToolkit$6 -java/awt/Cursor$CursorDisposer -java/awt/AWTException -java/awt/HeadlessException -java/lang/UnsupportedOperationException -sun/reflect/UnsafeLongFieldAccessorImpl -sun/reflect/UnsafeIntegerFieldAccessorImpl -sun/awt/X11/XClientMessageEvent -sun/awt/X11/XIconInfo -sun/awt/X11/XAWTIcon32_java_icon16_png -sun/awt/X11/XAWTIcon32_java_icon24_png -sun/awt/X11/XAWTIcon32_java_icon32_png -sun/awt/X11/XAWTIcon32_java_icon48_png -sun/awt/X11/XSizeHints -sun/awt/X11/XContentWindow -sun/awt/X11/XFocusProxyWindow -sun/awt/X11/XWMHints -java/util/LinkedList$ListItr -java/util/ListIterator -sun/awt/SunToolkit$2 -java/awt/image/BufferStrategy -java/awt/dnd/DropTarget -java/awt/dnd/DropTargetListener -java/awt/event/ComponentListener -java/awt/event/FocusListener -java/awt/event/HierarchyListener -java/awt/event/HierarchyBoundsListener -java/awt/event/KeyListener -java/awt/event/MouseListener -java/awt/event/MouseMotionListener -java/awt/event/MouseWheelListener -java/awt/event/InputMethodListener -java/awt/Component$NativeInLightFixer -java/awt/event/ContainerListener -javax/accessibility/AccessibleContext -sun/reflect/UnsafeObjectFieldAccessorImpl -java/awt/peer/LightweightPeer -sun/awt/X11/XLabelPeer -java/awt/peer/LabelPeer -sun/awt/X11/XMapEvent -sun/awt/X11/XQueryTree -sun/awt/X11/XConfigureEvent -sun/awt/X11/PropMwmHints -sun/awt/GlobalCursorManager$NativeUpdater -javax/swing/JFrame -javax/swing/WindowConstants -javax/swing/RootPaneContainer -javax/swing/TransferHandler$HasGetTransferHandler -javax/swing/JLabel -javax/swing/SwingConstants -javax/swing/JComponent -javax/swing/JComponent$1 -javax/swing/SwingUtilities -javax/swing/JRootPane -sun/security/action/GetBooleanAction -javax/swing/event/EventListenerList -javax/swing/JPanel -java/awt/FlowLayout -javax/swing/UIManager -javax/swing/UIManager$LookAndFeelInfo -sun/swing/SwingUtilities2 -sun/swing/SwingUtilities2$LSBCacheEntry -javax/swing/UIManager$LAFState -javax/swing/UIDefaults -javax/swing/MultiUIDefaults -javax/swing/UIManager$1 -javax/swing/plaf/metal/MetalLookAndFeel -javax/swing/plaf/basic/BasicLookAndFeel -javax/swing/LookAndFeel -sun/swing/DefaultLookup -javax/swing/plaf/metal/OceanTheme -javax/swing/plaf/metal/DefaultMetalTheme -javax/swing/plaf/metal/MetalTheme -javax/swing/plaf/ColorUIResource -javax/swing/plaf/UIResource -sun/swing/PrintColorUIResource -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate -javax/swing/plaf/FontUIResource -sun/swing/SwingLazyValue -javax/swing/UIDefaults$LazyValue -javax/swing/UIDefaults$ActiveValue -javax/swing/plaf/InsetsUIResource -sun/swing/SwingUtilities2$2 -javax/swing/plaf/basic/BasicLookAndFeel$2 -javax/swing/plaf/DimensionUIResource -javax/swing/UIDefaults$LazyInputMap -java/lang/Character$CharacterCache -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue -javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue -java/awt/print/PrinterJob -sun/swing/SwingUtilities2$AATextInfo -sun/awt/X11/XAWTXSettings -sun/awt/X11/XMSelectionListener -sun/awt/XSettings -sun/awt/X11/XMSelection -sun/awt/X11/XMSelection$1 -javax/swing/plaf/metal/MetalLookAndFeel$AATextListener -java/beans/PropertyChangeListener -java/beans/PropertyChangeListenerProxy -java/util/EventListenerProxy -sun/awt/EventListenerAggregate -javax/swing/UIDefaults$ProxyLazyValue -javax/swing/plaf/metal/OceanTheme$1 -javax/swing/plaf/metal/OceanTheme$2 -javax/swing/plaf/metal/OceanTheme$3 -javax/swing/plaf/metal/OceanTheme$4 -javax/swing/plaf/metal/OceanTheme$5 -javax/swing/plaf/metal/OceanTheme$6 -javax/swing/RepaintManager -javax/swing/RepaintManager$DisplayChangedHandler -javax/swing/SwingPaintEventDispatcher -sun/awt/PaintEventDispatcher -javax/swing/UIManager$2 -javax/swing/UIManager$3 -java/awt/PopupMenu -java/awt/Menu -java/awt/MenuItem -java/awt/MenuComponent -java/io/ObjectOutputStream -java/io/ObjectOutput -java/io/DataOutput -java/io/ObjectStreamConstants -java/io/PrintWriter -java/io/ObjectInputStream -java/io/ObjectInput -java/awt/Event -java/awt/im/InputContext -java/awt/event/MouseWheelEvent -java/awt/BufferCapabilities -sun/awt/CausedFocusEvent$Cause -java/awt/PointerInfo -java/awt/Component$BaselineResizeBehavior -java/awt/FontMetrics -java/awt/Image -java/awt/image/ImageProducer -java/awt/image/VolatileImage -java/awt/im/InputMethodRequests -java/awt/event/FocusEvent -java/awt/event/InputMethodEvent -java/awt/event/HierarchyEvent -javax/accessibility/AccessibleStateSet -com/sun/swing/internal/plaf/metal/resources/metal -sun/util/ResourceBundleEnumeration -com/sun/swing/internal/plaf/basic/resources/basic -javax/swing/plaf/basic/BasicPanelUI -javax/swing/plaf/PanelUI -javax/swing/plaf/ComponentUI -sun/reflect/misc/MethodUtil -sun/reflect/misc/MethodUtil$1 -java/util/jar/JarFile -java/util/zip/ZipFile -java/util/zip/ZipConstants -java/util/jar/JavaUtilJarAccessImpl -sun/misc/JavaUtilJarAccess -sun/misc/JarIndex -java/util/zip/ZipEntry -java/util/jar/JarFile$JarFileEntry -java/util/jar/JarEntry -sun/misc/URLClassPath$JarLoader$2 -sun/net/www/protocol/jar/JarURLConnection -java/net/JarURLConnection -sun/net/www/protocol/jar/JarFileFactory -sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController -java/net/HttpURLConnection -sun/net/www/protocol/jar/URLJarFile -sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry -sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream -java/util/zip/ZipFile$ZipFileInputStream -java/security/AllPermissionCollection -java/lang/IllegalAccessException -javax/swing/JPasswordField -javax/swing/JTextField -javax/swing/text/JTextComponent -javax/swing/Scrollable -javax/swing/JLayeredPane -javax/swing/JRootPane$1 -javax/swing/ArrayTable -javax/swing/JInternalFrame -javax/swing/JRootPane$RootLayout -javax/swing/BufferStrategyPaintManager -javax/swing/RepaintManager$PaintManager -javax/swing/plaf/metal/MetalRootPaneUI -javax/swing/plaf/basic/BasicRootPaneUI -javax/swing/plaf/RootPaneUI -javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap -javax/swing/plaf/ComponentInputMapUIResource -javax/swing/ComponentInputMap -javax/swing/InputMap -javax/swing/plaf/InputMapUIResource -javax/swing/KeyStroke -java/awt/VKCollection -sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl -javax/swing/plaf/basic/LazyActionMap -javax/swing/plaf/ActionMapUIResource -javax/swing/ActionMap -javax/swing/LayoutFocusTraversalPolicy -javax/swing/SortingFocusTraversalPolicy -javax/swing/InternalFrameFocusTraversalPolicy -javax/swing/SwingContainerOrderFocusTraversalPolicy -javax/swing/SwingDefaultFocusTraversalPolicy -javax/swing/LayoutComparator -javax/swing/plaf/metal/MetalLabelUI -javax/swing/plaf/basic/BasicLabelUI -javax/swing/plaf/LabelUI -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 -javax/swing/plaf/basic/BasicHTML -javax/swing/SystemEventQueueUtilities -javax/swing/SystemEventQueueUtilities$SystemEventQueue -sun/awt/NullComponentPeer -java/awt/event/WindowEvent -java/awt/EventQueue$1 -java/awt/EventDispatchThread$1 -java/awt/Conditional -java/awt/EventDispatchThread$HierarchyEventFilter -java/awt/EventFilter$FilterAction -sun/awt/dnd/SunDropTargetEvent -java/awt/event/ActionEvent -java/util/jar/Manifest -java/io/ByteArrayInputStream -java/util/jar/Attributes -java/util/jar/Manifest$FastInputStream -java/util/jar/Attributes$Name -sun/misc/ASCIICaseInsensitiveComparator -java/util/jar/JarVerifier -java/io/ByteArrayOutputStream -sun/misc/ExtensionDependency -java/lang/Package -sun/security/util/ManifestEntryVerifier -sun/security/provider/Sun -java/security/Provider -java/security/Provider$ServiceKey -java/security/Provider$EngineDescription -sun/security/provider/Sun$1 -java/security/Security -java/security/Security$1 -sun/misc/FloatingDecimal -sun/misc/FloatingDecimal$1 -sun/security/provider/NativePRNG -java/security/SecureRandomSpi -sun/security/provider/NativePRNG$1 -sun/security/provider/NativePRNG$RandomIO -sun/misc/BASE64Decoder -sun/misc/CharacterDecoder -sun/security/util/SignatureFileVerifier -java/awt/event/KeyAdapter -java/lang/NumberFormatException -java/lang/IllegalArgumentException -java/io/FileWriter -java/net/Authenticator -java/net/MalformedURLException -javax/swing/text/Element -javax/swing/text/Document -javax/swing/text/PlainDocument -javax/swing/text/AbstractDocument -javax/swing/text/GapContent -javax/swing/text/AbstractDocument$Content -javax/swing/text/GapVector -javax/swing/text/GapContent$MarkVector -javax/swing/text/GapContent$MarkData -javax/swing/text/StyleContext -javax/swing/text/AbstractDocument$AttributeContext -javax/swing/text/StyleConstants -javax/swing/text/StyleConstants$CharacterConstants -javax/swing/text/AttributeSet$CharacterAttribute -javax/swing/text/StyleConstants$FontConstants -javax/swing/text/AttributeSet$FontAttribute -javax/swing/text/StyleConstants$ColorConstants -javax/swing/text/AttributeSet$ColorAttribute -javax/swing/text/StyleConstants$ParagraphConstants -javax/swing/text/AttributeSet$ParagraphAttribute -javax/swing/text/StyleContext$FontKey -javax/swing/text/SimpleAttributeSet -javax/swing/text/MutableAttributeSet -javax/swing/text/AttributeSet -javax/swing/text/SimpleAttributeSet$EmptyAttributeSet -javax/swing/text/StyleContext$NamedStyle -javax/swing/text/Style -javax/swing/text/SimpleAttributeSet$1 -javax/swing/text/StyleContext$SmallAttributeSet -javax/swing/text/AbstractDocument$BidiRootElement -javax/swing/text/AbstractDocument$BranchElement -javax/swing/text/AbstractDocument$AbstractElement -javax/swing/tree/TreeNode -javax/swing/text/AbstractDocument$1 -javax/swing/text/AbstractDocument$BidiElement -javax/swing/text/AbstractDocument$LeafElement -javax/swing/text/GapContent$StickyPosition -javax/swing/text/Position -javax/swing/text/StyleContext$KeyEnumeration -javax/swing/text/GapContent$InsertUndo -javax/swing/undo/AbstractUndoableEdit -javax/swing/undo/UndoableEdit -javax/swing/text/AbstractDocument$DefaultDocumentEvent -javax/swing/event/DocumentEvent -javax/swing/undo/CompoundEdit -javax/swing/event/DocumentEvent$EventType -javax/swing/text/Segment -java/text/CharacterIterator -javax/swing/text/Utilities -javax/swing/text/SegmentCache -javax/swing/text/SegmentCache$CachedSegment -javax/swing/event/UndoableEditEvent -javax/swing/text/AbstractDocument$ElementEdit -javax/swing/event/DocumentEvent$ElementChange -java/net/Socket -java/net/InetAddress -java/net/InetAddress$Cache -java/net/InetAddress$Cache$Type -java/net/InetAddressImplFactory -java/net/Inet4AddressImpl -java/net/InetAddressImpl -java/net/InetAddress$1 -sun/net/spi/nameservice/NameService -sun/net/util/IPAddressUtil -java/util/RandomAccessSubList -java/util/SubList -java/util/SubList$1 -java/util/AbstractList$ListItr -java/net/Inet4Address -java/net/InetSocketAddress -java/net/SocketAddress -java/net/SocksSocketImpl -java/net/SocksConsts -java/net/PlainSocketImpl -java/net/SocketImpl -java/net/SocketOptions -java/net/SocketException -java/net/SocksSocketImpl$5 -java/net/ProxySelector -sun/net/spi/DefaultProxySelector -sun/net/spi/DefaultProxySelector$1 -sun/net/NetProperties -sun/net/NetProperties$1 -sun/net/spi/DefaultProxySelector$NonProxyInfo -java/net/Inet6Address -java/net/URI -java/net/URI$Parser -java/net/Proxy -java/net/Proxy$Type -java/net/ConnectException -javax/swing/JMenu -javax/swing/MenuElement -javax/swing/JMenuItem -javax/swing/AbstractButton -java/awt/ItemSelectable -javax/swing/event/MenuListener -javax/swing/JCheckBoxMenuItem -javax/swing/Icon -javax/swing/JButton -java/awt/event/WindowListener -java/net/URLClassLoader$2 -javax/swing/ImageIcon -javax/swing/ImageIcon$1 -java/awt/MediaTracker -sun/misc/SoftCache$ValueCell -sun/awt/image/URLImageSource -sun/awt/image/InputStreamImageSource -sun/awt/image/ImageFetchable -sun/awt/image/ToolkitImage -java/awt/Image$1 -sun/awt/image/SurfaceManager$ImageAccessor -sun/awt/image/SurfaceManager -sun/awt/image/NativeLibLoader -java/awt/ImageMediaEntry -java/awt/MediaEntry -sun/awt/image/ImageRepresentation -java/awt/image/ImageConsumer -sun/awt/image/ImageWatched -sun/awt/image/ImageWatched$Link -sun/awt/image/ImageWatched$WeakLink -sun/awt/image/ImageConsumerQueue -sun/awt/image/ImageFetcher -sun/awt/image/FetcherInfo -sun/awt/image/ImageFetcher$1 -sun/awt/image/GifImageDecoder -sun/awt/image/ImageDecoder -sun/awt/image/GifFrame -java/awt/image/Raster -java/awt/image/DataBufferByte -java/awt/image/DataBuffer -java/awt/image/PixelInterleavedSampleModel -java/awt/image/ComponentSampleModel -java/awt/image/SampleModel -sun/awt/image/ByteInterleavedRaster -sun/awt/image/ByteComponentRaster -sun/awt/image/SunWritableRaster -java/awt/image/WritableRaster -java/awt/image/BufferedImage -java/awt/image/WritableRenderedImage -java/awt/image/RenderedImage -sun/awt/image/IntegerComponentRaster -sun/awt/image/BytePackedRaster -java/awt/Canvas -sun/font/FontDesignMetrics -sun/font/FontStrikeDesc -sun/font/CompositeStrike -sun/font/FontStrikeDisposer -sun/font/StrikeCache$SoftDisposerRef -sun/font/StrikeCache$DisposableStrike -sun/font/TrueTypeFont$TTDisposerRecord -sun/font/TrueTypeFont$1 -java/io/RandomAccessFile -java/nio/ByteBufferAsIntBufferB -java/nio/IntBuffer -sun/font/TrueTypeFont$DirectoryEntry -java/nio/ByteBufferAsShortBufferB -java/nio/ShortBuffer -sun/nio/cs/UTF_16 -sun/nio/cs/UTF_16$Decoder -sun/nio/cs/UnicodeDecoder -sun/font/FileFontStrike -sun/font/FileFont$FileFontDisposer -sun/font/TrueTypeGlyphMapper -sun/font/CMap -sun/font/CMap$NullCMapClass -sun/font/CMap$CMapFormat4 -java/nio/ByteBufferAsCharBufferB -sun/font/FontDesignMetrics$KeyReference -sun/awt/image/PNGImageDecoder -sun/awt/image/PNGFilterInputStream -java/util/zip/InflaterInputStream -java/util/zip/Inflater -sun/awt/EventQueueItem -sun/awt/SunToolkit$3 -sun/awt/X11/XExposeEvent -sun/awt/X11/ComponentAccessor -sun/awt/X11/ComponentAccessor$1 -sun/reflect/UnsafeBooleanFieldAccessorImpl -sun/awt/event/IgnorePaintEvent -java/awt/image/DataBufferInt -java/awt/image/SinglePixelPackedSampleModel -sun/awt/image/IntegerInterleavedRaster -sun/java2d/x11/X11RemoteOffScreenImage -sun/awt/image/RemoteOffScreenImage -sun/awt/image/OffScreenImage -sun/java2d/x11/X11RemoteOffScreenImage$X11RemoteSurfaceManager -sun/awt/image/OffScreenSurfaceManager -sun/awt/image/CachingSurfaceManager -sun/awt/image/RasterListener -sun/awt/image/BufImgSurfaceData -sun/java2d/opengl/GLXGraphicsConfig -sun/java2d/opengl/OGLGraphicsConfig -sun/java2d/x11/X11SurfaceData$X11PixmapSurfaceData -sun/awt/image/WritableRasterNative -sun/awt/image/DataBufferNative -sun/java2d/SurfaceManagerFactory -sun/java2d/x11/X11CachingSurfaceManager -sun/java2d/opengl/GLXSurfaceData -sun/java2d/opengl/OGLSurfaceData -sun/font/CompositeGlyphMapper -sun/java2d/loops/FontInfo -java/util/Date -sun/util/calendar/CalendarSystem -sun/util/calendar/Gregorian -sun/util/calendar/BaseCalendar -sun/util/calendar/AbstractCalendar -java/util/TimeZone -java/lang/InheritableThreadLocal -sun/util/calendar/ZoneInfo -sun/util/calendar/ZoneInfoFile -sun/util/calendar/ZoneInfoFile$1 -java/util/TimeZone$1 -sun/util/calendar/Gregorian$Date -sun/util/calendar/BaseCalendar$Date -sun/util/calendar/CalendarDate -sun/util/calendar/CalendarUtils -java/util/TimeZone$DisplayNames -sun/util/TimeZoneNameUtility -sun/util/resources/TimeZoneNames -sun/util/resources/TimeZoneNamesBundle -sun/util/resources/TimeZoneNames_en -java/util/spi/TimeZoneNameProvider -java/lang/ProcessBuilder -java/lang/ProcessImpl -java/lang/UNIXProcess -java/lang/Process -java/lang/UNIXProcess$Gate -java/lang/UNIXProcess$1 -java/lang/UNIXProcess$1$1 -java/lang/UNIXProcess$1$1$1 -java/net/ServerSocket -java/util/Random -java/util/concurrent/atomic/AtomicLong -java/lang/InternalError -java/io/StringReader -java/lang/SecurityException -java/io/FilterReader -java/lang/reflect/Proxy -java/lang/reflect/InvocationHandler -java/lang/NoSuchFieldException -java/lang/InstantiationException -java/lang/ArrayIndexOutOfBoundsException -java/lang/IndexOutOfBoundsException -javax/swing/JDialog -sun/awt/X11/XClipboard -sun/awt/datatransfer/SunClipboard -java/awt/datatransfer/Clipboard -java/awt/datatransfer/SystemFlavorMap -java/awt/datatransfer/FlavorMap -java/awt/datatransfer/FlavorTable -java/awt/datatransfer/SystemFlavorMap$1 -sun/net/ProgressMonitor -sun/net/DefaultProgressMeteringPolicy -sun/net/ProgressMeteringPolicy -java/awt/datatransfer/SystemFlavorMap$2 -java/awt/datatransfer/MimeType -java/io/Externalizable -java/awt/datatransfer/MimeTypeParameterList -sun/awt/datatransfer/DataTransferer -java/util/Collections$SynchronizedSet -java/util/Collections$SynchronizedCollection -java/awt/datatransfer/DataFlavor -java/awt/datatransfer/DataFlavor$1 -sun/awt/datatransfer/DataTransferer$CharsetComparator -sun/awt/datatransfer/DataTransferer$IndexedComparator -sun/nio/cs/UTF_16LE -sun/nio/cs/UTF_16BE -sun/awt/datatransfer/DataTransferer$DataFlavorComparator -java/rmi/Remote -sun/awt/datatransfer/DataTransferer$1 -sun/awt/X11/XDataTransferer -sun/awt/datatransfer/ToolkitThreadBlockedHandler -javax/imageio/ImageTypeSpecifier -sun/awt/X11/XSelection -sun/security/action/GetIntegerAction -sun/awt/X11/XSelection$IncrementalTransferHandler -sun/awt/X11/XSelection$SelectionEventHandler -java/awt/datatransfer/Transferable -java/io/EOFException -java/util/Vector$1 -java/util/zip/ZipFile$1 -java/util/zip/ZipFile$2 -java/util/jar/JarFile$1 -java/util/PropertyResourceBundle -java/util/ResourceBundle$Control$1 -java/util/Hashtable$EntrySet -java/lang/IllegalAccessError -java/text/MessageFormat -java/text/MessageFormat$Field -java/text/Format$Field -java/lang/CloneNotSupportedException -sun/reflect/MethodAccessorGenerator -sun/reflect/AccessorGenerator -sun/reflect/ClassFileConstants -java/lang/Void -sun/reflect/ByteVectorFactory -sun/reflect/ByteVectorImpl -sun/reflect/ByteVector -sun/reflect/ClassFileAssembler -sun/reflect/UTF8 -sun/reflect/Label -sun/reflect/Label$PatchInfo -sun/reflect/MethodAccessorGenerator$1 -sun/reflect/ClassDefiner -sun/reflect/ClassDefiner$1 -sun/reflect/BootstrapConstructorAccessorImpl -java/awt/event/ActionListener -javax/swing/Timer -javax/swing/Timer$DoPostEvent -javax/swing/TimerQueue -javax/swing/TimerQueue$1 -javax/swing/ToolTipManager -java/awt/event/MouseAdapter -javax/swing/ToolTipManager$insideTimerAction -javax/swing/ToolTipManager$outsideTimerAction -javax/swing/ToolTipManager$stillInsideTimerAction -javax/swing/ToolTipManager$Actions -sun/swing/UIAction -javax/swing/Action -javax/swing/ToolTipManager$MoveBeforeEnterListener -java/awt/event/MouseMotionAdapter -java/util/Hashtable$ValueCollection -javax/swing/event/CaretListener -javax/swing/JToolBar -javax/swing/JSplitPane -javax/swing/border/Border -javax/swing/JToggleButton -javax/swing/border/EmptyBorder -javax/swing/border/AbstractBorder -javax/swing/DefaultButtonModel -javax/swing/ButtonModel -javax/swing/AbstractButton$Handler -javax/swing/event/ChangeListener -java/awt/event/ItemListener -javax/swing/plaf/metal/MetalButtonUI -javax/swing/plaf/basic/BasicButtonUI -javax/swing/plaf/ButtonUI -javax/swing/plaf/metal/MetalBorders -javax/swing/plaf/BorderUIResource$CompoundBorderUIResource -javax/swing/border/CompoundBorder -javax/swing/plaf/metal/MetalBorders$ButtonBorder -javax/swing/plaf/basic/BasicBorders$MarginBorder -javax/swing/plaf/basic/BasicButtonListener -java/awt/AWTEventMulticaster -java/awt/event/WindowFocusListener -java/awt/event/WindowStateListener -java/awt/event/AdjustmentListener -java/awt/event/TextListener -javax/swing/event/AncestorListener -java/beans/VetoableChangeListener -javax/swing/ButtonGroup -javax/swing/JToggleButton$ToggleButtonModel -javax/swing/plaf/metal/MetalToggleButtonUI -javax/swing/plaf/basic/BasicToggleButtonUI -javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder -java/awt/CardLayout -javax/swing/Box -javax/swing/plaf/metal/MetalBorders$TextFieldBorder -javax/swing/plaf/metal/MetalBorders$Flush3DBorder -javax/swing/BoxLayout -javax/swing/JMenuBar -javax/swing/DefaultSingleSelectionModel -javax/swing/SingleSelectionModel -javax/swing/plaf/basic/BasicMenuBarUI -javax/swing/plaf/MenuBarUI -javax/swing/plaf/basic/DefaultMenuLayout -javax/swing/plaf/metal/MetalBorders$MenuBarBorder -javax/swing/plaf/basic/BasicMenuBarUI$Handler -javax/swing/KeyboardManager -javax/swing/event/MenuEvent -javax/swing/JMenu$MenuChangeListener -javax/swing/JMenuItem$MenuItemFocusListener -javax/swing/plaf/basic/BasicMenuUI -javax/swing/plaf/basic/BasicMenuItemUI -javax/swing/plaf/MenuItemUI -javax/swing/plaf/metal/MetalBorders$MenuItemBorder -javax/swing/plaf/metal/MetalIconFactory -javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon -javax/swing/plaf/basic/BasicMenuUI$Handler -javax/swing/event/MenuKeyListener -javax/swing/plaf/basic/BasicMenuItemUI$Handler -javax/swing/event/MenuDragMouseListener -javax/swing/event/MouseInputListener -javax/swing/event/ChangeEvent -java/awt/event/ContainerEvent -javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon -javax/swing/JPopupMenu -javax/swing/plaf/basic/BasicPopupMenuUI -javax/swing/plaf/PopupMenuUI -javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper -java/awt/event/AWTEventListenerProxy -java/awt/Toolkit$SelectiveAWTEventListener -java/awt/Toolkit$ToolkitEventMulticaster -javax/swing/plaf/basic/BasicLookAndFeel$1 -javax/swing/plaf/metal/MetalBorders$PopupMenuBorder -javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener -javax/swing/event/PopupMenuListener -javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener -javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber -javax/swing/MenuSelectionManager -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 -java/awt/event/FocusAdapter -javax/swing/JMenu$WinListener -java/awt/event/WindowAdapter -javax/swing/JPopupMenu$Separator -javax/swing/JSeparator -javax/swing/plaf/metal/MetalPopupMenuSeparatorUI -javax/swing/plaf/metal/MetalSeparatorUI -javax/swing/plaf/basic/BasicSeparatorUI -javax/swing/plaf/SeparatorUI -javax/swing/JComboBox -javax/swing/event/ListDataListener -javax/swing/event/CaretEvent -javax/swing/text/TabExpander -javax/swing/JScrollBar -java/awt/Adjustable -javax/swing/event/MouseInputAdapter -javax/swing/JScrollBar$ModelListener -javax/swing/DefaultBoundedRangeModel -javax/swing/BoundedRangeModel -javax/swing/plaf/metal/MetalScrollBarUI -javax/swing/plaf/basic/BasicScrollBarUI -javax/swing/plaf/ScrollBarUI -javax/swing/plaf/metal/MetalBumps -javax/swing/plaf/metal/MetalScrollButton -javax/swing/plaf/basic/BasicArrowButton -javax/swing/plaf/basic/BasicScrollBarUI$TrackListener -javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener -javax/swing/plaf/basic/BasicScrollBarUI$ModelListener -javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener -javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicScrollBarUI$Handler -javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener -javax/swing/CellRendererPane -java/util/HashMap$EntryIterator -javax/swing/border/MatteBorder -sun/font/StandardGlyphVector -java/awt/font/GlyphVector -sun/font/StandardGlyphVector$GlyphStrike -sun/font/CoreMetrics -sun/font/FontLineMetrics -java/awt/font/LineMetrics -javax/swing/ComboBoxModel -javax/swing/ListModel -javax/swing/ListCellRenderer -javax/swing/DefaultComboBoxModel -javax/swing/MutableComboBoxModel -javax/swing/AbstractListModel -javax/swing/JComboBox$1 -javax/swing/AncestorNotifier -javax/swing/plaf/metal/MetalComboBoxUI -javax/swing/plaf/basic/BasicComboBoxUI -javax/swing/plaf/ComboBoxUI -javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager -javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager -javax/swing/plaf/basic/BasicComboPopup -javax/swing/plaf/basic/ComboPopup -javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass -javax/swing/border/LineBorder -javax/swing/plaf/basic/BasicComboPopup$1 -javax/swing/JList -javax/swing/DropMode -javax/swing/DefaultListSelectionModel -javax/swing/ListSelectionModel -javax/swing/plaf/basic/BasicListUI -javax/swing/plaf/ListUI -javax/swing/plaf/basic/BasicListUI$ListTransferHandler -javax/swing/TransferHandler -javax/swing/TransferHandler$TransferAction -javax/swing/DefaultListCellRenderer$UIResource -javax/swing/DefaultListCellRenderer -javax/swing/TransferHandler$SwingDropTarget -java/awt/dnd/DropTargetContext -javax/swing/TransferHandler$DropHandler -javax/swing/TransferHandler$TransferSupport -javax/swing/plaf/basic/BasicListUI$Handler -javax/swing/event/ListSelectionListener -javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag -javax/swing/plaf/basic/BasicComboPopup$Handler -javax/swing/JScrollPane -javax/swing/ScrollPaneConstants -javax/swing/ScrollPaneLayout$UIResource -javax/swing/ScrollPaneLayout -javax/swing/JViewport -javax/swing/ViewportLayout -javax/swing/plaf/basic/BasicViewportUI -javax/swing/plaf/ViewportUI -javax/swing/JScrollPane$ScrollBar -javax/swing/JViewport$ViewListener -java/awt/event/ComponentAdapter -javax/swing/plaf/metal/MetalScrollPaneUI -javax/swing/plaf/basic/BasicScrollPaneUI -javax/swing/plaf/ScrollPaneUI -javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder -javax/swing/plaf/basic/BasicScrollPaneUI$Handler -javax/swing/plaf/metal/MetalScrollPaneUI$1 -javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource -javax/swing/plaf/basic/BasicComboBoxRenderer -javax/swing/plaf/metal/MetalComboBoxEditor$UIResource -javax/swing/plaf/metal/MetalComboBoxEditor -javax/swing/plaf/basic/BasicComboBoxEditor -javax/swing/ComboBoxEditor -javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField -javax/swing/JTextField$NotifyAction -javax/swing/text/TextAction -javax/swing/AbstractAction -javax/swing/text/JTextComponent$MutableCaretEvent -javax/swing/plaf/metal/MetalTextFieldUI -javax/swing/plaf/basic/BasicTextFieldUI -javax/swing/plaf/basic/BasicTextUI -javax/swing/text/ViewFactory -javax/swing/plaf/TextUI -javax/swing/plaf/basic/BasicTextUI$BasicCursor -javax/swing/text/DefaultEditorKit -javax/swing/text/EditorKit -javax/swing/text/DefaultEditorKit$InsertContentAction -javax/swing/text/DefaultEditorKit$DeletePrevCharAction -javax/swing/text/DefaultEditorKit$DeleteNextCharAction -javax/swing/text/DefaultEditorKit$ReadOnlyAction -javax/swing/text/DefaultEditorKit$DeleteWordAction -javax/swing/text/DefaultEditorKit$WritableAction -javax/swing/text/DefaultEditorKit$CutAction -javax/swing/text/DefaultEditorKit$CopyAction -javax/swing/text/DefaultEditorKit$PasteAction -javax/swing/text/DefaultEditorKit$VerticalPageAction -javax/swing/text/DefaultEditorKit$PageAction -javax/swing/text/DefaultEditorKit$InsertBreakAction -javax/swing/text/DefaultEditorKit$BeepAction -javax/swing/text/DefaultEditorKit$NextVisualPositionAction -javax/swing/text/DefaultEditorKit$BeginWordAction -javax/swing/text/DefaultEditorKit$EndWordAction -javax/swing/text/DefaultEditorKit$PreviousWordAction -javax/swing/text/DefaultEditorKit$NextWordAction -javax/swing/text/DefaultEditorKit$BeginLineAction -javax/swing/text/DefaultEditorKit$EndLineAction -javax/swing/text/DefaultEditorKit$BeginParagraphAction -javax/swing/text/DefaultEditorKit$EndParagraphAction -javax/swing/text/DefaultEditorKit$BeginAction -javax/swing/text/DefaultEditorKit$EndAction -javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction -javax/swing/text/DefaultEditorKit$InsertTabAction -javax/swing/text/DefaultEditorKit$SelectWordAction -javax/swing/text/DefaultEditorKit$SelectLineAction -javax/swing/text/DefaultEditorKit$SelectParagraphAction -javax/swing/text/DefaultEditorKit$SelectAllAction -javax/swing/text/DefaultEditorKit$UnselectAction -javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction -javax/swing/text/DefaultEditorKit$DumpModelAction -javax/swing/plaf/basic/BasicTextUI$TextTransferHandler -javax/swing/text/Position$Bias -javax/swing/plaf/basic/BasicTextUI$RootView -javax/swing/text/View -javax/swing/plaf/basic/BasicTextUI$UpdateHandler -javax/swing/event/DocumentListener -javax/swing/plaf/basic/BasicTextUI$DragListener -javax/swing/plaf/basic/BasicComboBoxEditor$UIResource -javax/swing/plaf/basic/BasicTextUI$BasicCaret -javax/swing/text/DefaultCaret -javax/swing/text/Caret -javax/swing/text/DefaultCaret$Handler -java/awt/datatransfer/ClipboardOwner -javax/swing/plaf/basic/BasicTextUI$BasicHighlighter -javax/swing/text/DefaultHighlighter -javax/swing/text/LayeredHighlighter -javax/swing/text/Highlighter -javax/swing/text/Highlighter$Highlight -javax/swing/text/DefaultHighlighter$DefaultHighlightPainter -javax/swing/text/LayeredHighlighter$LayerPainter -javax/swing/text/Highlighter$HighlightPainter -javax/swing/text/DefaultHighlighter$SafeDamager -javax/swing/text/FieldView -javax/swing/text/PlainView -javax/swing/text/JTextComponent$DefaultKeymap -javax/swing/text/Keymap -javax/swing/text/JTextComponent$KeymapWrapper -javax/swing/text/JTextComponent$KeymapActionMap -javax/swing/plaf/basic/BasicTextUI$FocusAction -javax/swing/plaf/basic/BasicTextUI$TextActionWrapper -javax/swing/JTextArea -javax/swing/JEditorPane -javax/swing/JTextField$ScrollRepainter -javax/swing/plaf/metal/MetalComboBoxEditor$1 -javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder -javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener -javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicComboBoxUI$Handler -javax/swing/plaf/metal/MetalComboBoxButton -javax/swing/plaf/metal/MetalComboBoxIcon -javax/swing/plaf/metal/MetalComboBoxButton$1 -javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager -javax/swing/JComboBox$KeySelectionManager -javax/swing/JToolBar$DefaultToolBarLayout -javax/swing/plaf/metal/MetalToolBarUI -javax/swing/plaf/basic/BasicToolBarUI -javax/swing/plaf/ToolBarUI -javax/swing/plaf/metal/MetalBorders$ToolBarBorder -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue$1 -javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder -javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder -javax/swing/plaf/basic/BasicBorders$RadioButtonBorder -javax/swing/plaf/basic/BasicBorders$ButtonBorder -javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder -javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener -javax/swing/plaf/basic/BasicToolBarUI$DockingListener -javax/swing/plaf/basic/BasicToolBarUI$Handler -javax/swing/border/EtchedBorder -javax/swing/JToolBar$Separator -javax/swing/plaf/basic/BasicToolBarSeparatorUI -sun/awt/color/CMM -java/applet/Applet -java/awt/Panel -com/sun/awt/AWTUtilities -javax/swing/KeyboardManager$ComponentKeyStrokePair -sun/awt/EmbeddedFrame -sun/awt/im/InputMethodContext -java/awt/im/spi/InputMethodContext -sun/awt/im/InputContext -sun/awt/im/InputMethodManager -sun/awt/im/ExecutableInputMethodManager -sun/awt/X11/XInputMethodDescriptor -sun/awt/X11InputMethodDescriptor -java/awt/im/spi/InputMethodDescriptor -sun/awt/im/InputMethodLocator -sun/awt/im/ExecutableInputMethodManager$2 -sun/misc/Service -sun/misc/Service$LazyIterator -java/util/TreeSet -java/util/NavigableSet -java/util/SortedSet -javax/swing/SizeRequirements -javax/swing/plaf/basic/BasicGraphicsUtils -java/awt/event/AdjustmentEvent -java/awt/MenuBar -sun/awt/X11/XComponentPeer$2 -java/awt/SequencedEvent -java/beans/PropertyVetoException -java/awt/DefaultKeyboardFocusManager$TypeAheadMarker -java/awt/KeyboardFocusManager$HeavyweightFocusRequest -java/awt/KeyboardFocusManager$LightweightFocusRequest -sun/awt/KeyboardFocusManagerPeerImpl -sun/awt/SunToolkit$7 -java/awt/Window$1DisposeAction -java/awt/LightweightDispatcher$2 -sun/awt/X11/XReparentEvent -sun/awt/X11/XWindowAttributes -javax/swing/SystemEventQueueUtilities$ComponentWorkRequest -sun/awt/X11/XFocusChangeEvent -sun/awt/X11/XComponentPeer$1 -sun/awt/X11/XUnmapEvent -java/io/StringWriter -javax/swing/JWindow -java/io/UnsupportedEncodingException -java/net/UnknownHostException -java/nio/channels/SocketChannel -java/nio/channels/spi/AbstractSelectableChannel -java/nio/channels/SelectableChannel -java/net/SocketImplFactory -javax/swing/UnsupportedLookAndFeelException -java/lang/UnsatisfiedLinkError -javax/swing/Box$Filler -javax/swing/JComponent$2 -sun/net/www/MimeTable -java/net/FileNameMap -sun/net/www/MimeTable$1 -sun/net/www/MimeTable$2 -sun/net/www/MimeEntry -java/net/URLConnection$1 -java/text/SimpleDateFormat -java/text/DateFormat -java/text/DateFormat$Field -java/util/Calendar -java/util/GregorianCalendar -sun/util/resources/CalendarData -sun/util/resources/CalendarData_en -java/text/DateFormatSymbols -java/text/spi/DateFormatSymbolsProvider -java/text/DontCareFieldPosition -java/text/DontCareFieldPosition$1 -java/text/Format$FieldDelegate -javax/swing/plaf/BorderUIResource -javax/swing/BorderFactory -javax/swing/border/BevelBorder -javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon -javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 -java/util/zip/ZipInputStream -java/io/PushbackInputStream -java/util/zip/CRC32 -java/util/zip/Checksum -java/lang/Thread$State -javax/swing/SwingUtilities$SharedOwnerFrame -javax/swing/JTable -javax/swing/event/TableModelListener -javax/swing/event/TableColumnModelListener -javax/swing/event/CellEditorListener -javax/swing/event/RowSorterListener -javax/swing/BufferStrategyPaintManager$BufferInfo -java/awt/Component$BltSubRegionBufferStrategy -sun/awt/SubRegionShowable -java/awt/Component$BltBufferStrategy -sun/awt/image/SunVolatileImage -sun/awt/image/BufferedImageGraphicsConfig -sun/print/PrinterGraphicsConfig -sun/java2d/x11/X11VolatileSurfaceManager -sun/awt/image/VolatileSurfaceManager -java/awt/print/PrinterGraphics -java/awt/PrintGraphics -java/awt/GraphicsCallback$PaintCallback -java/awt/GraphicsCallback -sun/awt/SunGraphicsCallback -javax/swing/JRadioButton -java/lang/ClassFormatError -javax/swing/JTabbedPane -javax/swing/JTabbedPane$ModelListener -javax/swing/plaf/metal/MetalTabbedPaneUI -javax/swing/plaf/basic/BasicTabbedPaneUI -javax/swing/plaf/TabbedPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout -javax/swing/plaf/basic/BasicTabbedPaneUI$Handler -sun/swing/ImageIconUIResource -javax/swing/GrayFilter -java/awt/image/RGBImageFilter -java/awt/image/ImageFilter -java/awt/image/FilteredImageSource -org/w3c/dom/Node -org/xml/sax/SAXException -javax/xml/parsers/ParserConfigurationException -org/xml/sax/EntityResolver -java/security/NoSuchAlgorithmException -java/security/GeneralSecurityException -java/util/zip/GZIPInputStream -java/util/zip/DeflaterOutputStream -org/xml/sax/InputSource -javax/xml/parsers/DocumentBuilderFactory -javax/xml/parsers/FactoryFinder -javax/xml/parsers/SecuritySupport -javax/xml/parsers/SecuritySupport$2 -javax/xml/parsers/SecuritySupport$5 -javax/xml/parsers/SecuritySupport$1 -javax/xml/parsers/SecuritySupport$4 -javax/xml/parsers/DocumentBuilder -org/w3c/dom/Document -org/xml/sax/helpers/DefaultHandler -org/xml/sax/DTDHandler -org/xml/sax/ContentHandler -org/xml/sax/ErrorHandler -org/xml/sax/SAXNotSupportedException -org/xml/sax/Locator -org/xml/sax/SAXNotRecognizedException -org/xml/sax/SAXParseException -org/w3c/dom/NodeList -org/w3c/dom/events/EventTarget -org/w3c/dom/traversal/DocumentTraversal -org/w3c/dom/events/DocumentEvent -org/w3c/dom/ranges/DocumentRange -org/w3c/dom/Entity -org/w3c/dom/Element -org/w3c/dom/CharacterData -org/w3c/dom/CDATASection -org/w3c/dom/Text -org/xml/sax/AttributeList -org/w3c/dom/DOMException -org/w3c/dom/Notation -org/w3c/dom/DocumentType -org/w3c/dom/Attr -org/w3c/dom/EntityReference -org/w3c/dom/ProcessingInstruction -org/w3c/dom/Comment -org/w3c/dom/DocumentFragment -org/w3c/dom/events/Event -org/w3c/dom/events/MutationEvent -org/w3c/dom/traversal/TreeWalker -org/w3c/dom/ranges/Range -org/w3c/dom/traversal/NodeIterator -org/w3c/dom/events/EventException -org/w3c/dom/NamedNodeMap -java/lang/StringIndexOutOfBoundsException -java/awt/GridLayout -javax/swing/plaf/metal/MetalRadioButtonUI -javax/swing/plaf/basic/BasicRadioButtonUI -javax/swing/plaf/basic/BasicBorders -javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon -java/awt/event/ItemEvent -java/awt/CardLayout$Card -javax/swing/JCheckBox -javax/swing/event/ListSelectionEvent -javax/swing/plaf/metal/MetalCheckBoxUI -javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon -java/lang/ExceptionInInitializerError -com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI -javax/swing/JProgressBar -javax/swing/JProgressBar$ModelListener -javax/swing/plaf/metal/MetalProgressBarUI -javax/swing/plaf/basic/BasicProgressBarUI -javax/swing/plaf/ProgressBarUI -javax/swing/plaf/BorderUIResource$LineBorderUIResource -javax/swing/plaf/basic/BasicProgressBarUI$Handler -javax/swing/tree/TreeModel -javax/swing/table/TableCellRenderer -javax/swing/table/JTableHeader -javax/swing/event/TreeExpansionListener -javax/swing/table/AbstractTableModel -javax/swing/table/TableModel -javax/swing/table/DefaultTableCellRenderer -javax/swing/JTree -javax/swing/tree/TreeSelectionModel -javax/swing/tree/DefaultTreeCellRenderer -javax/swing/tree/TreeCellRenderer -javax/swing/table/TableCellEditor -javax/swing/CellEditor -javax/swing/JToolTip -javax/swing/table/TableColumn -javax/swing/table/DefaultTableColumnModel -javax/swing/table/TableColumnModel -javax/swing/table/DefaultTableModel -javax/swing/event/TableModelEvent -sun/swing/table/DefaultTableCellHeaderRenderer -javax/swing/plaf/basic/BasicTableHeaderUI -javax/swing/plaf/TableHeaderUI -javax/swing/plaf/basic/BasicTableHeaderUI$1 -javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler -javax/swing/DefaultCellEditor -javax/swing/tree/TreeCellEditor -javax/swing/AbstractCellEditor -javax/swing/plaf/basic/BasicTableUI -javax/swing/plaf/TableUI -javax/swing/plaf/basic/BasicTableUI$TableTransferHandler -javax/swing/plaf/basic/BasicTableUI$Handler -javax/swing/tree/DefaultTreeSelectionModel -javax/swing/tree/TreePath -javax/swing/plaf/metal/MetalTreeUI -javax/swing/plaf/basic/BasicTreeUI -javax/swing/plaf/TreeUI -javax/swing/plaf/basic/BasicTreeUI$Actions -javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler -javax/swing/plaf/metal/MetalTreeUI$LineListener -javax/swing/plaf/basic/BasicTreeUI$Handler -javax/swing/event/TreeModelListener -javax/swing/event/TreeSelectionListener -javax/swing/event/SwingPropertyChangeSupport -javax/swing/tree/VariableHeightLayoutCache -javax/swing/tree/AbstractLayoutCache -javax/swing/tree/RowMapper -javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler -javax/swing/tree/AbstractLayoutCache$NodeDimensions -javax/swing/JTree$TreeModelHandler -javax/swing/tree/VariableHeightLayoutCache$TreeStateNode -javax/swing/tree/DefaultMutableTreeNode -javax/swing/tree/MutableTreeNode -javax/swing/tree/DefaultMutableTreeNode$1 -javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration -javax/swing/event/TableColumnModelEvent -java/text/ParseException -java/text/NumberFormat$Field -javax/swing/event/UndoableEditListener -javax/swing/filechooser/FileFilter -javax/swing/tree/DefaultTreeModel -javax/swing/tree/DefaultTreeCellEditor -javax/swing/tree/DefaultTreeCellEditor$1 -javax/swing/tree/DefaultTreeCellEditor$DefaultTextField -javax/swing/DefaultCellEditor$1 -javax/swing/DefaultCellEditor$EditorDelegate -javax/swing/tree/DefaultTreeCellEditor$EditorContainer -javax/swing/JTree$TreeSelectionRedirector -javax/swing/event/TreeModelEvent -javax/swing/plaf/metal/MetalSplitPaneUI -javax/swing/plaf/basic/BasicSplitPaneUI -javax/swing/plaf/SplitPaneUI -javax/swing/plaf/basic/BasicSplitPaneDivider -javax/swing/plaf/basic/BasicBorders$SplitPaneBorder -javax/swing/plaf/metal/MetalSplitPaneDivider -javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout -javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler -javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder -javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager -javax/swing/plaf/basic/BasicSplitPaneUI$1 -javax/swing/plaf/basic/BasicSplitPaneUI$Handler -javax/swing/plaf/metal/MetalSplitPaneDivider$1 -javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler -javax/swing/plaf/metal/MetalSplitPaneDivider$2 -javax/swing/border/TitledBorder -javax/swing/plaf/basic/BasicTextAreaUI -java/util/Collections$UnmodifiableCollection$1 -java/io/InterruptedIOException -java/net/NoRouteToHostException -java/net/BindException -javax/swing/tree/PathPlaceHolder -javax/swing/event/TreeSelectionEvent -javax/swing/JList$3 -javax/swing/JList$ListSelectionHandler -javax/swing/JSlider -javax/swing/JSlider$ModelListener -javax/swing/plaf/metal/MetalSliderUI -javax/swing/plaf/basic/BasicSliderUI -javax/swing/plaf/SliderUI -javax/swing/plaf/basic/BasicSliderUI$Actions -javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon -javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon -javax/swing/plaf/basic/BasicSliderUI$TrackListener -javax/swing/plaf/basic/BasicSliderUI$Handler -javax/swing/plaf/basic/BasicSliderUI$ScrollListener -javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener -javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler -sun/java2d/HeadlessGraphicsEnvironment -java/util/Hashtable$KeySet -java/awt/FontFormatException -sun/java2d/SunGraphicsEnvironment$2 -sun/font/Type1Font$1 -java/nio/channels/FileChannel$MapMode -sun/nio/ch/FileChannelImpl$Unmapper -sun/nio/ch/Util$3 -java/nio/DirectByteBufferR -java/nio/charset/Charset$3 -sun/nio/cs/ext/ExtendedCharsets -sun/nio/cs/AbstractCharsetProvider -sun/nio/cs/ext/SJIS -sun/nio/cs/ext/SJIS$Decoder -sun/nio/cs/ext/DelegatableDecoder -sun/nio/cs/ext/JIS_X_0208_Decoder -sun/nio/cs/ext/DoubleByteDecoder -sun/nio/cs/ext/JIS_X_0201$Decoder -sun/nio/cs/SingleByteDecoder -java/lang/CharacterData00 -javax/swing/DefaultListModel -javax/swing/event/ListDataEvent -javax/sound/sampled/DataLine -javax/sound/sampled/Line -javax/sound/sampled/Line$Info -javax/sound/sampled/DataLine$Info -javax/sound/sampled/Control$Type -javax/sound/sampled/FloatControl$Type -javax/sound/sampled/LineUnavailableException -javax/sound/sampled/UnsupportedAudioFileException -javax/swing/JRadioButtonMenuItem -javax/swing/JMenuItem$AccessibleJMenuItem -javax/swing/AbstractButton$AccessibleAbstractButton -javax/accessibility/AccessibleAction -javax/accessibility/AccessibleValue -javax/accessibility/AccessibleText -javax/accessibility/AccessibleExtendedComponent -javax/accessibility/AccessibleComponent -javax/swing/JComponent$AccessibleJComponent -java/awt/Container$AccessibleAWTContainer -java/awt/Component$AccessibleAWTComponent -javax/accessibility/AccessibleRelationSet -javax/accessibility/AccessibleState -javax/accessibility/AccessibleBundle -javax/swing/plaf/basic/BasicCheckBoxMenuItemUI -javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon -javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem -javax/swing/plaf/basic/BasicRadioButtonMenuItemUI -javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon -sun/awt/image/ImageDecoder$1 -javax/swing/JTabbedPane$Page -java/net/DatagramSocket -java/net/MulticastSocket -java/net/DatagramPacket -sun/net/InetAddressCachePolicy -sun/net/InetAddressCachePolicy$1 -sun/net/InetAddressCachePolicy$2 -java/net/InetAddress$CacheEntry -java/net/PlainDatagramSocketImpl -java/net/DatagramSocketImpl -java/net/NetworkInterface -java/net/InterfaceAddress -java/text/Collator -java/text/spi/CollatorProvider -sun/text/resources/CollationData -sun/text/resources/CollationData_en -sun/util/EmptyListResourceBundle -java/text/RuleBasedCollator -java/text/CollationRules -java/text/RBCollationTables -java/text/RBTableBuilder -java/text/RBCollationTables$BuildAPI -sun/text/IntHashtable -sun/text/UCompactIntArray -sun/text/normalizer/NormalizerImpl -sun/text/normalizer/ICUData -sun/text/normalizer/NormalizerDataReader -sun/text/normalizer/ICUBinary$Authenticate -sun/text/normalizer/ICUBinary -sun/text/normalizer/NormalizerImpl$FCDTrieImpl -sun/text/normalizer/Trie$DataManipulate -sun/text/normalizer/NormalizerImpl$NormTrieImpl -sun/text/normalizer/NormalizerImpl$AuxTrieImpl -sun/text/normalizer/IntTrie -sun/text/normalizer/Trie -sun/text/normalizer/CharTrie -sun/text/normalizer/CharTrie$FriendAgent -sun/text/normalizer/UnicodeSet -sun/text/normalizer/UnicodeMatcher -sun/text/normalizer/NormalizerImpl$DecomposeArgs -java/text/MergeCollation -java/text/PatternEntry$Parser -java/text/PatternEntry -java/text/EntryPair -sun/text/ComposedCharIter -sun/text/normalizer/UTF16 -sun/net/www/protocol/http/Handler -java/io/ObjectInputStream$BlockDataInputStream -java/io/ObjectInputStream$PeekInputStream -java/io/ObjectInputStream$HandleTable -java/io/ObjectInputStream$ValidationList -java/io/Bits -java/io/ObjectStreamClass$Caches -java/io/ObjectStreamClass$WeakClassKey -java/io/ObjectStreamClass$EntryFuture -java/io/ObjectStreamClass$2 -sun/reflect/SerializationConstructorAccessorImpl -java/io/ObjectStreamClass$FieldReflectorKey -java/io/ObjectStreamClass$FieldReflector -java/io/ObjectStreamClass$1 -java/io/DataOutputStream -java/io/ObjectStreamClass$MemberSignature -java/io/ObjectStreamClass$3 -java/io/ObjectStreamClass$4 -java/io/ObjectStreamClass$5 -java/security/MessageDigest -java/security/MessageDigestSpi -sun/security/jca/GetInstance -sun/security/jca/Providers -sun/security/jca/ProviderList -sun/security/jca/ProviderConfig -sun/security/jca/ProviderList$3 -sun/security/jca/ProviderList$1 -sun/security/jca/ProviderList$2 -sun/security/jca/ProviderConfig$1 -sun/security/jca/ProviderConfig$3 -java/security/Provider$Service -java/security/Provider$UString -sun/security/provider/SHA -sun/security/provider/DigestBase -sun/security/jca/GetInstance$Instance -java/security/MessageDigest$Delegate -sun/security/provider/ByteArrayAccess -java/io/ObjectStreamClass$ClassDataSlot -java/io/ObjectInputStream$CallbackContext -sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl -java/security/SignatureException -java/security/InvalidKeyException -java/security/KeyException -java/security/Signature -java/security/SignatureSpi -java/io/ObjectOutputStream$BlockDataOutputStream -sun/security/provider/DSAPublicKey -java/security/interfaces/DSAPublicKey -java/security/interfaces/DSAKey -java/security/PublicKey -java/security/Key -sun/security/x509/X509Key -java/io/ObjectOutputStream$HandleTable -java/io/ObjectOutputStream$ReplaceTable -sun/security/x509/AlgorithmId -sun/security/util/DerEncoder -sun/security/util/BitArray -sun/security/util/DerOutputStream -sun/security/util/DerValue -java/math/BigInteger -java/security/interfaces/DSAParams -sun/security/util/DerInputStream -sun/security/util/DerInputBuffer -sun/security/util/ObjectIdentifier -java/security/AlgorithmParameters -java/security/AlgorithmParametersSpi -sun/security/provider/DSAParameters -sun/security/util/ByteArrayLexOrder -sun/security/util/ByteArrayTagOrder -sun/security/util/DerIndefLenConverter -java/io/InvalidClassException -java/io/ObjectStreamException -java/io/ObjectInputStream$GetFieldImpl -java/io/ObjectInputStream$GetField -sun/security/jca/ServiceId -sun/security/jca/ProviderList$ServiceList -sun/security/jca/ProviderList$ServiceList$1 -java/security/Signature$Delegate -java/security/interfaces/DSAPrivateKey -java/security/PrivateKey -sun/security/provider/DSA$SHA1withDSA -sun/security/provider/DSA -java/security/spec/DSAParameterSpec -java/security/spec/AlgorithmParameterSpec -java/math/MutableBigInteger -java/math/SignedMutableBigInteger -java/awt/EventQueue$1AWTInvocationLock -javax/swing/SystemEventQueueUtilities$RunnableCanvas -javax/swing/SystemEventQueueUtilities$RunnableCanvasGraphics -java/awt/Component$FlipBufferStrategy -java/awt/SentEvent -sun/awt/X11/XDestroyWindowEvent -sun/awt/X11/XDropTargetRegistry -sun/awt/X11/XEmbeddedFramePeer -sun/awt/X11/XDragAndDropProtocols -sun/awt/X11/XDropTargetContextPeer -sun/awt/dnd/SunDropTargetContextPeer -java/awt/dnd/peer/DropTargetContextPeer -sun/awt/X11/XDropTargetContextPeer$XDropTargetProtocolListenerImpl -sun/awt/X11/XDropTargetProtocolListener -sun/awt/X11/XDnDDragSourceProtocol -sun/awt/X11/XDragSourceProtocol -sun/awt/X11/MotifDnDDragSourceProtocol -sun/awt/X11/XDnDDropTargetProtocol -sun/awt/X11/XDropTargetProtocol -sun/awt/X11/MotifDnDDropTargetProtocol -sun/awt/X11/XDnDConstants -sun/awt/X11/MotifDnDConstants -javax/swing/JTable$2 -javax/swing/JTable$Resizable3 -javax/swing/JTable$Resizable2 -javax/swing/JTable$5 -javax/swing/event/AncestorEvent -sun/font/FontDesignMetrics$MetricsKey -java/awt/geom/Line2D$Float -java/awt/geom/Line2D -com/sun/java/swing/plaf/gtk/GTKLookAndFeel -javax/swing/plaf/synth/SynthLookAndFeel -javax/swing/plaf/synth/DefaultSynthStyleFactory -javax/swing/plaf/synth/SynthStyleFactory -sun/swing/BakedArrayList -javax/swing/plaf/synth/SynthLookAndFeel$Handler -javax/swing/plaf/synth/SynthDefaultLookup -com/sun/java/swing/plaf/gtk/GTKEngine -com/sun/java/swing/plaf/gtk/GTKDefaultEngine -com/sun/java/swing/plaf/gtk/GTKEngine$Settings -com/sun/java/swing/plaf/gtk/GTKStyleFactory -com/sun/java/swing/plaf/gtk/PangoFonts -sun/font/FontManager$FontConfigInfo -com/sun/java/swing/plaf/gtk/GTKLookAndFeel$WeakPCL -javax/swing/plaf/synth/Region -javax/swing/plaf/synth/SynthLookAndFeel$AATextListener -com/sun/java/swing/plaf/gtk/GTKNativeEngine -com/sun/java/swing/plaf/gtk/GTKNativeEngine$WidgetType -com/sun/java/swing/plaf/gtk/GTKRegion -com/sun/java/swing/plaf/gtk/GTKDefaultStyle -com/sun/java/swing/plaf/gtk/GTKStyle -com/sun/java/swing/plaf/gtk/GTKConstants -javax/swing/plaf/synth/SynthStyle -javax/swing/plaf/synth/SynthGraphicsUtils -com/sun/java/swing/plaf/gtk/GTKGraphicsUtils -com/sun/java/swing/plaf/gtk/GTKStyle$GTKStockIcon -sun/swing/plaf/synth/SynthIcon -com/sun/java/swing/plaf/gtk/GTKColorType -javax/swing/plaf/synth/ColorType -com/sun/java/swing/plaf/gtk/resources/gtk -com/sun/swing/internal/plaf/synth/resources/synth -com/sun/java/swing/plaf/gtk/GTKStyle$GTKLazyValue -com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue -com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2 -com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3 -javax/swing/plaf/synth/SynthPanelUI -javax/swing/plaf/synth/SynthConstants -javax/swing/plaf/synth/SynthContext -javax/swing/plaf/synth/SynthBorder -javax/swing/plaf/synth/SynthRootPaneUI -javax/swing/plaf/synth/SynthLabelUI -javax/swing/plaf/synth/SynthButtonUI -javax/swing/plaf/synth/SynthToggleButtonUI -javax/swing/plaf/basic/BasicBorders$FieldBorder -javax/swing/plaf/synth/SynthMenuBarUI -javax/swing/plaf/synth/DefaultMenuLayout -javax/swing/plaf/synth/SynthMenuUI -javax/swing/plaf/synth/SynthUI -com/sun/java/swing/plaf/gtk/GTKIconFactory -com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon -com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon -com/sun/java/swing/plaf/gtk/GTKConstants$ArrowType -javax/swing/plaf/basic/BasicIconFactory -javax/swing/plaf/basic/BasicIconFactory$MenuItemCheckIcon -javax/swing/plaf/synth/SynthMenuItemUI -javax/swing/plaf/synth/SynthPopupMenuUI -javax/swing/plaf/synth/SynthSeparatorUI -javax/swing/plaf/synth/SynthScrollBarUI -javax/swing/plaf/synth/SynthArrowButton -javax/swing/plaf/synth/SynthArrowButton$SynthArrowButtonUI -javax/swing/plaf/synth/SynthComboBoxUI -javax/swing/plaf/synth/SynthComboPopup -javax/swing/plaf/synth/SynthListUI -javax/swing/plaf/synth/SynthListUI$SynthListCellRenderer -javax/swing/plaf/synth/SynthViewportUI -javax/swing/plaf/synth/SynthScrollPaneUI -javax/swing/plaf/synth/SynthScrollPaneUI$ViewportBorder -javax/swing/plaf/synth/SynthComboBoxUI$SynthComboBoxRenderer -javax/swing/plaf/synth/SynthComboBoxUI$SynthComboBoxEditor -javax/swing/plaf/synth/SynthTextFieldUI -javax/swing/plaf/synth/SynthToolBarUI -javax/swing/plaf/synth/SynthToolBarUI$SynthToolBarLayoutManager -com/sun/java/swing/plaf/gtk/GTKIconFactory$ToolBarHandleIcon -com/sun/java/swing/plaf/gtk/GTKConstants$Orientation -sun/awt/X11/XTranslateCoordinates -com/sun/java/swing/plaf/gtk/GTKPainter -javax/swing/plaf/synth/SynthPainter -javax/swing/plaf/synth/SynthPainter$1 -com/sun/java/swing/plaf/gtk/GTKConstants$PositionType -com/sun/java/swing/plaf/gtk/GTKConstants$ShadowType -java/io/ObjectInputStream$HandleTable$HandleList -sun/java2d/pipe/ShapeSpanIterator -sun/java2d/pipe/SpanIterator -sun/dc/path/PathConsumer -sun/dc/pr/PathStroker -sun/dc/pr/PathDasher -java/awt/geom/LineIterator -java/awt/geom/PathIterator -sun/applet/Main -sun/applet/AppletMessageHandler -sun/applet/resources/MsgAppletViewer -sun/applet/AppletSecurity -sun/awt/AWTSecurityManager -java/lang/SecurityManager -java/security/DomainCombiner -sun/applet/AppletSecurity$1 -java/lang/SecurityManager$1 -java/security/SecurityPermission -java/util/PropertyPermission -sun/applet/AppletViewer -java/applet/AppletContext -java/awt/print/Printable -sun/security/util/SecurityConstants -java/awt/AWTPermission -java/net/NetPermission -java/net/SocketPermission -javax/security/auth/AuthPermission -java/lang/Thread$1 -java/util/logging/LogManager$5 -java/util/logging/LogManager$6 -sun/applet/StdAppletViewerFactory -sun/applet/AppletViewerFactory -sun/applet/AppletViewer$UserActionListener -sun/applet/AppletViewerPanel -sun/applet/AppletPanel -java/applet/AppletStub -sun/misc/MessageUtils -sun/applet/AppletPanel$10 -java/security/Policy$1 -sun/security/provider/PolicyFile$1 -sun/security/provider/PolicyInfo -sun/security/provider/PolicyFile$3 -sun/security/util/PropertyExpander -sun/security/provider/PolicyParser -sun/security/util/PolicyUtil -sun/security/provider/PolicyParser$GrantEntry -sun/security/provider/PolicyParser$PermissionEntry -sun/security/provider/PolicyFile$PolicyEntry -sun/security/provider/PolicyFile$6 -sun/security/provider/PolicyFile$7 -sun/security/provider/SelfPermission -java/net/SocketPermissionCollection -java/util/PropertyPermissionCollection -sun/applet/AppletPanel$9 -sun/applet/AppletClassLoader -sun/applet/AppletClassLoader$4 -sun/applet/AppletThreadGroup -sun/applet/AppContextCreator -sun/applet/AppletPanel$1 -sun/awt/X11/XMenuBarPeer -java/awt/peer/MenuBarPeer -java/awt/peer/MenuComponentPeer -sun/awt/X11/XBaseMenuWindow -sun/awt/X11/XMenuPeer -java/awt/peer/MenuPeer -java/awt/peer/MenuItemPeer -sun/awt/X11/XMenuItemPeer -java/awt/MenuShortcut -sun/awt/X11/XMenuWindow -sun/awt/X11/XMenuBarPeer$1 -sun/awt/X11/XMenuItemPeer$TextMetrics -sun/awt/AppContext$3 -sun/awt/MostRecentThreadAppContext -sun/awt/X11/XMenuBarPeer$MappingData -sun/awt/X11/XBaseMenuWindow$MappingData -sun/applet/AppletViewer$1 -sun/applet/AppletViewer$1AppletEventListener -sun/applet/AppletListener -sun/applet/AppletEventMulticaster -sun/misc/Queue -sun/misc/QueueElement -sun/applet/AppletEvent -sun/applet/AppletClassLoader$1 -sun/awt/X11/XBaseMenuWindow$3 -java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent -sun/awt/CausedFocusEvent -sun/awt/X11/XWindow$1 -java/net/URLClassLoader$4 -sun/applet/AppletClassLoader$2 -javax/swing/JApplet -java/lang/ClassLoader$1 -sun/security/provider/PolicyFile$5 -java/security/PermissionsEnumerator -java/util/Collections$1 -sun/applet/AppletPanel$11 -sun/applet/AppletPanel$8 -sun/applet/AppletPanel$2 -sun/applet/AppletPanel$3 -sun/applet/AppletPanel$6 -javax/swing/BufferStrategyPaintManager$1 -# f3ac8b467e7f8c49 diff --git a/jdk/make/data/classlist/classlist.linux b/jdk/make/data/classlist/classlist.linux deleted file mode 100644 index fe642b27eca..00000000000 --- a/jdk/make/data/classlist/classlist.linux +++ /dev/null @@ -1,2454 +0,0 @@ -com/sun/java/swing/SwingUtilities3 -com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI -com/sun/swing/internal/plaf/basic/resources/basic -com/sun/swing/internal/plaf/metal/resources/metal -java/applet/Applet -java/awt/AWTEvent -java/awt/AWTEvent$1 -java/awt/AWTEventMulticaster -java/awt/AWTKeyStroke -java/awt/AWTKeyStroke$1 -java/awt/ActiveEvent -java/awt/Adjustable -java/awt/AlphaComposite -java/awt/BasicStroke -java/awt/BorderLayout -java/awt/BufferCapabilities -java/awt/Canvas -java/awt/CardLayout -java/awt/CardLayout$Card -java/awt/Color -java/awt/Component -java/awt/Component$1 -java/awt/Component$3 -java/awt/Component$AWTTreeLock -java/awt/Component$AccessibleAWTComponent -java/awt/Component$BaselineResizeBehavior -java/awt/Component$BltBufferStrategy -java/awt/Component$BltSubRegionBufferStrategy -java/awt/Component$DummyRequestFocusController -java/awt/Component$FlipBufferStrategy -java/awt/ComponentOrientation -java/awt/Composite -java/awt/Conditional -java/awt/Container -java/awt/Container$1 -java/awt/Container$AccessibleAWTContainer -java/awt/ContainerOrderFocusTraversalPolicy -java/awt/Cursor -java/awt/Cursor$1 -java/awt/DefaultFocusTraversalPolicy -java/awt/DefaultKeyboardFocusManager -java/awt/DefaultKeyboardFocusManager$1 -java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent -java/awt/DefaultKeyboardFocusManager$TypeAheadMarker -java/awt/Dialog -java/awt/Dialog$ModalExclusionType -java/awt/Dialog$ModalityType -java/awt/Dimension -java/awt/Event -java/awt/EventDispatchThread -java/awt/EventDispatchThread$1 -java/awt/EventDispatchThread$HierarchyEventFilter -java/awt/EventFilter -java/awt/EventFilter$FilterAction -java/awt/EventQueue -java/awt/EventQueue$1 -java/awt/EventQueue$1AWTInvocationLock -java/awt/EventQueue$2 -java/awt/EventQueue$3 -java/awt/EventQueue$4 -java/awt/EventQueue$5 -java/awt/FlowLayout -java/awt/FocusTraversalPolicy -java/awt/Font -java/awt/Font$FontAccessImpl -java/awt/FontFormatException -java/awt/FontMetrics -java/awt/Frame -java/awt/Frame$1 -java/awt/Graphics -java/awt/Graphics2D -java/awt/GraphicsCallback -java/awt/GraphicsCallback$PaintCallback -java/awt/GraphicsConfiguration -java/awt/GraphicsDevice -java/awt/GraphicsEnvironment -java/awt/GraphicsEnvironment$1 -java/awt/GridLayout -java/awt/Image -java/awt/Image$1 -java/awt/ImageCapabilities -java/awt/ImageMediaEntry -java/awt/Insets -java/awt/ItemSelectable -java/awt/KeyEventDispatcher -java/awt/KeyEventPostProcessor -java/awt/KeyboardFocusManager -java/awt/KeyboardFocusManager$1 -java/awt/KeyboardFocusManager$3 -java/awt/KeyboardFocusManager$HeavyweightFocusRequest -java/awt/KeyboardFocusManager$LightweightFocusRequest -java/awt/Label -java/awt/LayoutManager -java/awt/LayoutManager2 -java/awt/LightweightDispatcher -java/awt/LightweightDispatcher$2 -java/awt/MediaEntry -java/awt/MediaTracker -java/awt/MenuBar -java/awt/MenuComponent -java/awt/MenuContainer -java/awt/ModalEventFilter -java/awt/Paint -java/awt/Panel -java/awt/Point -java/awt/PrintGraphics -java/awt/Queue -java/awt/Rectangle -java/awt/RenderingHints -java/awt/RenderingHints$Key -java/awt/SentEvent -java/awt/SequencedEvent -java/awt/SequencedEvent$1 -java/awt/Shape -java/awt/SplashScreen -java/awt/Stroke -java/awt/SystemColor -java/awt/Toolkit -java/awt/Toolkit$1 -java/awt/Toolkit$2 -java/awt/Toolkit$3 -java/awt/Toolkit$4 -java/awt/Toolkit$5 -java/awt/Toolkit$DesktopPropertyChangeSupport -java/awt/Toolkit$DesktopPropertyChangeSupport$1 -java/awt/Toolkit$SelectiveAWTEventListener -java/awt/Toolkit$ToolkitEventMulticaster -java/awt/Transparency -java/awt/TrayIcon -java/awt/VKCollection -java/awt/Window -java/awt/Window$1 -java/awt/Window$1DisposeAction -java/awt/Window$Type -java/awt/Window$WindowDisposerRecord -java/awt/color/ColorSpace -java/awt/color/ICC_ColorSpace -java/awt/color/ICC_Profile -java/awt/color/ICC_Profile$1 -java/awt/color/ICC_ProfileRGB -java/awt/datatransfer/Clipboard -java/awt/datatransfer/ClipboardOwner -java/awt/datatransfer/FlavorMap -java/awt/datatransfer/FlavorTable -java/awt/datatransfer/SystemFlavorMap -java/awt/datatransfer/Transferable -java/awt/dnd/DropTarget -java/awt/dnd/DropTargetContext -java/awt/dnd/DropTargetListener -java/awt/dnd/peer/DragSourceContextPeer -java/awt/dnd/peer/DropTargetContextPeer -java/awt/dnd/peer/DropTargetPeer -java/awt/event/AWTEventListener -java/awt/event/AWTEventListenerProxy -java/awt/event/ActionEvent -java/awt/event/ActionListener -java/awt/event/AdjustmentEvent -java/awt/event/AdjustmentListener -java/awt/event/ComponentAdapter -java/awt/event/ComponentEvent -java/awt/event/ComponentListener -java/awt/event/ContainerEvent -java/awt/event/ContainerListener -java/awt/event/FocusAdapter -java/awt/event/FocusEvent -java/awt/event/FocusListener -java/awt/event/HierarchyBoundsListener -java/awt/event/HierarchyListener -java/awt/event/InputEvent -java/awt/event/InputEvent$1 -java/awt/event/InputMethodEvent -java/awt/event/InputMethodListener -java/awt/event/InvocationEvent -java/awt/event/InvocationEvent$1 -java/awt/event/ItemEvent -java/awt/event/ItemListener -java/awt/event/KeyAdapter -java/awt/event/KeyEvent -java/awt/event/KeyEvent$1 -java/awt/event/KeyListener -java/awt/event/MouseAdapter -java/awt/event/MouseEvent -java/awt/event/MouseListener -java/awt/event/MouseMotionAdapter -java/awt/event/MouseMotionListener -java/awt/event/MouseWheelListener -java/awt/event/NativeLibLoader -java/awt/event/NativeLibLoader$1 -java/awt/event/PaintEvent -java/awt/event/TextListener -java/awt/event/WindowAdapter -java/awt/event/WindowEvent -java/awt/event/WindowFocusListener -java/awt/event/WindowListener -java/awt/event/WindowStateListener -java/awt/font/FontRenderContext -java/awt/font/GlyphVector -java/awt/font/LineMetrics -java/awt/font/TextAttribute -java/awt/geom/AffineTransform -java/awt/geom/Dimension2D -java/awt/geom/GeneralPath -java/awt/geom/Line2D -java/awt/geom/Line2D$Float -java/awt/geom/Path2D -java/awt/geom/Path2D$Float -java/awt/geom/PathIterator -java/awt/geom/Point2D -java/awt/geom/Point2D$Float -java/awt/geom/RectIterator -java/awt/geom/Rectangle2D -java/awt/geom/Rectangle2D$Float -java/awt/geom/RectangularShape -java/awt/im/InputContext -java/awt/im/InputMethodRequests -java/awt/im/spi/InputMethod -java/awt/im/spi/InputMethodContext -java/awt/im/spi/InputMethodDescriptor -java/awt/image/BufferStrategy -java/awt/image/BufferedImage -java/awt/image/BufferedImage$1 -java/awt/image/ColorModel -java/awt/image/ColorModel$1 -java/awt/image/ComponentSampleModel -java/awt/image/DataBuffer -java/awt/image/DataBuffer$1 -java/awt/image/DataBufferByte -java/awt/image/DataBufferInt -java/awt/image/DirectColorModel -java/awt/image/FilteredImageSource -java/awt/image/ImageConsumer -java/awt/image/ImageFilter -java/awt/image/ImageObserver -java/awt/image/ImageProducer -java/awt/image/IndexColorModel -java/awt/image/PackedColorModel -java/awt/image/PixelInterleavedSampleModel -java/awt/image/RGBImageFilter -java/awt/image/Raster -java/awt/image/RenderedImage -java/awt/image/SampleModel -java/awt/image/SinglePixelPackedSampleModel -java/awt/image/VolatileImage -java/awt/image/WritableRaster -java/awt/image/WritableRenderedImage -java/awt/peer/CanvasPeer -java/awt/peer/ComponentPeer -java/awt/peer/ContainerPeer -java/awt/peer/FramePeer -java/awt/peer/KeyboardFocusManagerPeer -java/awt/peer/LabelPeer -java/awt/peer/LightweightPeer -java/awt/peer/PanelPeer -java/awt/peer/SystemTrayPeer -java/awt/peer/WindowPeer -java/awt/print/PrinterGraphics -java/beans/ChangeListenerMap -java/beans/PropertyChangeEvent -java/beans/PropertyChangeListener -java/beans/PropertyChangeListenerProxy -java/beans/PropertyChangeSupport -java/beans/PropertyChangeSupport$PropertyChangeListenerMap -java/beans/VetoableChangeListener -java/io/Bits -java/io/BufferedInputStream -java/io/BufferedOutputStream -java/io/BufferedReader -java/io/BufferedWriter -java/io/ByteArrayInputStream -java/io/ByteArrayOutputStream -java/io/Closeable -java/io/DataInput -java/io/DataInputStream -java/io/DataOutput -java/io/DataOutputStream -java/io/DefaultFileSystem -java/io/EOFException -java/io/ExpiringCache -java/io/ExpiringCache$1 -java/io/ExpiringCache$Entry -java/io/Externalizable -java/io/File -java/io/File$PathStatus -java/io/FileDescriptor -java/io/FileDescriptor$1 -java/io/FileInputStream -java/io/FileInputStream$1 -java/io/FileNotFoundException -java/io/FileOutputStream -java/io/FileOutputStream$1 -java/io/FilePermission -java/io/FilePermission$1 -java/io/FilePermissionCollection -java/io/FileReader -java/io/FileSystem -java/io/FileWriter -java/io/FilenameFilter -java/io/FilterInputStream -java/io/FilterOutputStream -java/io/FilterReader -java/io/Flushable -java/io/IOException -java/io/InputStream -java/io/InputStreamReader -java/io/InterruptedIOException -java/io/ObjectInput -java/io/ObjectInputStream -java/io/ObjectInputStream$BlockDataInputStream -java/io/ObjectInputStream$GetField -java/io/ObjectInputStream$GetFieldImpl -java/io/ObjectInputStream$HandleTable -java/io/ObjectInputStream$HandleTable$HandleList -java/io/ObjectInputStream$PeekInputStream -java/io/ObjectInputStream$ValidationList -java/io/ObjectOutput -java/io/ObjectOutputStream -java/io/ObjectOutputStream$BlockDataOutputStream -java/io/ObjectOutputStream$HandleTable -java/io/ObjectOutputStream$ReplaceTable -java/io/ObjectStreamClass -java/io/ObjectStreamClass$1 -java/io/ObjectStreamClass$2 -java/io/ObjectStreamClass$3 -java/io/ObjectStreamClass$4 -java/io/ObjectStreamClass$5 -java/io/ObjectStreamClass$Caches -java/io/ObjectStreamClass$ClassDataSlot -java/io/ObjectStreamClass$EntryFuture -java/io/ObjectStreamClass$ExceptionInfo -java/io/ObjectStreamClass$FieldReflector -java/io/ObjectStreamClass$FieldReflectorKey -java/io/ObjectStreamClass$MemberSignature -java/io/ObjectStreamClass$WeakClassKey -java/io/ObjectStreamConstants -java/io/ObjectStreamField -java/io/OutputStream -java/io/OutputStreamWriter -java/io/PrintStream -java/io/PushbackInputStream -java/io/RandomAccessFile -java/io/RandomAccessFile$1 -java/io/Reader -java/io/SerialCallbackContext -java/io/Serializable -java/io/StreamTokenizer -java/io/StringReader -java/io/StringWriter -java/io/UnixFileSystem -java/io/UnsupportedEncodingException -java/io/Writer -java/lang/AbstractStringBuilder -java/lang/Appendable -java/lang/ApplicationShutdownHooks -java/lang/ApplicationShutdownHooks$1 -java/lang/ArithmeticException -java/lang/ArrayIndexOutOfBoundsException -java/lang/ArrayStoreException -java/lang/AutoCloseable -java/lang/Boolean -java/lang/BootstrapMethodError -java/lang/Byte -java/lang/CharSequence -java/lang/Character -java/lang/Character$CharacterCache -java/lang/CharacterData -java/lang/CharacterData00 -java/lang/CharacterDataLatin1 -java/lang/Class -java/lang/Class$1 -java/lang/Class$3 -java/lang/Class$4 -java/lang/Class$AnnotationData -java/lang/Class$Atomic -java/lang/Class$ReflectionData -java/lang/ClassCastException -java/lang/ClassFormatError -java/lang/ClassLoader -java/lang/ClassLoader$2 -java/lang/ClassLoader$3 -java/lang/ClassLoader$NativeLibrary -java/lang/ClassLoader$ParallelLoaders -java/lang/ClassNotFoundException -java/lang/ClassValue$ClassValueMap -java/lang/CloneNotSupportedException -java/lang/Cloneable -java/lang/Comparable -java/lang/Compiler -java/lang/Compiler$1 -java/lang/Double -java/lang/Enum -java/lang/Error -java/lang/Exception -java/lang/ExceptionInInitializerError -java/lang/Float -java/lang/IllegalAccessError -java/lang/IllegalAccessException -java/lang/IllegalArgumentException -java/lang/IllegalMonitorStateException -java/lang/IllegalStateException -java/lang/IncompatibleClassChangeError -java/lang/IndexOutOfBoundsException -java/lang/InheritableThreadLocal -java/lang/InstantiationException -java/lang/Integer -java/lang/Integer$IntegerCache -java/lang/InternalError -java/lang/InterruptedException -java/lang/Iterable -java/lang/LinkageError -java/lang/Long -java/lang/Long$LongCache -java/lang/Math -java/lang/NoClassDefFoundError -java/lang/NoSuchFieldException -java/lang/NoSuchMethodError -java/lang/NoSuchMethodException -java/lang/NullPointerException -java/lang/Number -java/lang/NumberFormatException -java/lang/Object -java/lang/OutOfMemoryError -java/lang/Package -java/lang/Process -java/lang/ProcessBuilder -java/lang/ProcessBuilder$NullOutputStream -java/lang/ProcessEnvironment -java/lang/ProcessEnvironment$ExternalData -java/lang/ProcessEnvironment$StringEnvironment -java/lang/ProcessEnvironment$Value -java/lang/ProcessEnvironment$Variable -java/lang/ProcessImpl -java/lang/Readable -java/lang/ReflectiveOperationException -java/lang/Runnable -java/lang/Runtime -java/lang/RuntimeException -java/lang/RuntimePermission -java/lang/SecurityException -java/lang/SecurityManager -java/lang/Short -java/lang/Shutdown -java/lang/Shutdown$Lock -java/lang/StackOverflowError -java/lang/StackTraceElement -java/lang/StrictMath -java/lang/String -java/lang/String$CaseInsensitiveComparator -java/lang/StringBuffer -java/lang/StringBuilder -java/lang/StringCoding -java/lang/StringCoding$StringDecoder -java/lang/StringCoding$StringEncoder -java/lang/StringIndexOutOfBoundsException -java/lang/System -java/lang/System$2 -java/lang/SystemClassLoaderAction -java/lang/Terminator -java/lang/Terminator$1 -java/lang/Thread -java/lang/Thread$State -java/lang/Thread$UncaughtExceptionHandler -java/lang/ThreadDeath -java/lang/ThreadGroup -java/lang/ThreadLocal -java/lang/ThreadLocal$ThreadLocalMap -java/lang/ThreadLocal$ThreadLocalMap$Entry -java/lang/Throwable -java/lang/Throwable$PrintStreamOrWriter -java/lang/Throwable$WrappedPrintStream -java/lang/UNIXProcess -java/lang/UNIXProcess$1 -java/lang/UNIXProcess$2 -java/lang/UNIXProcess$3 -java/lang/UNIXProcess$4 -java/lang/UNIXProcess$LaunchMechanism -java/lang/UNIXProcess$ProcessPipeInputStream -java/lang/UNIXProcess$ProcessPipeOutputStream -java/lang/UNIXProcess$ProcessReaperThreadFactory -java/lang/UNIXProcess$ProcessReaperThreadFactory$1 -java/lang/UnsatisfiedLinkError -java/lang/UnsupportedOperationException -java/lang/VirtualMachineError -java/lang/Void -java/lang/annotation/Annotation -java/lang/invoke/CallSite -java/lang/invoke/ConstantCallSite -java/lang/invoke/DirectMethodHandle -java/lang/invoke/Invokers -java/lang/invoke/LambdaForm -java/lang/invoke/LambdaForm$NamedFunction -java/lang/invoke/MemberName -java/lang/invoke/MemberName$Factory -java/lang/invoke/MethodHandle -java/lang/invoke/MethodHandleImpl -java/lang/invoke/MethodHandleNatives -java/lang/invoke/MethodHandleStatics -java/lang/invoke/MethodHandleStatics$1 -java/lang/invoke/MethodType -java/lang/invoke/MethodType$ConcurrentWeakInternSet -java/lang/invoke/MethodType$ConcurrentWeakInternSet$WeakEntry -java/lang/invoke/MethodTypeForm -java/lang/invoke/MutableCallSite -java/lang/invoke/VolatileCallSite -java/lang/ref/FinalReference -java/lang/ref/Finalizer -java/lang/ref/Finalizer$FinalizerThread -java/lang/ref/PhantomReference -java/lang/ref/Reference -java/lang/ref/Reference$Lock -java/lang/ref/Reference$ReferenceHandler -java/lang/ref/ReferenceQueue -java/lang/ref/ReferenceQueue$Lock -java/lang/ref/ReferenceQueue$Null -java/lang/ref/SoftReference -java/lang/ref/WeakReference -java/lang/reflect/AccessibleObject -java/lang/reflect/AnnotatedElement -java/lang/reflect/Array -java/lang/reflect/Constructor -java/lang/reflect/Executable -java/lang/reflect/Field -java/lang/reflect/GenericDeclaration -java/lang/reflect/InvocationHandler -java/lang/reflect/InvocationTargetException -java/lang/reflect/Member -java/lang/reflect/Method -java/lang/reflect/Modifier -java/lang/reflect/Parameter -java/lang/reflect/Proxy -java/lang/reflect/Proxy$KeyFactory -java/lang/reflect/Proxy$ProxyClassFactory -java/lang/reflect/ReflectAccess -java/lang/reflect/ReflectPermission -java/lang/reflect/Type -java/lang/reflect/WeakCache -java/math/BigInteger -java/math/BigInteger$UnsafeHolder -java/math/MutableBigInteger -java/math/RoundingMode -java/math/SignedMutableBigInteger -java/net/AbstractPlainDatagramSocketImpl -java/net/AbstractPlainDatagramSocketImpl$1 -java/net/AbstractPlainSocketImpl -java/net/AbstractPlainSocketImpl$1 -java/net/Authenticator -java/net/BindException -java/net/ConnectException -java/net/DatagramPacket -java/net/DatagramPacket$1 -java/net/DatagramSocket -java/net/DatagramSocket$1 -java/net/DatagramSocketImpl -java/net/DefaultDatagramSocketImplFactory -java/net/DefaultInterface -java/net/FileNameMap -java/net/HttpURLConnection -java/net/Inet4Address -java/net/Inet4AddressImpl -java/net/Inet6Address -java/net/Inet6Address$Inet6AddressHolder -java/net/Inet6AddressImpl -java/net/InetAddress -java/net/InetAddress$1 -java/net/InetAddress$2 -java/net/InetAddress$Cache -java/net/InetAddress$Cache$Type -java/net/InetAddress$CacheEntry -java/net/InetAddress$InetAddressHolder -java/net/InetAddressImpl -java/net/InetAddressImplFactory -java/net/InetSocketAddress -java/net/InetSocketAddress$InetSocketAddressHolder -java/net/InterfaceAddress -java/net/JarURLConnection -java/net/MalformedURLException -java/net/MulticastSocket -java/net/NetworkInterface -java/net/NetworkInterface$1 -java/net/NoRouteToHostException -java/net/Parts -java/net/PlainDatagramSocketImpl -java/net/PlainSocketImpl -java/net/Proxy -java/net/Proxy$Type -java/net/ProxySelector -java/net/ServerSocket -java/net/Socket -java/net/SocketAddress -java/net/SocketException -java/net/SocketImpl -java/net/SocketImplFactory -java/net/SocketOptions -java/net/SocksConsts -java/net/SocksSocketImpl -java/net/SocksSocketImpl$3 -java/net/URI -java/net/URI$Parser -java/net/URL -java/net/URLClassLoader -java/net/URLClassLoader$1 -java/net/URLClassLoader$2 -java/net/URLClassLoader$3 -java/net/URLClassLoader$3$1 -java/net/URLClassLoader$7 -java/net/URLConnection -java/net/URLConnection$1 -java/net/URLStreamHandler -java/net/URLStreamHandlerFactory -java/net/UnknownHostException -java/nio/Bits -java/nio/Bits$1 -java/nio/Buffer -java/nio/ByteBuffer -java/nio/ByteBufferAsIntBufferB -java/nio/ByteBufferAsShortBufferB -java/nio/ByteOrder -java/nio/CharBuffer -java/nio/DirectByteBuffer -java/nio/DirectByteBuffer$Deallocator -java/nio/DirectByteBufferR -java/nio/DirectLongBufferU -java/nio/HeapByteBuffer -java/nio/HeapCharBuffer -java/nio/IntBuffer -java/nio/LongBuffer -java/nio/MappedByteBuffer -java/nio/ShortBuffer -java/nio/channels/ByteChannel -java/nio/channels/Channel -java/nio/channels/FileChannel -java/nio/channels/FileChannel$MapMode -java/nio/channels/GatheringByteChannel -java/nio/channels/InterruptibleChannel -java/nio/channels/NetworkChannel -java/nio/channels/ReadableByteChannel -java/nio/channels/ScatteringByteChannel -java/nio/channels/SeekableByteChannel -java/nio/channels/SelectableChannel -java/nio/channels/SocketChannel -java/nio/channels/WritableByteChannel -java/nio/channels/spi/AbstractInterruptibleChannel -java/nio/channels/spi/AbstractInterruptibleChannel$1 -java/nio/channels/spi/AbstractSelectableChannel -java/nio/charset/Charset -java/nio/charset/CharsetDecoder -java/nio/charset/CharsetEncoder -java/nio/charset/CoderResult -java/nio/charset/CoderResult$1 -java/nio/charset/CoderResult$2 -java/nio/charset/CoderResult$Cache -java/nio/charset/CodingErrorAction -java/nio/charset/StandardCharsets -java/nio/charset/spi/CharsetProvider -java/nio/file/Path -java/nio/file/Watchable -java/nio/file/attribute/FileAttribute -java/security/AccessControlContext -java/security/AccessController -java/security/AlgorithmParameters -java/security/AlgorithmParametersSpi -java/security/AllPermission -java/security/AllPermissionCollection -java/security/BasicPermission -java/security/BasicPermissionCollection -java/security/CodeSigner -java/security/CodeSource -java/security/GeneralSecurityException -java/security/Guard -java/security/InvalidKeyException -java/security/Key -java/security/KeyException -java/security/MessageDigest -java/security/MessageDigest$Delegate -java/security/MessageDigestSpi -java/security/NoSuchAlgorithmException -java/security/Permission -java/security/PermissionCollection -java/security/Permissions -java/security/Principal -java/security/PrivateKey -java/security/PrivilegedAction -java/security/PrivilegedActionException -java/security/PrivilegedExceptionAction -java/security/ProtectionDomain -java/security/ProtectionDomain$1 -java/security/ProtectionDomain$3 -java/security/ProtectionDomain$Key -java/security/Provider -java/security/Provider$EngineDescription -java/security/Provider$Service -java/security/Provider$ServiceKey -java/security/Provider$UString -java/security/PublicKey -java/security/SecureClassLoader -java/security/SecureRandomSpi -java/security/Security -java/security/Security$1 -java/security/Signature -java/security/Signature$Delegate -java/security/SignatureException -java/security/SignatureSpi -java/security/UnresolvedPermission -java/security/cert/Certificate -java/security/interfaces/DSAKey -java/security/interfaces/DSAParams -java/security/interfaces/DSAPrivateKey -java/security/interfaces/DSAPublicKey -java/security/spec/AlgorithmParameterSpec -java/security/spec/DSAParameterSpec -java/text/AttributedCharacterIterator$Attribute -java/text/CharacterIterator -java/text/Collator -java/text/DateFormat -java/text/DateFormat$Field -java/text/DateFormatSymbols -java/text/DecimalFormat -java/text/DecimalFormatSymbols -java/text/DigitList -java/text/DontCareFieldPosition -java/text/DontCareFieldPosition$1 -java/text/EntryPair -java/text/FieldPosition -java/text/Format -java/text/Format$Field -java/text/Format$FieldDelegate -java/text/MergeCollation -java/text/MessageFormat -java/text/MessageFormat$Field -java/text/NumberFormat -java/text/NumberFormat$Field -java/text/ParseException -java/text/PatternEntry -java/text/PatternEntry$Parser -java/text/RBCollationTables -java/text/RBCollationTables$BuildAPI -java/text/RBTableBuilder -java/text/RuleBasedCollator -java/text/SimpleDateFormat -java/text/spi/BreakIteratorProvider -java/text/spi/CollatorProvider -java/text/spi/DateFormatProvider -java/text/spi/DateFormatSymbolsProvider -java/text/spi/DecimalFormatSymbolsProvider -java/text/spi/NumberFormatProvider -java/util/AbstractCollection -java/util/AbstractList -java/util/AbstractList$Itr -java/util/AbstractList$ListItr -java/util/AbstractMap -java/util/AbstractQueue -java/util/AbstractSequentialList -java/util/AbstractSet -java/util/ArrayDeque -java/util/ArrayList -java/util/ArrayList$Itr -java/util/ArrayList$ListItr -java/util/ArrayList$SubList -java/util/ArrayList$SubList$1 -java/util/Arrays -java/util/Arrays$ArrayList -java/util/Arrays$LegacyMergeSort -java/util/BitSet -java/util/Calendar -java/util/Calendar$Builder -java/util/Collection -java/util/Collections -java/util/Collections$3 -java/util/Collections$EmptyEnumeration -java/util/Collections$EmptyIterator -java/util/Collections$EmptyList -java/util/Collections$EmptyMap -java/util/Collections$EmptySet -java/util/Collections$SetFromMap -java/util/Collections$SynchronizedCollection -java/util/Collections$SynchronizedMap -java/util/Collections$SynchronizedSet -java/util/Collections$UnmodifiableCollection -java/util/Collections$UnmodifiableCollection$1 -java/util/Collections$UnmodifiableList -java/util/Collections$UnmodifiableList$1 -java/util/Collections$UnmodifiableMap -java/util/Collections$UnmodifiableRandomAccessList -java/util/Collections$UnmodifiableSet -java/util/ComparableTimSort -java/util/Comparator -java/util/Currency -java/util/Currency$1 -java/util/Currency$CurrencyNameGetter -java/util/Date -java/util/Deque -java/util/Dictionary -java/util/Enumeration -java/util/EventListener -java/util/EventListenerProxy -java/util/EventObject -java/util/GregorianCalendar -java/util/HashMap -java/util/HashMap$EntryIterator -java/util/HashMap$EntrySet -java/util/HashMap$HashIterator -java/util/HashMap$KeyIterator -java/util/HashMap$KeySet -java/util/HashMap$Node -java/util/HashMap$TreeNode -java/util/HashMap$ValueIterator -java/util/HashMap$Values -java/util/HashSet -java/util/Hashtable -java/util/Hashtable$Entry -java/util/Hashtable$EntrySet -java/util/Hashtable$Enumerator -java/util/Hashtable$ValueCollection -java/util/IdentityHashMap -java/util/IdentityHashMap$IdentityHashMapIterator -java/util/IdentityHashMap$KeyIterator -java/util/IdentityHashMap$KeySet -java/util/IdentityHashMap$ValueIterator -java/util/IdentityHashMap$Values -java/util/Iterator -java/util/LinkedHashMap -java/util/LinkedHashMap$Entry -java/util/LinkedHashMap$LinkedEntryIterator -java/util/LinkedHashMap$LinkedEntrySet -java/util/LinkedHashMap$LinkedHashIterator -java/util/LinkedHashMap$LinkedKeyIterator -java/util/LinkedHashMap$LinkedKeySet -java/util/LinkedList -java/util/LinkedList$ListItr -java/util/LinkedList$Node -java/util/List -java/util/ListIterator -java/util/ListResourceBundle -java/util/Locale -java/util/Locale$1 -java/util/Locale$Cache -java/util/Locale$Category -java/util/Locale$LocaleKey -java/util/Map -java/util/Map$Entry -java/util/MissingResourceException -java/util/NavigableMap -java/util/Objects -java/util/PriorityQueue -java/util/Properties -java/util/Properties$LineReader -java/util/PropertyResourceBundle -java/util/Queue -java/util/Random -java/util/RandomAccess -java/util/ResourceBundle -java/util/ResourceBundle$1 -java/util/ResourceBundle$BundleReference -java/util/ResourceBundle$CacheKey -java/util/ResourceBundle$CacheKeyReference -java/util/ResourceBundle$Control -java/util/ResourceBundle$Control$1 -java/util/ResourceBundle$Control$CandidateListCache -java/util/ResourceBundle$LoaderReference -java/util/ResourceBundle$RBClassLoader -java/util/ResourceBundle$RBClassLoader$1 -java/util/ResourceBundle$SingleFormatControl -java/util/ServiceLoader -java/util/ServiceLoader$1 -java/util/ServiceLoader$LazyIterator -java/util/Set -java/util/SortedMap -java/util/Stack -java/util/StringTokenizer -java/util/TimSort -java/util/TimeZone -java/util/TimeZone$1 -java/util/TreeMap -java/util/TreeMap$Entry -java/util/Vector -java/util/Vector$1 -java/util/Vector$Itr -java/util/Vector$ListItr -java/util/WeakHashMap -java/util/WeakHashMap$Entry -java/util/WeakHashMap$KeySet -java/util/concurrent/AbstractExecutorService -java/util/concurrent/BlockingQueue -java/util/concurrent/ConcurrentHashMap -java/util/concurrent/ConcurrentHashMap$BaseIterator -java/util/concurrent/ConcurrentHashMap$CollectionView -java/util/concurrent/ConcurrentHashMap$CounterCell -java/util/concurrent/ConcurrentHashMap$EntrySetView -java/util/concurrent/ConcurrentHashMap$ForwardingNode -java/util/concurrent/ConcurrentHashMap$KeyIterator -java/util/concurrent/ConcurrentHashMap$KeySetView -java/util/concurrent/ConcurrentHashMap$Node -java/util/concurrent/ConcurrentHashMap$Segment -java/util/concurrent/ConcurrentHashMap$Traverser -java/util/concurrent/ConcurrentHashMap$ValueIterator -java/util/concurrent/ConcurrentHashMap$ValuesView -java/util/concurrent/ConcurrentMap -java/util/concurrent/CopyOnWriteArrayList -java/util/concurrent/DelayQueue -java/util/concurrent/Delayed -java/util/concurrent/Executor -java/util/concurrent/ExecutorService -java/util/concurrent/Executors -java/util/concurrent/RejectedExecutionHandler -java/util/concurrent/SynchronousQueue -java/util/concurrent/SynchronousQueue$TransferStack -java/util/concurrent/SynchronousQueue$TransferStack$SNode -java/util/concurrent/SynchronousQueue$Transferer -java/util/concurrent/ThreadFactory -java/util/concurrent/ThreadPoolExecutor -java/util/concurrent/ThreadPoolExecutor$AbortPolicy -java/util/concurrent/ThreadPoolExecutor$Worker -java/util/concurrent/TimeUnit -java/util/concurrent/TimeUnit$1 -java/util/concurrent/TimeUnit$2 -java/util/concurrent/TimeUnit$3 -java/util/concurrent/TimeUnit$4 -java/util/concurrent/TimeUnit$5 -java/util/concurrent/TimeUnit$6 -java/util/concurrent/TimeUnit$7 -java/util/concurrent/atomic/AtomicBoolean -java/util/concurrent/atomic/AtomicInteger -java/util/concurrent/atomic/AtomicLong -java/util/concurrent/atomic/AtomicMarkableReference -java/util/concurrent/atomic/AtomicMarkableReference$Pair -java/util/concurrent/atomic/AtomicReferenceFieldUpdater -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 -java/util/concurrent/locks/AbstractOwnableSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject -java/util/concurrent/locks/AbstractQueuedSynchronizer$Node -java/util/concurrent/locks/Condition -java/util/concurrent/locks/Lock -java/util/concurrent/locks/LockSupport -java/util/concurrent/locks/ReentrantLock -java/util/concurrent/locks/ReentrantLock$NonfairSync -java/util/concurrent/locks/ReentrantLock$Sync -java/util/function/BiFunction -java/util/jar/Attributes -java/util/jar/Attributes$Name -java/util/jar/JarEntry -java/util/jar/JarFile -java/util/jar/JarFile$JarEntryIterator -java/util/jar/JarFile$JarFileEntry -java/util/jar/JarVerifier -java/util/jar/JarVerifier$3 -java/util/jar/JavaUtilJarAccessImpl -java/util/jar/Manifest -java/util/jar/Manifest$FastInputStream -java/util/logging/Handler -java/util/logging/Level -java/util/logging/Level$KnownLevel -java/util/logging/LogManager -java/util/logging/LogManager$1 -java/util/logging/LogManager$2 -java/util/logging/LogManager$3 -java/util/logging/LogManager$5 -java/util/logging/LogManager$Cleaner -java/util/logging/LogManager$LogNode -java/util/logging/LogManager$LoggerContext -java/util/logging/LogManager$LoggerContext$1 -java/util/logging/LogManager$LoggerWeakRef -java/util/logging/LogManager$RootLogger -java/util/logging/LogManager$SystemLoggerContext -java/util/logging/Logger -java/util/logging/Logger$1 -java/util/logging/LoggingPermission -java/util/logging/LoggingProxyImpl -java/util/spi/CalendarDataProvider -java/util/spi/CurrencyNameProvider -java/util/spi/LocaleNameProvider -java/util/spi/LocaleServiceProvider -java/util/spi/ResourceBundleControlProvider -java/util/spi/TimeZoneNameProvider -java/util/zip/CRC32 -java/util/zip/Checksum -java/util/zip/DeflaterOutputStream -java/util/zip/GZIPInputStream -java/util/zip/Inflater -java/util/zip/InflaterInputStream -java/util/zip/ZStreamRef -java/util/zip/ZipCoder -java/util/zip/ZipConstants -java/util/zip/ZipEntry -java/util/zip/ZipFile -java/util/zip/ZipFile$1 -java/util/zip/ZipFile$ZipEntryIterator -java/util/zip/ZipFile$ZipFileInflaterInputStream -java/util/zip/ZipFile$ZipFileInputStream -java/util/zip/ZipInputStream -java/util/zip/ZipUtils -javax/accessibility/Accessible -javax/accessibility/AccessibleAction -javax/accessibility/AccessibleBundle -javax/accessibility/AccessibleComponent -javax/accessibility/AccessibleContext -javax/accessibility/AccessibleExtendedComponent -javax/accessibility/AccessibleRelationSet -javax/accessibility/AccessibleState -javax/accessibility/AccessibleText -javax/accessibility/AccessibleValue -javax/security/auth/Destroyable -javax/sound/sampled/Control$Type -javax/sound/sampled/DataLine -javax/sound/sampled/DataLine$Info -javax/sound/sampled/FloatControl$Type -javax/sound/sampled/Line -javax/sound/sampled/Line$Info -javax/sound/sampled/LineUnavailableException -javax/sound/sampled/UnsupportedAudioFileException -javax/swing/AbstractAction -javax/swing/AbstractButton -javax/swing/AbstractButton$AccessibleAbstractButton -javax/swing/AbstractButton$Handler -javax/swing/AbstractCellEditor -javax/swing/AbstractListModel -javax/swing/Action -javax/swing/ActionMap -javax/swing/AncestorNotifier -javax/swing/ArrayTable -javax/swing/BorderFactory -javax/swing/BoundedRangeModel -javax/swing/Box -javax/swing/Box$Filler -javax/swing/BoxLayout -javax/swing/BufferStrategyPaintManager -javax/swing/BufferStrategyPaintManager$BufferInfo -javax/swing/ButtonGroup -javax/swing/ButtonModel -javax/swing/CellEditor -javax/swing/CellRendererPane -javax/swing/ClientPropertyKey -javax/swing/ClientPropertyKey$1 -javax/swing/ComboBoxEditor -javax/swing/ComboBoxModel -javax/swing/ComponentInputMap -javax/swing/DefaultBoundedRangeModel -javax/swing/DefaultButtonModel -javax/swing/DefaultCellEditor -javax/swing/DefaultCellEditor$1 -javax/swing/DefaultCellEditor$EditorDelegate -javax/swing/DefaultComboBoxModel -javax/swing/DefaultListCellRenderer -javax/swing/DefaultListCellRenderer$UIResource -javax/swing/DefaultListModel -javax/swing/DefaultListSelectionModel -javax/swing/DefaultSingleSelectionModel -javax/swing/DropMode -javax/swing/FocusManager -javax/swing/GrayFilter -javax/swing/Icon -javax/swing/ImageIcon -javax/swing/ImageIcon$1 -javax/swing/ImageIcon$2 -javax/swing/ImageIcon$2$1 -javax/swing/ImageIcon$3 -javax/swing/InputMap -javax/swing/InternalFrameFocusTraversalPolicy -javax/swing/JButton -javax/swing/JCheckBox -javax/swing/JCheckBoxMenuItem -javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem -javax/swing/JComboBox -javax/swing/JComboBox$1 -javax/swing/JComboBox$KeySelectionManager -javax/swing/JComponent -javax/swing/JComponent$1 -javax/swing/JComponent$2 -javax/swing/JComponent$AccessibleJComponent -javax/swing/JDialog -javax/swing/JEditorPane -javax/swing/JFrame -javax/swing/JInternalFrame -javax/swing/JLabel -javax/swing/JLayer -javax/swing/JLayeredPane -javax/swing/JList -javax/swing/JList$3 -javax/swing/JList$ListSelectionHandler -javax/swing/JMenu -javax/swing/JMenu$MenuChangeListener -javax/swing/JMenu$WinListener -javax/swing/JMenuBar -javax/swing/JMenuItem -javax/swing/JMenuItem$AccessibleJMenuItem -javax/swing/JMenuItem$MenuItemFocusListener -javax/swing/JPanel -javax/swing/JPopupMenu -javax/swing/JPopupMenu$Separator -javax/swing/JProgressBar -javax/swing/JProgressBar$ModelListener -javax/swing/JRadioButton -javax/swing/JRadioButtonMenuItem -javax/swing/JRootPane -javax/swing/JRootPane$1 -javax/swing/JRootPane$RootLayout -javax/swing/JScrollBar -javax/swing/JScrollBar$ModelListener -javax/swing/JScrollPane -javax/swing/JScrollPane$ScrollBar -javax/swing/JSeparator -javax/swing/JSlider -javax/swing/JSlider$ModelListener -javax/swing/JSplitPane -javax/swing/JTabbedPane -javax/swing/JTabbedPane$ModelListener -javax/swing/JTabbedPane$Page -javax/swing/JTable -javax/swing/JTable$2 -javax/swing/JTable$5 -javax/swing/JTable$Resizable2 -javax/swing/JTable$Resizable3 -javax/swing/JTextArea -javax/swing/JTextField -javax/swing/JTextField$NotifyAction -javax/swing/JTextField$ScrollRepainter -javax/swing/JToggleButton -javax/swing/JToggleButton$ToggleButtonModel -javax/swing/JToolBar -javax/swing/JToolBar$DefaultToolBarLayout -javax/swing/JToolBar$Separator -javax/swing/JToolTip -javax/swing/JTree -javax/swing/JTree$TreeModelHandler -javax/swing/JTree$TreeSelectionRedirector -javax/swing/JViewport -javax/swing/JViewport$ViewListener -javax/swing/JWindow -javax/swing/KeyStroke -javax/swing/KeyboardManager -javax/swing/KeyboardManager$ComponentKeyStrokePair -javax/swing/LayoutComparator -javax/swing/LayoutFocusTraversalPolicy -javax/swing/ListCellRenderer -javax/swing/ListModel -javax/swing/ListSelectionModel -javax/swing/LookAndFeel -javax/swing/MenuElement -javax/swing/MenuSelectionManager -javax/swing/MultiUIDefaults -javax/swing/MutableComboBoxModel -javax/swing/RepaintManager -javax/swing/RepaintManager$2 -javax/swing/RepaintManager$3 -javax/swing/RepaintManager$DisplayChangedHandler -javax/swing/RepaintManager$PaintManager -javax/swing/RepaintManager$ProcessingRunnable -javax/swing/RootPaneContainer -javax/swing/ScrollPaneConstants -javax/swing/ScrollPaneLayout -javax/swing/ScrollPaneLayout$UIResource -javax/swing/Scrollable -javax/swing/SingleSelectionModel -javax/swing/SizeRequirements -javax/swing/SortingFocusTraversalPolicy -javax/swing/SwingConstants -javax/swing/SwingContainerOrderFocusTraversalPolicy -javax/swing/SwingDefaultFocusTraversalPolicy -javax/swing/SwingPaintEventDispatcher -javax/swing/SwingUtilities -javax/swing/SwingUtilities$SharedOwnerFrame -javax/swing/Timer -javax/swing/Timer$DoPostEvent -javax/swing/TimerQueue -javax/swing/TimerQueue$1 -javax/swing/TimerQueue$DelayedTimer -javax/swing/ToolTipManager -javax/swing/ToolTipManager$AccessibilityKeyListener -javax/swing/ToolTipManager$MoveBeforeEnterListener -javax/swing/ToolTipManager$insideTimerAction -javax/swing/ToolTipManager$outsideTimerAction -javax/swing/ToolTipManager$stillInsideTimerAction -javax/swing/TransferHandler -javax/swing/TransferHandler$DropHandler -javax/swing/TransferHandler$HasGetTransferHandler -javax/swing/TransferHandler$SwingDropTarget -javax/swing/TransferHandler$TransferAction -javax/swing/TransferHandler$TransferSupport -javax/swing/UIDefaults -javax/swing/UIDefaults$ActiveValue -javax/swing/UIDefaults$LazyInputMap -javax/swing/UIDefaults$LazyValue -javax/swing/UIDefaults$TextAndMnemonicHashMap -javax/swing/UIManager -javax/swing/UIManager$1 -javax/swing/UIManager$2 -javax/swing/UIManager$LAFState -javax/swing/UIManager$LookAndFeelInfo -javax/swing/UnsupportedLookAndFeelException -javax/swing/ViewportLayout -javax/swing/WindowConstants -javax/swing/border/AbstractBorder -javax/swing/border/BevelBorder -javax/swing/border/Border -javax/swing/border/CompoundBorder -javax/swing/border/EmptyBorder -javax/swing/border/EtchedBorder -javax/swing/border/LineBorder -javax/swing/border/MatteBorder -javax/swing/border/TitledBorder -javax/swing/event/AncestorEvent -javax/swing/event/AncestorListener -javax/swing/event/CaretEvent -javax/swing/event/CaretListener -javax/swing/event/CellEditorListener -javax/swing/event/ChangeEvent -javax/swing/event/ChangeListener -javax/swing/event/DocumentEvent -javax/swing/event/DocumentEvent$ElementChange -javax/swing/event/DocumentEvent$EventType -javax/swing/event/DocumentListener -javax/swing/event/EventListenerList -javax/swing/event/ListDataEvent -javax/swing/event/ListDataListener -javax/swing/event/ListSelectionEvent -javax/swing/event/ListSelectionListener -javax/swing/event/MenuDragMouseListener -javax/swing/event/MenuEvent -javax/swing/event/MenuKeyListener -javax/swing/event/MenuListener -javax/swing/event/MouseInputAdapter -javax/swing/event/MouseInputListener -javax/swing/event/PopupMenuListener -javax/swing/event/RowSorterListener -javax/swing/event/SwingPropertyChangeSupport -javax/swing/event/TableColumnModelEvent -javax/swing/event/TableColumnModelListener -javax/swing/event/TableModelEvent -javax/swing/event/TableModelListener -javax/swing/event/TreeExpansionListener -javax/swing/event/TreeModelEvent -javax/swing/event/TreeModelListener -javax/swing/event/TreeSelectionEvent -javax/swing/event/TreeSelectionListener -javax/swing/event/UndoableEditEvent -javax/swing/event/UndoableEditListener -javax/swing/filechooser/FileFilter -javax/swing/plaf/ActionMapUIResource -javax/swing/plaf/BorderUIResource -javax/swing/plaf/BorderUIResource$CompoundBorderUIResource -javax/swing/plaf/BorderUIResource$EmptyBorderUIResource -javax/swing/plaf/BorderUIResource$LineBorderUIResource -javax/swing/plaf/ButtonUI -javax/swing/plaf/ColorUIResource -javax/swing/plaf/ComboBoxUI -javax/swing/plaf/ComponentInputMapUIResource -javax/swing/plaf/ComponentUI -javax/swing/plaf/DimensionUIResource -javax/swing/plaf/FontUIResource -javax/swing/plaf/InputMapUIResource -javax/swing/plaf/InsetsUIResource -javax/swing/plaf/LabelUI -javax/swing/plaf/ListUI -javax/swing/plaf/MenuBarUI -javax/swing/plaf/MenuItemUI -javax/swing/plaf/PanelUI -javax/swing/plaf/PopupMenuUI -javax/swing/plaf/ProgressBarUI -javax/swing/plaf/RootPaneUI -javax/swing/plaf/ScrollBarUI -javax/swing/plaf/ScrollPaneUI -javax/swing/plaf/SeparatorUI -javax/swing/plaf/SliderUI -javax/swing/plaf/SplitPaneUI -javax/swing/plaf/TabbedPaneUI -javax/swing/plaf/TableHeaderUI -javax/swing/plaf/TableUI -javax/swing/plaf/TextUI -javax/swing/plaf/ToolBarUI -javax/swing/plaf/TreeUI -javax/swing/plaf/UIResource -javax/swing/plaf/ViewportUI -javax/swing/plaf/basic/BasicArrowButton -javax/swing/plaf/basic/BasicBorders -javax/swing/plaf/basic/BasicBorders$ButtonBorder -javax/swing/plaf/basic/BasicBorders$MarginBorder -javax/swing/plaf/basic/BasicBorders$RadioButtonBorder -javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder -javax/swing/plaf/basic/BasicBorders$SplitPaneBorder -javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder -javax/swing/plaf/basic/BasicButtonListener -javax/swing/plaf/basic/BasicButtonUI -javax/swing/plaf/basic/BasicCheckBoxMenuItemUI -javax/swing/plaf/basic/BasicComboBoxEditor -javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField -javax/swing/plaf/basic/BasicComboBoxEditor$UIResource -javax/swing/plaf/basic/BasicComboBoxRenderer -javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource -javax/swing/plaf/basic/BasicComboBoxUI -javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager -javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager -javax/swing/plaf/basic/BasicComboBoxUI$Handler -javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicComboPopup -javax/swing/plaf/basic/BasicComboPopup$1 -javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass -javax/swing/plaf/basic/BasicComboPopup$Handler -javax/swing/plaf/basic/BasicGraphicsUtils -javax/swing/plaf/basic/BasicHTML -javax/swing/plaf/basic/BasicLabelUI -javax/swing/plaf/basic/BasicListUI -javax/swing/plaf/basic/BasicListUI$Handler -javax/swing/plaf/basic/BasicListUI$ListTransferHandler -javax/swing/plaf/basic/BasicLookAndFeel -javax/swing/plaf/basic/BasicLookAndFeel$1 -javax/swing/plaf/basic/BasicLookAndFeel$2 -javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper -javax/swing/plaf/basic/BasicMenuBarUI -javax/swing/plaf/basic/BasicMenuBarUI$Handler -javax/swing/plaf/basic/BasicMenuItemUI -javax/swing/plaf/basic/BasicMenuItemUI$Handler -javax/swing/plaf/basic/BasicMenuUI -javax/swing/plaf/basic/BasicMenuUI$Handler -javax/swing/plaf/basic/BasicPanelUI -javax/swing/plaf/basic/BasicPopupMenuUI -javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener -javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 -javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber -javax/swing/plaf/basic/BasicProgressBarUI -javax/swing/plaf/basic/BasicProgressBarUI$Handler -javax/swing/plaf/basic/BasicRadioButtonMenuItemUI -javax/swing/plaf/basic/BasicRadioButtonUI -javax/swing/plaf/basic/BasicRootPaneUI -javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap -javax/swing/plaf/basic/BasicScrollBarUI -javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener -javax/swing/plaf/basic/BasicScrollBarUI$Handler -javax/swing/plaf/basic/BasicScrollBarUI$ModelListener -javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener -javax/swing/plaf/basic/BasicScrollBarUI$TrackListener -javax/swing/plaf/basic/BasicScrollPaneUI -javax/swing/plaf/basic/BasicScrollPaneUI$Handler -javax/swing/plaf/basic/BasicSeparatorUI -javax/swing/plaf/basic/BasicSliderUI -javax/swing/plaf/basic/BasicSliderUI$Actions -javax/swing/plaf/basic/BasicSliderUI$Handler -javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicSliderUI$ScrollListener -javax/swing/plaf/basic/BasicSliderUI$TrackListener -javax/swing/plaf/basic/BasicSplitPaneDivider -javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout -javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler -javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler -javax/swing/plaf/basic/BasicSplitPaneUI -javax/swing/plaf/basic/BasicSplitPaneUI$1 -javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager -javax/swing/plaf/basic/BasicSplitPaneUI$Handler -javax/swing/plaf/basic/BasicTabbedPaneUI -javax/swing/plaf/basic/BasicTabbedPaneUI$Handler -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout -javax/swing/plaf/basic/BasicTableHeaderUI -javax/swing/plaf/basic/BasicTableHeaderUI$1 -javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler -javax/swing/plaf/basic/BasicTableUI -javax/swing/plaf/basic/BasicTableUI$Handler -javax/swing/plaf/basic/BasicTableUI$TableTransferHandler -javax/swing/plaf/basic/BasicTextAreaUI -javax/swing/plaf/basic/BasicTextFieldUI -javax/swing/plaf/basic/BasicTextUI -javax/swing/plaf/basic/BasicTextUI$BasicCaret -javax/swing/plaf/basic/BasicTextUI$BasicCursor -javax/swing/plaf/basic/BasicTextUI$BasicHighlighter -javax/swing/plaf/basic/BasicTextUI$DragListener -javax/swing/plaf/basic/BasicTextUI$FocusAction -javax/swing/plaf/basic/BasicTextUI$RootView -javax/swing/plaf/basic/BasicTextUI$TextActionWrapper -javax/swing/plaf/basic/BasicTextUI$TextTransferHandler -javax/swing/plaf/basic/BasicTextUI$UpdateHandler -javax/swing/plaf/basic/BasicToggleButtonUI -javax/swing/plaf/basic/BasicToolBarSeparatorUI -javax/swing/plaf/basic/BasicToolBarUI -javax/swing/plaf/basic/BasicToolBarUI$DockingListener -javax/swing/plaf/basic/BasicToolBarUI$Handler -javax/swing/plaf/basic/BasicTreeUI -javax/swing/plaf/basic/BasicTreeUI$Actions -javax/swing/plaf/basic/BasicTreeUI$Handler -javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler -javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler -javax/swing/plaf/basic/BasicViewportUI -javax/swing/plaf/basic/ComboPopup -javax/swing/plaf/basic/DefaultMenuLayout -javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag -javax/swing/plaf/basic/LazyActionMap -javax/swing/plaf/metal/DefaultMetalTheme -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 -javax/swing/plaf/metal/MetalBorders -javax/swing/plaf/metal/MetalBorders$ButtonBorder -javax/swing/plaf/metal/MetalBorders$Flush3DBorder -javax/swing/plaf/metal/MetalBorders$MenuBarBorder -javax/swing/plaf/metal/MetalBorders$MenuItemBorder -javax/swing/plaf/metal/MetalBorders$PopupMenuBorder -javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder -javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder -javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder -javax/swing/plaf/metal/MetalBorders$TextFieldBorder -javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder -javax/swing/plaf/metal/MetalBorders$ToolBarBorder -javax/swing/plaf/metal/MetalBumps -javax/swing/plaf/metal/MetalButtonUI -javax/swing/plaf/metal/MetalCheckBoxUI -javax/swing/plaf/metal/MetalComboBoxButton -javax/swing/plaf/metal/MetalComboBoxButton$1 -javax/swing/plaf/metal/MetalComboBoxEditor -javax/swing/plaf/metal/MetalComboBoxEditor$1 -javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder -javax/swing/plaf/metal/MetalComboBoxEditor$UIResource -javax/swing/plaf/metal/MetalComboBoxIcon -javax/swing/plaf/metal/MetalComboBoxUI -javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager -javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener -javax/swing/plaf/metal/MetalIconFactory -javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon -javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon -javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 -javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon -javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon -javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon -javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon -javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon -javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon -javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon -javax/swing/plaf/metal/MetalLabelUI -javax/swing/plaf/metal/MetalLookAndFeel -javax/swing/plaf/metal/MetalLookAndFeel$AATextListener -javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue$1 -javax/swing/plaf/metal/MetalPopupMenuSeparatorUI -javax/swing/plaf/metal/MetalProgressBarUI -javax/swing/plaf/metal/MetalRadioButtonUI -javax/swing/plaf/metal/MetalRootPaneUI -javax/swing/plaf/metal/MetalScrollBarUI -javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener -javax/swing/plaf/metal/MetalScrollButton -javax/swing/plaf/metal/MetalScrollPaneUI -javax/swing/plaf/metal/MetalScrollPaneUI$1 -javax/swing/plaf/metal/MetalSeparatorUI -javax/swing/plaf/metal/MetalSliderUI -javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener -javax/swing/plaf/metal/MetalSplitPaneDivider -javax/swing/plaf/metal/MetalSplitPaneDivider$1 -javax/swing/plaf/metal/MetalSplitPaneDivider$2 -javax/swing/plaf/metal/MetalSplitPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/metal/MetalTextFieldUI -javax/swing/plaf/metal/MetalTheme -javax/swing/plaf/metal/MetalToggleButtonUI -javax/swing/plaf/metal/MetalToolBarUI -javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener -javax/swing/plaf/metal/MetalTreeUI -javax/swing/plaf/metal/MetalTreeUI$LineListener -javax/swing/plaf/metal/OceanTheme -javax/swing/plaf/metal/OceanTheme$1 -javax/swing/plaf/metal/OceanTheme$2 -javax/swing/plaf/metal/OceanTheme$3 -javax/swing/plaf/metal/OceanTheme$4 -javax/swing/plaf/metal/OceanTheme$5 -javax/swing/plaf/metal/OceanTheme$6 -javax/swing/plaf/synth/SynthConstants -javax/swing/plaf/synth/SynthUI -javax/swing/table/AbstractTableModel -javax/swing/table/DefaultTableCellRenderer -javax/swing/table/DefaultTableColumnModel -javax/swing/table/DefaultTableModel -javax/swing/table/JTableHeader -javax/swing/table/TableCellEditor -javax/swing/table/TableCellRenderer -javax/swing/table/TableColumn -javax/swing/table/TableColumnModel -javax/swing/table/TableModel -javax/swing/text/AbstractDocument -javax/swing/text/AbstractDocument$1 -javax/swing/text/AbstractDocument$AbstractElement -javax/swing/text/AbstractDocument$AttributeContext -javax/swing/text/AbstractDocument$BidiElement -javax/swing/text/AbstractDocument$BidiRootElement -javax/swing/text/AbstractDocument$BranchElement -javax/swing/text/AbstractDocument$Content -javax/swing/text/AbstractDocument$DefaultDocumentEvent -javax/swing/text/AbstractDocument$ElementEdit -javax/swing/text/AbstractDocument$InsertStringResult -javax/swing/text/AbstractDocument$LeafElement -javax/swing/text/AttributeSet -javax/swing/text/AttributeSet$CharacterAttribute -javax/swing/text/AttributeSet$ColorAttribute -javax/swing/text/AttributeSet$FontAttribute -javax/swing/text/AttributeSet$ParagraphAttribute -javax/swing/text/Caret -javax/swing/text/DefaultCaret -javax/swing/text/DefaultCaret$Handler -javax/swing/text/DefaultEditorKit -javax/swing/text/DefaultEditorKit$BeepAction -javax/swing/text/DefaultEditorKit$BeginAction -javax/swing/text/DefaultEditorKit$BeginLineAction -javax/swing/text/DefaultEditorKit$BeginParagraphAction -javax/swing/text/DefaultEditorKit$BeginWordAction -javax/swing/text/DefaultEditorKit$CopyAction -javax/swing/text/DefaultEditorKit$CutAction -javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction -javax/swing/text/DefaultEditorKit$DeleteNextCharAction -javax/swing/text/DefaultEditorKit$DeletePrevCharAction -javax/swing/text/DefaultEditorKit$DeleteWordAction -javax/swing/text/DefaultEditorKit$DumpModelAction -javax/swing/text/DefaultEditorKit$EndAction -javax/swing/text/DefaultEditorKit$EndLineAction -javax/swing/text/DefaultEditorKit$EndParagraphAction -javax/swing/text/DefaultEditorKit$EndWordAction -javax/swing/text/DefaultEditorKit$InsertBreakAction -javax/swing/text/DefaultEditorKit$InsertContentAction -javax/swing/text/DefaultEditorKit$InsertTabAction -javax/swing/text/DefaultEditorKit$NextVisualPositionAction -javax/swing/text/DefaultEditorKit$NextWordAction -javax/swing/text/DefaultEditorKit$PageAction -javax/swing/text/DefaultEditorKit$PasteAction -javax/swing/text/DefaultEditorKit$PreviousWordAction -javax/swing/text/DefaultEditorKit$ReadOnlyAction -javax/swing/text/DefaultEditorKit$SelectAllAction -javax/swing/text/DefaultEditorKit$SelectLineAction -javax/swing/text/DefaultEditorKit$SelectParagraphAction -javax/swing/text/DefaultEditorKit$SelectWordAction -javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction -javax/swing/text/DefaultEditorKit$UnselectAction -javax/swing/text/DefaultEditorKit$VerticalPageAction -javax/swing/text/DefaultEditorKit$WritableAction -javax/swing/text/DefaultHighlighter -javax/swing/text/DefaultHighlighter$DefaultHighlightPainter -javax/swing/text/DefaultHighlighter$SafeDamager -javax/swing/text/Document -javax/swing/text/EditorKit -javax/swing/text/Element -javax/swing/text/FieldView -javax/swing/text/GapContent -javax/swing/text/GapContent$InsertUndo -javax/swing/text/GapContent$MarkData -javax/swing/text/GapContent$MarkVector -javax/swing/text/GapContent$StickyPosition -javax/swing/text/GapVector -javax/swing/text/Highlighter -javax/swing/text/Highlighter$Highlight -javax/swing/text/Highlighter$HighlightPainter -javax/swing/text/JTextComponent -javax/swing/text/JTextComponent$1 -javax/swing/text/JTextComponent$DefaultKeymap -javax/swing/text/JTextComponent$KeymapActionMap -javax/swing/text/JTextComponent$KeymapWrapper -javax/swing/text/JTextComponent$MutableCaretEvent -javax/swing/text/Keymap -javax/swing/text/LayeredHighlighter -javax/swing/text/LayeredHighlighter$LayerPainter -javax/swing/text/MutableAttributeSet -javax/swing/text/PlainDocument -javax/swing/text/PlainView -javax/swing/text/Position -javax/swing/text/Position$Bias -javax/swing/text/Segment -javax/swing/text/SegmentCache -javax/swing/text/SegmentCache$CachedSegment -javax/swing/text/SimpleAttributeSet -javax/swing/text/SimpleAttributeSet$EmptyAttributeSet -javax/swing/text/Style -javax/swing/text/StyleConstants -javax/swing/text/StyleConstants$CharacterConstants -javax/swing/text/StyleConstants$ColorConstants -javax/swing/text/StyleConstants$FontConstants -javax/swing/text/StyleConstants$ParagraphConstants -javax/swing/text/StyleContext -javax/swing/text/StyleContext$FontKey -javax/swing/text/StyleContext$KeyEnumeration -javax/swing/text/StyleContext$NamedStyle -javax/swing/text/StyleContext$SmallAttributeSet -javax/swing/text/TabExpander -javax/swing/text/TextAction -javax/swing/text/Utilities -javax/swing/text/View -javax/swing/text/ViewFactory -javax/swing/tree/AbstractLayoutCache -javax/swing/tree/AbstractLayoutCache$NodeDimensions -javax/swing/tree/DefaultMutableTreeNode -javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration -javax/swing/tree/DefaultTreeCellEditor -javax/swing/tree/DefaultTreeCellEditor$1 -javax/swing/tree/DefaultTreeCellEditor$DefaultTextField -javax/swing/tree/DefaultTreeCellEditor$EditorContainer -javax/swing/tree/DefaultTreeCellRenderer -javax/swing/tree/DefaultTreeModel -javax/swing/tree/DefaultTreeSelectionModel -javax/swing/tree/MutableTreeNode -javax/swing/tree/PathPlaceHolder -javax/swing/tree/RowMapper -javax/swing/tree/TreeCellEditor -javax/swing/tree/TreeCellRenderer -javax/swing/tree/TreeModel -javax/swing/tree/TreeNode -javax/swing/tree/TreePath -javax/swing/tree/TreeSelectionModel -javax/swing/tree/VariableHeightLayoutCache -javax/swing/tree/VariableHeightLayoutCache$TreeStateNode -javax/swing/undo/AbstractUndoableEdit -javax/swing/undo/CompoundEdit -javax/swing/undo/UndoableEdit -javax/xml/parsers/DocumentBuilder -javax/xml/parsers/DocumentBuilderFactory -javax/xml/parsers/FactoryFinder -javax/xml/parsers/FactoryFinder$1 -javax/xml/parsers/ParserConfigurationException -javax/xml/parsers/SecuritySupport -javax/xml/parsers/SecuritySupport$2 -javax/xml/parsers/SecuritySupport$5 -org/w3c/dom/Attr -org/w3c/dom/CDATASection -org/w3c/dom/CharacterData -org/w3c/dom/Comment -org/w3c/dom/DOMException -org/w3c/dom/Document -org/w3c/dom/DocumentFragment -org/w3c/dom/DocumentType -org/w3c/dom/Element -org/w3c/dom/Entity -org/w3c/dom/EntityReference -org/w3c/dom/NamedNodeMap -org/w3c/dom/Node -org/w3c/dom/NodeList -org/w3c/dom/Notation -org/w3c/dom/ProcessingInstruction -org/w3c/dom/Text -org/w3c/dom/events/DocumentEvent -org/w3c/dom/events/Event -org/w3c/dom/events/EventException -org/w3c/dom/events/EventTarget -org/w3c/dom/events/MutationEvent -org/w3c/dom/ranges/DocumentRange -org/w3c/dom/ranges/Range -org/w3c/dom/traversal/DocumentTraversal -org/w3c/dom/traversal/NodeIterator -org/w3c/dom/traversal/TreeWalker -org/xml/sax/AttributeList -org/xml/sax/ContentHandler -org/xml/sax/DTDHandler -org/xml/sax/EntityResolver -org/xml/sax/ErrorHandler -org/xml/sax/InputSource -org/xml/sax/Locator -org/xml/sax/SAXException -org/xml/sax/SAXNotRecognizedException -org/xml/sax/SAXNotSupportedException -org/xml/sax/SAXParseException -org/xml/sax/helpers/DefaultHandler -sun/awt/AWTAccessor -sun/awt/AWTAccessor$AWTEventAccessor -sun/awt/AWTAccessor$ClientPropertyKeyAccessor -sun/awt/AWTAccessor$ComponentAccessor -sun/awt/AWTAccessor$ContainerAccessor -sun/awt/AWTAccessor$CursorAccessor -sun/awt/AWTAccessor$DefaultKeyboardFocusManagerAccessor -sun/awt/AWTAccessor$EventQueueAccessor -sun/awt/AWTAccessor$FrameAccessor -sun/awt/AWTAccessor$InputEventAccessor -sun/awt/AWTAccessor$InvocationEventAccessor -sun/awt/AWTAccessor$KeyEventAccessor -sun/awt/AWTAccessor$KeyboardFocusManagerAccessor -sun/awt/AWTAccessor$SequencedEventAccessor -sun/awt/AWTAccessor$ToolkitAccessor -sun/awt/AWTAccessor$WindowAccessor -sun/awt/AWTAutoShutdown -sun/awt/AWTIcon32_java_icon16_png -sun/awt/AWTIcon32_java_icon24_png -sun/awt/AWTIcon32_java_icon32_png -sun/awt/AWTIcon32_java_icon48_png -sun/awt/AppContext -sun/awt/AppContext$1 -sun/awt/AppContext$2 -sun/awt/AppContext$3 -sun/awt/AppContext$6 -sun/awt/AppContext$GetAppContextLock -sun/awt/AppContext$State -sun/awt/CausedFocusEvent -sun/awt/CausedFocusEvent$Cause -sun/awt/ComponentFactory -sun/awt/ConstrainableGraphics -sun/awt/DisplayChangedListener -sun/awt/EmbeddedFrame -sun/awt/EventQueueDelegate -sun/awt/EventQueueItem -sun/awt/FontConfiguration -sun/awt/FontDescriptor -sun/awt/GlobalCursorManager -sun/awt/GlobalCursorManager$NativeUpdater -sun/awt/HeadlessToolkit -sun/awt/IconInfo -sun/awt/InputMethodSupport -sun/awt/KeyboardFocusManagerPeerImpl -sun/awt/KeyboardFocusManagerPeerProvider -sun/awt/LightweightFrame -sun/awt/ModalityListener -sun/awt/MostRecentKeyValue -sun/awt/NullComponentPeer -sun/awt/OSInfo -sun/awt/OSInfo$1 -sun/awt/OSInfo$OSType -sun/awt/OSInfo$WindowsVersion -sun/awt/PaintEventDispatcher -sun/awt/PeerEvent -sun/awt/PostEventQueue -sun/awt/RepaintArea -sun/awt/RequestFocusController -sun/awt/SubRegionShowable -sun/awt/SunDisplayChanger -sun/awt/SunGraphicsCallback -sun/awt/SunHints -sun/awt/SunHints$Key -sun/awt/SunHints$LCDContrastKey -sun/awt/SunHints$Value -sun/awt/SunToolkit -sun/awt/SunToolkit$ModalityListenerList -sun/awt/TimedWindowEvent -sun/awt/UNIXToolkit -sun/awt/WindowClosingListener -sun/awt/WindowClosingSupport -sun/awt/X11/AwtGraphicsConfigData -sun/awt/X11/AwtScreenData -sun/awt/X11/MotifColorUtilities -sun/awt/X11/MotifDnDConstants -sun/awt/X11/MotifDnDDragSourceProtocol -sun/awt/X11/MotifDnDDropTargetProtocol -sun/awt/X11/Native -sun/awt/X11/Native$1 -sun/awt/X11/OwnershipListener -sun/awt/X11/PropMwmHints -sun/awt/X11/UnsafeXDisposerRecord -sun/awt/X11/WindowDimensions -sun/awt/X11/WindowPropertyGetter -sun/awt/X11/XAWTXSettings -sun/awt/X11/XAnyEvent -sun/awt/X11/XAtom -sun/awt/X11/XAtomList -sun/awt/X11/XAwtState -sun/awt/X11/XBaseWindow -sun/awt/X11/XBaseWindow$1 -sun/awt/X11/XBaseWindow$InitialiseState -sun/awt/X11/XBaseWindow$StateLock -sun/awt/X11/XCanvasPeer -sun/awt/X11/XClientMessageEvent -sun/awt/X11/XClipboard -sun/awt/X11/XComponentPeer -sun/awt/X11/XComponentPeer$1 -sun/awt/X11/XConfigureEvent -sun/awt/X11/XContentWindow -sun/awt/X11/XCreateWindowParams -sun/awt/X11/XDecoratedPeer -sun/awt/X11/XDnDConstants -sun/awt/X11/XDnDDragSourceProtocol -sun/awt/X11/XDnDDropTargetProtocol -sun/awt/X11/XDragAndDropProtocols -sun/awt/X11/XDragSourceContextPeer -sun/awt/X11/XDragSourceProtocol -sun/awt/X11/XDragSourceProtocolListener -sun/awt/X11/XDropTargetContextPeer -sun/awt/X11/XDropTargetContextPeer$XDropTargetProtocolListenerImpl -sun/awt/X11/XDropTargetEventProcessor -sun/awt/X11/XDropTargetProtocol -sun/awt/X11/XDropTargetProtocolListener -sun/awt/X11/XDropTargetRegistry -sun/awt/X11/XEmbeddedFramePeer -sun/awt/X11/XErrorEvent -sun/awt/X11/XErrorHandler -sun/awt/X11/XErrorHandler$IgnoreBadWindowHandler -sun/awt/X11/XErrorHandler$VerifyChangePropertyHandler -sun/awt/X11/XErrorHandler$XBaseErrorHandler -sun/awt/X11/XErrorHandler$XErrorHandlerWithFlag -sun/awt/X11/XErrorHandler$XShmAttachHandler -sun/awt/X11/XErrorHandlerUtil -sun/awt/X11/XEvent -sun/awt/X11/XEventDispatcher -sun/awt/X11/XExposeEvent -sun/awt/X11/XFocusChangeEvent -sun/awt/X11/XFocusProxyWindow -sun/awt/X11/XFramePeer -sun/awt/X11/XGlobalCursorManager -sun/awt/X11/XInputMethod -sun/awt/X11/XInputMethodDescriptor -sun/awt/X11/XKeyboardFocusManagerPeer -sun/awt/X11/XLabelPeer -sun/awt/X11/XLayerProtocol -sun/awt/X11/XMSelection -sun/awt/X11/XMSelection$1 -sun/awt/X11/XMSelection$3 -sun/awt/X11/XMSelectionListener -sun/awt/X11/XModifierKeymap -sun/awt/X11/XNETProtocol -sun/awt/X11/XPanelPeer -sun/awt/X11/XPropertyCache -sun/awt/X11/XPropertyEvent -sun/awt/X11/XProtocol -sun/awt/X11/XRepaintArea -sun/awt/X11/XReparentEvent -sun/awt/X11/XRootWindow -sun/awt/X11/XSelection -sun/awt/X11/XSelection$IncrementalTransferHandler -sun/awt/X11/XSelection$SelectionEventHandler -sun/awt/X11/XSetWindowAttributes -sun/awt/X11/XSizeHints -sun/awt/X11/XStateProtocol -sun/awt/X11/XSystemTrayPeer -sun/awt/X11/XToolkit -sun/awt/X11/XToolkit$1 -sun/awt/X11/XToolkit$2 -sun/awt/X11/XToolkit$2$1 -sun/awt/X11/XToolkit$3 -sun/awt/X11/XToolkit$4 -sun/awt/X11/XToolkit$5 -sun/awt/X11/XUnmapEvent -sun/awt/X11/XVisibilityEvent -sun/awt/X11/XVisualInfo -sun/awt/X11/XWINProtocol -sun/awt/X11/XWM -sun/awt/X11/XWM$1 -sun/awt/X11/XWMHints -sun/awt/X11/XWindow -sun/awt/X11/XWindowAttributes -sun/awt/X11/XWindowAttributesData -sun/awt/X11/XWindowPeer -sun/awt/X11/XWindowPeer$2 -sun/awt/X11/XWindowPeer$4 -sun/awt/X11/XWrapperBase -sun/awt/X11/XlibUtil -sun/awt/X11/XlibWrapper -sun/awt/X11ComponentPeer -sun/awt/X11FontManager -sun/awt/X11GraphicsConfig -sun/awt/X11GraphicsConfig$X11GCDisposerRecord -sun/awt/X11GraphicsDevice -sun/awt/X11GraphicsEnvironment -sun/awt/X11GraphicsEnvironment$1 -sun/awt/X11InputMethod -sun/awt/X11InputMethodDescriptor -sun/awt/XSettings -sun/awt/XSettings$Update -sun/awt/datatransfer/SunClipboard -sun/awt/dnd/SunDragSourceContextPeer -sun/awt/dnd/SunDropTargetContextPeer -sun/awt/dnd/SunDropTargetEvent -sun/awt/event/IgnorePaintEvent -sun/awt/geom/PathConsumer2D -sun/awt/im/ExecutableInputMethodManager -sun/awt/im/ExecutableInputMethodManager$3 -sun/awt/im/InputContext -sun/awt/im/InputMethodAdapter -sun/awt/im/InputMethodContext -sun/awt/im/InputMethodLocator -sun/awt/im/InputMethodManager -sun/awt/image/BufImgSurfaceData -sun/awt/image/BufImgSurfaceData$ICMColorData -sun/awt/image/BufImgSurfaceManager -sun/awt/image/BufferedImageGraphicsConfig -sun/awt/image/ByteComponentRaster -sun/awt/image/ByteInterleavedRaster -sun/awt/image/BytePackedRaster -sun/awt/image/FetcherInfo -sun/awt/image/GifFrame -sun/awt/image/GifImageDecoder -sun/awt/image/ImageConsumerQueue -sun/awt/image/ImageDecoder -sun/awt/image/ImageDecoder$1 -sun/awt/image/ImageFetchable -sun/awt/image/ImageFetcher -sun/awt/image/ImageFetcher$1 -sun/awt/image/ImageRepresentation -sun/awt/image/ImageWatched -sun/awt/image/ImageWatched$Link -sun/awt/image/ImageWatched$WeakLink -sun/awt/image/InputStreamImageSource -sun/awt/image/IntegerComponentRaster -sun/awt/image/IntegerInterleavedRaster -sun/awt/image/NativeLibLoader -sun/awt/image/NativeLibLoader$1 -sun/awt/image/OffScreenImage -sun/awt/image/PNGFilterInputStream -sun/awt/image/PNGImageDecoder -sun/awt/image/PixelConverter -sun/awt/image/PixelConverter$Argb -sun/awt/image/PixelConverter$ArgbBm -sun/awt/image/PixelConverter$ArgbPre -sun/awt/image/PixelConverter$Bgrx -sun/awt/image/PixelConverter$ByteGray -sun/awt/image/PixelConverter$Rgba -sun/awt/image/PixelConverter$RgbaPre -sun/awt/image/PixelConverter$Rgbx -sun/awt/image/PixelConverter$Ushort4444Argb -sun/awt/image/PixelConverter$Ushort555Rgb -sun/awt/image/PixelConverter$Ushort555Rgbx -sun/awt/image/PixelConverter$Ushort565Rgb -sun/awt/image/PixelConverter$UshortGray -sun/awt/image/PixelConverter$Xbgr -sun/awt/image/PixelConverter$Xrgb -sun/awt/image/SunVolatileImage -sun/awt/image/SunWritableRaster -sun/awt/image/SunWritableRaster$DataStealer -sun/awt/image/SurfaceManager -sun/awt/image/SurfaceManager$ImageAccessor -sun/awt/image/SurfaceManager$ProxiedGraphicsConfig -sun/awt/image/ToolkitImage -sun/awt/image/URLImageSource -sun/awt/image/VolatileSurfaceManager -sun/awt/motif/MFontConfiguration -sun/awt/resources/awt -sun/awt/util/IdentityArrayList -sun/dc/DuctusRenderingEngine -sun/dc/path/PathConsumer -sun/dc/pr/PathDasher -sun/dc/pr/PathDasher$1 -sun/dc/pr/PathStroker -sun/dc/pr/PathStroker$1 -sun/font/AttributeValues -sun/font/CMap -sun/font/CMap$CMapFormat12 -sun/font/CMap$NullCMapClass -sun/font/CharToGlyphMapper -sun/font/CompositeFont -sun/font/CompositeFontDescriptor -sun/font/CompositeGlyphMapper -sun/font/CompositeStrike -sun/font/CoreMetrics -sun/font/EAttribute -sun/font/FcFontConfiguration -sun/font/FileFont -sun/font/FileFontStrike -sun/font/Font2D -sun/font/Font2DHandle -sun/font/FontAccess -sun/font/FontConfigManager -sun/font/FontConfigManager$FcCompFont -sun/font/FontConfigManager$FontConfigFont -sun/font/FontConfigManager$FontConfigInfo -sun/font/FontDesignMetrics -sun/font/FontDesignMetrics$KeyReference -sun/font/FontDesignMetrics$MetricsKey -sun/font/FontFamily -sun/font/FontLineMetrics -sun/font/FontManager -sun/font/FontManagerFactory -sun/font/FontManagerFactory$1 -sun/font/FontManagerForSGE -sun/font/FontManagerNativeLibrary -sun/font/FontManagerNativeLibrary$1 -sun/font/FontScaler -sun/font/FontStrike -sun/font/FontStrikeDesc -sun/font/FontStrikeDisposer -sun/font/FontUtilities -sun/font/FontUtilities$1 -sun/font/GlyphList -sun/font/PhysicalFont -sun/font/PhysicalStrike -sun/font/StandardGlyphVector -sun/font/StandardGlyphVector$GlyphStrike -sun/font/StrikeCache -sun/font/StrikeCache$1 -sun/font/StrikeCache$DisposableStrike -sun/font/StrikeCache$SoftDisposerRef -sun/font/StrikeMetrics -sun/font/SunFontManager -sun/font/SunFontManager$1 -sun/font/SunFontManager$11 -sun/font/SunFontManager$2 -sun/font/SunFontManager$3 -sun/font/SunFontManager$FontRegistrationInfo -sun/font/SunFontManager$T1Filter -sun/font/SunFontManager$TTFilter -sun/font/T2KFontScaler -sun/font/T2KFontScaler$1 -sun/font/TrueTypeFont -sun/font/TrueTypeFont$1 -sun/font/TrueTypeFont$DirectoryEntry -sun/font/TrueTypeFont$TTDisposerRecord -sun/font/TrueTypeGlyphMapper -sun/font/Type1Font -sun/font/Type1Font$1 -sun/font/X11TextRenderer -sun/java2d/BackBufferCapsProvider -sun/java2d/DefaultDisposerRecord -sun/java2d/DestSurfaceProvider -sun/java2d/Disposer -sun/java2d/Disposer$1 -sun/java2d/Disposer$2 -sun/java2d/Disposer$PollDisposable -sun/java2d/DisposerRecord -sun/java2d/DisposerTarget -sun/java2d/FontSupport -sun/java2d/InvalidPipeException -sun/java2d/NullSurfaceData -sun/java2d/StateTrackable -sun/java2d/StateTrackable$State -sun/java2d/StateTrackableDelegate -sun/java2d/StateTrackableDelegate$2 -sun/java2d/SunGraphics2D -sun/java2d/SunGraphicsEnvironment -sun/java2d/SunGraphicsEnvironment$1 -sun/java2d/Surface -sun/java2d/SurfaceData -sun/java2d/SurfaceData$PixelToPgramLoopConverter -sun/java2d/SurfaceData$PixelToShapeLoopConverter -sun/java2d/SurfaceManagerFactory -sun/java2d/UnixSurfaceManagerFactory -sun/java2d/cmm/CMSManager -sun/java2d/cmm/ProfileActivator -sun/java2d/cmm/ProfileDeferralInfo -sun/java2d/cmm/ProfileDeferralMgr -sun/java2d/loops/Blit -sun/java2d/loops/BlitBg -sun/java2d/loops/CompositeType -sun/java2d/loops/CustomComponent -sun/java2d/loops/DrawGlyphList -sun/java2d/loops/DrawGlyphListAA -sun/java2d/loops/DrawGlyphListLCD -sun/java2d/loops/DrawLine -sun/java2d/loops/DrawParallelogram -sun/java2d/loops/DrawPath -sun/java2d/loops/DrawPolygons -sun/java2d/loops/DrawRect -sun/java2d/loops/FillParallelogram -sun/java2d/loops/FillPath -sun/java2d/loops/FillRect -sun/java2d/loops/FillSpans -sun/java2d/loops/FontInfo -sun/java2d/loops/GeneralRenderer -sun/java2d/loops/GraphicsPrimitive -sun/java2d/loops/GraphicsPrimitiveMgr -sun/java2d/loops/GraphicsPrimitiveMgr$1 -sun/java2d/loops/GraphicsPrimitiveMgr$2 -sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec -sun/java2d/loops/GraphicsPrimitiveProxy -sun/java2d/loops/MaskBlit -sun/java2d/loops/MaskFill -sun/java2d/loops/RenderCache -sun/java2d/loops/RenderCache$Entry -sun/java2d/loops/RenderLoops -sun/java2d/loops/ScaledBlit -sun/java2d/loops/SurfaceType -sun/java2d/loops/TransformHelper -sun/java2d/loops/XORComposite -sun/java2d/opengl/GLXGraphicsConfig -sun/java2d/opengl/OGLGraphicsConfig -sun/java2d/pipe/AAShapePipe -sun/java2d/pipe/AATextRenderer -sun/java2d/pipe/AlphaColorPipe -sun/java2d/pipe/AlphaPaintPipe -sun/java2d/pipe/CompositePipe -sun/java2d/pipe/DrawImage -sun/java2d/pipe/DrawImagePipe -sun/java2d/pipe/GeneralCompositePipe -sun/java2d/pipe/GlyphListLoopPipe -sun/java2d/pipe/GlyphListPipe -sun/java2d/pipe/LCDTextRenderer -sun/java2d/pipe/LoopBasedPipe -sun/java2d/pipe/LoopPipe -sun/java2d/pipe/NullPipe -sun/java2d/pipe/OutlineTextRenderer -sun/java2d/pipe/ParallelogramPipe -sun/java2d/pipe/PixelDrawPipe -sun/java2d/pipe/PixelFillPipe -sun/java2d/pipe/PixelToParallelogramConverter -sun/java2d/pipe/PixelToShapeConverter -sun/java2d/pipe/Region -sun/java2d/pipe/Region$ImmutableRegion -sun/java2d/pipe/RegionIterator -sun/java2d/pipe/RenderingEngine -sun/java2d/pipe/RenderingEngine$1 -sun/java2d/pipe/ShapeDrawPipe -sun/java2d/pipe/ShapeSpanIterator -sun/java2d/pipe/SolidTextRenderer -sun/java2d/pipe/SpanClipRenderer -sun/java2d/pipe/SpanIterator -sun/java2d/pipe/SpanShapeRenderer -sun/java2d/pipe/SpanShapeRenderer$Composite -sun/java2d/pipe/TextPipe -sun/java2d/pipe/TextRenderer -sun/java2d/pipe/ValidatePipe -sun/java2d/pipe/hw/AccelGraphicsConfig -sun/java2d/pipe/hw/BufferedContextProvider -sun/java2d/x11/X11Renderer -sun/java2d/x11/X11SurfaceData -sun/java2d/x11/X11SurfaceData$LazyPipe -sun/java2d/x11/X11SurfaceData$X11WindowSurfaceData -sun/java2d/x11/X11VolatileSurfaceManager -sun/java2d/x11/XSurfaceData -sun/java2d/xr/XRGraphicsConfig -sun/launcher/LauncherHelper -sun/launcher/LauncherHelper$FXHelper -sun/misc/ASCIICaseInsensitiveComparator -sun/misc/Cleaner -sun/misc/CompoundEnumeration -sun/misc/ExtensionDependency -sun/misc/FDBigInteger -sun/misc/FileURLMapper -sun/misc/FloatingDecimal -sun/misc/FloatingDecimal$1 -sun/misc/FloatingDecimal$ASCIIToBinaryBuffer -sun/misc/FloatingDecimal$ASCIIToBinaryConverter -sun/misc/FloatingDecimal$BinaryToASCIIBuffer -sun/misc/FloatingDecimal$BinaryToASCIIConverter -sun/misc/FloatingDecimal$ExceptionalBinaryToASCIIBuffer -sun/misc/FloatingDecimal$PreparedASCIIToBinaryBuffer -sun/misc/IOUtils -sun/misc/JarIndex -sun/misc/JavaAWTAccess -sun/misc/JavaIOFileDescriptorAccess -sun/misc/JavaLangAccess -sun/misc/JavaNetAccess -sun/misc/JavaNioAccess -sun/misc/JavaSecurityAccess -sun/misc/JavaSecurityProtectionDomainAccess -sun/misc/JavaUtilJarAccess -sun/misc/JavaUtilZipFileAccess -sun/misc/Launcher -sun/misc/Launcher$AppClassLoader -sun/misc/Launcher$AppClassLoader$1 -sun/misc/Launcher$BootClassPathHolder -sun/misc/Launcher$BootClassPathHolder$1 -sun/misc/Launcher$ExtClassLoader -sun/misc/Launcher$ExtClassLoader$1 -sun/misc/Launcher$Factory -sun/misc/MetaIndex -sun/misc/NativeSignalHandler -sun/misc/OSEnvironment -sun/misc/Perf -sun/misc/Perf$GetPerfAction -sun/misc/PerfCounter -sun/misc/PerfCounter$CoreCounters -sun/misc/PerformanceLogger -sun/misc/PerformanceLogger$TimeData -sun/misc/PostVMInitHook -sun/misc/Resource -sun/misc/SharedSecrets -sun/misc/Signal -sun/misc/SignalHandler -sun/misc/SoftCache -sun/misc/SoftCache$ValueCell -sun/misc/URLClassPath -sun/misc/URLClassPath$1 -sun/misc/URLClassPath$2 -sun/misc/URLClassPath$3 -sun/misc/URLClassPath$FileLoader -sun/misc/URLClassPath$JarLoader -sun/misc/URLClassPath$JarLoader$1 -sun/misc/URLClassPath$JarLoader$2 -sun/misc/URLClassPath$Loader -sun/misc/Unsafe -sun/misc/VM -sun/misc/Version -sun/net/DefaultProgressMeteringPolicy -sun/net/InetAddressCachePolicy -sun/net/InetAddressCachePolicy$1 -sun/net/InetAddressCachePolicy$2 -sun/net/NetHooks -sun/net/NetHooks$Provider -sun/net/NetProperties -sun/net/NetProperties$1 -sun/net/ProgressMeteringPolicy -sun/net/ProgressMonitor -sun/net/ResourceManager -sun/net/sdp/SdpProvider -sun/net/spi/DefaultProxySelector -sun/net/spi/DefaultProxySelector$1 -sun/net/spi/DefaultProxySelector$3 -sun/net/spi/DefaultProxySelector$NonProxyInfo -sun/net/spi/nameservice/NameService -sun/net/util/IPAddressUtil -sun/net/util/URLUtil -sun/net/www/MessageHeader -sun/net/www/MimeEntry -sun/net/www/MimeTable -sun/net/www/MimeTable$1 -sun/net/www/MimeTable$DefaultInstanceHolder -sun/net/www/MimeTable$DefaultInstanceHolder$1 -sun/net/www/ParseUtil -sun/net/www/URLConnection -sun/net/www/protocol/file/FileURLConnection -sun/net/www/protocol/file/Handler -sun/net/www/protocol/http/Handler -sun/net/www/protocol/jar/Handler -sun/net/www/protocol/jar/JarFileFactory -sun/net/www/protocol/jar/JarURLConnection -sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream -sun/net/www/protocol/jar/URLJarFile -sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController -sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry -sun/nio/ByteBuffered -sun/nio/ch/DirectBuffer -sun/nio/ch/FileChannelImpl -sun/nio/ch/FileChannelImpl$Unmapper -sun/nio/ch/FileDispatcher -sun/nio/ch/FileDispatcherImpl -sun/nio/ch/IOStatus -sun/nio/ch/IOUtil -sun/nio/ch/IOUtil$1 -sun/nio/ch/Interruptible -sun/nio/ch/NativeDispatcher -sun/nio/ch/NativeThread -sun/nio/ch/NativeThreadSet -sun/nio/ch/Util -sun/nio/ch/Util$1 -sun/nio/ch/Util$4 -sun/nio/ch/Util$BufferCache -sun/nio/cs/ArrayDecoder -sun/nio/cs/ArrayEncoder -sun/nio/cs/FastCharsetProvider -sun/nio/cs/HistoricallyNamedCharset -sun/nio/cs/ISO_8859_1 -sun/nio/cs/ISO_8859_1$Encoder -sun/nio/cs/StandardCharsets -sun/nio/cs/StandardCharsets$Aliases -sun/nio/cs/StandardCharsets$Cache -sun/nio/cs/StandardCharsets$Classes -sun/nio/cs/StreamDecoder -sun/nio/cs/StreamEncoder -sun/nio/cs/Surrogate -sun/nio/cs/Surrogate$Parser -sun/nio/cs/US_ASCII -sun/nio/cs/US_ASCII$Decoder -sun/nio/cs/UTF_16 -sun/nio/cs/UTF_16$Decoder -sun/nio/cs/UTF_16BE -sun/nio/cs/UTF_16LE -sun/nio/cs/UTF_8 -sun/nio/cs/UTF_8$Decoder -sun/nio/cs/UTF_8$Encoder -sun/nio/cs/Unicode -sun/nio/cs/UnicodeDecoder -sun/print/PrinterGraphicsConfig -sun/reflect/AccessorGenerator -sun/reflect/BootstrapConstructorAccessorImpl -sun/reflect/ByteVector -sun/reflect/ByteVectorFactory -sun/reflect/ByteVectorImpl -sun/reflect/CallerSensitive -sun/reflect/ClassDefiner -sun/reflect/ClassDefiner$1 -sun/reflect/ClassFileAssembler -sun/reflect/ClassFileConstants -sun/reflect/ConstantPool -sun/reflect/ConstructorAccessor -sun/reflect/ConstructorAccessorImpl -sun/reflect/DelegatingClassLoader -sun/reflect/DelegatingConstructorAccessorImpl -sun/reflect/DelegatingMethodAccessorImpl -sun/reflect/FieldAccessor -sun/reflect/FieldAccessorImpl -sun/reflect/Label -sun/reflect/Label$PatchInfo -sun/reflect/LangReflectAccess -sun/reflect/MagicAccessorImpl -sun/reflect/MethodAccessor -sun/reflect/MethodAccessorGenerator -sun/reflect/MethodAccessorGenerator$1 -sun/reflect/MethodAccessorImpl -sun/reflect/NativeConstructorAccessorImpl -sun/reflect/NativeMethodAccessorImpl -sun/reflect/Reflection -sun/reflect/ReflectionFactory -sun/reflect/ReflectionFactory$1 -sun/reflect/ReflectionFactory$GetReflectionFactoryAction -sun/reflect/SerializationConstructorAccessorImpl -sun/reflect/UTF8 -sun/reflect/UnsafeFieldAccessorFactory -sun/reflect/UnsafeFieldAccessorImpl -sun/reflect/UnsafeObjectFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl -sun/reflect/UnsafeStaticFieldAccessorImpl -sun/reflect/annotation/AnnotationType -sun/reflect/generics/repository/AbstractRepository -sun/reflect/generics/repository/ClassRepository -sun/reflect/generics/repository/GenericDeclRepository -sun/reflect/misc/MethodUtil -sun/reflect/misc/MethodUtil$1 -sun/reflect/misc/ReflectUtil -sun/security/action/GetBooleanAction -sun/security/action/GetIntegerAction -sun/security/action/GetPropertyAction -sun/security/jca/GetInstance -sun/security/jca/GetInstance$Instance -sun/security/jca/ProviderConfig -sun/security/jca/ProviderConfig$2 -sun/security/jca/ProviderList -sun/security/jca/ProviderList$1 -sun/security/jca/ProviderList$2 -sun/security/jca/ProviderList$3 -sun/security/jca/ProviderList$ServiceList -sun/security/jca/ProviderList$ServiceList$1 -sun/security/jca/Providers -sun/security/jca/ServiceId -sun/security/provider/ByteArrayAccess -sun/security/provider/DSA -sun/security/provider/DSA$LegacyDSA -sun/security/provider/DSA$SHA1withDSA -sun/security/provider/DSAParameters -sun/security/provider/DSAPublicKey -sun/security/provider/DigestBase -sun/security/provider/NativePRNG -sun/security/provider/NativePRNG$1 -sun/security/provider/NativePRNG$2 -sun/security/provider/NativePRNG$Blocking -sun/security/provider/NativePRNG$NonBlocking -sun/security/provider/NativePRNG$RandomIO -sun/security/provider/NativePRNG$Variant -sun/security/provider/SHA -sun/security/provider/Sun -sun/security/provider/SunEntries -sun/security/provider/SunEntries$1 -sun/security/util/BitArray -sun/security/util/ByteArrayLexOrder -sun/security/util/Debug -sun/security/util/DerEncoder -sun/security/util/DerIndefLenConverter -sun/security/util/DerInputBuffer -sun/security/util/DerInputStream -sun/security/util/DerOutputStream -sun/security/util/DerValue -sun/security/util/ManifestEntryVerifier -sun/security/util/ObjectIdentifier -sun/security/util/SignatureFileVerifier -sun/security/x509/AlgorithmId -sun/security/x509/X509Key -sun/swing/DefaultLookup -sun/swing/ImageIconUIResource -sun/swing/JLightweightFrame -sun/swing/MenuItemLayoutHelper -sun/swing/MenuItemLayoutHelper$ColumnAlignment -sun/swing/MenuItemLayoutHelper$LayoutResult -sun/swing/MenuItemLayoutHelper$RectSize -sun/swing/PrintColorUIResource -sun/swing/StringUIClientPropertyKey -sun/swing/SwingAccessor -sun/swing/SwingAccessor$JTextComponentAccessor -sun/swing/SwingLazyValue -sun/swing/SwingLazyValue$1 -sun/swing/SwingUtilities2 -sun/swing/SwingUtilities2$2 -sun/swing/SwingUtilities2$AATextInfo -sun/swing/SwingUtilities2$LSBCacheEntry -sun/swing/UIAction -sun/swing/UIClientPropertyKey -sun/swing/table/DefaultTableCellHeaderRenderer -sun/swing/table/DefaultTableCellHeaderRenderer$EmptyIcon -sun/text/ComposedCharIter -sun/text/IntHashtable -sun/text/UCompactIntArray -sun/text/normalizer/CharTrie -sun/text/normalizer/CharTrie$FriendAgent -sun/text/normalizer/ICUBinary -sun/text/normalizer/ICUBinary$Authenticate -sun/text/normalizer/ICUData -sun/text/normalizer/IntTrie -sun/text/normalizer/NormalizerDataReader -sun/text/normalizer/NormalizerImpl -sun/text/normalizer/NormalizerImpl$AuxTrieImpl -sun/text/normalizer/NormalizerImpl$DecomposeArgs -sun/text/normalizer/NormalizerImpl$FCDTrieImpl -sun/text/normalizer/NormalizerImpl$NormTrieImpl -sun/text/normalizer/Trie -sun/text/normalizer/Trie$DataManipulate -sun/text/normalizer/UTF16 -sun/text/normalizer/UnicodeMatcher -sun/text/normalizer/UnicodeSet -sun/text/resources/CollationData -sun/text/resources/FormatData -sun/text/resources/en/FormatData_en -sun/text/resources/en/FormatData_en_US -sun/util/CoreResourceBundleControl -sun/util/PreHashedMap -sun/util/ResourceBundleEnumeration -sun/util/calendar/AbstractCalendar -sun/util/calendar/BaseCalendar -sun/util/calendar/BaseCalendar$Date -sun/util/calendar/CalendarDate -sun/util/calendar/CalendarSystem -sun/util/calendar/CalendarUtils -sun/util/calendar/Gregorian -sun/util/calendar/Gregorian$Date -sun/util/calendar/ZoneInfo -sun/util/calendar/ZoneInfoFile -sun/util/calendar/ZoneInfoFile$1 -sun/util/calendar/ZoneInfoFile$Checksum -sun/util/calendar/ZoneInfoFile$ZoneOffsetTransitionRule -sun/util/locale/BaseLocale -sun/util/locale/BaseLocale$Cache -sun/util/locale/BaseLocale$Key -sun/util/locale/LanguageTag -sun/util/locale/LocaleObjectCache -sun/util/locale/LocaleObjectCache$CacheEntry -sun/util/locale/LocaleUtils -sun/util/locale/provider/AuxLocaleProviderAdapter -sun/util/locale/provider/AuxLocaleProviderAdapter$NullProvider -sun/util/locale/provider/AvailableLanguageTags -sun/util/locale/provider/CalendarDataProviderImpl -sun/util/locale/provider/CalendarDataUtility -sun/util/locale/provider/CalendarDataUtility$CalendarWeekParameterGetter -sun/util/locale/provider/CalendarProviderImpl -sun/util/locale/provider/CollatorProviderImpl -sun/util/locale/provider/CurrencyNameProviderImpl -sun/util/locale/provider/DateFormatSymbolsProviderImpl -sun/util/locale/provider/DecimalFormatSymbolsProviderImpl -sun/util/locale/provider/JRELocaleProviderAdapter -sun/util/locale/provider/JRELocaleProviderAdapter$1 -sun/util/locale/provider/LocaleDataMetaInfo -sun/util/locale/provider/LocaleProviderAdapter -sun/util/locale/provider/LocaleProviderAdapter$1 -sun/util/locale/provider/LocaleProviderAdapter$Type -sun/util/locale/provider/LocaleResources -sun/util/locale/provider/LocaleResources$ResourceReference -sun/util/locale/provider/LocaleServiceProviderPool -sun/util/locale/provider/LocaleServiceProviderPool$LocalizedObjectGetter -sun/util/locale/provider/NumberFormatProviderImpl -sun/util/locale/provider/ResourceBundleBasedAdapter -sun/util/locale/provider/SPILocaleProviderAdapter -sun/util/locale/provider/SPILocaleProviderAdapter$1 -sun/util/locale/provider/TimeZoneNameProviderImpl -sun/util/locale/provider/TimeZoneNameUtility -sun/util/locale/provider/TimeZoneNameUtility$TimeZoneNameGetter -sun/util/logging/LoggingProxy -sun/util/logging/LoggingSupport -sun/util/logging/LoggingSupport$1 -sun/util/logging/LoggingSupport$2 -sun/util/logging/PlatformLogger -sun/util/logging/PlatformLogger$1 -sun/util/logging/PlatformLogger$DefaultLoggerProxy -sun/util/logging/PlatformLogger$JavaLoggerProxy -sun/util/logging/PlatformLogger$Level -sun/util/logging/PlatformLogger$LoggerProxy -sun/util/logging/resources/logging -sun/util/resources/CalendarData -sun/util/resources/CurrencyNames -sun/util/resources/LocaleData -sun/util/resources/LocaleData$1 -sun/util/resources/LocaleData$LocaleDataResourceBundleControl -sun/util/resources/LocaleNamesBundle -sun/util/resources/OpenListResourceBundle -sun/util/resources/ParallelListResourceBundle -sun/util/resources/ParallelListResourceBundle$KeySet -sun/util/resources/TimeZoneNames -sun/util/resources/TimeZoneNamesBundle -sun/util/resources/en/CalendarData_en -sun/util/resources/en/CurrencyNames_en_US -sun/util/resources/en/TimeZoneNames_en -sun/util/spi/CalendarProvider -# e4fe875988768cf5 diff --git a/jdk/make/data/classlist/classlist.macosx b/jdk/make/data/classlist/classlist.macosx deleted file mode 100644 index 6f854b45e39..00000000000 --- a/jdk/make/data/classlist/classlist.macosx +++ /dev/null @@ -1,2208 +0,0 @@ -apple/laf/JRSUIConstants -apple/laf/JRSUIConstants$AlignmentHorizontal -apple/laf/JRSUIConstants$AlignmentVertical -apple/laf/JRSUIConstants$Animating -apple/laf/JRSUIConstants$DoubleValue -apple/laf/JRSUIConstants$Focused -apple/laf/JRSUIConstants$FrameOnly -apple/laf/JRSUIConstants$Hit -apple/laf/JRSUIConstants$IndicatorOnly -apple/laf/JRSUIConstants$Key -apple/laf/JRSUIConstants$NothingToScroll -apple/laf/JRSUIConstants$Orientation -apple/laf/JRSUIConstants$Property -apple/laf/JRSUIConstants$PropertyEncoding -apple/laf/JRSUIConstants$ScrollBarPart -apple/laf/JRSUIConstants$SegmentPosition -apple/laf/JRSUIConstants$SegmentTrailingSeparator -apple/laf/JRSUIConstants$ShowArrows -apple/laf/JRSUIConstants$Size -apple/laf/JRSUIConstants$State -apple/laf/JRSUIConstants$Widget -apple/laf/JRSUIControl -apple/laf/JRSUIControl$BufferState -apple/laf/JRSUIControl$ThreadLocalByteBuffer -apple/laf/JRSUIState -apple/laf/JRSUIState$ScrollBarState -apple/laf/JRSUIState$ValueState -apple/laf/JRSUIStateFactory -apple/laf/JRSUIUtils -apple/laf/JRSUIUtils$NineSliceMetricsProvider -apple/laf/JRSUIUtils$TabbedPane -com/apple/eawt/AboutHandler -com/apple/eawt/AppEventListener -com/apple/eawt/AppReOpenedListener -com/apple/eawt/OpenFilesHandler -com/apple/eawt/PreferencesHandler -com/apple/eawt/PrintFilesHandler -com/apple/eawt/QuitHandler -com/apple/eawt/QuitStrategy -com/apple/eawt/_AppEventHandler -com/apple/eawt/_AppEventHandler$_AboutDispatcher -com/apple/eawt/_AppEventHandler$_AppEventDispatcher -com/apple/eawt/_AppEventHandler$_AppEventMultiplexor -com/apple/eawt/_AppEventHandler$_AppForegroundDispatcher -com/apple/eawt/_AppEventHandler$_AppReOpenedDispatcher -com/apple/eawt/_AppEventHandler$_BooleanAppEventMultiplexor -com/apple/eawt/_AppEventHandler$_HiddenAppDispatcher -com/apple/eawt/_AppEventHandler$_NativeEvent -com/apple/eawt/_AppEventHandler$_OpenAppDispatcher -com/apple/eawt/_AppEventHandler$_OpenFileDispatcher -com/apple/eawt/_AppEventHandler$_OpenURIDispatcher -com/apple/eawt/_AppEventHandler$_PreferencesDispatcher -com/apple/eawt/_AppEventHandler$_PrintFileDispatcher -com/apple/eawt/_AppEventHandler$_QueuingAppEventDispatcher -com/apple/eawt/_AppEventHandler$_QuitDispatcher -com/apple/eawt/_AppEventHandler$_ScreenSleepDispatcher -com/apple/eawt/_AppEventHandler$_SystemSleepDispatcher -com/apple/eawt/_AppEventHandler$_UserSessionDispatcher -com/apple/eawt/_AppEventLegacyHandler -com/apple/eawt/_AppMenuBarHandler -com/apple/eawt/_OpenAppHandler -com/apple/laf/AquaBorder -com/apple/laf/AquaButtonBorder -com/apple/laf/AquaButtonBorder$1 -com/apple/laf/AquaButtonBorder$Dynamic -com/apple/laf/AquaButtonBorder$Dynamic$1 -com/apple/laf/AquaButtonBorder$Named -com/apple/laf/AquaButtonBorder$Toggle -com/apple/laf/AquaButtonBorder$Toolbar -com/apple/laf/AquaButtonExtendedTypes -com/apple/laf/AquaButtonExtendedTypes$1 -com/apple/laf/AquaButtonExtendedTypes$2 -com/apple/laf/AquaButtonExtendedTypes$3 -com/apple/laf/AquaButtonExtendedTypes$4 -com/apple/laf/AquaButtonExtendedTypes$5 -com/apple/laf/AquaButtonExtendedTypes$6 -com/apple/laf/AquaButtonExtendedTypes$7 -com/apple/laf/AquaButtonExtendedTypes$8 -com/apple/laf/AquaButtonExtendedTypes$BorderDefinedTypeSpecifier -com/apple/laf/AquaButtonExtendedTypes$BorderDefinedTypeSpecifier$1 -com/apple/laf/AquaButtonExtendedTypes$SegmentedBorderDefinedTypeSpecifier -com/apple/laf/AquaButtonExtendedTypes$SegmentedNamedBorder -com/apple/laf/AquaButtonExtendedTypes$TypeSpecifier -com/apple/laf/AquaButtonToggleUI -com/apple/laf/AquaButtonUI -com/apple/laf/AquaButtonUI$AquaButtonListener -com/apple/laf/AquaButtonUI$AquaHierarchyButtonListener -com/apple/laf/AquaCaret -com/apple/laf/AquaComboBoxButton -com/apple/laf/AquaComboBoxButton$1 -com/apple/laf/AquaComboBoxPopup -com/apple/laf/AquaComboBoxPopup$1 -com/apple/laf/AquaComboBoxRenderer -com/apple/laf/AquaComboBoxRendererInternal -com/apple/laf/AquaComboBoxUI -com/apple/laf/AquaComboBoxUI$1 -com/apple/laf/AquaComboBoxUI$10 -com/apple/laf/AquaComboBoxUI$11 -com/apple/laf/AquaComboBoxUI$12 -com/apple/laf/AquaComboBoxUI$12$1 -com/apple/laf/AquaComboBoxUI$12$2 -com/apple/laf/AquaComboBoxUI$12$3 -com/apple/laf/AquaComboBoxUI$12$4 -com/apple/laf/AquaComboBoxUI$12$5 -com/apple/laf/AquaComboBoxUI$12$6 -com/apple/laf/AquaComboBoxUI$12$7 -com/apple/laf/AquaComboBoxUI$2 -com/apple/laf/AquaComboBoxUI$3 -com/apple/laf/AquaComboBoxUI$4 -com/apple/laf/AquaComboBoxUI$5 -com/apple/laf/AquaComboBoxUI$6 -com/apple/laf/AquaComboBoxUI$7 -com/apple/laf/AquaComboBoxUI$8 -com/apple/laf/AquaComboBoxUI$9 -com/apple/laf/AquaComboBoxUI$AquaComboBoxEditor -com/apple/laf/AquaComboBoxUI$AquaComboBoxLayoutManager -com/apple/laf/AquaComboBoxUI$AquaCustomComboTextField -com/apple/laf/AquaComboBoxUI$AquaCustomComboTextField$1 -com/apple/laf/AquaComboBoxUI$ComboBoxAction -com/apple/laf/AquaFocusHandler -com/apple/laf/AquaFocusHandler$1 -com/apple/laf/AquaFonts -com/apple/laf/AquaFonts$1 -com/apple/laf/AquaFonts$2 -com/apple/laf/AquaFonts$3 -com/apple/laf/AquaFonts$4 -com/apple/laf/AquaFonts$5 -com/apple/laf/AquaFonts$6 -com/apple/laf/AquaFonts$7 -com/apple/laf/AquaFonts$DerivedUIResourceFont -com/apple/laf/AquaHighlighter -com/apple/laf/AquaHighlighter$1 -com/apple/laf/AquaHighlighter$AquaHighlightPainter -com/apple/laf/AquaIcon$CachingScalingIcon -com/apple/laf/AquaIcon$InvertableIcon -com/apple/laf/AquaIcon$SystemIcon -com/apple/laf/AquaIcon$SystemIconSingleton -com/apple/laf/AquaIcon$SystemIconUIResourceSingleton -com/apple/laf/AquaImageFactory -com/apple/laf/AquaImageFactory$IconUIResourceSingleton -com/apple/laf/AquaImageFactory$InvertableImageIcon -com/apple/laf/AquaImageFactory$NamedImageSingleton -com/apple/laf/AquaImageFactory$SystemColorProxy -com/apple/laf/AquaKeyBindings -com/apple/laf/AquaKeyBindings$AquaMultilineAction -com/apple/laf/AquaKeyBindings$BindingsProvider -com/apple/laf/AquaKeyBindings$LateBoundInputMap -com/apple/laf/AquaKeyBindings$SimpleBinding -com/apple/laf/AquaLabelUI -com/apple/laf/AquaListUI -com/apple/laf/AquaListUI$AquaHomeEndAction -com/apple/laf/AquaListUI$AquaPropertyChangeHandler -com/apple/laf/AquaListUI$FocusHandler -com/apple/laf/AquaListUI$MouseInputHandler -com/apple/laf/AquaLookAndFeel -com/apple/laf/AquaLookAndFeel$1 -com/apple/laf/AquaLookAndFeel$2 -com/apple/laf/AquaLookAndFeel$3 -com/apple/laf/AquaMenuBarBorder -com/apple/laf/AquaMenuBarUI -com/apple/laf/AquaMenuBorder -com/apple/laf/AquaMenuItemUI -com/apple/laf/AquaMenuItemUI$IndeterminateListener -com/apple/laf/AquaMenuPainter -com/apple/laf/AquaMenuPainter$Client -com/apple/laf/AquaMenuPainter$RecyclableBorder -com/apple/laf/AquaMenuUI -com/apple/laf/AquaMenuUI$AquaMouseInputHandler -com/apple/laf/AquaMenuUI$MenuDragMouseHandler -com/apple/laf/AquaMnemonicHandler -com/apple/laf/AquaMnemonicHandler$AltProcessor -com/apple/laf/AquaPainter -com/apple/laf/AquaPainter$1 -com/apple/laf/AquaPainter$AquaNineSlicingImagePainter -com/apple/laf/AquaPainter$AquaSingleImagePainter -com/apple/laf/AquaPanelUI -com/apple/laf/AquaPopupMenuSeparatorUI -com/apple/laf/AquaPopupMenuUI -com/apple/laf/AquaRootPaneUI -com/apple/laf/AquaScrollBarUI -com/apple/laf/AquaScrollBarUI$1 -com/apple/laf/AquaScrollBarUI$ModelListener -com/apple/laf/AquaScrollBarUI$PropertyChangeHandler -com/apple/laf/AquaScrollBarUI$ScrollListener -com/apple/laf/AquaScrollBarUI$TrackListener -com/apple/laf/AquaScrollPaneUI -com/apple/laf/AquaScrollPaneUI$XYMouseWheelHandler -com/apple/laf/AquaScrollRegionBorder -com/apple/laf/AquaTableHeaderBorder -com/apple/laf/AquaTableHeaderBorder$1 -com/apple/laf/AquaTextAreaUI -com/apple/laf/AquaTextFieldBorder -com/apple/laf/AquaTextFieldSearch -com/apple/laf/AquaTextFieldSearch$SearchFieldBorder -com/apple/laf/AquaTextFieldSearch$SearchFieldPropertyListener -com/apple/laf/AquaTextFieldUI -com/apple/laf/AquaToolBarSeparatorUI -com/apple/laf/AquaToolBarUI -com/apple/laf/AquaToolBarUI$ToolBarBorder -com/apple/laf/AquaUtilControlSize -com/apple/laf/AquaUtilControlSize$PropertySizeListener -com/apple/laf/AquaUtilControlSize$SizeDescriptor -com/apple/laf/AquaUtilControlSize$SizeVariant -com/apple/laf/AquaUtilControlSize$Sizeable -com/apple/laf/AquaUtils -com/apple/laf/AquaUtils$2 -com/apple/laf/AquaUtils$5 -com/apple/laf/AquaUtils$6 -com/apple/laf/AquaUtils$JComponentPainter -com/apple/laf/AquaUtils$RecyclableSingleton -com/apple/laf/AquaUtils$RecyclableSingletonFromDefaultConstructor -com/apple/laf/ClientPropertyApplicator -com/apple/laf/ClientPropertyApplicator$Property -com/apple/laf/ImageCache -com/apple/laf/ImageCache$1 -com/apple/laf/ImageCache$PixelCountSoftReference -com/apple/laf/ScreenMenuBar -com/apple/laf/ScreenMenuBarProvider -com/apple/laf/ScreenMenuPropertyHandler -com/apple/laf/ScreenPopupFactory -com/apple/laf/ScreenPopupFactory$1 -com/apple/laf/resources/aqua -com/sun/java/swing/SwingUtilities3 -com/sun/swing/internal/plaf/basic/resources/basic -java/applet/Applet -java/awt/AWTEvent -java/awt/AWTEvent$1 -java/awt/AWTEvent$2 -java/awt/AWTEventMulticaster -java/awt/AWTKeyStroke -java/awt/AWTKeyStroke$1 -java/awt/ActiveEvent -java/awt/Adjustable -java/awt/AlphaComposite -java/awt/BasicStroke -java/awt/BorderLayout -java/awt/Canvas -java/awt/CardLayout -java/awt/Color -java/awt/Component -java/awt/Component$1 -java/awt/Component$3 -java/awt/Component$AWTTreeLock -java/awt/Component$DummyRequestFocusController -java/awt/ComponentOrientation -java/awt/Composite -java/awt/Conditional -java/awt/Container -java/awt/Container$1 -java/awt/Container$EventTargetFilter -java/awt/Container$MouseEventTargetFilter -java/awt/ContainerOrderFocusTraversalPolicy -java/awt/Cursor -java/awt/Cursor$1 -java/awt/DefaultFocusTraversalPolicy -java/awt/DefaultKeyboardFocusManager -java/awt/DefaultKeyboardFocusManager$1 -java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent -java/awt/DefaultKeyboardFocusManager$TypeAheadMarker -java/awt/Dialog -java/awt/Dialog$1 -java/awt/Dialog$3 -java/awt/Dialog$ModalExclusionType -java/awt/Dialog$ModalityType -java/awt/Dimension -java/awt/Event -java/awt/EventDispatchThread -java/awt/EventDispatchThread$1 -java/awt/EventDispatchThread$HierarchyEventFilter -java/awt/EventFilter -java/awt/EventFilter$FilterAction -java/awt/EventQueue -java/awt/EventQueue$1 -java/awt/EventQueue$2 -java/awt/EventQueue$3 -java/awt/EventQueue$4 -java/awt/EventQueue$5 -java/awt/FlowLayout -java/awt/FocusTraversalPolicy -java/awt/Font -java/awt/Font$FontAccessImpl -java/awt/FontMetrics -java/awt/Frame -java/awt/Frame$1 -java/awt/Graphics -java/awt/Graphics2D -java/awt/GraphicsCallback -java/awt/GraphicsCallback$PaintCallback -java/awt/GraphicsConfiguration -java/awt/GraphicsDevice -java/awt/GraphicsEnvironment -java/awt/GraphicsEnvironment$1 -java/awt/Image -java/awt/Image$1 -java/awt/ImageCapabilities -java/awt/ImageMediaEntry -java/awt/Insets -java/awt/ItemSelectable -java/awt/KeyEventDispatcher -java/awt/KeyEventPostProcessor -java/awt/KeyboardFocusManager -java/awt/KeyboardFocusManager$1 -java/awt/KeyboardFocusManager$2 -java/awt/KeyboardFocusManager$3 -java/awt/KeyboardFocusManager$HeavyweightFocusRequest -java/awt/KeyboardFocusManager$LightweightFocusRequest -java/awt/Label -java/awt/LayoutManager -java/awt/LayoutManager2 -java/awt/LightweightDispatcher -java/awt/LightweightDispatcher$1 -java/awt/LightweightDispatcher$2 -java/awt/MediaEntry -java/awt/MediaTracker -java/awt/MenuBar -java/awt/MenuComponent -java/awt/MenuContainer -java/awt/ModalEventFilter -java/awt/ModalEventFilter$1 -java/awt/ModalEventFilter$ApplicationModalEventFilter -java/awt/Paint -java/awt/Panel -java/awt/Point -java/awt/PrintGraphics -java/awt/Queue -java/awt/Rectangle -java/awt/RenderingHints -java/awt/RenderingHints$Key -java/awt/SecondaryLoop -java/awt/SentEvent -java/awt/SequencedEvent -java/awt/Shape -java/awt/SplashScreen -java/awt/Stroke -java/awt/SystemColor -java/awt/Toolkit -java/awt/Toolkit$1 -java/awt/Toolkit$2 -java/awt/Toolkit$3 -java/awt/Toolkit$4 -java/awt/Toolkit$5 -java/awt/Toolkit$DesktopPropertyChangeSupport -java/awt/Toolkit$SelectiveAWTEventListener -java/awt/Toolkit$ToolkitEventMulticaster -java/awt/Transparency -java/awt/TrayIcon -java/awt/VKCollection -java/awt/WaitDispatchSupport -java/awt/WaitDispatchSupport$1 -java/awt/WaitDispatchSupport$2 -java/awt/WaitDispatchSupport$5 -java/awt/Window -java/awt/Window$1 -java/awt/Window$1DisposeAction -java/awt/Window$Type -java/awt/Window$WindowDisposerRecord -java/awt/color/ColorSpace -java/awt/color/ICC_ColorSpace -java/awt/color/ICC_Profile -java/awt/color/ICC_Profile$1 -java/awt/color/ICC_ProfileRGB -java/awt/datatransfer/Clipboard -java/awt/datatransfer/ClipboardOwner -java/awt/datatransfer/DataFlavor -java/awt/datatransfer/FlavorMap -java/awt/datatransfer/FlavorTable -java/awt/datatransfer/MimeType -java/awt/datatransfer/MimeTypeParameterList -java/awt/datatransfer/MimeTypeParseException -java/awt/datatransfer/SystemFlavorMap -java/awt/datatransfer/SystemFlavorMap$1 -java/awt/datatransfer/SystemFlavorMap$2 -java/awt/datatransfer/Transferable -java/awt/dnd/DropTarget -java/awt/dnd/DropTargetContext -java/awt/dnd/DropTargetListener -java/awt/dnd/peer/DragSourceContextPeer -java/awt/dnd/peer/DropTargetPeer -java/awt/event/AWTEventListener -java/awt/event/AWTEventListenerProxy -java/awt/event/ActionEvent -java/awt/event/ActionListener -java/awt/event/AdjustmentEvent -java/awt/event/AdjustmentListener -java/awt/event/ComponentAdapter -java/awt/event/ComponentEvent -java/awt/event/ComponentListener -java/awt/event/ContainerEvent -java/awt/event/ContainerListener -java/awt/event/FocusAdapter -java/awt/event/FocusEvent -java/awt/event/FocusListener -java/awt/event/HierarchyBoundsListener -java/awt/event/HierarchyEvent -java/awt/event/HierarchyListener -java/awt/event/InputEvent -java/awt/event/InputEvent$1 -java/awt/event/InputMethodEvent -java/awt/event/InputMethodListener -java/awt/event/InvocationEvent -java/awt/event/ItemListener -java/awt/event/KeyAdapter -java/awt/event/KeyEvent -java/awt/event/KeyEvent$1 -java/awt/event/KeyListener -java/awt/event/MouseAdapter -java/awt/event/MouseEvent -java/awt/event/MouseListener -java/awt/event/MouseMotionAdapter -java/awt/event/MouseMotionListener -java/awt/event/MouseWheelEvent -java/awt/event/MouseWheelListener -java/awt/event/NativeLibLoader -java/awt/event/NativeLibLoader$1 -java/awt/event/PaintEvent -java/awt/event/TextListener -java/awt/event/WindowAdapter -java/awt/event/WindowEvent -java/awt/event/WindowFocusListener -java/awt/event/WindowListener -java/awt/event/WindowStateListener -java/awt/font/FontRenderContext -java/awt/font/GlyphVector -java/awt/font/LineMetrics -java/awt/font/TextAttribute -java/awt/geom/AffineTransform -java/awt/geom/Dimension2D -java/awt/geom/GeneralPath -java/awt/geom/Path2D -java/awt/geom/Path2D$Float -java/awt/geom/Point2D -java/awt/geom/Point2D$Double -java/awt/geom/Point2D$Float -java/awt/geom/Rectangle2D -java/awt/geom/Rectangle2D$Double -java/awt/geom/Rectangle2D$Float -java/awt/geom/RectangularShape -java/awt/im/InputContext -java/awt/im/InputMethodRequests -java/awt/im/spi/InputMethod -java/awt/im/spi/InputMethodContext -java/awt/im/spi/InputMethodDescriptor -java/awt/image/BufferStrategy -java/awt/image/BufferedImage -java/awt/image/BufferedImage$1 -java/awt/image/ColorModel -java/awt/image/ColorModel$1 -java/awt/image/ComponentSampleModel -java/awt/image/DataBuffer -java/awt/image/DataBuffer$1 -java/awt/image/DataBufferByte -java/awt/image/DataBufferInt -java/awt/image/DirectColorModel -java/awt/image/FilteredImageSource -java/awt/image/ImageConsumer -java/awt/image/ImageFilter -java/awt/image/ImageObserver -java/awt/image/ImageProducer -java/awt/image/IndexColorModel -java/awt/image/PackedColorModel -java/awt/image/PixelInterleavedSampleModel -java/awt/image/RGBImageFilter -java/awt/image/Raster -java/awt/image/RenderedImage -java/awt/image/SampleModel -java/awt/image/SinglePixelPackedSampleModel -java/awt/image/VolatileImage -java/awt/image/WritableRaster -java/awt/image/WritableRenderedImage -java/awt/peer/CanvasPeer -java/awt/peer/ComponentPeer -java/awt/peer/ContainerPeer -java/awt/peer/DialogPeer -java/awt/peer/FramePeer -java/awt/peer/KeyboardFocusManagerPeer -java/awt/peer/LabelPeer -java/awt/peer/LightweightPeer -java/awt/peer/PanelPeer -java/awt/peer/WindowPeer -java/awt/print/PrinterGraphics -java/beans/ChangeListenerMap -java/beans/PropertyChangeEvent -java/beans/PropertyChangeListener -java/beans/PropertyChangeListenerProxy -java/beans/PropertyChangeSupport -java/beans/PropertyChangeSupport$PropertyChangeListenerMap -java/io/Bits -java/io/BufferedInputStream -java/io/BufferedOutputStream -java/io/BufferedReader -java/io/BufferedWriter -java/io/ByteArrayInputStream -java/io/ByteArrayOutputStream -java/io/Closeable -java/io/DataInput -java/io/DataInputStream -java/io/DataOutput -java/io/DataOutputStream -java/io/DefaultFileSystem -java/io/EOFException -java/io/ExpiringCache -java/io/ExpiringCache$1 -java/io/ExpiringCache$Entry -java/io/Externalizable -java/io/File -java/io/File$PathStatus -java/io/FileDescriptor -java/io/FileDescriptor$1 -java/io/FileInputStream -java/io/FileInputStream$1 -java/io/FileNotFoundException -java/io/FileOutputStream -java/io/FileOutputStream$1 -java/io/FilePermission -java/io/FilePermission$1 -java/io/FilePermissionCollection -java/io/FileReader -java/io/FileSystem -java/io/FileWriter -java/io/FilenameFilter -java/io/FilterInputStream -java/io/FilterOutputStream -java/io/FilterReader -java/io/Flushable -java/io/IOException -java/io/InputStream -java/io/InputStreamReader -java/io/ObjectInput -java/io/ObjectInputStream -java/io/ObjectOutput -java/io/ObjectOutputStream -java/io/ObjectOutputStream$BlockDataOutputStream -java/io/ObjectOutputStream$HandleTable -java/io/ObjectOutputStream$ReplaceTable -java/io/ObjectStreamClass -java/io/ObjectStreamClass$2 -java/io/ObjectStreamClass$Caches -java/io/ObjectStreamClass$EntryFuture -java/io/ObjectStreamClass$FieldReflector -java/io/ObjectStreamClass$FieldReflectorKey -java/io/ObjectStreamClass$WeakClassKey -java/io/ObjectStreamConstants -java/io/ObjectStreamField -java/io/OutputStream -java/io/OutputStreamWriter -java/io/PrintStream -java/io/PrintWriter -java/io/RandomAccessFile -java/io/Reader -java/io/Serializable -java/io/StringReader -java/io/StringWriter -java/io/UnixFileSystem -java/io/UnsupportedEncodingException -java/io/Writer -java/lang/AbstractStringBuilder -java/lang/Appendable -java/lang/ApplicationShutdownHooks -java/lang/ApplicationShutdownHooks$1 -java/lang/ArithmeticException -java/lang/ArrayIndexOutOfBoundsException -java/lang/ArrayStoreException -java/lang/AutoCloseable -java/lang/Boolean -java/lang/BootstrapMethodError -java/lang/Byte -java/lang/CharSequence -java/lang/Character -java/lang/Character$CharacterCache -java/lang/CharacterData -java/lang/CharacterDataLatin1 -java/lang/Class -java/lang/Class$1 -java/lang/Class$3 -java/lang/Class$4 -java/lang/Class$AnnotationData -java/lang/Class$Atomic -java/lang/Class$ReflectionData -java/lang/ClassCastException -java/lang/ClassLoader -java/lang/ClassLoader$2 -java/lang/ClassLoader$3 -java/lang/ClassLoader$NativeLibrary -java/lang/ClassLoader$ParallelLoaders -java/lang/ClassLoaderHelper -java/lang/ClassNotFoundException -java/lang/ClassValue$ClassValueMap -java/lang/CloneNotSupportedException -java/lang/Cloneable -java/lang/Comparable -java/lang/Compiler -java/lang/Compiler$1 -java/lang/Double -java/lang/Enum -java/lang/Error -java/lang/Exception -java/lang/ExceptionInInitializerError -java/lang/Float -java/lang/IllegalAccessError -java/lang/IllegalAccessException -java/lang/IllegalArgumentException -java/lang/IllegalMonitorStateException -java/lang/IllegalStateException -java/lang/IncompatibleClassChangeError -java/lang/IndexOutOfBoundsException -java/lang/InstantiationException -java/lang/Integer -java/lang/Integer$IntegerCache -java/lang/InternalError -java/lang/InterruptedException -java/lang/Iterable -java/lang/LinkageError -java/lang/Long -java/lang/Long$LongCache -java/lang/Math -java/lang/NoClassDefFoundError -java/lang/NoSuchFieldException -java/lang/NoSuchMethodError -java/lang/NoSuchMethodException -java/lang/NullPointerException -java/lang/Number -java/lang/NumberFormatException -java/lang/Object -java/lang/OutOfMemoryError -java/lang/Package -java/lang/Process -java/lang/ProcessBuilder -java/lang/ProcessBuilder$NullInputStream -java/lang/ProcessBuilder$NullOutputStream -java/lang/ProcessEnvironment -java/lang/ProcessEnvironment$ExternalData -java/lang/ProcessEnvironment$StringEnvironment -java/lang/ProcessEnvironment$Value -java/lang/ProcessEnvironment$Variable -java/lang/ProcessImpl -java/lang/Readable -java/lang/ReflectiveOperationException -java/lang/Runnable -java/lang/Runtime -java/lang/RuntimeException -java/lang/RuntimePermission -java/lang/SecurityException -java/lang/SecurityManager -java/lang/Short -java/lang/Short$ShortCache -java/lang/Shutdown -java/lang/Shutdown$Lock -java/lang/StackOverflowError -java/lang/StackTraceElement -java/lang/StrictMath -java/lang/String -java/lang/String$CaseInsensitiveComparator -java/lang/StringBuffer -java/lang/StringBuilder -java/lang/StringCoding -java/lang/StringCoding$StringDecoder -java/lang/StringCoding$StringEncoder -java/lang/StringIndexOutOfBoundsException -java/lang/System -java/lang/System$2 -java/lang/SystemClassLoaderAction -java/lang/Terminator -java/lang/Terminator$1 -java/lang/Thread -java/lang/Thread$UncaughtExceptionHandler -java/lang/ThreadDeath -java/lang/ThreadGroup -java/lang/ThreadLocal -java/lang/ThreadLocal$ThreadLocalMap -java/lang/ThreadLocal$ThreadLocalMap$Entry -java/lang/Throwable -java/lang/Throwable$PrintStreamOrWriter -java/lang/Throwable$WrappedPrintStream -java/lang/Throwable$WrappedPrintWriter -java/lang/UNIXProcess -java/lang/UNIXProcess$1 -java/lang/UNIXProcess$2 -java/lang/UNIXProcess$3 -java/lang/UNIXProcess$4 -java/lang/UNIXProcess$LaunchMechanism -java/lang/UNIXProcess$ProcessPipeInputStream -java/lang/UNIXProcess$ProcessPipeOutputStream -java/lang/UNIXProcess$ProcessReaperThreadFactory -java/lang/UNIXProcess$ProcessReaperThreadFactory$1 -java/lang/UnsatisfiedLinkError -java/lang/UnsupportedOperationException -java/lang/VirtualMachineError -java/lang/Void -java/lang/annotation/Annotation -java/lang/invoke/CallSite -java/lang/invoke/ConstantCallSite -java/lang/invoke/DirectMethodHandle -java/lang/invoke/Invokers -java/lang/invoke/LambdaForm -java/lang/invoke/LambdaForm$NamedFunction -java/lang/invoke/MagicLambdaImpl -java/lang/invoke/MemberName -java/lang/invoke/MemberName$Factory -java/lang/invoke/MethodHandle -java/lang/invoke/MethodHandleImpl -java/lang/invoke/MethodHandleNatives -java/lang/invoke/MethodHandleStatics -java/lang/invoke/MethodHandleStatics$1 -java/lang/invoke/MethodType -java/lang/invoke/MethodType$ConcurrentWeakInternSet -java/lang/invoke/MethodType$ConcurrentWeakInternSet$WeakEntry -java/lang/invoke/MethodTypeForm -java/lang/invoke/MutableCallSite -java/lang/invoke/VolatileCallSite -java/lang/ref/FinalReference -java/lang/ref/Finalizer -java/lang/ref/Finalizer$FinalizerThread -java/lang/ref/PhantomReference -java/lang/ref/Reference -java/lang/ref/Reference$Lock -java/lang/ref/Reference$ReferenceHandler -java/lang/ref/ReferenceQueue -java/lang/ref/ReferenceQueue$Lock -java/lang/ref/ReferenceQueue$Null -java/lang/ref/SoftReference -java/lang/ref/WeakReference -java/lang/reflect/AccessibleObject -java/lang/reflect/AnnotatedElement -java/lang/reflect/Array -java/lang/reflect/Constructor -java/lang/reflect/Executable -java/lang/reflect/Field -java/lang/reflect/GenericDeclaration -java/lang/reflect/InvocationHandler -java/lang/reflect/InvocationTargetException -java/lang/reflect/Member -java/lang/reflect/Method -java/lang/reflect/Modifier -java/lang/reflect/Parameter -java/lang/reflect/Proxy -java/lang/reflect/Proxy$KeyFactory -java/lang/reflect/Proxy$ProxyClassFactory -java/lang/reflect/ReflectAccess -java/lang/reflect/ReflectPermission -java/lang/reflect/Type -java/lang/reflect/WeakCache -java/net/AbstractPlainSocketImpl -java/net/AbstractPlainSocketImpl$1 -java/net/Authenticator -java/net/ConnectException -java/net/DefaultInterface -java/net/HttpURLConnection -java/net/Inet4Address -java/net/Inet6Address -java/net/Inet6Address$Inet6AddressHolder -java/net/Inet6AddressImpl -java/net/InetAddress -java/net/InetAddress$1 -java/net/InetAddress$2 -java/net/InetAddress$Cache -java/net/InetAddress$Cache$Type -java/net/InetAddress$InetAddressHolder -java/net/InetAddressImpl -java/net/InetAddressImplFactory -java/net/InetSocketAddress -java/net/InetSocketAddress$InetSocketAddressHolder -java/net/InterfaceAddress -java/net/JarURLConnection -java/net/MalformedURLException -java/net/NetworkInterface -java/net/NetworkInterface$1 -java/net/NetworkInterface$2 -java/net/Parts -java/net/PlainSocketImpl -java/net/Proxy -java/net/Proxy$Type -java/net/ProxySelector -java/net/ServerSocket -java/net/Socket -java/net/SocketAddress -java/net/SocketException -java/net/SocketImpl -java/net/SocketOptions -java/net/SocksConsts -java/net/SocksSocketImpl -java/net/SocksSocketImpl$3 -java/net/URI -java/net/URI$Parser -java/net/URL -java/net/URLClassLoader -java/net/URLClassLoader$1 -java/net/URLClassLoader$2 -java/net/URLClassLoader$3 -java/net/URLClassLoader$3$1 -java/net/URLClassLoader$7 -java/net/URLConnection -java/net/URLStreamHandler -java/net/URLStreamHandlerFactory -java/nio/Bits -java/nio/Bits$1 -java/nio/Buffer -java/nio/ByteBuffer -java/nio/ByteBufferAsIntBufferB -java/nio/ByteBufferAsShortBufferB -java/nio/ByteOrder -java/nio/CharBuffer -java/nio/DirectByteBuffer -java/nio/DirectByteBuffer$Deallocator -java/nio/DirectLongBufferU -java/nio/HeapByteBuffer -java/nio/HeapCharBuffer -java/nio/IntBuffer -java/nio/LongBuffer -java/nio/MappedByteBuffer -java/nio/ShortBuffer -java/nio/channels/ByteChannel -java/nio/channels/Channel -java/nio/channels/FileChannel -java/nio/channels/GatheringByteChannel -java/nio/channels/InterruptibleChannel -java/nio/channels/ReadableByteChannel -java/nio/channels/ScatteringByteChannel -java/nio/channels/SeekableByteChannel -java/nio/channels/WritableByteChannel -java/nio/channels/spi/AbstractInterruptibleChannel -java/nio/channels/spi/AbstractInterruptibleChannel$1 -java/nio/charset/Charset -java/nio/charset/CharsetDecoder -java/nio/charset/CharsetEncoder -java/nio/charset/CoderResult -java/nio/charset/CoderResult$1 -java/nio/charset/CoderResult$2 -java/nio/charset/CoderResult$Cache -java/nio/charset/CodingErrorAction -java/nio/charset/StandardCharsets -java/nio/charset/spi/CharsetProvider -java/nio/file/Path -java/nio/file/Watchable -java/nio/file/attribute/FileAttribute -java/rmi/MarshalledObject -java/rmi/Remote -java/security/AccessControlContext -java/security/AccessController -java/security/AllPermission -java/security/AllPermissionCollection -java/security/BasicPermission -java/security/BasicPermissionCollection -java/security/CodeSigner -java/security/CodeSource -java/security/Guard -java/security/Permission -java/security/PermissionCollection -java/security/Permissions -java/security/Principal -java/security/PrivilegedAction -java/security/PrivilegedActionException -java/security/PrivilegedExceptionAction -java/security/ProtectionDomain -java/security/ProtectionDomain$1 -java/security/ProtectionDomain$3 -java/security/ProtectionDomain$Key -java/security/SecureClassLoader -java/security/UnresolvedPermission -java/security/cert/Certificate -java/text/AttributedCharacterIterator -java/text/AttributedCharacterIterator$Attribute -java/text/AttributedString -java/text/AttributedString$AttributedStringIterator -java/text/CharacterIterator -java/text/FieldPosition -java/text/Format -java/text/Format$Field -java/text/MessageFormat -java/text/MessageFormat$Field -java/text/spi/BreakIteratorProvider -java/text/spi/CollatorProvider -java/text/spi/DateFormatProvider -java/text/spi/DateFormatSymbolsProvider -java/text/spi/DecimalFormatSymbolsProvider -java/text/spi/NumberFormatProvider -java/util/AbstractCollection -java/util/AbstractList -java/util/AbstractList$Itr -java/util/AbstractMap -java/util/AbstractQueue -java/util/AbstractSequentialList -java/util/AbstractSet -java/util/ArrayDeque -java/util/ArrayList -java/util/ArrayList$Itr -java/util/ArrayList$ListItr -java/util/ArrayList$SubList -java/util/ArrayList$SubList$1 -java/util/Arrays -java/util/Arrays$ArrayList -java/util/Arrays$LegacyMergeSort -java/util/BitSet -java/util/Collection -java/util/Collections -java/util/Collections$EmptyEnumeration -java/util/Collections$EmptyList -java/util/Collections$EmptyMap -java/util/Collections$EmptySet -java/util/Collections$SetFromMap -java/util/Collections$SynchronizedCollection -java/util/Collections$SynchronizedMap -java/util/Collections$SynchronizedSet -java/util/Collections$UnmodifiableCollection -java/util/Collections$UnmodifiableCollection$1 -java/util/Collections$UnmodifiableList -java/util/Collections$UnmodifiableMap -java/util/Collections$UnmodifiableRandomAccessList -java/util/Collections$UnmodifiableSet -java/util/Collections$UnmodifiableSortedSet -java/util/ComparableTimSort -java/util/Comparator -java/util/Date -java/util/Deque -java/util/Dictionary -java/util/Enumeration -java/util/EventListener -java/util/EventListenerProxy -java/util/EventObject -java/util/HashMap -java/util/HashMap$EntryIterator -java/util/HashMap$EntrySet -java/util/HashMap$HashIterator -java/util/HashMap$KeyIterator -java/util/HashMap$KeySet -java/util/HashMap$Node -java/util/HashMap$TreeNode -java/util/HashMap$ValueIterator -java/util/HashMap$Values -java/util/HashSet -java/util/Hashtable -java/util/Hashtable$Entry -java/util/Hashtable$EntrySet -java/util/Hashtable$Enumerator -java/util/Hashtable$ValueCollection -java/util/IdentityHashMap -java/util/IdentityHashMap$IdentityHashMapIterator -java/util/IdentityHashMap$KeyIterator -java/util/IdentityHashMap$KeySet -java/util/Iterator -java/util/LinkedHashMap -java/util/LinkedHashMap$Entry -java/util/LinkedHashMap$LinkedEntryIterator -java/util/LinkedHashMap$LinkedEntrySet -java/util/LinkedHashMap$LinkedHashIterator -java/util/LinkedHashMap$LinkedKeyIterator -java/util/LinkedHashMap$LinkedKeySet -java/util/LinkedHashSet -java/util/LinkedList -java/util/LinkedList$ListItr -java/util/LinkedList$Node -java/util/List -java/util/ListIterator -java/util/ListResourceBundle -java/util/Locale -java/util/Locale$1 -java/util/Locale$Cache -java/util/Locale$Category -java/util/Locale$LocaleKey -java/util/Map -java/util/Map$Entry -java/util/MissingResourceException -java/util/NavigableMap -java/util/NavigableSet -java/util/Objects -java/util/PriorityQueue -java/util/Properties -java/util/Properties$LineReader -java/util/PropertyResourceBundle -java/util/Queue -java/util/Random -java/util/RandomAccess -java/util/ResourceBundle -java/util/ResourceBundle$1 -java/util/ResourceBundle$BundleReference -java/util/ResourceBundle$CacheKey -java/util/ResourceBundle$CacheKeyReference -java/util/ResourceBundle$Control -java/util/ResourceBundle$Control$1 -java/util/ResourceBundle$Control$CandidateListCache -java/util/ResourceBundle$LoaderReference -java/util/ResourceBundle$RBClassLoader -java/util/ResourceBundle$RBClassLoader$1 -java/util/ResourceBundle$SingleFormatControl -java/util/ServiceLoader -java/util/ServiceLoader$1 -java/util/ServiceLoader$LazyIterator -java/util/Set -java/util/SortedMap -java/util/SortedSet -java/util/Stack -java/util/StringTokenizer -java/util/TimSort -java/util/TimeZone -java/util/TimeZone$1 -java/util/TreeMap -java/util/TreeMap$Entry -java/util/TreeMap$KeyIterator -java/util/TreeMap$KeySet -java/util/TreeMap$PrivateEntryIterator -java/util/TreeSet -java/util/Vector -java/util/Vector$1 -java/util/Vector$Itr -java/util/Vector$ListItr -java/util/WeakHashMap -java/util/WeakHashMap$Entry -java/util/WeakHashMap$HashIterator -java/util/WeakHashMap$KeyIterator -java/util/WeakHashMap$KeySet -java/util/concurrent/AbstractExecutorService -java/util/concurrent/BlockingQueue -java/util/concurrent/ConcurrentHashMap -java/util/concurrent/ConcurrentHashMap$BaseIterator -java/util/concurrent/ConcurrentHashMap$CollectionView -java/util/concurrent/ConcurrentHashMap$CounterCell -java/util/concurrent/ConcurrentHashMap$EntrySetView -java/util/concurrent/ConcurrentHashMap$ForwardingNode -java/util/concurrent/ConcurrentHashMap$KeyIterator -java/util/concurrent/ConcurrentHashMap$KeySetView -java/util/concurrent/ConcurrentHashMap$Node -java/util/concurrent/ConcurrentHashMap$Segment -java/util/concurrent/ConcurrentHashMap$Traverser -java/util/concurrent/ConcurrentHashMap$ValuesView -java/util/concurrent/ConcurrentMap -java/util/concurrent/CopyOnWriteArrayList -java/util/concurrent/DelayQueue -java/util/concurrent/Delayed -java/util/concurrent/Executor -java/util/concurrent/ExecutorService -java/util/concurrent/Executors -java/util/concurrent/RejectedExecutionHandler -java/util/concurrent/SynchronousQueue -java/util/concurrent/SynchronousQueue$TransferStack -java/util/concurrent/SynchronousQueue$TransferStack$SNode -java/util/concurrent/SynchronousQueue$Transferer -java/util/concurrent/ThreadFactory -java/util/concurrent/ThreadPoolExecutor -java/util/concurrent/ThreadPoolExecutor$AbortPolicy -java/util/concurrent/ThreadPoolExecutor$Worker -java/util/concurrent/TimeUnit -java/util/concurrent/TimeUnit$1 -java/util/concurrent/TimeUnit$2 -java/util/concurrent/TimeUnit$3 -java/util/concurrent/TimeUnit$4 -java/util/concurrent/TimeUnit$5 -java/util/concurrent/TimeUnit$6 -java/util/concurrent/TimeUnit$7 -java/util/concurrent/atomic/AtomicBoolean -java/util/concurrent/atomic/AtomicInteger -java/util/concurrent/atomic/AtomicLong -java/util/concurrent/atomic/AtomicReferenceFieldUpdater -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 -java/util/concurrent/locks/AbstractOwnableSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject -java/util/concurrent/locks/AbstractQueuedSynchronizer$Node -java/util/concurrent/locks/Condition -java/util/concurrent/locks/Lock -java/util/concurrent/locks/LockSupport -java/util/concurrent/locks/ReadWriteLock -java/util/concurrent/locks/ReentrantLock -java/util/concurrent/locks/ReentrantLock$NonfairSync -java/util/concurrent/locks/ReentrantLock$Sync -java/util/concurrent/locks/ReentrantReadWriteLock -java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync -java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock -java/util/concurrent/locks/ReentrantReadWriteLock$Sync -java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter -java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock -java/util/function/BiFunction -java/util/jar/Attributes -java/util/jar/Attributes$Name -java/util/jar/JarEntry -java/util/jar/JarFile -java/util/jar/JarFile$JarEntryIterator -java/util/jar/JarFile$JarFileEntry -java/util/jar/JarVerifier -java/util/jar/JarVerifier$3 -java/util/jar/JavaUtilJarAccessImpl -java/util/jar/Manifest -java/util/jar/Manifest$FastInputStream -java/util/logging/Handler -java/util/logging/Level -java/util/logging/Level$KnownLevel -java/util/logging/LogManager -java/util/logging/LogManager$1 -java/util/logging/LogManager$2 -java/util/logging/LogManager$3 -java/util/logging/LogManager$5 -java/util/logging/LogManager$Cleaner -java/util/logging/LogManager$LogNode -java/util/logging/LogManager$LoggerContext -java/util/logging/LogManager$LoggerContext$1 -java/util/logging/LogManager$LoggerWeakRef -java/util/logging/LogManager$RootLogger -java/util/logging/LogManager$SystemLoggerContext -java/util/logging/Logger -java/util/logging/Logger$1 -java/util/logging/LoggingPermission -java/util/logging/LoggingProxyImpl -java/util/spi/CalendarDataProvider -java/util/spi/CurrencyNameProvider -java/util/spi/LocaleNameProvider -java/util/spi/LocaleServiceProvider -java/util/spi/ResourceBundleControlProvider -java/util/spi/TimeZoneNameProvider -java/util/zip/CRC32 -java/util/zip/Checksum -java/util/zip/Inflater -java/util/zip/InflaterInputStream -java/util/zip/ZStreamRef -java/util/zip/ZipCoder -java/util/zip/ZipConstants -java/util/zip/ZipEntry -java/util/zip/ZipException -java/util/zip/ZipFile -java/util/zip/ZipFile$1 -java/util/zip/ZipFile$ZipEntryIterator -java/util/zip/ZipFile$ZipFileInflaterInputStream -java/util/zip/ZipFile$ZipFileInputStream -java/util/zip/ZipUtils -javax/accessibility/Accessible -javax/accessibility/AccessibleContext -javax/swing/AbstractAction -javax/swing/AbstractButton -javax/swing/AbstractButton$Handler -javax/swing/AbstractListModel -javax/swing/Action -javax/swing/ActionMap -javax/swing/AncestorNotifier -javax/swing/ArrayTable -javax/swing/Autoscroller -javax/swing/BorderFactory -javax/swing/BoundedRangeModel -javax/swing/Box -javax/swing/Box$Filler -javax/swing/BoxLayout -javax/swing/ButtonGroup -javax/swing/ButtonModel -javax/swing/CellRendererPane -javax/swing/ClientPropertyKey -javax/swing/ClientPropertyKey$1 -javax/swing/ComboBoxEditor -javax/swing/ComboBoxModel -javax/swing/ComponentInputMap -javax/swing/DefaultBoundedRangeModel -javax/swing/DefaultButtonModel -javax/swing/DefaultComboBoxModel -javax/swing/DefaultListCellRenderer -javax/swing/DefaultListCellRenderer$UIResource -javax/swing/DefaultListSelectionModel -javax/swing/DefaultSingleSelectionModel -javax/swing/DropMode -javax/swing/FocusManager -javax/swing/GrayFilter -javax/swing/Icon -javax/swing/ImageIcon -javax/swing/ImageIcon$1 -javax/swing/ImageIcon$2 -javax/swing/ImageIcon$2$1 -javax/swing/ImageIcon$3 -javax/swing/InputMap -javax/swing/InternalFrameFocusTraversalPolicy -javax/swing/JButton -javax/swing/JCheckBox -javax/swing/JCheckBoxMenuItem -javax/swing/JComboBox -javax/swing/JComboBox$1 -javax/swing/JComboBox$KeySelectionManager -javax/swing/JComponent -javax/swing/JComponent$1 -javax/swing/JComponent$2 -javax/swing/JDialog -javax/swing/JEditorPane -javax/swing/JFrame -javax/swing/JInternalFrame -javax/swing/JLabel -javax/swing/JLayer -javax/swing/JLayeredPane -javax/swing/JList -javax/swing/JMenu -javax/swing/JMenu$MenuChangeListener -javax/swing/JMenu$WinListener -javax/swing/JMenuBar -javax/swing/JMenuItem -javax/swing/JMenuItem$MenuItemFocusListener -javax/swing/JPanel -javax/swing/JPasswordField -javax/swing/JPopupMenu -javax/swing/JPopupMenu$Separator -javax/swing/JRadioButton -javax/swing/JRadioButtonMenuItem -javax/swing/JRootPane -javax/swing/JRootPane$1 -javax/swing/JRootPane$RootLayout -javax/swing/JScrollBar -javax/swing/JScrollBar$ModelListener -javax/swing/JScrollPane -javax/swing/JScrollPane$ScrollBar -javax/swing/JSeparator -javax/swing/JSplitPane -javax/swing/JTextArea -javax/swing/JTextField -javax/swing/JTextField$NotifyAction -javax/swing/JTextField$ScrollRepainter -javax/swing/JToggleButton -javax/swing/JToggleButton$ToggleButtonModel -javax/swing/JToolBar -javax/swing/JToolBar$DefaultToolBarLayout -javax/swing/JToolBar$Separator -javax/swing/JViewport -javax/swing/JViewport$ViewListener -javax/swing/JWindow -javax/swing/KeyStroke -javax/swing/KeyboardManager -javax/swing/KeyboardManager$ComponentKeyStrokePair -javax/swing/LayoutComparator -javax/swing/LayoutFocusTraversalPolicy -javax/swing/ListCellRenderer -javax/swing/ListModel -javax/swing/ListSelectionModel -javax/swing/LookAndFeel -javax/swing/MenuElement -javax/swing/MenuSelectionManager -javax/swing/MultiUIDefaults -javax/swing/MutableComboBoxModel -javax/swing/PopupFactory -javax/swing/RepaintManager -javax/swing/RepaintManager$2 -javax/swing/RepaintManager$3 -javax/swing/RepaintManager$DisplayChangedHandler -javax/swing/RepaintManager$PaintManager -javax/swing/RepaintManager$ProcessingRunnable -javax/swing/RootPaneContainer -javax/swing/ScrollPaneConstants -javax/swing/ScrollPaneLayout -javax/swing/ScrollPaneLayout$UIResource -javax/swing/Scrollable -javax/swing/SingleSelectionModel -javax/swing/SizeRequirements -javax/swing/SortingFocusTraversalPolicy -javax/swing/SwingConstants -javax/swing/SwingContainerOrderFocusTraversalPolicy -javax/swing/SwingDefaultFocusTraversalPolicy -javax/swing/SwingHeavyWeight -javax/swing/SwingPaintEventDispatcher -javax/swing/SwingUtilities -javax/swing/SwingUtilities$SharedOwnerFrame -javax/swing/Timer -javax/swing/Timer$DoPostEvent -javax/swing/TimerQueue -javax/swing/TimerQueue$1 -javax/swing/TimerQueue$DelayedTimer -javax/swing/ToolTipManager -javax/swing/ToolTipManager$AccessibilityKeyListener -javax/swing/ToolTipManager$MoveBeforeEnterListener -javax/swing/ToolTipManager$insideTimerAction -javax/swing/ToolTipManager$outsideTimerAction -javax/swing/ToolTipManager$stillInsideTimerAction -javax/swing/TransferHandler -javax/swing/TransferHandler$DropHandler -javax/swing/TransferHandler$HasGetTransferHandler -javax/swing/TransferHandler$SwingDropTarget -javax/swing/TransferHandler$TransferAction -javax/swing/TransferHandler$TransferAction$1 -javax/swing/TransferHandler$TransferAction$2 -javax/swing/TransferHandler$TransferSupport -javax/swing/UIDefaults -javax/swing/UIDefaults$ActiveValue -javax/swing/UIDefaults$LazyInputMap -javax/swing/UIDefaults$LazyValue -javax/swing/UIDefaults$TextAndMnemonicHashMap -javax/swing/UIManager -javax/swing/UIManager$1 -javax/swing/UIManager$2 -javax/swing/UIManager$LAFState -javax/swing/UIManager$LookAndFeelInfo -javax/swing/ViewportLayout -javax/swing/WindowConstants -javax/swing/border/AbstractBorder -javax/swing/border/BevelBorder -javax/swing/border/Border -javax/swing/border/CompoundBorder -javax/swing/border/EmptyBorder -javax/swing/border/EtchedBorder -javax/swing/border/LineBorder -javax/swing/border/MatteBorder -javax/swing/event/AncestorEvent -javax/swing/event/AncestorListener -javax/swing/event/CaretEvent -javax/swing/event/CaretListener -javax/swing/event/ChangeEvent -javax/swing/event/ChangeListener -javax/swing/event/DocumentEvent -javax/swing/event/DocumentEvent$ElementChange -javax/swing/event/DocumentEvent$EventType -javax/swing/event/DocumentListener -javax/swing/event/EventListenerList -javax/swing/event/ListDataListener -javax/swing/event/ListSelectionListener -javax/swing/event/MenuDragMouseListener -javax/swing/event/MenuEvent -javax/swing/event/MenuKeyListener -javax/swing/event/MenuListener -javax/swing/event/MouseInputAdapter -javax/swing/event/MouseInputListener -javax/swing/event/PopupMenuListener -javax/swing/event/UndoableEditEvent -javax/swing/event/UndoableEditListener -javax/swing/plaf/ActionMapUIResource -javax/swing/plaf/BorderUIResource -javax/swing/plaf/BorderUIResource$EmptyBorderUIResource -javax/swing/plaf/BorderUIResource$LineBorderUIResource -javax/swing/plaf/ButtonUI -javax/swing/plaf/ColorUIResource -javax/swing/plaf/ComboBoxUI -javax/swing/plaf/ComponentInputMapUIResource -javax/swing/plaf/ComponentUI -javax/swing/plaf/DimensionUIResource -javax/swing/plaf/FontUIResource -javax/swing/plaf/IconUIResource -javax/swing/plaf/InputMapUIResource -javax/swing/plaf/InsetsUIResource -javax/swing/plaf/LabelUI -javax/swing/plaf/ListUI -javax/swing/plaf/MenuBarUI -javax/swing/plaf/MenuItemUI -javax/swing/plaf/PanelUI -javax/swing/plaf/PopupMenuUI -javax/swing/plaf/RootPaneUI -javax/swing/plaf/ScrollBarUI -javax/swing/plaf/ScrollPaneUI -javax/swing/plaf/SeparatorUI -javax/swing/plaf/TextUI -javax/swing/plaf/ToolBarUI -javax/swing/plaf/UIResource -javax/swing/plaf/ViewportUI -javax/swing/plaf/basic/BasicBorders$ButtonBorder -javax/swing/plaf/basic/BasicBorders$MarginBorder -javax/swing/plaf/basic/BasicBorders$RadioButtonBorder -javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder -javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder -javax/swing/plaf/basic/BasicButtonListener -javax/swing/plaf/basic/BasicButtonUI -javax/swing/plaf/basic/BasicComboBoxEditor -javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField -javax/swing/plaf/basic/BasicComboBoxEditor$UIResource -javax/swing/plaf/basic/BasicComboBoxUI -javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager -javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager -javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler -javax/swing/plaf/basic/BasicComboBoxUI$Handler -javax/swing/plaf/basic/BasicComboPopup -javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass -javax/swing/plaf/basic/BasicComboPopup$Handler -javax/swing/plaf/basic/BasicGraphicsUtils -javax/swing/plaf/basic/BasicHTML -javax/swing/plaf/basic/BasicIconFactory -javax/swing/plaf/basic/BasicIconFactory$MenuItemArrowIcon -javax/swing/plaf/basic/BasicIconFactory$MenuItemCheckIcon -javax/swing/plaf/basic/BasicLabelUI -javax/swing/plaf/basic/BasicListUI -javax/swing/plaf/basic/BasicListUI$FocusHandler -javax/swing/plaf/basic/BasicListUI$Handler -javax/swing/plaf/basic/BasicListUI$ListTransferHandler -javax/swing/plaf/basic/BasicListUI$MouseInputHandler -javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicLookAndFeel -javax/swing/plaf/basic/BasicLookAndFeel$1 -javax/swing/plaf/basic/BasicLookAndFeel$2 -javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper -javax/swing/plaf/basic/BasicMenuBarUI -javax/swing/plaf/basic/BasicMenuBarUI$Handler -javax/swing/plaf/basic/BasicMenuItemUI -javax/swing/plaf/basic/BasicMenuItemUI$Handler -javax/swing/plaf/basic/BasicMenuUI -javax/swing/plaf/basic/BasicMenuUI$ChangeHandler -javax/swing/plaf/basic/BasicMenuUI$Handler -javax/swing/plaf/basic/BasicMenuUI$MouseInputHandler -javax/swing/plaf/basic/BasicPanelUI -javax/swing/plaf/basic/BasicPopupMenuUI -javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener -javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 -javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber -javax/swing/plaf/basic/BasicRootPaneUI -javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap -javax/swing/plaf/basic/BasicScrollPaneUI -javax/swing/plaf/basic/BasicScrollPaneUI$Handler -javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler -javax/swing/plaf/basic/BasicSeparatorUI -javax/swing/plaf/basic/BasicTextAreaUI -javax/swing/plaf/basic/BasicTextFieldUI -javax/swing/plaf/basic/BasicTextUI -javax/swing/plaf/basic/BasicTextUI$BasicCursor -javax/swing/plaf/basic/BasicTextUI$DragListener -javax/swing/plaf/basic/BasicTextUI$FocusAction -javax/swing/plaf/basic/BasicTextUI$RootView -javax/swing/plaf/basic/BasicTextUI$TextActionWrapper -javax/swing/plaf/basic/BasicTextUI$TextTransferHandler -javax/swing/plaf/basic/BasicTextUI$TextTransferHandler$TextTransferable -javax/swing/plaf/basic/BasicTextUI$UpdateHandler -javax/swing/plaf/basic/BasicToolBarSeparatorUI -javax/swing/plaf/basic/BasicToolBarUI -javax/swing/plaf/basic/BasicToolBarUI$Handler -javax/swing/plaf/basic/BasicTransferable -javax/swing/plaf/basic/BasicViewportUI -javax/swing/plaf/basic/ComboPopup -javax/swing/plaf/basic/DefaultMenuLayout -javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag -javax/swing/plaf/basic/LazyActionMap -javax/swing/plaf/metal/DefaultMetalTheme -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 -javax/swing/plaf/metal/MetalLookAndFeel -javax/swing/plaf/metal/MetalTheme -javax/swing/plaf/synth/SynthConstants -javax/swing/plaf/synth/SynthUI -javax/swing/text/AbstractDocument -javax/swing/text/AbstractDocument$1 -javax/swing/text/AbstractDocument$AbstractElement -javax/swing/text/AbstractDocument$AttributeContext -javax/swing/text/AbstractDocument$BidiElement -javax/swing/text/AbstractDocument$BidiRootElement -javax/swing/text/AbstractDocument$BranchElement -javax/swing/text/AbstractDocument$Content -javax/swing/text/AbstractDocument$DefaultDocumentEvent -javax/swing/text/AbstractDocument$ElementEdit -javax/swing/text/AbstractDocument$InsertStringResult -javax/swing/text/AbstractDocument$LeafElement -javax/swing/text/AttributeSet -javax/swing/text/AttributeSet$CharacterAttribute -javax/swing/text/AttributeSet$ColorAttribute -javax/swing/text/AttributeSet$FontAttribute -javax/swing/text/AttributeSet$ParagraphAttribute -javax/swing/text/Caret -javax/swing/text/DefaultCaret -javax/swing/text/DefaultCaret$1 -javax/swing/text/DefaultCaret$Handler -javax/swing/text/DefaultEditorKit -javax/swing/text/DefaultEditorKit$BeepAction -javax/swing/text/DefaultEditorKit$BeginAction -javax/swing/text/DefaultEditorKit$BeginLineAction -javax/swing/text/DefaultEditorKit$BeginParagraphAction -javax/swing/text/DefaultEditorKit$BeginWordAction -javax/swing/text/DefaultEditorKit$CopyAction -javax/swing/text/DefaultEditorKit$CutAction -javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction -javax/swing/text/DefaultEditorKit$DeleteNextCharAction -javax/swing/text/DefaultEditorKit$DeletePrevCharAction -javax/swing/text/DefaultEditorKit$DeleteWordAction -javax/swing/text/DefaultEditorKit$DumpModelAction -javax/swing/text/DefaultEditorKit$EndAction -javax/swing/text/DefaultEditorKit$EndLineAction -javax/swing/text/DefaultEditorKit$EndParagraphAction -javax/swing/text/DefaultEditorKit$EndWordAction -javax/swing/text/DefaultEditorKit$InsertBreakAction -javax/swing/text/DefaultEditorKit$InsertContentAction -javax/swing/text/DefaultEditorKit$InsertTabAction -javax/swing/text/DefaultEditorKit$NextVisualPositionAction -javax/swing/text/DefaultEditorKit$NextWordAction -javax/swing/text/DefaultEditorKit$PageAction -javax/swing/text/DefaultEditorKit$PasteAction -javax/swing/text/DefaultEditorKit$PreviousWordAction -javax/swing/text/DefaultEditorKit$ReadOnlyAction -javax/swing/text/DefaultEditorKit$SelectAllAction -javax/swing/text/DefaultEditorKit$SelectLineAction -javax/swing/text/DefaultEditorKit$SelectParagraphAction -javax/swing/text/DefaultEditorKit$SelectWordAction -javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction -javax/swing/text/DefaultEditorKit$UnselectAction -javax/swing/text/DefaultEditorKit$VerticalPageAction -javax/swing/text/DefaultEditorKit$WritableAction -javax/swing/text/DefaultHighlighter -javax/swing/text/DefaultHighlighter$DefaultHighlightPainter -javax/swing/text/DefaultHighlighter$HighlightInfo -javax/swing/text/DefaultHighlighter$LayeredHighlightInfo -javax/swing/text/DefaultHighlighter$SafeDamager -javax/swing/text/Document -javax/swing/text/EditorKit -javax/swing/text/Element -javax/swing/text/FieldView -javax/swing/text/GapContent -javax/swing/text/GapContent$InsertUndo -javax/swing/text/GapContent$MarkData -javax/swing/text/GapContent$MarkVector -javax/swing/text/GapContent$StickyPosition -javax/swing/text/GapVector -javax/swing/text/Highlighter -javax/swing/text/Highlighter$Highlight -javax/swing/text/Highlighter$HighlightPainter -javax/swing/text/JTextComponent -javax/swing/text/JTextComponent$1 -javax/swing/text/JTextComponent$DefaultKeymap -javax/swing/text/JTextComponent$KeymapActionMap -javax/swing/text/JTextComponent$KeymapWrapper -javax/swing/text/JTextComponent$MutableCaretEvent -javax/swing/text/Keymap -javax/swing/text/LayeredHighlighter -javax/swing/text/LayeredHighlighter$LayerPainter -javax/swing/text/MutableAttributeSet -javax/swing/text/PlainDocument -javax/swing/text/PlainView -javax/swing/text/Position -javax/swing/text/Position$Bias -javax/swing/text/Segment -javax/swing/text/SegmentCache -javax/swing/text/SegmentCache$CachedSegment -javax/swing/text/SimpleAttributeSet -javax/swing/text/SimpleAttributeSet$EmptyAttributeSet -javax/swing/text/Style -javax/swing/text/StyleConstants -javax/swing/text/StyleConstants$CharacterConstants -javax/swing/text/StyleConstants$ColorConstants -javax/swing/text/StyleConstants$FontConstants -javax/swing/text/StyleConstants$ParagraphConstants -javax/swing/text/StyleContext -javax/swing/text/StyleContext$FontKey -javax/swing/text/StyleContext$KeyEnumeration -javax/swing/text/StyleContext$NamedStyle -javax/swing/text/StyleContext$SmallAttributeSet -javax/swing/text/TabExpander -javax/swing/text/TextAction -javax/swing/text/Utilities -javax/swing/text/View -javax/swing/text/ViewFactory -javax/swing/tree/TreeNode -javax/swing/undo/AbstractUndoableEdit -javax/swing/undo/CompoundEdit -javax/swing/undo/UndoableEdit -sun/awt/AWTAccessor -sun/awt/AWTAccessor$AWTEventAccessor -sun/awt/AWTAccessor$ClientPropertyKeyAccessor -sun/awt/AWTAccessor$ComponentAccessor -sun/awt/AWTAccessor$ContainerAccessor -sun/awt/AWTAccessor$CursorAccessor -sun/awt/AWTAccessor$DefaultKeyboardFocusManagerAccessor -sun/awt/AWTAccessor$EventQueueAccessor -sun/awt/AWTAccessor$FrameAccessor -sun/awt/AWTAccessor$InputEventAccessor -sun/awt/AWTAccessor$KeyEventAccessor -sun/awt/AWTAccessor$KeyboardFocusManagerAccessor -sun/awt/AWTAccessor$ToolkitAccessor -sun/awt/AWTAccessor$WindowAccessor -sun/awt/AWTAutoShutdown -sun/awt/AppContext -sun/awt/AppContext$1 -sun/awt/AppContext$2 -sun/awt/AppContext$3 -sun/awt/AppContext$6 -sun/awt/AppContext$State -sun/awt/CGraphicsConfig -sun/awt/CGraphicsDevice -sun/awt/CGraphicsEnvironment -sun/awt/CGraphicsEnvironment$1 -sun/awt/CGraphicsEnvironment$2 -sun/awt/CausedFocusEvent -sun/awt/CausedFocusEvent$Cause -sun/awt/ComponentFactory -sun/awt/ConstrainableGraphics -sun/awt/DisplayChangedListener -sun/awt/EmbeddedFrame -sun/awt/EventQueueDelegate -sun/awt/EventQueueItem -sun/awt/FontConfiguration -sun/awt/FontDescriptor -sun/awt/FullScreenCapable -sun/awt/HeadlessToolkit -sun/awt/InputMethodSupport -sun/awt/KeyboardFocusManagerPeerImpl -sun/awt/KeyboardFocusManagerPeerProvider -sun/awt/LightweightFrame -sun/awt/ModalExclude -sun/awt/ModalityEvent -sun/awt/ModalityListener -sun/awt/MostRecentKeyValue -sun/awt/Mutex -sun/awt/NullComponentPeer -sun/awt/OSInfo -sun/awt/OSInfo$1 -sun/awt/OSInfo$OSType -sun/awt/OSInfo$WindowsVersion -sun/awt/PaintEventDispatcher -sun/awt/PeerEvent -sun/awt/PostEventQueue -sun/awt/RepaintArea -sun/awt/RequestFocusController -sun/awt/SunDisplayChanger -sun/awt/SunGraphicsCallback -sun/awt/SunHints -sun/awt/SunHints$Key -sun/awt/SunHints$LCDContrastKey -sun/awt/SunHints$Value -sun/awt/SunToolkit -sun/awt/SunToolkit$1 -sun/awt/SunToolkit$ModalityListenerList -sun/awt/TimedWindowEvent -sun/awt/WindowClosingListener -sun/awt/WindowClosingSupport -sun/awt/datatransfer/DataTransferer -sun/awt/datatransfer/DataTransferer$1 -sun/awt/datatransfer/DataTransferer$CharsetComparator -sun/awt/datatransfer/DataTransferer$IndexOrderComparator -sun/awt/datatransfer/DataTransferer$IndexedComparator -sun/awt/datatransfer/DataTransferer$RMI -sun/awt/datatransfer/DataTransferer$StandardEncodingsHolder -sun/awt/datatransfer/SunClipboard -sun/awt/datatransfer/ToolkitThreadBlockedHandler -sun/awt/datatransfer/TransferableProxy -sun/awt/dnd/SunDragSourceContextPeer -sun/awt/dnd/SunDropTargetEvent -sun/awt/event/IgnorePaintEvent -sun/awt/im/CompositionAreaHandler -sun/awt/im/ExecutableInputMethodManager -sun/awt/im/ExecutableInputMethodManager$3 -sun/awt/im/InputContext -sun/awt/im/InputMethodAdapter -sun/awt/im/InputMethodContext -sun/awt/im/InputMethodLocator -sun/awt/im/InputMethodManager -sun/awt/im/InputMethodWindow -sun/awt/image/BufImgSurfaceData -sun/awt/image/BufImgSurfaceData$ICMColorData -sun/awt/image/BufImgSurfaceManager -sun/awt/image/BufferedImageGraphicsConfig -sun/awt/image/ByteComponentRaster -sun/awt/image/ByteInterleavedRaster -sun/awt/image/BytePackedRaster -sun/awt/image/FetcherInfo -sun/awt/image/GifFrame -sun/awt/image/GifImageDecoder -sun/awt/image/ImageConsumerQueue -sun/awt/image/ImageDecoder -sun/awt/image/ImageFetchable -sun/awt/image/ImageFetcher -sun/awt/image/ImageFetcher$1 -sun/awt/image/ImageRepresentation -sun/awt/image/ImageWatched -sun/awt/image/ImageWatched$Link -sun/awt/image/ImageWatched$WeakLink -sun/awt/image/InputStreamImageSource -sun/awt/image/IntegerComponentRaster -sun/awt/image/IntegerInterleavedRaster -sun/awt/image/NativeLibLoader -sun/awt/image/NativeLibLoader$1 -sun/awt/image/OffScreenImage -sun/awt/image/OffScreenImageSource -sun/awt/image/PNGFilterInputStream -sun/awt/image/PNGImageDecoder -sun/awt/image/PixelConverter -sun/awt/image/PixelConverter$Argb -sun/awt/image/PixelConverter$ArgbBm -sun/awt/image/PixelConverter$ArgbPre -sun/awt/image/PixelConverter$Bgrx -sun/awt/image/PixelConverter$ByteGray -sun/awt/image/PixelConverter$Rgba -sun/awt/image/PixelConverter$RgbaPre -sun/awt/image/PixelConverter$Rgbx -sun/awt/image/PixelConverter$Ushort4444Argb -sun/awt/image/PixelConverter$Ushort555Rgb -sun/awt/image/PixelConverter$Ushort555Rgbx -sun/awt/image/PixelConverter$Ushort565Rgb -sun/awt/image/PixelConverter$UshortGray -sun/awt/image/PixelConverter$Xbgr -sun/awt/image/PixelConverter$Xrgb -sun/awt/image/SunVolatileImage -sun/awt/image/SunWritableRaster -sun/awt/image/SunWritableRaster$DataStealer -sun/awt/image/SurfaceManager -sun/awt/image/SurfaceManager$FlushableCacheData -sun/awt/image/SurfaceManager$ImageAccessor -sun/awt/image/SurfaceManager$ProxiedGraphicsConfig -sun/awt/image/ToolkitImage -sun/awt/image/URLImageSource -sun/awt/image/VolatileSurfaceManager -sun/awt/resources/awt -sun/awt/resources/awtosx -sun/awt/util/IdentityArrayList -sun/awt/util/IdentityLinkedList -sun/awt/util/IdentityLinkedList$Entry -sun/awt/util/IdentityLinkedList$ListItr -sun/dc/DuctusRenderingEngine -sun/font/AttributeValues -sun/font/CCharToGlyphMapper -sun/font/CCharToGlyphMapper$Cache -sun/font/CFont -sun/font/CFontConfiguration -sun/font/CFontManager -sun/font/CFontManager$4 -sun/font/CStrike -sun/font/CStrike$GlyphAdvanceCache -sun/font/CStrike$GlyphInfoCache -sun/font/CStrikeDisposer -sun/font/CharToGlyphMapper -sun/font/CompositeFont -sun/font/CompositeFontDescriptor -sun/font/CoreMetrics -sun/font/EAttribute -sun/font/FileFont -sun/font/Font2D -sun/font/Font2DHandle -sun/font/FontAccess -sun/font/FontDesignMetrics -sun/font/FontDesignMetrics$KeyReference -sun/font/FontDesignMetrics$MetricsKey -sun/font/FontFamily -sun/font/FontLineMetrics -sun/font/FontManager -sun/font/FontManagerFactory -sun/font/FontManagerFactory$1 -sun/font/FontManagerForSGE -sun/font/FontManagerNativeLibrary -sun/font/FontManagerNativeLibrary$1 -sun/font/FontStrike -sun/font/FontStrikeDesc -sun/font/FontStrikeDisposer -sun/font/FontUtilities -sun/font/FontUtilities$1 -sun/font/GlyphList -sun/font/PhysicalFont -sun/font/PhysicalStrike -sun/font/StandardGlyphVector -sun/font/StandardGlyphVector$GlyphStrike -sun/font/StrikeCache -sun/font/StrikeCache$1 -sun/font/StrikeCache$DisposableStrike -sun/font/StrikeCache$SoftDisposerRef -sun/font/StrikeMetrics -sun/font/SunFontManager -sun/font/SunFontManager$1 -sun/font/SunFontManager$11 -sun/font/SunFontManager$2 -sun/font/SunFontManager$3 -sun/font/SunFontManager$FontRegistrationInfo -sun/font/SunFontManager$T1Filter -sun/font/SunFontManager$TTFilter -sun/font/TrueTypeFont -sun/font/TrueTypeFont$1 -sun/font/TrueTypeFont$DirectoryEntry -sun/font/TrueTypeFont$TTDisposerRecord -sun/font/Type1Font -sun/java2d/DefaultDisposerRecord -sun/java2d/DestSurfaceProvider -sun/java2d/Disposer -sun/java2d/Disposer$1 -sun/java2d/Disposer$2 -sun/java2d/Disposer$PollDisposable -sun/java2d/DisposerRecord -sun/java2d/DisposerTarget -sun/java2d/FontSupport -sun/java2d/InvalidPipeException -sun/java2d/MacosxSurfaceManagerFactory -sun/java2d/NullSurfaceData -sun/java2d/StateTrackable -sun/java2d/StateTrackable$State -sun/java2d/StateTrackableDelegate -sun/java2d/StateTrackableDelegate$1 -sun/java2d/StateTrackableDelegate$2 -sun/java2d/StateTracker -sun/java2d/StateTracker$1 -sun/java2d/StateTracker$2 -sun/java2d/SunGraphics2D -sun/java2d/SunGraphicsEnvironment -sun/java2d/SunGraphicsEnvironment$1 -sun/java2d/Surface -sun/java2d/SurfaceData -sun/java2d/SurfaceData$PixelToPgramLoopConverter -sun/java2d/SurfaceData$PixelToShapeLoopConverter -sun/java2d/SurfaceDataProxy -sun/java2d/SurfaceDataProxy$1 -sun/java2d/SurfaceManagerFactory -sun/java2d/cmm/CMSManager -sun/java2d/cmm/ProfileActivator -sun/java2d/cmm/ProfileDeferralInfo -sun/java2d/cmm/ProfileDeferralMgr -sun/java2d/loops/Blit -sun/java2d/loops/BlitBg -sun/java2d/loops/CompositeType -sun/java2d/loops/CustomComponent -sun/java2d/loops/DrawGlyphList -sun/java2d/loops/DrawGlyphListAA -sun/java2d/loops/DrawGlyphListLCD -sun/java2d/loops/DrawLine -sun/java2d/loops/DrawParallelogram -sun/java2d/loops/DrawPath -sun/java2d/loops/DrawPolygons -sun/java2d/loops/DrawRect -sun/java2d/loops/FillParallelogram -sun/java2d/loops/FillPath -sun/java2d/loops/FillRect -sun/java2d/loops/FillSpans -sun/java2d/loops/FontInfo -sun/java2d/loops/GeneralRenderer -sun/java2d/loops/GraphicsPrimitive -sun/java2d/loops/GraphicsPrimitiveMgr -sun/java2d/loops/GraphicsPrimitiveMgr$1 -sun/java2d/loops/GraphicsPrimitiveMgr$2 -sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec -sun/java2d/loops/GraphicsPrimitiveProxy -sun/java2d/loops/MaskBlit -sun/java2d/loops/MaskFill -sun/java2d/loops/ProcessPath$DrawHandler -sun/java2d/loops/RenderCache -sun/java2d/loops/RenderCache$Entry -sun/java2d/loops/RenderLoops -sun/java2d/loops/ScaledBlit -sun/java2d/loops/SurfaceType -sun/java2d/loops/TransformBlit -sun/java2d/loops/TransformHelper -sun/java2d/loops/XORComposite -sun/java2d/opengl/CGLGraphicsConfig -sun/java2d/opengl/CGLGraphicsConfig$1 -sun/java2d/opengl/CGLGraphicsConfig$CGLGCDisposerRecord -sun/java2d/opengl/CGLGraphicsConfig$CGLImageCaps -sun/java2d/opengl/CGLLayer -sun/java2d/opengl/CGLSurfaceData -sun/java2d/opengl/CGLSurfaceData$CGLLayerSurfaceData -sun/java2d/opengl/CGLSurfaceData$CGLOffScreenSurfaceData -sun/java2d/opengl/CGLVolatileSurfaceManager -sun/java2d/opengl/OGLAnyCompositeBlit -sun/java2d/opengl/OGLBlitLoops -sun/java2d/opengl/OGLContext -sun/java2d/opengl/OGLContext$OGLContextCaps -sun/java2d/opengl/OGLDrawImage -sun/java2d/opengl/OGLGeneralBlit -sun/java2d/opengl/OGLGraphicsConfig -sun/java2d/opengl/OGLMaskBlit -sun/java2d/opengl/OGLMaskFill -sun/java2d/opengl/OGLRTTSurfaceToSurfaceBlit -sun/java2d/opengl/OGLRTTSurfaceToSurfaceScale -sun/java2d/opengl/OGLRTTSurfaceToSurfaceTransform -sun/java2d/opengl/OGLRenderQueue -sun/java2d/opengl/OGLRenderQueue$1 -sun/java2d/opengl/OGLRenderQueue$QueueFlusher -sun/java2d/opengl/OGLRenderer -sun/java2d/opengl/OGLSurfaceData -sun/java2d/opengl/OGLSurfaceData$1 -sun/java2d/opengl/OGLSurfaceDataProxy -sun/java2d/opengl/OGLSurfaceToSurfaceBlit -sun/java2d/opengl/OGLSurfaceToSurfaceScale -sun/java2d/opengl/OGLSurfaceToSurfaceTransform -sun/java2d/opengl/OGLSurfaceToSwBlit -sun/java2d/opengl/OGLSwToSurfaceBlit -sun/java2d/opengl/OGLSwToSurfaceScale -sun/java2d/opengl/OGLSwToSurfaceTransform -sun/java2d/opengl/OGLSwToTextureBlit -sun/java2d/opengl/OGLTextRenderer -sun/java2d/opengl/OGLTextureToSurfaceBlit -sun/java2d/opengl/OGLTextureToSurfaceScale -sun/java2d/opengl/OGLTextureToSurfaceTransform -sun/java2d/pipe/AAShapePipe -sun/java2d/pipe/AATextRenderer -sun/java2d/pipe/AlphaColorPipe -sun/java2d/pipe/AlphaPaintPipe -sun/java2d/pipe/BufferedContext -sun/java2d/pipe/BufferedMaskBlit -sun/java2d/pipe/BufferedMaskFill -sun/java2d/pipe/BufferedPaints -sun/java2d/pipe/BufferedRenderPipe -sun/java2d/pipe/BufferedRenderPipe$AAParallelogramPipe -sun/java2d/pipe/BufferedRenderPipe$BufferedDrawHandler -sun/java2d/pipe/BufferedTextPipe -sun/java2d/pipe/CompositePipe -sun/java2d/pipe/DrawImage -sun/java2d/pipe/DrawImagePipe -sun/java2d/pipe/GeneralCompositePipe -sun/java2d/pipe/GlyphListLoopPipe -sun/java2d/pipe/GlyphListPipe -sun/java2d/pipe/LCDTextRenderer -sun/java2d/pipe/LoopBasedPipe -sun/java2d/pipe/LoopPipe -sun/java2d/pipe/NullPipe -sun/java2d/pipe/OutlineTextRenderer -sun/java2d/pipe/ParallelogramPipe -sun/java2d/pipe/PixelDrawPipe -sun/java2d/pipe/PixelFillPipe -sun/java2d/pipe/PixelToParallelogramConverter -sun/java2d/pipe/PixelToShapeConverter -sun/java2d/pipe/Region -sun/java2d/pipe/Region$ImmutableRegion -sun/java2d/pipe/RegionIterator -sun/java2d/pipe/RenderBuffer -sun/java2d/pipe/RenderQueue -sun/java2d/pipe/RenderingEngine -sun/java2d/pipe/RenderingEngine$1 -sun/java2d/pipe/ShapeDrawPipe -sun/java2d/pipe/SolidTextRenderer -sun/java2d/pipe/SpanClipRenderer -sun/java2d/pipe/SpanShapeRenderer -sun/java2d/pipe/SpanShapeRenderer$Composite -sun/java2d/pipe/TextPipe -sun/java2d/pipe/TextRenderer -sun/java2d/pipe/ValidatePipe -sun/java2d/pipe/hw/AccelGraphicsConfig -sun/java2d/pipe/hw/AccelSurface -sun/java2d/pipe/hw/BufferedContextProvider -sun/java2d/pipe/hw/ContextCapabilities -sun/launcher/LauncherHelper -sun/launcher/LauncherHelper$FXHelper -sun/lwawt/LWCanvasPeer -sun/lwawt/LWComponentPeer -sun/lwawt/LWComponentPeer$1 -sun/lwawt/LWComponentPeer$2 -sun/lwawt/LWComponentPeer$3 -sun/lwawt/LWComponentPeer$DelegateContainer -sun/lwawt/LWContainerPeer -sun/lwawt/LWCursorManager -sun/lwawt/LWCursorManager$1 -sun/lwawt/LWGraphicsConfig -sun/lwawt/LWKeyboardFocusManagerPeer -sun/lwawt/LWLabelPeer -sun/lwawt/LWRepaintArea -sun/lwawt/LWToolkit -sun/lwawt/LWWindowPeer -sun/lwawt/LWWindowPeer$PeerType -sun/lwawt/PlatformComponent -sun/lwawt/PlatformEventNotifier -sun/lwawt/PlatformWindow -sun/lwawt/macosx/CClipboard -sun/lwawt/macosx/CCursorManager -sun/lwawt/macosx/CCustomCursor -sun/lwawt/macosx/CDataTransferer -sun/lwawt/macosx/CDropTarget -sun/lwawt/macosx/CFRetainedResource -sun/lwawt/macosx/CImage -sun/lwawt/macosx/CImage$Creator -sun/lwawt/macosx/CInputMethod -sun/lwawt/macosx/CInputMethodDescriptor -sun/lwawt/macosx/CPlatformComponent -sun/lwawt/macosx/CPlatformResponder -sun/lwawt/macosx/CPlatformView -sun/lwawt/macosx/CPlatformWindow -sun/lwawt/macosx/CPlatformWindow$1 -sun/lwawt/macosx/CPlatformWindow$10 -sun/lwawt/macosx/CPlatformWindow$11 -sun/lwawt/macosx/CPlatformWindow$12 -sun/lwawt/macosx/CPlatformWindow$14 -sun/lwawt/macosx/CPlatformWindow$2 -sun/lwawt/macosx/CPlatformWindow$3 -sun/lwawt/macosx/CPlatformWindow$4 -sun/lwawt/macosx/CPlatformWindow$5 -sun/lwawt/macosx/CPlatformWindow$6 -sun/lwawt/macosx/CPlatformWindow$7 -sun/lwawt/macosx/CPlatformWindow$8 -sun/lwawt/macosx/CPlatformWindow$9 -sun/lwawt/macosx/CPrinterDialog -sun/lwawt/macosx/CThreading -sun/lwawt/macosx/CToolkitThreadBlockedHandler -sun/lwawt/macosx/CWrapper$NSWindow -sun/lwawt/macosx/LWCToolkit -sun/lwawt/macosx/LWCToolkit$1 -sun/lwawt/macosx/LWCToolkit$2 -sun/lwawt/macosx/LWCToolkit$5 -sun/lwawt/macosx/LWCToolkit$AppleSpecificColor -sun/lwawt/macosx/NamedCursor -sun/lwawt/macosx/event/NSEvent -sun/misc/ASCIICaseInsensitiveComparator -sun/misc/Cleaner -sun/misc/CompoundEnumeration -sun/misc/ExtensionDependency -sun/misc/FileURLMapper -sun/misc/FloatingDecimal -sun/misc/FloatingDecimal$1 -sun/misc/FloatingDecimal$ASCIIToBinaryConverter -sun/misc/FloatingDecimal$BinaryToASCIIBuffer -sun/misc/FloatingDecimal$BinaryToASCIIConverter -sun/misc/FloatingDecimal$ExceptionalBinaryToASCIIBuffer -sun/misc/FloatingDecimal$PreparedASCIIToBinaryBuffer -sun/misc/IOUtils -sun/misc/JarIndex -sun/misc/JavaAWTAccess -sun/misc/JavaIOFileDescriptorAccess -sun/misc/JavaLangAccess -sun/misc/JavaNetAccess -sun/misc/JavaNioAccess -sun/misc/JavaSecurityAccess -sun/misc/JavaSecurityProtectionDomainAccess -sun/misc/JavaUtilJarAccess -sun/misc/JavaUtilZipFileAccess -sun/misc/Launcher -sun/misc/Launcher$AppClassLoader -sun/misc/Launcher$AppClassLoader$1 -sun/misc/Launcher$BootClassPathHolder -sun/misc/Launcher$BootClassPathHolder$1 -sun/misc/Launcher$ExtClassLoader -sun/misc/Launcher$ExtClassLoader$1 -sun/misc/Launcher$Factory -sun/misc/MetaIndex -sun/misc/NativeSignalHandler -sun/misc/OSEnvironment -sun/misc/Perf -sun/misc/Perf$GetPerfAction -sun/misc/PerfCounter -sun/misc/PerfCounter$CoreCounters -sun/misc/PerformanceLogger -sun/misc/PerformanceLogger$TimeData -sun/misc/PostVMInitHook -sun/misc/Resource -sun/misc/SharedSecrets -sun/misc/Signal -sun/misc/SignalHandler -sun/misc/SoftCache -sun/misc/SoftCache$ValueCell -sun/misc/URLClassPath -sun/misc/URLClassPath$1 -sun/misc/URLClassPath$2 -sun/misc/URLClassPath$3 -sun/misc/URLClassPath$FileLoader -sun/misc/URLClassPath$JarLoader -sun/misc/URLClassPath$JarLoader$1 -sun/misc/URLClassPath$JarLoader$2 -sun/misc/URLClassPath$Loader -sun/misc/Unsafe -sun/misc/VM -sun/misc/Version -sun/net/DefaultProgressMeteringPolicy -sun/net/NetHooks -sun/net/NetHooks$Provider -sun/net/NetProperties -sun/net/NetProperties$1 -sun/net/ProgressMeteringPolicy -sun/net/ProgressMonitor -sun/net/sdp/SdpProvider -sun/net/spi/DefaultProxySelector -sun/net/spi/DefaultProxySelector$1 -sun/net/spi/DefaultProxySelector$3 -sun/net/spi/DefaultProxySelector$NonProxyInfo -sun/net/spi/nameservice/NameService -sun/net/util/IPAddressUtil -sun/net/util/URLUtil -sun/net/www/MessageHeader -sun/net/www/ParseUtil -sun/net/www/URLConnection -sun/net/www/protocol/file/FileURLConnection -sun/net/www/protocol/file/Handler -sun/net/www/protocol/jar/Handler -sun/net/www/protocol/jar/JarFileFactory -sun/net/www/protocol/jar/JarURLConnection -sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream -sun/net/www/protocol/jar/URLJarFile -sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController -sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry -sun/nio/ByteBuffered -sun/nio/ch/DirectBuffer -sun/nio/ch/FileChannelImpl -sun/nio/ch/FileDispatcher -sun/nio/ch/FileDispatcherImpl -sun/nio/ch/IOStatus -sun/nio/ch/IOUtil -sun/nio/ch/IOUtil$1 -sun/nio/ch/Interruptible -sun/nio/ch/NativeDispatcher -sun/nio/ch/NativeThread -sun/nio/ch/NativeThreadSet -sun/nio/ch/Util -sun/nio/ch/Util$1 -sun/nio/ch/Util$BufferCache -sun/nio/cs/ArrayDecoder -sun/nio/cs/ArrayEncoder -sun/nio/cs/FastCharsetProvider -sun/nio/cs/HistoricallyNamedCharset -sun/nio/cs/ISO_8859_1 -sun/nio/cs/ISO_8859_1$Decoder -sun/nio/cs/StandardCharsets -sun/nio/cs/StandardCharsets$Aliases -sun/nio/cs/StandardCharsets$Cache -sun/nio/cs/StandardCharsets$Classes -sun/nio/cs/StreamDecoder -sun/nio/cs/StreamEncoder -sun/nio/cs/US_ASCII -sun/nio/cs/UTF_16 -sun/nio/cs/UTF_16$Decoder -sun/nio/cs/UTF_16BE -sun/nio/cs/UTF_16LE -sun/nio/cs/UTF_8 -sun/nio/cs/UTF_8$Decoder -sun/nio/cs/UTF_8$Encoder -sun/nio/cs/Unicode -sun/nio/cs/UnicodeDecoder -sun/print/PrinterGraphicsConfig -sun/reflect/AccessorGenerator -sun/reflect/BootstrapConstructorAccessorImpl -sun/reflect/ByteVector -sun/reflect/ByteVectorFactory -sun/reflect/ByteVectorImpl -sun/reflect/CallerSensitive -sun/reflect/ClassDefiner -sun/reflect/ClassDefiner$1 -sun/reflect/ClassFileAssembler -sun/reflect/ClassFileConstants -sun/reflect/ConstantPool -sun/reflect/ConstructorAccessor -sun/reflect/ConstructorAccessorImpl -sun/reflect/DelegatingClassLoader -sun/reflect/DelegatingConstructorAccessorImpl -sun/reflect/DelegatingMethodAccessorImpl -sun/reflect/FieldAccessor -sun/reflect/FieldAccessorImpl -sun/reflect/Label -sun/reflect/Label$PatchInfo -sun/reflect/LangReflectAccess -sun/reflect/MagicAccessorImpl -sun/reflect/MethodAccessor -sun/reflect/MethodAccessorGenerator -sun/reflect/MethodAccessorGenerator$1 -sun/reflect/MethodAccessorImpl -sun/reflect/NativeConstructorAccessorImpl -sun/reflect/NativeMethodAccessorImpl -sun/reflect/Reflection -sun/reflect/ReflectionFactory -sun/reflect/ReflectionFactory$1 -sun/reflect/ReflectionFactory$GetReflectionFactoryAction -sun/reflect/SerializationConstructorAccessorImpl -sun/reflect/UTF8 -sun/reflect/UnsafeBooleanFieldAccessorImpl -sun/reflect/UnsafeFieldAccessorFactory -sun/reflect/UnsafeFieldAccessorImpl -sun/reflect/UnsafeObjectFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl -sun/reflect/UnsafeStaticFieldAccessorImpl -sun/reflect/annotation/AnnotationType -sun/reflect/generics/repository/AbstractRepository -sun/reflect/generics/repository/ClassRepository -sun/reflect/generics/repository/GenericDeclRepository -sun/reflect/misc/MethodUtil -sun/reflect/misc/MethodUtil$1 -sun/reflect/misc/ReflectUtil -sun/security/action/GetBooleanAction -sun/security/action/GetPropertyAction -sun/security/util/Debug -sun/security/util/ManifestEntryVerifier -sun/swing/DefaultLookup -sun/swing/JLightweightFrame -sun/swing/MenuItemLayoutHelper -sun/swing/StringUIClientPropertyKey -sun/swing/SwingAccessor -sun/swing/SwingAccessor$JTextComponentAccessor -sun/swing/SwingLazyValue -sun/swing/SwingLazyValue$1 -sun/swing/SwingUtilities2 -sun/swing/SwingUtilities2$2 -sun/swing/SwingUtilities2$AATextInfo -sun/swing/SwingUtilities2$LSBCacheEntry -sun/swing/UIAction -sun/swing/UIClientPropertyKey -sun/util/CoreResourceBundleControl -sun/util/PreHashedMap -sun/util/ResourceBundleEnumeration -sun/util/calendar/AbstractCalendar -sun/util/calendar/BaseCalendar -sun/util/calendar/BaseCalendar$Date -sun/util/calendar/CalendarDate -sun/util/calendar/CalendarSystem -sun/util/calendar/CalendarUtils -sun/util/calendar/Gregorian -sun/util/calendar/Gregorian$Date -sun/util/calendar/ZoneInfo -sun/util/calendar/ZoneInfoFile -sun/util/calendar/ZoneInfoFile$1 -sun/util/calendar/ZoneInfoFile$Checksum -sun/util/calendar/ZoneInfoFile$ZoneOffsetTransitionRule -sun/util/locale/BaseLocale -sun/util/locale/BaseLocale$Cache -sun/util/locale/BaseLocale$Key -sun/util/locale/LocaleObjectCache -sun/util/locale/LocaleObjectCache$CacheEntry -sun/util/locale/LocaleUtils -sun/util/locale/provider/AuxLocaleProviderAdapter -sun/util/locale/provider/AuxLocaleProviderAdapter$NullProvider -sun/util/locale/provider/JRELocaleProviderAdapter -sun/util/locale/provider/JRELocaleProviderAdapter$1 -sun/util/locale/provider/LocaleDataMetaInfo -sun/util/locale/provider/LocaleProviderAdapter -sun/util/locale/provider/LocaleProviderAdapter$1 -sun/util/locale/provider/LocaleProviderAdapter$Type -sun/util/locale/provider/LocaleResources -sun/util/locale/provider/LocaleResources$ResourceReference -sun/util/locale/provider/LocaleServiceProviderPool -sun/util/locale/provider/LocaleServiceProviderPool$LocalizedObjectGetter -sun/util/locale/provider/ResourceBundleBasedAdapter -sun/util/locale/provider/SPILocaleProviderAdapter -sun/util/locale/provider/SPILocaleProviderAdapter$1 -sun/util/locale/provider/TimeZoneNameProviderImpl -sun/util/locale/provider/TimeZoneNameUtility$TimeZoneNameGetter -sun/util/logging/LoggingProxy -sun/util/logging/LoggingSupport -sun/util/logging/LoggingSupport$1 -sun/util/logging/LoggingSupport$2 -sun/util/logging/PlatformLogger -sun/util/logging/PlatformLogger$1 -sun/util/logging/PlatformLogger$DefaultLoggerProxy -sun/util/logging/PlatformLogger$JavaLoggerProxy -sun/util/logging/PlatformLogger$Level -sun/util/logging/PlatformLogger$LoggerProxy -sun/util/logging/resources/logging -sun/util/resources/LocaleData -sun/util/resources/LocaleData$1 -sun/util/resources/LocaleData$LocaleDataResourceBundleControl -sun/util/resources/OpenListResourceBundle -sun/util/resources/TimeZoneNames -sun/util/resources/TimeZoneNamesBundle -sun/util/resources/en/TimeZoneNames_en -# 32aa76348b93579f diff --git a/jdk/make/data/classlist/classlist.solaris b/jdk/make/data/classlist/classlist.solaris deleted file mode 100644 index e5175dccb95..00000000000 --- a/jdk/make/data/classlist/classlist.solaris +++ /dev/null @@ -1,2644 +0,0 @@ -com/sun/java/swing/SwingUtilities3 -com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI -com/sun/swing/internal/plaf/basic/resources/basic -com/sun/swing/internal/plaf/metal/resources/metal -java/applet/Applet -java/awt/AWTEvent -java/awt/AWTEvent$1 -java/awt/AWTEventMulticaster -java/awt/AWTKeyStroke -java/awt/AWTKeyStroke$1 -java/awt/ActiveEvent -java/awt/Adjustable -java/awt/AlphaComposite -java/awt/BasicStroke -java/awt/BorderLayout -java/awt/BufferCapabilities -java/awt/Canvas -java/awt/CardLayout -java/awt/CardLayout$Card -java/awt/Color -java/awt/Component -java/awt/Component$1 -java/awt/Component$3 -java/awt/Component$AWTTreeLock -java/awt/Component$AccessibleAWTComponent -java/awt/Component$BaselineResizeBehavior -java/awt/Component$BltBufferStrategy -java/awt/Component$BltSubRegionBufferStrategy -java/awt/Component$DummyRequestFocusController -java/awt/Component$FlipBufferStrategy -java/awt/ComponentOrientation -java/awt/Composite -java/awt/Conditional -java/awt/Container -java/awt/Container$1 -java/awt/Container$AccessibleAWTContainer -java/awt/ContainerOrderFocusTraversalPolicy -java/awt/Cursor -java/awt/Cursor$1 -java/awt/DefaultFocusTraversalPolicy -java/awt/DefaultKeyboardFocusManager -java/awt/DefaultKeyboardFocusManager$1 -java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent -java/awt/DefaultKeyboardFocusManager$TypeAheadMarker -java/awt/Dialog -java/awt/Dialog$ModalExclusionType -java/awt/Dialog$ModalityType -java/awt/Dimension -java/awt/Event -java/awt/EventDispatchThread -java/awt/EventDispatchThread$1 -java/awt/EventDispatchThread$HierarchyEventFilter -java/awt/EventFilter -java/awt/EventFilter$FilterAction -java/awt/EventQueue -java/awt/EventQueue$1 -java/awt/EventQueue$1AWTInvocationLock -java/awt/EventQueue$2 -java/awt/EventQueue$3 -java/awt/EventQueue$4 -java/awt/EventQueue$5 -java/awt/FlowLayout -java/awt/FocusTraversalPolicy -java/awt/Font -java/awt/Font$FontAccessImpl -java/awt/FontFormatException -java/awt/FontMetrics -java/awt/Frame -java/awt/Frame$1 -java/awt/Graphics -java/awt/Graphics2D -java/awt/GraphicsCallback -java/awt/GraphicsCallback$PaintCallback -java/awt/GraphicsConfiguration -java/awt/GraphicsDevice -java/awt/GraphicsEnvironment -java/awt/GraphicsEnvironment$1 -java/awt/GridLayout -java/awt/Image -java/awt/Image$1 -java/awt/ImageCapabilities -java/awt/ImageMediaEntry -java/awt/Insets -java/awt/ItemSelectable -java/awt/KeyEventDispatcher -java/awt/KeyEventPostProcessor -java/awt/KeyboardFocusManager -java/awt/KeyboardFocusManager$1 -java/awt/KeyboardFocusManager$3 -java/awt/KeyboardFocusManager$HeavyweightFocusRequest -java/awt/KeyboardFocusManager$LightweightFocusRequest -java/awt/Label -java/awt/LayoutManager -java/awt/LayoutManager2 -java/awt/LightweightDispatcher -java/awt/LightweightDispatcher$2 -java/awt/MediaEntry -java/awt/MediaTracker -java/awt/MenuBar -java/awt/MenuComponent -java/awt/MenuContainer -java/awt/ModalEventFilter -java/awt/Paint -java/awt/Panel -java/awt/Point -java/awt/PrintGraphics -java/awt/Queue -java/awt/Rectangle -java/awt/RenderingHints -java/awt/RenderingHints$Key -java/awt/SentEvent -java/awt/SequencedEvent -java/awt/SequencedEvent$1 -java/awt/Shape -java/awt/SplashScreen -java/awt/Stroke -java/awt/SystemColor -java/awt/Toolkit -java/awt/Toolkit$1 -java/awt/Toolkit$2 -java/awt/Toolkit$3 -java/awt/Toolkit$4 -java/awt/Toolkit$5 -java/awt/Toolkit$DesktopPropertyChangeSupport -java/awt/Toolkit$DesktopPropertyChangeSupport$1 -java/awt/Toolkit$SelectiveAWTEventListener -java/awt/Toolkit$ToolkitEventMulticaster -java/awt/Transparency -java/awt/TrayIcon -java/awt/VKCollection -java/awt/Window -java/awt/Window$1 -java/awt/Window$1DisposeAction -java/awt/Window$Type -java/awt/Window$WindowDisposerRecord -java/awt/color/ColorSpace -java/awt/color/ICC_ColorSpace -java/awt/color/ICC_Profile -java/awt/color/ICC_Profile$1 -java/awt/color/ICC_ProfileRGB -java/awt/datatransfer/Clipboard -java/awt/datatransfer/ClipboardOwner -java/awt/datatransfer/FlavorMap -java/awt/datatransfer/FlavorTable -java/awt/datatransfer/SystemFlavorMap -java/awt/datatransfer/Transferable -java/awt/dnd/DropTarget -java/awt/dnd/DropTargetContext -java/awt/dnd/DropTargetListener -java/awt/dnd/peer/DragSourceContextPeer -java/awt/dnd/peer/DropTargetContextPeer -java/awt/dnd/peer/DropTargetPeer -java/awt/event/AWTEventListener -java/awt/event/AWTEventListenerProxy -java/awt/event/ActionEvent -java/awt/event/ActionListener -java/awt/event/AdjustmentEvent -java/awt/event/AdjustmentListener -java/awt/event/ComponentAdapter -java/awt/event/ComponentEvent -java/awt/event/ComponentListener -java/awt/event/ContainerEvent -java/awt/event/ContainerListener -java/awt/event/FocusAdapter -java/awt/event/FocusEvent -java/awt/event/FocusListener -java/awt/event/HierarchyBoundsListener -java/awt/event/HierarchyListener -java/awt/event/InputEvent -java/awt/event/InputEvent$1 -java/awt/event/InputMethodEvent -java/awt/event/InputMethodListener -java/awt/event/InvocationEvent -java/awt/event/InvocationEvent$1 -java/awt/event/ItemEvent -java/awt/event/ItemListener -java/awt/event/KeyAdapter -java/awt/event/KeyEvent -java/awt/event/KeyEvent$1 -java/awt/event/KeyListener -java/awt/event/MouseAdapter -java/awt/event/MouseEvent -java/awt/event/MouseListener -java/awt/event/MouseMotionAdapter -java/awt/event/MouseMotionListener -java/awt/event/MouseWheelListener -java/awt/event/NativeLibLoader -java/awt/event/NativeLibLoader$1 -java/awt/event/PaintEvent -java/awt/event/TextListener -java/awt/event/WindowAdapter -java/awt/event/WindowEvent -java/awt/event/WindowFocusListener -java/awt/event/WindowListener -java/awt/event/WindowStateListener -java/awt/font/FontRenderContext -java/awt/font/GlyphVector -java/awt/font/LineMetrics -java/awt/font/TextAttribute -java/awt/geom/AffineTransform -java/awt/geom/Dimension2D -java/awt/geom/GeneralPath -java/awt/geom/Path2D -java/awt/geom/Path2D$Float -java/awt/geom/Path2D$Float$CopyIterator -java/awt/geom/Path2D$Iterator -java/awt/geom/PathIterator -java/awt/geom/Point2D -java/awt/geom/Point2D$Float -java/awt/geom/RectIterator -java/awt/geom/Rectangle2D -java/awt/geom/Rectangle2D$Float -java/awt/geom/RectangularShape -java/awt/im/InputContext -java/awt/im/InputMethodRequests -java/awt/im/spi/InputMethod -java/awt/im/spi/InputMethodContext -java/awt/im/spi/InputMethodDescriptor -java/awt/image/BufferStrategy -java/awt/image/BufferedImage -java/awt/image/BufferedImage$1 -java/awt/image/ColorModel -java/awt/image/ColorModel$1 -java/awt/image/ComponentSampleModel -java/awt/image/DataBuffer -java/awt/image/DataBuffer$1 -java/awt/image/DataBufferByte -java/awt/image/DataBufferInt -java/awt/image/DirectColorModel -java/awt/image/FilteredImageSource -java/awt/image/ImageConsumer -java/awt/image/ImageFilter -java/awt/image/ImageObserver -java/awt/image/ImageProducer -java/awt/image/IndexColorModel -java/awt/image/PackedColorModel -java/awt/image/PixelInterleavedSampleModel -java/awt/image/RGBImageFilter -java/awt/image/Raster -java/awt/image/RenderedImage -java/awt/image/SampleModel -java/awt/image/SinglePixelPackedSampleModel -java/awt/image/VolatileImage -java/awt/image/WritableRaster -java/awt/image/WritableRenderedImage -java/awt/peer/CanvasPeer -java/awt/peer/ComponentPeer -java/awt/peer/ContainerPeer -java/awt/peer/FramePeer -java/awt/peer/KeyboardFocusManagerPeer -java/awt/peer/LabelPeer -java/awt/peer/LightweightPeer -java/awt/peer/PanelPeer -java/awt/peer/SystemTrayPeer -java/awt/peer/WindowPeer -java/awt/print/PrinterGraphics -java/beans/ChangeListenerMap -java/beans/PropertyChangeEvent -java/beans/PropertyChangeListener -java/beans/PropertyChangeListenerProxy -java/beans/PropertyChangeSupport -java/beans/PropertyChangeSupport$PropertyChangeListenerMap -java/beans/VetoableChangeListener -java/io/Bits -java/io/BufferedInputStream -java/io/BufferedOutputStream -java/io/BufferedReader -java/io/BufferedWriter -java/io/ByteArrayInputStream -java/io/ByteArrayOutputStream -java/io/Closeable -java/io/DataInput -java/io/DataInputStream -java/io/DataOutput -java/io/DataOutputStream -java/io/DefaultFileSystem -java/io/EOFException -java/io/ExpiringCache -java/io/ExpiringCache$1 -java/io/ExpiringCache$Entry -java/io/Externalizable -java/io/File -java/io/File$PathStatus -java/io/FileDescriptor -java/io/FileDescriptor$1 -java/io/FileInputStream -java/io/FileInputStream$1 -java/io/FileNotFoundException -java/io/FileOutputStream -java/io/FileOutputStream$1 -java/io/FilePermission -java/io/FilePermission$1 -java/io/FilePermissionCollection -java/io/FileReader -java/io/FileSystem -java/io/FileWriter -java/io/FilenameFilter -java/io/FilterInputStream -java/io/FilterOutputStream -java/io/FilterReader -java/io/Flushable -java/io/IOException -java/io/InputStream -java/io/InputStreamReader -java/io/InterruptedIOException -java/io/NotSerializableException -java/io/ObjectInput -java/io/ObjectInputStream -java/io/ObjectInputStream$BlockDataInputStream -java/io/ObjectInputStream$GetField -java/io/ObjectInputStream$GetFieldImpl -java/io/ObjectInputStream$HandleTable -java/io/ObjectInputStream$HandleTable$HandleList -java/io/ObjectInputStream$PeekInputStream -java/io/ObjectInputStream$ValidationList -java/io/ObjectOutput -java/io/ObjectOutputStream -java/io/ObjectOutputStream$BlockDataOutputStream -java/io/ObjectOutputStream$HandleTable -java/io/ObjectOutputStream$ReplaceTable -java/io/ObjectStreamClass -java/io/ObjectStreamClass$1 -java/io/ObjectStreamClass$2 -java/io/ObjectStreamClass$3 -java/io/ObjectStreamClass$4 -java/io/ObjectStreamClass$5 -java/io/ObjectStreamClass$Caches -java/io/ObjectStreamClass$ClassDataSlot -java/io/ObjectStreamClass$EntryFuture -java/io/ObjectStreamClass$ExceptionInfo -java/io/ObjectStreamClass$FieldReflector -java/io/ObjectStreamClass$FieldReflectorKey -java/io/ObjectStreamClass$MemberSignature -java/io/ObjectStreamClass$WeakClassKey -java/io/ObjectStreamConstants -java/io/ObjectStreamException -java/io/ObjectStreamField -java/io/OutputStream -java/io/OutputStreamWriter -java/io/PrintStream -java/io/PushbackInputStream -java/io/RandomAccessFile -java/io/RandomAccessFile$1 -java/io/Reader -java/io/SerialCallbackContext -java/io/Serializable -java/io/StreamTokenizer -java/io/StringReader -java/io/StringWriter -java/io/UnixFileSystem -java/io/UnsupportedEncodingException -java/io/Writer -java/lang/AbstractStringBuilder -java/lang/Appendable -java/lang/ApplicationShutdownHooks -java/lang/ApplicationShutdownHooks$1 -java/lang/ArithmeticException -java/lang/ArrayIndexOutOfBoundsException -java/lang/ArrayStoreException -java/lang/AssertionError -java/lang/AutoCloseable -java/lang/Boolean -java/lang/BootstrapMethodError -java/lang/Byte -java/lang/CharSequence -java/lang/Character -java/lang/Character$CharacterCache -java/lang/CharacterData -java/lang/CharacterData00 -java/lang/CharacterDataLatin1 -java/lang/Class -java/lang/Class$1 -java/lang/Class$3 -java/lang/Class$4 -java/lang/Class$AnnotationData -java/lang/Class$Atomic -java/lang/Class$ReflectionData -java/lang/ClassCastException -java/lang/ClassFormatError -java/lang/ClassLoader -java/lang/ClassLoader$2 -java/lang/ClassLoader$3 -java/lang/ClassLoader$NativeLibrary -java/lang/ClassLoader$ParallelLoaders -java/lang/ClassLoaderHelper -java/lang/ClassNotFoundException -java/lang/ClassValue$ClassValueMap -java/lang/CloneNotSupportedException -java/lang/Cloneable -java/lang/Comparable -java/lang/Compiler -java/lang/Compiler$1 -java/lang/Double -java/lang/Enum -java/lang/Error -java/lang/Exception -java/lang/ExceptionInInitializerError -java/lang/Float -java/lang/IllegalAccessError -java/lang/IllegalAccessException -java/lang/IllegalArgumentException -java/lang/IllegalMonitorStateException -java/lang/IllegalStateException -java/lang/IncompatibleClassChangeError -java/lang/IndexOutOfBoundsException -java/lang/InheritableThreadLocal -java/lang/InstantiationException -java/lang/Integer -java/lang/Integer$IntegerCache -java/lang/InternalError -java/lang/InterruptedException -java/lang/Iterable -java/lang/LinkageError -java/lang/Long -java/lang/Long$LongCache -java/lang/Math -java/lang/NoClassDefFoundError -java/lang/NoSuchFieldException -java/lang/NoSuchMethodError -java/lang/NoSuchMethodException -java/lang/NullPointerException -java/lang/Number -java/lang/NumberFormatException -java/lang/Object -java/lang/OutOfMemoryError -java/lang/Package -java/lang/Process -java/lang/ProcessBuilder -java/lang/ProcessEnvironment -java/lang/ProcessEnvironment$ExternalData -java/lang/ProcessEnvironment$StringEnvironment -java/lang/ProcessEnvironment$Value -java/lang/ProcessEnvironment$Variable -java/lang/ProcessImpl -java/lang/Readable -java/lang/ReflectiveOperationException -java/lang/Runnable -java/lang/Runtime -java/lang/RuntimeException -java/lang/RuntimePermission -java/lang/SecurityException -java/lang/SecurityManager -java/lang/Short -java/lang/Short$ShortCache -java/lang/Shutdown -java/lang/Shutdown$Lock -java/lang/StackOverflowError -java/lang/StackTraceElement -java/lang/StrictMath -java/lang/String -java/lang/String$CaseInsensitiveComparator -java/lang/StringBuffer -java/lang/StringBuilder -java/lang/StringCoding -java/lang/StringCoding$StringDecoder -java/lang/StringCoding$StringEncoder -java/lang/StringIndexOutOfBoundsException -java/lang/System -java/lang/System$2 -java/lang/SystemClassLoaderAction -java/lang/Terminator -java/lang/Terminator$1 -java/lang/Thread -java/lang/Thread$State -java/lang/Thread$UncaughtExceptionHandler -java/lang/ThreadDeath -java/lang/ThreadGroup -java/lang/ThreadLocal -java/lang/ThreadLocal$ThreadLocalMap -java/lang/ThreadLocal$ThreadLocalMap$Entry -java/lang/Throwable -java/lang/Throwable$PrintStreamOrWriter -java/lang/Throwable$WrappedPrintStream -java/lang/UNIXProcess -java/lang/UNIXProcess$1 -java/lang/UNIXProcess$2 -java/lang/UNIXProcess$3 -java/lang/UNIXProcess$3$1 -java/lang/UNIXProcess$DeferredCloseInputStream -java/lang/UNIXProcess$LaunchMechanism -java/lang/UnsatisfiedLinkError -java/lang/UnsupportedOperationException -java/lang/VirtualMachineError -java/lang/Void -java/lang/annotation/Annotation -java/lang/invoke/CallSite -java/lang/invoke/ConstantCallSite -java/lang/invoke/DirectMethodHandle -java/lang/invoke/Invokers -java/lang/invoke/LambdaForm -java/lang/invoke/LambdaForm$NamedFunction -java/lang/invoke/MemberName -java/lang/invoke/MemberName$Factory -java/lang/invoke/MethodHandle -java/lang/invoke/MethodHandleImpl -java/lang/invoke/MethodHandleNatives -java/lang/invoke/MethodHandleStatics -java/lang/invoke/MethodHandleStatics$1 -java/lang/invoke/MethodType -java/lang/invoke/MethodType$ConcurrentWeakInternSet -java/lang/invoke/MethodType$ConcurrentWeakInternSet$WeakEntry -java/lang/invoke/MethodTypeForm -java/lang/invoke/MutableCallSite -java/lang/invoke/VolatileCallSite -java/lang/ref/FinalReference -java/lang/ref/Finalizer -java/lang/ref/Finalizer$FinalizerThread -java/lang/ref/PhantomReference -java/lang/ref/Reference -java/lang/ref/Reference$Lock -java/lang/ref/Reference$ReferenceHandler -java/lang/ref/ReferenceQueue -java/lang/ref/ReferenceQueue$Lock -java/lang/ref/ReferenceQueue$Null -java/lang/ref/SoftReference -java/lang/ref/WeakReference -java/lang/reflect/AccessibleObject -java/lang/reflect/AnnotatedElement -java/lang/reflect/Array -java/lang/reflect/Constructor -java/lang/reflect/Executable -java/lang/reflect/Field -java/lang/reflect/GenericDeclaration -java/lang/reflect/InvocationHandler -java/lang/reflect/InvocationTargetException -java/lang/reflect/Member -java/lang/reflect/Method -java/lang/reflect/Modifier -java/lang/reflect/Parameter -java/lang/reflect/Proxy -java/lang/reflect/Proxy$KeyFactory -java/lang/reflect/Proxy$ProxyClassFactory -java/lang/reflect/ReflectAccess -java/lang/reflect/ReflectPermission -java/lang/reflect/Type -java/lang/reflect/WeakCache -java/math/BigInteger -java/math/BigInteger$UnsafeHolder -java/math/MutableBigInteger -java/math/RoundingMode -java/net/AbstractPlainDatagramSocketImpl -java/net/AbstractPlainDatagramSocketImpl$1 -java/net/AbstractPlainSocketImpl -java/net/AbstractPlainSocketImpl$1 -java/net/Authenticator -java/net/BindException -java/net/ConnectException -java/net/DatagramPacket -java/net/DatagramPacket$1 -java/net/DatagramSocket -java/net/DatagramSocket$1 -java/net/DatagramSocketImpl -java/net/DefaultDatagramSocketImplFactory -java/net/DefaultInterface -java/net/FileNameMap -java/net/HttpURLConnection -java/net/Inet4Address -java/net/Inet4AddressImpl -java/net/Inet6Address -java/net/Inet6Address$Inet6AddressHolder -java/net/Inet6AddressImpl -java/net/InetAddress -java/net/InetAddress$1 -java/net/InetAddress$2 -java/net/InetAddress$Cache -java/net/InetAddress$Cache$Type -java/net/InetAddress$CacheEntry -java/net/InetAddress$InetAddressHolder -java/net/InetAddressImpl -java/net/InetAddressImplFactory -java/net/InetSocketAddress -java/net/InetSocketAddress$InetSocketAddressHolder -java/net/InterfaceAddress -java/net/JarURLConnection -java/net/MalformedURLException -java/net/MulticastSocket -java/net/NetworkInterface -java/net/NetworkInterface$1 -java/net/NetworkInterface$2 -java/net/NoRouteToHostException -java/net/Parts -java/net/PlainDatagramSocketImpl -java/net/PlainSocketImpl -java/net/Proxy -java/net/Proxy$Type -java/net/ProxySelector -java/net/ServerSocket -java/net/Socket -java/net/SocketAddress -java/net/SocketException -java/net/SocketImpl -java/net/SocketImplFactory -java/net/SocketOptions -java/net/SocksConsts -java/net/SocksSocketImpl -java/net/SocksSocketImpl$3 -java/net/URI -java/net/URI$Parser -java/net/URL -java/net/URLClassLoader -java/net/URLClassLoader$1 -java/net/URLClassLoader$2 -java/net/URLClassLoader$3 -java/net/URLClassLoader$3$1 -java/net/URLClassLoader$7 -java/net/URLConnection -java/net/URLConnection$1 -java/net/URLStreamHandler -java/net/URLStreamHandlerFactory -java/net/UnknownHostException -java/nio/Bits -java/nio/Bits$1 -java/nio/Buffer -java/nio/BufferUnderflowException -java/nio/ByteBuffer -java/nio/ByteBufferAsIntBufferB -java/nio/ByteBufferAsShortBufferB -java/nio/ByteOrder -java/nio/CharBuffer -java/nio/DirectByteBuffer -java/nio/DirectByteBuffer$Deallocator -java/nio/DirectByteBufferR -java/nio/DirectLongBufferU -java/nio/HeapByteBuffer -java/nio/HeapCharBuffer -java/nio/IntBuffer -java/nio/LongBuffer -java/nio/MappedByteBuffer -java/nio/ShortBuffer -java/nio/channels/ByteChannel -java/nio/channels/Channel -java/nio/channels/FileChannel -java/nio/channels/FileChannel$MapMode -java/nio/channels/GatheringByteChannel -java/nio/channels/InterruptibleChannel -java/nio/channels/NetworkChannel -java/nio/channels/ReadableByteChannel -java/nio/channels/ScatteringByteChannel -java/nio/channels/SeekableByteChannel -java/nio/channels/SelectableChannel -java/nio/channels/SocketChannel -java/nio/channels/WritableByteChannel -java/nio/channels/spi/AbstractInterruptibleChannel -java/nio/channels/spi/AbstractInterruptibleChannel$1 -java/nio/channels/spi/AbstractSelectableChannel -java/nio/charset/Charset -java/nio/charset/Charset$ExtendedProviderHolder -java/nio/charset/Charset$ExtendedProviderHolder$1 -java/nio/charset/CharsetDecoder -java/nio/charset/CharsetEncoder -java/nio/charset/CoderResult -java/nio/charset/CoderResult$1 -java/nio/charset/CoderResult$2 -java/nio/charset/CoderResult$Cache -java/nio/charset/CodingErrorAction -java/nio/charset/StandardCharsets -java/nio/charset/spi/CharsetProvider -java/nio/file/Path -java/nio/file/Watchable -java/nio/file/attribute/FileAttribute -java/security/AccessControlContext -java/security/AccessControlException -java/security/AccessController -java/security/AlgorithmParameters -java/security/AlgorithmParametersSpi -java/security/AllPermission -java/security/AllPermissionCollection -java/security/AuthProvider -java/security/BasicPermission -java/security/BasicPermissionCollection -java/security/CodeSigner -java/security/CodeSource -java/security/DigestException -java/security/GeneralSecurityException -java/security/Guard -java/security/InvalidAlgorithmParameterException -java/security/InvalidKeyException -java/security/InvalidParameterException -java/security/Key -java/security/KeyException -java/security/KeyFactory -java/security/KeyFactorySpi -java/security/MessageDigest -java/security/MessageDigest$Delegate -java/security/MessageDigestSpi -java/security/NoSuchAlgorithmException -java/security/Permission -java/security/PermissionCollection -java/security/Permissions -java/security/Principal -java/security/PrivateKey -java/security/PrivilegedAction -java/security/PrivilegedActionException -java/security/PrivilegedExceptionAction -java/security/ProtectionDomain -java/security/ProtectionDomain$1 -java/security/ProtectionDomain$3 -java/security/ProtectionDomain$Key -java/security/Provider -java/security/Provider$EngineDescription -java/security/Provider$Service -java/security/Provider$ServiceKey -java/security/Provider$UString -java/security/ProviderException -java/security/PublicKey -java/security/SecureClassLoader -java/security/SecureRandomSpi -java/security/Security -java/security/Security$1 -java/security/SecurityPermission -java/security/Signature -java/security/Signature$Delegate -java/security/SignatureException -java/security/SignatureSpi -java/security/UnresolvedPermission -java/security/cert/CertPath -java/security/cert/Certificate -java/security/cert/CertificateFactory -java/security/cert/CertificateFactorySpi -java/security/cert/Extension -java/security/cert/X509Certificate -java/security/cert/X509Extension -java/security/interfaces/DSAKey -java/security/interfaces/DSAParams -java/security/interfaces/DSAPrivateKey -java/security/interfaces/DSAPublicKey -java/security/interfaces/RSAKey -java/security/interfaces/RSAPrivateCrtKey -java/security/interfaces/RSAPrivateKey -java/security/interfaces/RSAPublicKey -java/security/spec/AlgorithmParameterSpec -java/security/spec/DSAParameterSpec -java/security/spec/DSAPublicKeySpec -java/security/spec/EncodedKeySpec -java/security/spec/InvalidKeySpecException -java/security/spec/KeySpec -java/security/spec/PKCS8EncodedKeySpec -java/security/spec/RSAPrivateCrtKeySpec -java/security/spec/RSAPrivateKeySpec -java/security/spec/RSAPublicKeySpec -java/security/spec/X509EncodedKeySpec -java/text/AttributedCharacterIterator$Attribute -java/text/CharacterIterator -java/text/Collator -java/text/DateFormat -java/text/DateFormat$Field -java/text/DateFormatSymbols -java/text/DecimalFormat -java/text/DecimalFormatSymbols -java/text/DigitList -java/text/DontCareFieldPosition -java/text/DontCareFieldPosition$1 -java/text/EntryPair -java/text/FieldPosition -java/text/Format -java/text/Format$Field -java/text/Format$FieldDelegate -java/text/MergeCollation -java/text/MessageFormat -java/text/MessageFormat$Field -java/text/Normalizer -java/text/Normalizer$Form -java/text/NumberFormat -java/text/NumberFormat$Field -java/text/ParseException -java/text/PatternEntry -java/text/PatternEntry$Parser -java/text/RBCollationTables -java/text/RBCollationTables$BuildAPI -java/text/RBTableBuilder -java/text/RuleBasedCollator -java/text/SimpleDateFormat -java/text/spi/BreakIteratorProvider -java/text/spi/CollatorProvider -java/text/spi/DateFormatProvider -java/text/spi/DateFormatSymbolsProvider -java/text/spi/DecimalFormatSymbolsProvider -java/text/spi/NumberFormatProvider -java/util/AbstractCollection -java/util/AbstractList -java/util/AbstractList$Itr -java/util/AbstractList$ListItr -java/util/AbstractMap -java/util/AbstractQueue -java/util/AbstractSequentialList -java/util/AbstractSet -java/util/ArrayDeque -java/util/ArrayList -java/util/ArrayList$1 -java/util/ArrayList$Itr -java/util/ArrayList$ListItr -java/util/ArrayList$SubList -java/util/ArrayList$SubList$1 -java/util/Arrays -java/util/Arrays$ArrayList -java/util/Arrays$LegacyMergeSort -java/util/Base64 -java/util/Base64$Decoder -java/util/Base64$Encoder -java/util/BitSet -java/util/Calendar -java/util/Calendar$Builder -java/util/Collection -java/util/Collections -java/util/Collections$3 -java/util/Collections$EmptyEnumeration -java/util/Collections$EmptyIterator -java/util/Collections$EmptyList -java/util/Collections$EmptyMap -java/util/Collections$EmptySet -java/util/Collections$SetFromMap -java/util/Collections$SynchronizedCollection -java/util/Collections$SynchronizedMap -java/util/Collections$SynchronizedSet -java/util/Collections$SynchronizedSortedSet -java/util/Collections$UnmodifiableCollection -java/util/Collections$UnmodifiableCollection$1 -java/util/Collections$UnmodifiableList -java/util/Collections$UnmodifiableList$1 -java/util/Collections$UnmodifiableMap -java/util/Collections$UnmodifiableRandomAccessList -java/util/Collections$UnmodifiableSet -java/util/ComparableTimSort -java/util/Comparator -java/util/Currency -java/util/Currency$1 -java/util/Currency$CurrencyNameGetter -java/util/Date -java/util/Deque -java/util/Dictionary -java/util/Enumeration -java/util/EventListener -java/util/EventListenerProxy -java/util/EventObject -java/util/GregorianCalendar -java/util/HashMap -java/util/HashMap$EntryIterator -java/util/HashMap$EntrySet -java/util/HashMap$HashIterator -java/util/HashMap$KeyIterator -java/util/HashMap$KeySet -java/util/HashMap$Node -java/util/HashMap$TreeNode -java/util/HashMap$ValueIterator -java/util/HashMap$Values -java/util/HashSet -java/util/Hashtable -java/util/Hashtable$Entry -java/util/Hashtable$EntrySet -java/util/Hashtable$Enumerator -java/util/Hashtable$ValueCollection -java/util/IdentityHashMap -java/util/IdentityHashMap$IdentityHashMapIterator -java/util/IdentityHashMap$KeyIterator -java/util/IdentityHashMap$KeySet -java/util/IdentityHashMap$ValueIterator -java/util/IdentityHashMap$Values -java/util/Iterator -java/util/LinkedHashMap -java/util/LinkedHashMap$Entry -java/util/LinkedHashMap$LinkedEntryIterator -java/util/LinkedHashMap$LinkedEntrySet -java/util/LinkedHashMap$LinkedHashIterator -java/util/LinkedHashMap$LinkedKeyIterator -java/util/LinkedHashMap$LinkedKeySet -java/util/LinkedList -java/util/LinkedList$ListItr -java/util/LinkedList$Node -java/util/List -java/util/ListIterator -java/util/ListResourceBundle -java/util/Locale -java/util/Locale$1 -java/util/Locale$Cache -java/util/Locale$Category -java/util/Locale$LocaleKey -java/util/Map -java/util/Map$Entry -java/util/MissingResourceException -java/util/NavigableMap -java/util/NavigableSet -java/util/Objects -java/util/PriorityQueue -java/util/Properties -java/util/Properties$LineReader -java/util/PropertyResourceBundle -java/util/Queue -java/util/Random -java/util/RandomAccess -java/util/ResourceBundle -java/util/ResourceBundle$1 -java/util/ResourceBundle$BundleReference -java/util/ResourceBundle$CacheKey -java/util/ResourceBundle$CacheKeyReference -java/util/ResourceBundle$Control -java/util/ResourceBundle$Control$1 -java/util/ResourceBundle$Control$CandidateListCache -java/util/ResourceBundle$LoaderReference -java/util/ResourceBundle$RBClassLoader -java/util/ResourceBundle$RBClassLoader$1 -java/util/ResourceBundle$SingleFormatControl -java/util/ServiceLoader -java/util/ServiceLoader$1 -java/util/ServiceLoader$LazyIterator -java/util/Set -java/util/SortedMap -java/util/SortedSet -java/util/Stack -java/util/StringTokenizer -java/util/TimSort -java/util/TimeZone -java/util/TimeZone$1 -java/util/TreeMap -java/util/TreeMap$Entry -java/util/TreeSet -java/util/Vector -java/util/Vector$1 -java/util/Vector$Itr -java/util/Vector$ListItr -java/util/WeakHashMap -java/util/WeakHashMap$Entry -java/util/WeakHashMap$KeySet -java/util/concurrent/BlockingQueue -java/util/concurrent/ConcurrentHashMap -java/util/concurrent/ConcurrentHashMap$BaseIterator -java/util/concurrent/ConcurrentHashMap$CollectionView -java/util/concurrent/ConcurrentHashMap$CounterCell -java/util/concurrent/ConcurrentHashMap$EntrySetView -java/util/concurrent/ConcurrentHashMap$ForwardingNode -java/util/concurrent/ConcurrentHashMap$KeyIterator -java/util/concurrent/ConcurrentHashMap$KeySetView -java/util/concurrent/ConcurrentHashMap$Node -java/util/concurrent/ConcurrentHashMap$Segment -java/util/concurrent/ConcurrentHashMap$Traverser -java/util/concurrent/ConcurrentHashMap$ValueIterator -java/util/concurrent/ConcurrentHashMap$ValuesView -java/util/concurrent/ConcurrentMap -java/util/concurrent/ConcurrentNavigableMap -java/util/concurrent/ConcurrentSkipListMap -java/util/concurrent/ConcurrentSkipListMap$EntrySet -java/util/concurrent/ConcurrentSkipListMap$HeadIndex -java/util/concurrent/ConcurrentSkipListMap$Index -java/util/concurrent/ConcurrentSkipListMap$KeySet -java/util/concurrent/ConcurrentSkipListMap$Node -java/util/concurrent/ConcurrentSkipListMap$Values -java/util/concurrent/ConcurrentSkipListSet -java/util/concurrent/CopyOnWriteArrayList -java/util/concurrent/DelayQueue -java/util/concurrent/Delayed -java/util/concurrent/ThreadLocalRandom -java/util/concurrent/TimeUnit -java/util/concurrent/TimeUnit$1 -java/util/concurrent/TimeUnit$2 -java/util/concurrent/TimeUnit$3 -java/util/concurrent/TimeUnit$4 -java/util/concurrent/TimeUnit$5 -java/util/concurrent/TimeUnit$6 -java/util/concurrent/TimeUnit$7 -java/util/concurrent/atomic/AtomicBoolean -java/util/concurrent/atomic/AtomicInteger -java/util/concurrent/atomic/AtomicLong -java/util/concurrent/atomic/AtomicMarkableReference -java/util/concurrent/atomic/AtomicMarkableReference$Pair -java/util/concurrent/atomic/AtomicReferenceFieldUpdater -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 -java/util/concurrent/locks/AbstractOwnableSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject -java/util/concurrent/locks/AbstractQueuedSynchronizer$Node -java/util/concurrent/locks/Condition -java/util/concurrent/locks/Lock -java/util/concurrent/locks/LockSupport -java/util/concurrent/locks/ReentrantLock -java/util/concurrent/locks/ReentrantLock$NonfairSync -java/util/concurrent/locks/ReentrantLock$Sync -java/util/function/BiFunction -java/util/jar/Attributes -java/util/jar/Attributes$Name -java/util/jar/JarEntry -java/util/jar/JarFile -java/util/jar/JarFile$JarEntryIterator -java/util/jar/JarFile$JarFileEntry -java/util/jar/JarVerifier -java/util/jar/JarVerifier$3 -java/util/jar/JarVerifier$VerifierStream -java/util/jar/JavaUtilJarAccessImpl -java/util/jar/Manifest -java/util/jar/Manifest$FastInputStream -java/util/logging/Handler -java/util/logging/Level -java/util/logging/Level$KnownLevel -java/util/logging/LogManager -java/util/logging/LogManager$1 -java/util/logging/LogManager$2 -java/util/logging/LogManager$3 -java/util/logging/LogManager$5 -java/util/logging/LogManager$Cleaner -java/util/logging/LogManager$LogNode -java/util/logging/LogManager$LoggerContext -java/util/logging/LogManager$LoggerContext$1 -java/util/logging/LogManager$LoggerWeakRef -java/util/logging/LogManager$RootLogger -java/util/logging/LogManager$SystemLoggerContext -java/util/logging/Logger -java/util/logging/Logger$1 -java/util/logging/LoggingPermission -java/util/logging/LoggingProxyImpl -java/util/regex/MatchResult -java/util/regex/Matcher -java/util/regex/Pattern -java/util/regex/Pattern$4 -java/util/regex/Pattern$BnM -java/util/regex/Pattern$GroupHead -java/util/regex/Pattern$LastNode -java/util/regex/Pattern$Node -java/util/regex/Pattern$Slice -java/util/regex/Pattern$SliceNode -java/util/regex/Pattern$Start -java/util/regex/Pattern$TreeInfo -java/util/spi/CalendarDataProvider -java/util/spi/CurrencyNameProvider -java/util/spi/LocaleNameProvider -java/util/spi/LocaleServiceProvider -java/util/spi/ResourceBundleControlProvider -java/util/spi/TimeZoneNameProvider -java/util/zip/CRC32 -java/util/zip/Checksum -java/util/zip/DeflaterOutputStream -java/util/zip/GZIPInputStream -java/util/zip/Inflater -java/util/zip/InflaterInputStream -java/util/zip/ZStreamRef -java/util/zip/ZipCoder -java/util/zip/ZipConstants -java/util/zip/ZipEntry -java/util/zip/ZipFile -java/util/zip/ZipFile$1 -java/util/zip/ZipFile$ZipEntryIterator -java/util/zip/ZipFile$ZipFileInflaterInputStream -java/util/zip/ZipFile$ZipFileInputStream -java/util/zip/ZipInputStream -java/util/zip/ZipUtils -javax/accessibility/Accessible -javax/accessibility/AccessibleAction -javax/accessibility/AccessibleBundle -javax/accessibility/AccessibleComponent -javax/accessibility/AccessibleContext -javax/accessibility/AccessibleExtendedComponent -javax/accessibility/AccessibleRelationSet -javax/accessibility/AccessibleState -javax/accessibility/AccessibleText -javax/accessibility/AccessibleValue -javax/crypto/SecretKey -javax/security/auth/Destroyable -javax/security/auth/login/FailedLoginException -javax/security/auth/login/LoginException -javax/security/auth/x500/X500Principal -javax/sound/sampled/Control$Type -javax/sound/sampled/DataLine -javax/sound/sampled/DataLine$Info -javax/sound/sampled/FloatControl$Type -javax/sound/sampled/Line -javax/sound/sampled/Line$Info -javax/sound/sampled/LineUnavailableException -javax/sound/sampled/UnsupportedAudioFileException -javax/swing/AbstractAction -javax/swing/AbstractButton -javax/swing/AbstractButton$AccessibleAbstractButton -javax/swing/AbstractButton$Handler -javax/swing/AbstractCellEditor -javax/swing/AbstractListModel -javax/swing/Action -javax/swing/ActionMap -javax/swing/AncestorNotifier -javax/swing/ArrayTable -javax/swing/BorderFactory -javax/swing/BoundedRangeModel -javax/swing/Box -javax/swing/Box$Filler -javax/swing/BoxLayout -javax/swing/BufferStrategyPaintManager -javax/swing/BufferStrategyPaintManager$BufferInfo -javax/swing/ButtonGroup -javax/swing/ButtonModel -javax/swing/CellEditor -javax/swing/CellRendererPane -javax/swing/ClientPropertyKey -javax/swing/ClientPropertyKey$1 -javax/swing/ComboBoxEditor -javax/swing/ComboBoxModel -javax/swing/ComponentInputMap -javax/swing/DefaultBoundedRangeModel -javax/swing/DefaultButtonModel -javax/swing/DefaultCellEditor -javax/swing/DefaultCellEditor$1 -javax/swing/DefaultCellEditor$EditorDelegate -javax/swing/DefaultComboBoxModel -javax/swing/DefaultListCellRenderer -javax/swing/DefaultListCellRenderer$UIResource -javax/swing/DefaultListModel -javax/swing/DefaultListSelectionModel -javax/swing/DefaultSingleSelectionModel -javax/swing/DropMode -javax/swing/FocusManager -javax/swing/GrayFilter -javax/swing/Icon -javax/swing/ImageIcon -javax/swing/ImageIcon$1 -javax/swing/ImageIcon$2 -javax/swing/ImageIcon$2$1 -javax/swing/ImageIcon$3 -javax/swing/InputMap -javax/swing/InternalFrameFocusTraversalPolicy -javax/swing/JButton -javax/swing/JCheckBox -javax/swing/JCheckBoxMenuItem -javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem -javax/swing/JComboBox -javax/swing/JComboBox$1 -javax/swing/JComboBox$KeySelectionManager -javax/swing/JComponent -javax/swing/JComponent$1 -javax/swing/JComponent$2 -javax/swing/JComponent$AccessibleJComponent -javax/swing/JDialog -javax/swing/JEditorPane -javax/swing/JFrame -javax/swing/JInternalFrame -javax/swing/JLabel -javax/swing/JLayer -javax/swing/JLayeredPane -javax/swing/JList -javax/swing/JList$3 -javax/swing/JList$ListSelectionHandler -javax/swing/JMenu -javax/swing/JMenu$MenuChangeListener -javax/swing/JMenu$WinListener -javax/swing/JMenuBar -javax/swing/JMenuItem -javax/swing/JMenuItem$AccessibleJMenuItem -javax/swing/JMenuItem$MenuItemFocusListener -javax/swing/JPanel -javax/swing/JPopupMenu -javax/swing/JPopupMenu$Separator -javax/swing/JProgressBar -javax/swing/JProgressBar$ModelListener -javax/swing/JRadioButton -javax/swing/JRadioButtonMenuItem -javax/swing/JRootPane -javax/swing/JRootPane$1 -javax/swing/JRootPane$RootLayout -javax/swing/JScrollBar -javax/swing/JScrollBar$ModelListener -javax/swing/JScrollPane -javax/swing/JScrollPane$ScrollBar -javax/swing/JSeparator -javax/swing/JSlider -javax/swing/JSlider$ModelListener -javax/swing/JSplitPane -javax/swing/JTabbedPane -javax/swing/JTabbedPane$ModelListener -javax/swing/JTabbedPane$Page -javax/swing/JTable -javax/swing/JTable$2 -javax/swing/JTable$5 -javax/swing/JTable$Resizable2 -javax/swing/JTable$Resizable3 -javax/swing/JTextArea -javax/swing/JTextField -javax/swing/JTextField$NotifyAction -javax/swing/JTextField$ScrollRepainter -javax/swing/JToggleButton -javax/swing/JToggleButton$ToggleButtonModel -javax/swing/JToolBar -javax/swing/JToolBar$DefaultToolBarLayout -javax/swing/JToolBar$Separator -javax/swing/JToolTip -javax/swing/JTree -javax/swing/JTree$TreeModelHandler -javax/swing/JTree$TreeSelectionRedirector -javax/swing/JViewport -javax/swing/JViewport$ViewListener -javax/swing/JWindow -javax/swing/KeyStroke -javax/swing/KeyboardManager -javax/swing/KeyboardManager$ComponentKeyStrokePair -javax/swing/LayoutComparator -javax/swing/LayoutFocusTraversalPolicy -javax/swing/ListCellRenderer -javax/swing/ListModel -javax/swing/ListSelectionModel -javax/swing/LookAndFeel -javax/swing/MenuElement -javax/swing/MenuSelectionManager -javax/swing/MultiUIDefaults -javax/swing/MutableComboBoxModel -javax/swing/RepaintManager -javax/swing/RepaintManager$2 -javax/swing/RepaintManager$3 -javax/swing/RepaintManager$DisplayChangedHandler -javax/swing/RepaintManager$PaintManager -javax/swing/RepaintManager$ProcessingRunnable -javax/swing/RootPaneContainer -javax/swing/ScrollPaneConstants -javax/swing/ScrollPaneLayout -javax/swing/ScrollPaneLayout$UIResource -javax/swing/Scrollable -javax/swing/SingleSelectionModel -javax/swing/SizeRequirements -javax/swing/SortingFocusTraversalPolicy -javax/swing/SwingConstants -javax/swing/SwingContainerOrderFocusTraversalPolicy -javax/swing/SwingDefaultFocusTraversalPolicy -javax/swing/SwingPaintEventDispatcher -javax/swing/SwingUtilities -javax/swing/SwingUtilities$SharedOwnerFrame -javax/swing/Timer -javax/swing/Timer$DoPostEvent -javax/swing/TimerQueue -javax/swing/TimerQueue$1 -javax/swing/TimerQueue$DelayedTimer -javax/swing/ToolTipManager -javax/swing/ToolTipManager$AccessibilityKeyListener -javax/swing/ToolTipManager$MoveBeforeEnterListener -javax/swing/ToolTipManager$insideTimerAction -javax/swing/ToolTipManager$outsideTimerAction -javax/swing/ToolTipManager$stillInsideTimerAction -javax/swing/TransferHandler -javax/swing/TransferHandler$DropHandler -javax/swing/TransferHandler$HasGetTransferHandler -javax/swing/TransferHandler$SwingDropTarget -javax/swing/TransferHandler$TransferAction -javax/swing/TransferHandler$TransferSupport -javax/swing/UIDefaults -javax/swing/UIDefaults$ActiveValue -javax/swing/UIDefaults$LazyInputMap -javax/swing/UIDefaults$LazyValue -javax/swing/UIDefaults$TextAndMnemonicHashMap -javax/swing/UIManager -javax/swing/UIManager$1 -javax/swing/UIManager$2 -javax/swing/UIManager$LAFState -javax/swing/UIManager$LookAndFeelInfo -javax/swing/UnsupportedLookAndFeelException -javax/swing/ViewportLayout -javax/swing/WindowConstants -javax/swing/border/AbstractBorder -javax/swing/border/BevelBorder -javax/swing/border/Border -javax/swing/border/CompoundBorder -javax/swing/border/EmptyBorder -javax/swing/border/EtchedBorder -javax/swing/border/LineBorder -javax/swing/border/MatteBorder -javax/swing/border/TitledBorder -javax/swing/event/AncestorEvent -javax/swing/event/AncestorListener -javax/swing/event/CaretEvent -javax/swing/event/CaretListener -javax/swing/event/CellEditorListener -javax/swing/event/ChangeEvent -javax/swing/event/ChangeListener -javax/swing/event/DocumentEvent -javax/swing/event/DocumentEvent$ElementChange -javax/swing/event/DocumentEvent$EventType -javax/swing/event/DocumentListener -javax/swing/event/EventListenerList -javax/swing/event/ListDataEvent -javax/swing/event/ListDataListener -javax/swing/event/ListSelectionEvent -javax/swing/event/ListSelectionListener -javax/swing/event/MenuDragMouseListener -javax/swing/event/MenuEvent -javax/swing/event/MenuKeyListener -javax/swing/event/MenuListener -javax/swing/event/MouseInputAdapter -javax/swing/event/MouseInputListener -javax/swing/event/PopupMenuListener -javax/swing/event/RowSorterListener -javax/swing/event/SwingPropertyChangeSupport -javax/swing/event/TableColumnModelEvent -javax/swing/event/TableColumnModelListener -javax/swing/event/TableModelEvent -javax/swing/event/TableModelListener -javax/swing/event/TreeExpansionListener -javax/swing/event/TreeModelEvent -javax/swing/event/TreeModelListener -javax/swing/event/TreeSelectionEvent -javax/swing/event/TreeSelectionListener -javax/swing/event/UndoableEditEvent -javax/swing/event/UndoableEditListener -javax/swing/filechooser/FileFilter -javax/swing/plaf/ActionMapUIResource -javax/swing/plaf/BorderUIResource -javax/swing/plaf/BorderUIResource$CompoundBorderUIResource -javax/swing/plaf/BorderUIResource$EmptyBorderUIResource -javax/swing/plaf/BorderUIResource$LineBorderUIResource -javax/swing/plaf/ButtonUI -javax/swing/plaf/ColorUIResource -javax/swing/plaf/ComboBoxUI -javax/swing/plaf/ComponentInputMapUIResource -javax/swing/plaf/ComponentUI -javax/swing/plaf/DimensionUIResource -javax/swing/plaf/FontUIResource -javax/swing/plaf/InputMapUIResource -javax/swing/plaf/InsetsUIResource -javax/swing/plaf/LabelUI -javax/swing/plaf/ListUI -javax/swing/plaf/MenuBarUI -javax/swing/plaf/MenuItemUI -javax/swing/plaf/PanelUI -javax/swing/plaf/PopupMenuUI -javax/swing/plaf/ProgressBarUI -javax/swing/plaf/RootPaneUI -javax/swing/plaf/ScrollBarUI -javax/swing/plaf/ScrollPaneUI -javax/swing/plaf/SeparatorUI -javax/swing/plaf/SliderUI -javax/swing/plaf/SplitPaneUI -javax/swing/plaf/TabbedPaneUI -javax/swing/plaf/TableHeaderUI -javax/swing/plaf/TableUI -javax/swing/plaf/TextUI -javax/swing/plaf/ToolBarUI -javax/swing/plaf/TreeUI -javax/swing/plaf/UIResource -javax/swing/plaf/ViewportUI -javax/swing/plaf/basic/BasicArrowButton -javax/swing/plaf/basic/BasicBorders -javax/swing/plaf/basic/BasicBorders$ButtonBorder -javax/swing/plaf/basic/BasicBorders$MarginBorder -javax/swing/plaf/basic/BasicBorders$RadioButtonBorder -javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder -javax/swing/plaf/basic/BasicBorders$SplitPaneBorder -javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder -javax/swing/plaf/basic/BasicButtonListener -javax/swing/plaf/basic/BasicButtonUI -javax/swing/plaf/basic/BasicCheckBoxMenuItemUI -javax/swing/plaf/basic/BasicComboBoxEditor -javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField -javax/swing/plaf/basic/BasicComboBoxEditor$UIResource -javax/swing/plaf/basic/BasicComboBoxRenderer -javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource -javax/swing/plaf/basic/BasicComboBoxUI -javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager -javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager -javax/swing/plaf/basic/BasicComboBoxUI$Handler -javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicComboPopup -javax/swing/plaf/basic/BasicComboPopup$1 -javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass -javax/swing/plaf/basic/BasicComboPopup$Handler -javax/swing/plaf/basic/BasicGraphicsUtils -javax/swing/plaf/basic/BasicHTML -javax/swing/plaf/basic/BasicLabelUI -javax/swing/plaf/basic/BasicListUI -javax/swing/plaf/basic/BasicListUI$Handler -javax/swing/plaf/basic/BasicListUI$ListTransferHandler -javax/swing/plaf/basic/BasicLookAndFeel -javax/swing/plaf/basic/BasicLookAndFeel$1 -javax/swing/plaf/basic/BasicLookAndFeel$2 -javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper -javax/swing/plaf/basic/BasicMenuBarUI -javax/swing/plaf/basic/BasicMenuBarUI$Handler -javax/swing/plaf/basic/BasicMenuItemUI -javax/swing/plaf/basic/BasicMenuItemUI$Handler -javax/swing/plaf/basic/BasicMenuUI -javax/swing/plaf/basic/BasicMenuUI$Handler -javax/swing/plaf/basic/BasicPanelUI -javax/swing/plaf/basic/BasicPopupMenuUI -javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener -javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 -javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber -javax/swing/plaf/basic/BasicProgressBarUI -javax/swing/plaf/basic/BasicProgressBarUI$Handler -javax/swing/plaf/basic/BasicRadioButtonMenuItemUI -javax/swing/plaf/basic/BasicRadioButtonUI -javax/swing/plaf/basic/BasicRootPaneUI -javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap -javax/swing/plaf/basic/BasicScrollBarUI -javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener -javax/swing/plaf/basic/BasicScrollBarUI$Handler -javax/swing/plaf/basic/BasicScrollBarUI$ModelListener -javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener -javax/swing/plaf/basic/BasicScrollBarUI$TrackListener -javax/swing/plaf/basic/BasicScrollPaneUI -javax/swing/plaf/basic/BasicScrollPaneUI$Handler -javax/swing/plaf/basic/BasicSeparatorUI -javax/swing/plaf/basic/BasicSliderUI -javax/swing/plaf/basic/BasicSliderUI$Actions -javax/swing/plaf/basic/BasicSliderUI$Handler -javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicSliderUI$ScrollListener -javax/swing/plaf/basic/BasicSliderUI$TrackListener -javax/swing/plaf/basic/BasicSplitPaneDivider -javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout -javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler -javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler -javax/swing/plaf/basic/BasicSplitPaneUI -javax/swing/plaf/basic/BasicSplitPaneUI$1 -javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager -javax/swing/plaf/basic/BasicSplitPaneUI$Handler -javax/swing/plaf/basic/BasicTabbedPaneUI -javax/swing/plaf/basic/BasicTabbedPaneUI$Handler -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout -javax/swing/plaf/basic/BasicTableHeaderUI -javax/swing/plaf/basic/BasicTableHeaderUI$1 -javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler -javax/swing/plaf/basic/BasicTableUI -javax/swing/plaf/basic/BasicTableUI$Handler -javax/swing/plaf/basic/BasicTableUI$TableTransferHandler -javax/swing/plaf/basic/BasicTextAreaUI -javax/swing/plaf/basic/BasicTextFieldUI -javax/swing/plaf/basic/BasicTextUI -javax/swing/plaf/basic/BasicTextUI$BasicCaret -javax/swing/plaf/basic/BasicTextUI$BasicCursor -javax/swing/plaf/basic/BasicTextUI$BasicHighlighter -javax/swing/plaf/basic/BasicTextUI$DragListener -javax/swing/plaf/basic/BasicTextUI$FocusAction -javax/swing/plaf/basic/BasicTextUI$RootView -javax/swing/plaf/basic/BasicTextUI$TextActionWrapper -javax/swing/plaf/basic/BasicTextUI$TextTransferHandler -javax/swing/plaf/basic/BasicTextUI$UpdateHandler -javax/swing/plaf/basic/BasicToggleButtonUI -javax/swing/plaf/basic/BasicToolBarSeparatorUI -javax/swing/plaf/basic/BasicToolBarUI -javax/swing/plaf/basic/BasicToolBarUI$DockingListener -javax/swing/plaf/basic/BasicToolBarUI$Handler -javax/swing/plaf/basic/BasicTreeUI -javax/swing/plaf/basic/BasicTreeUI$Actions -javax/swing/plaf/basic/BasicTreeUI$Handler -javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler -javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler -javax/swing/plaf/basic/BasicViewportUI -javax/swing/plaf/basic/ComboPopup -javax/swing/plaf/basic/DefaultMenuLayout -javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag -javax/swing/plaf/basic/LazyActionMap -javax/swing/plaf/metal/DefaultMetalTheme -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 -javax/swing/plaf/metal/MetalBorders -javax/swing/plaf/metal/MetalBorders$ButtonBorder -javax/swing/plaf/metal/MetalBorders$Flush3DBorder -javax/swing/plaf/metal/MetalBorders$MenuBarBorder -javax/swing/plaf/metal/MetalBorders$MenuItemBorder -javax/swing/plaf/metal/MetalBorders$PopupMenuBorder -javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder -javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder -javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder -javax/swing/plaf/metal/MetalBorders$TextFieldBorder -javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder -javax/swing/plaf/metal/MetalBorders$ToolBarBorder -javax/swing/plaf/metal/MetalBumps -javax/swing/plaf/metal/MetalButtonUI -javax/swing/plaf/metal/MetalCheckBoxUI -javax/swing/plaf/metal/MetalComboBoxButton -javax/swing/plaf/metal/MetalComboBoxButton$1 -javax/swing/plaf/metal/MetalComboBoxEditor -javax/swing/plaf/metal/MetalComboBoxEditor$1 -javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder -javax/swing/plaf/metal/MetalComboBoxEditor$UIResource -javax/swing/plaf/metal/MetalComboBoxIcon -javax/swing/plaf/metal/MetalComboBoxUI -javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager -javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener -javax/swing/plaf/metal/MetalIconFactory -javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon -javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon -javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 -javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon -javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon -javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon -javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon -javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon -javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon -javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon -javax/swing/plaf/metal/MetalLabelUI -javax/swing/plaf/metal/MetalLookAndFeel -javax/swing/plaf/metal/MetalLookAndFeel$AATextListener -javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue$1 -javax/swing/plaf/metal/MetalPopupMenuSeparatorUI -javax/swing/plaf/metal/MetalProgressBarUI -javax/swing/plaf/metal/MetalRadioButtonUI -javax/swing/plaf/metal/MetalRootPaneUI -javax/swing/plaf/metal/MetalScrollBarUI -javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener -javax/swing/plaf/metal/MetalScrollButton -javax/swing/plaf/metal/MetalScrollPaneUI -javax/swing/plaf/metal/MetalScrollPaneUI$1 -javax/swing/plaf/metal/MetalSeparatorUI -javax/swing/plaf/metal/MetalSliderUI -javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener -javax/swing/plaf/metal/MetalSplitPaneDivider -javax/swing/plaf/metal/MetalSplitPaneDivider$1 -javax/swing/plaf/metal/MetalSplitPaneDivider$2 -javax/swing/plaf/metal/MetalSplitPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/metal/MetalTextFieldUI -javax/swing/plaf/metal/MetalTheme -javax/swing/plaf/metal/MetalToggleButtonUI -javax/swing/plaf/metal/MetalToolBarUI -javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener -javax/swing/plaf/metal/MetalTreeUI -javax/swing/plaf/metal/MetalTreeUI$LineListener -javax/swing/plaf/metal/OceanTheme -javax/swing/plaf/metal/OceanTheme$1 -javax/swing/plaf/metal/OceanTheme$2 -javax/swing/plaf/metal/OceanTheme$3 -javax/swing/plaf/metal/OceanTheme$4 -javax/swing/plaf/metal/OceanTheme$5 -javax/swing/plaf/metal/OceanTheme$6 -javax/swing/plaf/synth/SynthConstants -javax/swing/plaf/synth/SynthUI -javax/swing/table/AbstractTableModel -javax/swing/table/DefaultTableCellRenderer -javax/swing/table/DefaultTableColumnModel -javax/swing/table/DefaultTableModel -javax/swing/table/JTableHeader -javax/swing/table/TableCellEditor -javax/swing/table/TableCellRenderer -javax/swing/table/TableColumn -javax/swing/table/TableColumnModel -javax/swing/table/TableModel -javax/swing/text/AbstractDocument -javax/swing/text/AbstractDocument$1 -javax/swing/text/AbstractDocument$AbstractElement -javax/swing/text/AbstractDocument$AttributeContext -javax/swing/text/AbstractDocument$BidiElement -javax/swing/text/AbstractDocument$BidiRootElement -javax/swing/text/AbstractDocument$BranchElement -javax/swing/text/AbstractDocument$Content -javax/swing/text/AbstractDocument$DefaultDocumentEvent -javax/swing/text/AbstractDocument$ElementEdit -javax/swing/text/AbstractDocument$InsertStringResult -javax/swing/text/AbstractDocument$LeafElement -javax/swing/text/AttributeSet -javax/swing/text/AttributeSet$CharacterAttribute -javax/swing/text/AttributeSet$ColorAttribute -javax/swing/text/AttributeSet$FontAttribute -javax/swing/text/AttributeSet$ParagraphAttribute -javax/swing/text/Caret -javax/swing/text/DefaultCaret -javax/swing/text/DefaultCaret$Handler -javax/swing/text/DefaultEditorKit -javax/swing/text/DefaultEditorKit$BeepAction -javax/swing/text/DefaultEditorKit$BeginAction -javax/swing/text/DefaultEditorKit$BeginLineAction -javax/swing/text/DefaultEditorKit$BeginParagraphAction -javax/swing/text/DefaultEditorKit$BeginWordAction -javax/swing/text/DefaultEditorKit$CopyAction -javax/swing/text/DefaultEditorKit$CutAction -javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction -javax/swing/text/DefaultEditorKit$DeleteNextCharAction -javax/swing/text/DefaultEditorKit$DeletePrevCharAction -javax/swing/text/DefaultEditorKit$DeleteWordAction -javax/swing/text/DefaultEditorKit$DumpModelAction -javax/swing/text/DefaultEditorKit$EndAction -javax/swing/text/DefaultEditorKit$EndLineAction -javax/swing/text/DefaultEditorKit$EndParagraphAction -javax/swing/text/DefaultEditorKit$EndWordAction -javax/swing/text/DefaultEditorKit$InsertBreakAction -javax/swing/text/DefaultEditorKit$InsertContentAction -javax/swing/text/DefaultEditorKit$InsertTabAction -javax/swing/text/DefaultEditorKit$NextVisualPositionAction -javax/swing/text/DefaultEditorKit$NextWordAction -javax/swing/text/DefaultEditorKit$PageAction -javax/swing/text/DefaultEditorKit$PasteAction -javax/swing/text/DefaultEditorKit$PreviousWordAction -javax/swing/text/DefaultEditorKit$ReadOnlyAction -javax/swing/text/DefaultEditorKit$SelectAllAction -javax/swing/text/DefaultEditorKit$SelectLineAction -javax/swing/text/DefaultEditorKit$SelectParagraphAction -javax/swing/text/DefaultEditorKit$SelectWordAction -javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction -javax/swing/text/DefaultEditorKit$UnselectAction -javax/swing/text/DefaultEditorKit$VerticalPageAction -javax/swing/text/DefaultEditorKit$WritableAction -javax/swing/text/DefaultHighlighter -javax/swing/text/DefaultHighlighter$DefaultHighlightPainter -javax/swing/text/DefaultHighlighter$SafeDamager -javax/swing/text/Document -javax/swing/text/EditorKit -javax/swing/text/Element -javax/swing/text/FieldView -javax/swing/text/GapContent -javax/swing/text/GapContent$InsertUndo -javax/swing/text/GapContent$MarkData -javax/swing/text/GapContent$MarkVector -javax/swing/text/GapContent$StickyPosition -javax/swing/text/GapVector -javax/swing/text/Highlighter -javax/swing/text/Highlighter$Highlight -javax/swing/text/Highlighter$HighlightPainter -javax/swing/text/JTextComponent -javax/swing/text/JTextComponent$1 -javax/swing/text/JTextComponent$DefaultKeymap -javax/swing/text/JTextComponent$KeymapActionMap -javax/swing/text/JTextComponent$KeymapWrapper -javax/swing/text/JTextComponent$MutableCaretEvent -javax/swing/text/Keymap -javax/swing/text/LayeredHighlighter -javax/swing/text/LayeredHighlighter$LayerPainter -javax/swing/text/MutableAttributeSet -javax/swing/text/PlainDocument -javax/swing/text/PlainView -javax/swing/text/Position -javax/swing/text/Position$Bias -javax/swing/text/Segment -javax/swing/text/SegmentCache -javax/swing/text/SegmentCache$CachedSegment -javax/swing/text/SimpleAttributeSet -javax/swing/text/SimpleAttributeSet$EmptyAttributeSet -javax/swing/text/Style -javax/swing/text/StyleConstants -javax/swing/text/StyleConstants$CharacterConstants -javax/swing/text/StyleConstants$ColorConstants -javax/swing/text/StyleConstants$FontConstants -javax/swing/text/StyleConstants$ParagraphConstants -javax/swing/text/StyleContext -javax/swing/text/StyleContext$FontKey -javax/swing/text/StyleContext$KeyEnumeration -javax/swing/text/StyleContext$NamedStyle -javax/swing/text/StyleContext$SmallAttributeSet -javax/swing/text/TabExpander -javax/swing/text/TextAction -javax/swing/text/Utilities -javax/swing/text/View -javax/swing/text/ViewFactory -javax/swing/tree/AbstractLayoutCache -javax/swing/tree/AbstractLayoutCache$NodeDimensions -javax/swing/tree/DefaultMutableTreeNode -javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration -javax/swing/tree/DefaultTreeCellEditor -javax/swing/tree/DefaultTreeCellEditor$1 -javax/swing/tree/DefaultTreeCellEditor$DefaultTextField -javax/swing/tree/DefaultTreeCellEditor$EditorContainer -javax/swing/tree/DefaultTreeCellRenderer -javax/swing/tree/DefaultTreeModel -javax/swing/tree/DefaultTreeSelectionModel -javax/swing/tree/MutableTreeNode -javax/swing/tree/PathPlaceHolder -javax/swing/tree/RowMapper -javax/swing/tree/TreeCellEditor -javax/swing/tree/TreeCellRenderer -javax/swing/tree/TreeModel -javax/swing/tree/TreeNode -javax/swing/tree/TreePath -javax/swing/tree/TreeSelectionModel -javax/swing/tree/VariableHeightLayoutCache -javax/swing/tree/VariableHeightLayoutCache$TreeStateNode -javax/swing/undo/AbstractUndoableEdit -javax/swing/undo/CompoundEdit -javax/swing/undo/UndoableEdit -javax/xml/parsers/DocumentBuilder -javax/xml/parsers/DocumentBuilderFactory -javax/xml/parsers/FactoryFinder -javax/xml/parsers/FactoryFinder$1 -javax/xml/parsers/ParserConfigurationException -javax/xml/parsers/SecuritySupport -javax/xml/parsers/SecuritySupport$2 -javax/xml/parsers/SecuritySupport$5 -org/w3c/dom/Attr -org/w3c/dom/CDATASection -org/w3c/dom/CharacterData -org/w3c/dom/Comment -org/w3c/dom/DOMException -org/w3c/dom/Document -org/w3c/dom/DocumentFragment -org/w3c/dom/DocumentType -org/w3c/dom/Element -org/w3c/dom/Entity -org/w3c/dom/EntityReference -org/w3c/dom/NamedNodeMap -org/w3c/dom/Node -org/w3c/dom/NodeList -org/w3c/dom/Notation -org/w3c/dom/ProcessingInstruction -org/w3c/dom/Text -org/w3c/dom/events/DocumentEvent -org/w3c/dom/events/Event -org/w3c/dom/events/EventException -org/w3c/dom/events/EventTarget -org/w3c/dom/events/MutationEvent -org/w3c/dom/ranges/DocumentRange -org/w3c/dom/ranges/Range -org/w3c/dom/traversal/DocumentTraversal -org/w3c/dom/traversal/NodeIterator -org/w3c/dom/traversal/TreeWalker -org/xml/sax/AttributeList -org/xml/sax/ContentHandler -org/xml/sax/DTDHandler -org/xml/sax/EntityResolver -org/xml/sax/ErrorHandler -org/xml/sax/InputSource -org/xml/sax/Locator -org/xml/sax/SAXException -org/xml/sax/SAXNotRecognizedException -org/xml/sax/SAXNotSupportedException -org/xml/sax/SAXParseException -org/xml/sax/helpers/DefaultHandler -sun/awt/AWTAccessor -sun/awt/AWTAccessor$AWTEventAccessor -sun/awt/AWTAccessor$ClientPropertyKeyAccessor -sun/awt/AWTAccessor$ComponentAccessor -sun/awt/AWTAccessor$ContainerAccessor -sun/awt/AWTAccessor$CursorAccessor -sun/awt/AWTAccessor$DefaultKeyboardFocusManagerAccessor -sun/awt/AWTAccessor$EventQueueAccessor -sun/awt/AWTAccessor$FrameAccessor -sun/awt/AWTAccessor$InputEventAccessor -sun/awt/AWTAccessor$InvocationEventAccessor -sun/awt/AWTAccessor$KeyEventAccessor -sun/awt/AWTAccessor$KeyboardFocusManagerAccessor -sun/awt/AWTAccessor$SequencedEventAccessor -sun/awt/AWTAccessor$ToolkitAccessor -sun/awt/AWTAccessor$WindowAccessor -sun/awt/AWTAutoShutdown -sun/awt/AWTIcon64_java_icon16_png -sun/awt/AWTIcon64_java_icon24_png -sun/awt/AWTIcon64_java_icon32_png -sun/awt/AWTIcon64_java_icon48_png -sun/awt/AppContext -sun/awt/AppContext$1 -sun/awt/AppContext$2 -sun/awt/AppContext$3 -sun/awt/AppContext$6 -sun/awt/AppContext$GetAppContextLock -sun/awt/AppContext$State -sun/awt/CausedFocusEvent -sun/awt/CausedFocusEvent$Cause -sun/awt/ComponentFactory -sun/awt/ConstrainableGraphics -sun/awt/DisplayChangedListener -sun/awt/EmbeddedFrame -sun/awt/EventQueueDelegate -sun/awt/EventQueueItem -sun/awt/FontConfiguration -sun/awt/FontConfiguration$1 -sun/awt/FontDescriptor -sun/awt/GlobalCursorManager -sun/awt/GlobalCursorManager$NativeUpdater -sun/awt/HeadlessToolkit -sun/awt/IconInfo -sun/awt/InputMethodSupport -sun/awt/KeyboardFocusManagerPeerImpl -sun/awt/KeyboardFocusManagerPeerProvider -sun/awt/LightweightFrame -sun/awt/ModalityListener -sun/awt/MostRecentKeyValue -sun/awt/NullComponentPeer -sun/awt/OSInfo -sun/awt/OSInfo$1 -sun/awt/OSInfo$OSType -sun/awt/OSInfo$WindowsVersion -sun/awt/PaintEventDispatcher -sun/awt/PeerEvent -sun/awt/PostEventQueue -sun/awt/RepaintArea -sun/awt/RequestFocusController -sun/awt/SubRegionShowable -sun/awt/SunDisplayChanger -sun/awt/SunGraphicsCallback -sun/awt/SunHints -sun/awt/SunHints$Key -sun/awt/SunHints$LCDContrastKey -sun/awt/SunHints$Value -sun/awt/SunToolkit -sun/awt/SunToolkit$ModalityListenerList -sun/awt/TimedWindowEvent -sun/awt/UNIXToolkit -sun/awt/WindowClosingListener -sun/awt/WindowClosingSupport -sun/awt/X11/AwtGraphicsConfigData -sun/awt/X11/AwtScreenData -sun/awt/X11/MotifColorUtilities -sun/awt/X11/MotifDnDConstants -sun/awt/X11/MotifDnDDragSourceProtocol -sun/awt/X11/MotifDnDDropTargetProtocol -sun/awt/X11/Native -sun/awt/X11/Native$1 -sun/awt/X11/OwnershipListener -sun/awt/X11/PropMwmHints -sun/awt/X11/UnsafeXDisposerRecord -sun/awt/X11/WindowDimensions -sun/awt/X11/WindowPropertyGetter -sun/awt/X11/XAWTXSettings -sun/awt/X11/XAnyEvent -sun/awt/X11/XAtom -sun/awt/X11/XAtomList -sun/awt/X11/XAwtState -sun/awt/X11/XBaseWindow -sun/awt/X11/XBaseWindow$1 -sun/awt/X11/XBaseWindow$InitialiseState -sun/awt/X11/XBaseWindow$StateLock -sun/awt/X11/XCanvasPeer -sun/awt/X11/XClientMessageEvent -sun/awt/X11/XClipboard -sun/awt/X11/XComponentPeer -sun/awt/X11/XComponentPeer$1 -sun/awt/X11/XConfigureEvent -sun/awt/X11/XContentWindow -sun/awt/X11/XCreateWindowParams -sun/awt/X11/XDecoratedPeer -sun/awt/X11/XDnDConstants -sun/awt/X11/XDnDDragSourceProtocol -sun/awt/X11/XDnDDropTargetProtocol -sun/awt/X11/XDragAndDropProtocols -sun/awt/X11/XDragSourceContextPeer -sun/awt/X11/XDragSourceProtocol -sun/awt/X11/XDragSourceProtocolListener -sun/awt/X11/XDropTargetContextPeer -sun/awt/X11/XDropTargetContextPeer$XDropTargetProtocolListenerImpl -sun/awt/X11/XDropTargetEventProcessor -sun/awt/X11/XDropTargetProtocol -sun/awt/X11/XDropTargetProtocolListener -sun/awt/X11/XDropTargetRegistry -sun/awt/X11/XEmbeddedFramePeer -sun/awt/X11/XErrorEvent -sun/awt/X11/XErrorHandler -sun/awt/X11/XErrorHandler$IgnoreBadWindowHandler -sun/awt/X11/XErrorHandler$VerifyChangePropertyHandler -sun/awt/X11/XErrorHandler$XBaseErrorHandler -sun/awt/X11/XErrorHandler$XErrorHandlerWithFlag -sun/awt/X11/XErrorHandler$XShmAttachHandler -sun/awt/X11/XErrorHandlerUtil -sun/awt/X11/XEvent -sun/awt/X11/XEventDispatcher -sun/awt/X11/XExposeEvent -sun/awt/X11/XFocusChangeEvent -sun/awt/X11/XFocusProxyWindow -sun/awt/X11/XFramePeer -sun/awt/X11/XGlobalCursorManager -sun/awt/X11/XInputMethod -sun/awt/X11/XInputMethodDescriptor -sun/awt/X11/XKeyboardFocusManagerPeer -sun/awt/X11/XLabelPeer -sun/awt/X11/XLayerProtocol -sun/awt/X11/XMSelection -sun/awt/X11/XMSelection$1 -sun/awt/X11/XMSelection$3 -sun/awt/X11/XMSelectionListener -sun/awt/X11/XModifierKeymap -sun/awt/X11/XNETProtocol -sun/awt/X11/XPanelPeer -sun/awt/X11/XPropertyCache -sun/awt/X11/XPropertyEvent -sun/awt/X11/XProtocol -sun/awt/X11/XRepaintArea -sun/awt/X11/XReparentEvent -sun/awt/X11/XRootWindow -sun/awt/X11/XSelection -sun/awt/X11/XSelection$IncrementalTransferHandler -sun/awt/X11/XSelection$SelectionEventHandler -sun/awt/X11/XSetWindowAttributes -sun/awt/X11/XSizeHints -sun/awt/X11/XStateProtocol -sun/awt/X11/XSystemTrayPeer -sun/awt/X11/XToolkit -sun/awt/X11/XToolkit$1 -sun/awt/X11/XToolkit$2 -sun/awt/X11/XToolkit$2$1 -sun/awt/X11/XToolkit$3 -sun/awt/X11/XToolkit$4 -sun/awt/X11/XToolkit$5 -sun/awt/X11/XTranslateCoordinates -sun/awt/X11/XUnmapEvent -sun/awt/X11/XVisibilityEvent -sun/awt/X11/XVisualInfo -sun/awt/X11/XWINProtocol -sun/awt/X11/XWM -sun/awt/X11/XWM$1 -sun/awt/X11/XWMHints -sun/awt/X11/XWindow -sun/awt/X11/XWindowAttributes -sun/awt/X11/XWindowAttributesData -sun/awt/X11/XWindowPeer -sun/awt/X11/XWindowPeer$2 -sun/awt/X11/XWindowPeer$4 -sun/awt/X11/XWrapperBase -sun/awt/X11/XlibUtil -sun/awt/X11/XlibWrapper -sun/awt/X11ComponentPeer -sun/awt/X11FontManager -sun/awt/X11GraphicsConfig -sun/awt/X11GraphicsConfig$X11GCDisposerRecord -sun/awt/X11GraphicsDevice -sun/awt/X11GraphicsEnvironment -sun/awt/X11GraphicsEnvironment$1 -sun/awt/X11InputMethod -sun/awt/X11InputMethodDescriptor -sun/awt/XSettings -sun/awt/XSettings$Update -sun/awt/datatransfer/SunClipboard -sun/awt/dnd/SunDragSourceContextPeer -sun/awt/dnd/SunDropTargetContextPeer -sun/awt/dnd/SunDropTargetEvent -sun/awt/event/IgnorePaintEvent -sun/awt/im/ExecutableInputMethodManager -sun/awt/im/ExecutableInputMethodManager$3 -sun/awt/im/InputContext -sun/awt/im/InputMethodAdapter -sun/awt/im/InputMethodContext -sun/awt/im/InputMethodLocator -sun/awt/im/InputMethodManager -sun/awt/image/BufImgSurfaceData -sun/awt/image/BufImgSurfaceData$ICMColorData -sun/awt/image/BufImgSurfaceManager -sun/awt/image/BufferedImageGraphicsConfig -sun/awt/image/ByteComponentRaster -sun/awt/image/ByteInterleavedRaster -sun/awt/image/BytePackedRaster -sun/awt/image/FetcherInfo -sun/awt/image/GifFrame -sun/awt/image/GifImageDecoder -sun/awt/image/ImageConsumerQueue -sun/awt/image/ImageDecoder -sun/awt/image/ImageDecoder$1 -sun/awt/image/ImageFetchable -sun/awt/image/ImageFetcher -sun/awt/image/ImageFetcher$1 -sun/awt/image/ImageRepresentation -sun/awt/image/ImageWatched -sun/awt/image/ImageWatched$Link -sun/awt/image/ImageWatched$WeakLink -sun/awt/image/InputStreamImageSource -sun/awt/image/IntegerComponentRaster -sun/awt/image/IntegerInterleavedRaster -sun/awt/image/NativeLibLoader -sun/awt/image/NativeLibLoader$1 -sun/awt/image/OffScreenImage -sun/awt/image/PNGFilterInputStream -sun/awt/image/PNGImageDecoder -sun/awt/image/PixelConverter -sun/awt/image/PixelConverter$Argb -sun/awt/image/PixelConverter$ArgbBm -sun/awt/image/PixelConverter$ArgbPre -sun/awt/image/PixelConverter$Bgrx -sun/awt/image/PixelConverter$ByteGray -sun/awt/image/PixelConverter$Rgba -sun/awt/image/PixelConverter$RgbaPre -sun/awt/image/PixelConverter$Rgbx -sun/awt/image/PixelConverter$Ushort4444Argb -sun/awt/image/PixelConverter$Ushort555Rgb -sun/awt/image/PixelConverter$Ushort555Rgbx -sun/awt/image/PixelConverter$Ushort565Rgb -sun/awt/image/PixelConverter$UshortGray -sun/awt/image/PixelConverter$Xbgr -sun/awt/image/PixelConverter$Xrgb -sun/awt/image/SunVolatileImage -sun/awt/image/SunWritableRaster -sun/awt/image/SunWritableRaster$DataStealer -sun/awt/image/SurfaceManager -sun/awt/image/SurfaceManager$FlushableCacheData -sun/awt/image/SurfaceManager$ImageAccessor -sun/awt/image/SurfaceManager$ProxiedGraphicsConfig -sun/awt/image/ToolkitImage -sun/awt/image/URLImageSource -sun/awt/image/VolatileSurfaceManager -sun/awt/motif/MFontConfiguration -sun/awt/resources/awt -sun/awt/util/IdentityArrayList -sun/dc/DuctusRenderingEngine -sun/font/AttributeValues -sun/font/CMap -sun/font/CMap$CMapFormat12 -sun/font/CMap$NullCMapClass -sun/font/CharToGlyphMapper -sun/font/CompositeFont -sun/font/CompositeFontDescriptor -sun/font/CompositeGlyphMapper -sun/font/CompositeStrike -sun/font/CoreMetrics -sun/font/EAttribute -sun/font/FcFontConfiguration -sun/font/FileFont -sun/font/FileFontStrike -sun/font/Font2D -sun/font/Font2DHandle -sun/font/FontAccess -sun/font/FontConfigManager -sun/font/FontConfigManager$FcCompFont -sun/font/FontConfigManager$FontConfigFont -sun/font/FontConfigManager$FontConfigInfo -sun/font/FontDesignMetrics -sun/font/FontDesignMetrics$KeyReference -sun/font/FontDesignMetrics$MetricsKey -sun/font/FontFamily -sun/font/FontLineMetrics -sun/font/FontManager -sun/font/FontManagerFactory -sun/font/FontManagerFactory$1 -sun/font/FontManagerForSGE -sun/font/FontManagerNativeLibrary -sun/font/FontManagerNativeLibrary$1 -sun/font/FontScaler -sun/font/FontStrike -sun/font/FontStrikeDesc -sun/font/FontStrikeDisposer -sun/font/FontUtilities -sun/font/FontUtilities$1 -sun/font/GlyphDisposedListener -sun/font/GlyphList -sun/font/PhysicalFont -sun/font/PhysicalStrike -sun/font/StandardGlyphVector -sun/font/StandardGlyphVector$GlyphStrike -sun/font/StrikeCache -sun/font/StrikeCache$1 -sun/font/StrikeCache$DisposableStrike -sun/font/StrikeCache$SoftDisposerRef -sun/font/StrikeMetrics -sun/font/SunFontManager -sun/font/SunFontManager$1 -sun/font/SunFontManager$11 -sun/font/SunFontManager$13 -sun/font/SunFontManager$2 -sun/font/SunFontManager$3 -sun/font/SunFontManager$FontRegistrationInfo -sun/font/SunFontManager$T1Filter -sun/font/SunFontManager$TTFilter -sun/font/T2KFontScaler -sun/font/T2KFontScaler$1 -sun/font/TrueTypeFont -sun/font/TrueTypeFont$1 -sun/font/TrueTypeFont$DirectoryEntry -sun/font/TrueTypeFont$TTDisposerRecord -sun/font/TrueTypeGlyphMapper -sun/font/Type1Font -sun/font/Type1Font$1 -sun/font/XRGlyphCache -sun/font/XRGlyphCacheEntry -sun/font/XRTextRenderer -sun/java2d/BackBufferCapsProvider -sun/java2d/DefaultDisposerRecord -sun/java2d/DestSurfaceProvider -sun/java2d/Disposer -sun/java2d/Disposer$1 -sun/java2d/Disposer$2 -sun/java2d/Disposer$PollDisposable -sun/java2d/DisposerRecord -sun/java2d/DisposerTarget -sun/java2d/FontSupport -sun/java2d/InvalidPipeException -sun/java2d/NullSurfaceData -sun/java2d/StateTrackable -sun/java2d/StateTrackable$State -sun/java2d/StateTrackableDelegate -sun/java2d/StateTrackableDelegate$1 -sun/java2d/StateTrackableDelegate$2 -sun/java2d/StateTracker -sun/java2d/StateTracker$1 -sun/java2d/StateTracker$2 -sun/java2d/SunGraphics2D -sun/java2d/SunGraphicsEnvironment -sun/java2d/SunGraphicsEnvironment$1 -sun/java2d/Surface -sun/java2d/SurfaceData -sun/java2d/SurfaceData$PixelToPgramLoopConverter -sun/java2d/SurfaceData$PixelToShapeLoopConverter -sun/java2d/SurfaceDataProxy -sun/java2d/SurfaceDataProxy$1 -sun/java2d/SurfaceManagerFactory -sun/java2d/UnixSurfaceManagerFactory -sun/java2d/cmm/CMSManager -sun/java2d/cmm/ProfileActivator -sun/java2d/cmm/ProfileDeferralInfo -sun/java2d/cmm/ProfileDeferralMgr -sun/java2d/jules/JulesPathBuf -sun/java2d/jules/JulesPathBuf$1 -sun/java2d/loops/Blit -sun/java2d/loops/BlitBg -sun/java2d/loops/CompositeType -sun/java2d/loops/CustomComponent -sun/java2d/loops/DrawGlyphList -sun/java2d/loops/DrawGlyphListAA -sun/java2d/loops/DrawGlyphListLCD -sun/java2d/loops/DrawLine -sun/java2d/loops/DrawParallelogram -sun/java2d/loops/DrawPath -sun/java2d/loops/DrawPolygons -sun/java2d/loops/DrawRect -sun/java2d/loops/FillParallelogram -sun/java2d/loops/FillPath -sun/java2d/loops/FillRect -sun/java2d/loops/FillSpans -sun/java2d/loops/FontInfo -sun/java2d/loops/GeneralRenderer -sun/java2d/loops/GraphicsPrimitive -sun/java2d/loops/GraphicsPrimitiveMgr -sun/java2d/loops/GraphicsPrimitiveMgr$1 -sun/java2d/loops/GraphicsPrimitiveMgr$2 -sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec -sun/java2d/loops/GraphicsPrimitiveProxy -sun/java2d/loops/MaskBlit -sun/java2d/loops/MaskFill -sun/java2d/loops/ProcessPath -sun/java2d/loops/ProcessPath$1 -sun/java2d/loops/ProcessPath$ActiveEdgeList -sun/java2d/loops/ProcessPath$DrawHandler -sun/java2d/loops/ProcessPath$Edge -sun/java2d/loops/ProcessPath$EndSubPathHandler -sun/java2d/loops/ProcessPath$FillData -sun/java2d/loops/ProcessPath$FillProcessHandler -sun/java2d/loops/ProcessPath$Point -sun/java2d/loops/ProcessPath$ProcessHandler -sun/java2d/loops/RenderCache -sun/java2d/loops/RenderCache$Entry -sun/java2d/loops/RenderLoops -sun/java2d/loops/ScaledBlit -sun/java2d/loops/SurfaceType -sun/java2d/loops/TransformBlit -sun/java2d/loops/TransformHelper -sun/java2d/loops/XORComposite -sun/java2d/opengl/GLXGraphicsConfig -sun/java2d/opengl/OGLGraphicsConfig -sun/java2d/pipe/AAShapePipe -sun/java2d/pipe/AATextRenderer -sun/java2d/pipe/AlphaColorPipe -sun/java2d/pipe/AlphaPaintPipe -sun/java2d/pipe/CompositePipe -sun/java2d/pipe/DrawImage -sun/java2d/pipe/DrawImagePipe -sun/java2d/pipe/GeneralCompositePipe -sun/java2d/pipe/GlyphListLoopPipe -sun/java2d/pipe/GlyphListPipe -sun/java2d/pipe/LCDTextRenderer -sun/java2d/pipe/LoopBasedPipe -sun/java2d/pipe/LoopPipe -sun/java2d/pipe/NullPipe -sun/java2d/pipe/OutlineTextRenderer -sun/java2d/pipe/ParallelogramPipe -sun/java2d/pipe/PixelDrawPipe -sun/java2d/pipe/PixelFillPipe -sun/java2d/pipe/PixelToParallelogramConverter -sun/java2d/pipe/PixelToShapeConverter -sun/java2d/pipe/Region -sun/java2d/pipe/Region$ImmutableRegion -sun/java2d/pipe/RegionIterator -sun/java2d/pipe/RenderingEngine -sun/java2d/pipe/RenderingEngine$1 -sun/java2d/pipe/ShapeDrawPipe -sun/java2d/pipe/SolidTextRenderer -sun/java2d/pipe/SpanClipRenderer -sun/java2d/pipe/SpanShapeRenderer -sun/java2d/pipe/SpanShapeRenderer$Composite -sun/java2d/pipe/TextPipe -sun/java2d/pipe/TextRenderer -sun/java2d/pipe/ValidatePipe -sun/java2d/pipe/hw/AccelGraphicsConfig -sun/java2d/pipe/hw/BufferedContextProvider -sun/java2d/x11/X11SurfaceData -sun/java2d/x11/X11SurfaceData$LazyPipe -sun/java2d/x11/XSurfaceData -sun/java2d/xr/DirtyRegion -sun/java2d/xr/GrowableEltArray -sun/java2d/xr/GrowableIntArray -sun/java2d/xr/GrowableRectArray -sun/java2d/xr/MaskTile -sun/java2d/xr/MaskTileManager -sun/java2d/xr/MutableInteger -sun/java2d/xr/XRBackend -sun/java2d/xr/XRBackendNative -sun/java2d/xr/XRColor -sun/java2d/xr/XRCompositeManager -sun/java2d/xr/XRCompositeManager$1 -sun/java2d/xr/XRDrawImage -sun/java2d/xr/XRDrawLine -sun/java2d/xr/XRGraphicsConfig -sun/java2d/xr/XRMaskBlit -sun/java2d/xr/XRMaskFill -sun/java2d/xr/XRMaskImage -sun/java2d/xr/XRPMBlit -sun/java2d/xr/XRPMBlitLoops -sun/java2d/xr/XRPMScaledBlit -sun/java2d/xr/XRPMTransformedBlit -sun/java2d/xr/XRPaints -sun/java2d/xr/XRPaints$XRGradient -sun/java2d/xr/XRPaints$XRLinearGradient -sun/java2d/xr/XRPaints$XRRadialGradient -sun/java2d/xr/XRPaints$XRTexture -sun/java2d/xr/XRRenderer -sun/java2d/xr/XRRenderer$XRDrawHandler -sun/java2d/xr/XRSolidSrcPict -sun/java2d/xr/XRSurfaceData -sun/java2d/xr/XRSurfaceData$XRInternalSurfaceData -sun/java2d/xr/XRSurfaceData$XRPixmapSurfaceData -sun/java2d/xr/XRSurfaceData$XRWindowSurfaceData -sun/java2d/xr/XRSurfaceDataProxy -sun/java2d/xr/XRUtils -sun/java2d/xr/XRVolatileSurfaceManager -sun/java2d/xr/XrSwToPMBlit -sun/java2d/xr/XrSwToPMScaledBlit -sun/java2d/xr/XrSwToPMTransformedBlit -sun/launcher/LauncherHelper -sun/launcher/LauncherHelper$FXHelper -sun/misc/ASCIICaseInsensitiveComparator -sun/misc/Cleaner -sun/misc/CompoundEnumeration -sun/misc/ExtensionDependency -sun/misc/FDBigInteger -sun/misc/FileURLMapper -sun/misc/FloatingDecimal -sun/misc/FloatingDecimal$1 -sun/misc/FloatingDecimal$ASCIIToBinaryBuffer -sun/misc/FloatingDecimal$ASCIIToBinaryConverter -sun/misc/FloatingDecimal$BinaryToASCIIBuffer -sun/misc/FloatingDecimal$BinaryToASCIIConverter -sun/misc/FloatingDecimal$ExceptionalBinaryToASCIIBuffer -sun/misc/FloatingDecimal$PreparedASCIIToBinaryBuffer -sun/misc/IOUtils -sun/misc/JarIndex -sun/misc/JavaAWTAccess -sun/misc/JavaIOFileDescriptorAccess -sun/misc/JavaLangAccess -sun/misc/JavaNetAccess -sun/misc/JavaNioAccess -sun/misc/JavaSecurityAccess -sun/misc/JavaSecurityProtectionDomainAccess -sun/misc/JavaUtilJarAccess -sun/misc/JavaUtilZipFileAccess -sun/misc/Launcher -sun/misc/Launcher$AppClassLoader -sun/misc/Launcher$AppClassLoader$1 -sun/misc/Launcher$BootClassPathHolder -sun/misc/Launcher$BootClassPathHolder$1 -sun/misc/Launcher$ExtClassLoader -sun/misc/Launcher$ExtClassLoader$1 -sun/misc/Launcher$Factory -sun/misc/MetaIndex -sun/misc/NativeSignalHandler -sun/misc/OSEnvironment -sun/misc/Perf -sun/misc/Perf$GetPerfAction -sun/misc/PerfCounter -sun/misc/PerfCounter$CoreCounters -sun/misc/PerformanceLogger -sun/misc/PerformanceLogger$TimeData -sun/misc/PostVMInitHook -sun/misc/Resource -sun/misc/SharedSecrets -sun/misc/Signal -sun/misc/SignalHandler -sun/misc/SoftCache -sun/misc/SoftCache$ValueCell -sun/misc/URLClassPath -sun/misc/URLClassPath$1 -sun/misc/URLClassPath$2 -sun/misc/URLClassPath$3 -sun/misc/URLClassPath$FileLoader -sun/misc/URLClassPath$JarLoader -sun/misc/URLClassPath$JarLoader$1 -sun/misc/URLClassPath$JarLoader$2 -sun/misc/URLClassPath$Loader -sun/misc/Unsafe -sun/misc/VM -sun/misc/Version -sun/net/DefaultProgressMeteringPolicy -sun/net/InetAddressCachePolicy -sun/net/InetAddressCachePolicy$1 -sun/net/InetAddressCachePolicy$2 -sun/net/NetHooks -sun/net/NetHooks$Provider -sun/net/NetProperties -sun/net/NetProperties$1 -sun/net/ProgressMeteringPolicy -sun/net/ProgressMonitor -sun/net/ResourceManager -sun/net/sdp/SdpProvider -sun/net/spi/DefaultProxySelector -sun/net/spi/DefaultProxySelector$1 -sun/net/spi/DefaultProxySelector$3 -sun/net/spi/DefaultProxySelector$NonProxyInfo -sun/net/spi/nameservice/NameService -sun/net/util/IPAddressUtil -sun/net/util/URLUtil -sun/net/www/MessageHeader -sun/net/www/MimeEntry -sun/net/www/MimeTable -sun/net/www/MimeTable$1 -sun/net/www/MimeTable$DefaultInstanceHolder -sun/net/www/MimeTable$DefaultInstanceHolder$1 -sun/net/www/ParseUtil -sun/net/www/URLConnection -sun/net/www/protocol/file/FileURLConnection -sun/net/www/protocol/file/Handler -sun/net/www/protocol/http/Handler -sun/net/www/protocol/jar/Handler -sun/net/www/protocol/jar/JarFileFactory -sun/net/www/protocol/jar/JarURLConnection -sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream -sun/net/www/protocol/jar/URLJarFile -sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController -sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry -sun/nio/ByteBuffered -sun/nio/ch/DirectBuffer -sun/nio/ch/FileChannelImpl -sun/nio/ch/FileChannelImpl$Unmapper -sun/nio/ch/FileDispatcher -sun/nio/ch/FileDispatcherImpl -sun/nio/ch/IOStatus -sun/nio/ch/IOUtil -sun/nio/ch/IOUtil$1 -sun/nio/ch/Interruptible -sun/nio/ch/NativeDispatcher -sun/nio/ch/NativeThread -sun/nio/ch/NativeThreadSet -sun/nio/ch/Util -sun/nio/ch/Util$1 -sun/nio/ch/Util$4 -sun/nio/ch/Util$BufferCache -sun/nio/cs/AbstractCharsetProvider -sun/nio/cs/ArrayDecoder -sun/nio/cs/ArrayEncoder -sun/nio/cs/FastCharsetProvider -sun/nio/cs/HistoricallyNamedCharset -sun/nio/cs/ISO_8859_1 -sun/nio/cs/ISO_8859_1$Decoder -sun/nio/cs/ISO_8859_1$Encoder -sun/nio/cs/StandardCharsets -sun/nio/cs/StandardCharsets$Aliases -sun/nio/cs/StandardCharsets$Cache -sun/nio/cs/StandardCharsets$Classes -sun/nio/cs/StreamDecoder -sun/nio/cs/StreamEncoder -sun/nio/cs/Surrogate -sun/nio/cs/Surrogate$Parser -sun/nio/cs/US_ASCII -sun/nio/cs/US_ASCII$Decoder -sun/nio/cs/UTF_16 -sun/nio/cs/UTF_16$Decoder -sun/nio/cs/UTF_16BE -sun/nio/cs/UTF_16LE -sun/nio/cs/UTF_8 -sun/nio/cs/UTF_8$Decoder -sun/nio/cs/UTF_8$Encoder -sun/nio/cs/Unicode -sun/nio/cs/UnicodeDecoder -sun/nio/cs/ext/DelegatableDecoder -sun/nio/cs/ext/DoubleByte -sun/nio/cs/ext/DoubleByte$Decoder -sun/nio/cs/ext/EUC_KR -sun/nio/cs/ext/ExtendedCharsets -sun/print/PrinterGraphicsConfig -sun/reflect/AccessorGenerator -sun/reflect/BootstrapConstructorAccessorImpl -sun/reflect/ByteVector -sun/reflect/ByteVectorFactory -sun/reflect/ByteVectorImpl -sun/reflect/CallerSensitive -sun/reflect/ClassDefiner -sun/reflect/ClassDefiner$1 -sun/reflect/ClassFileAssembler -sun/reflect/ClassFileConstants -sun/reflect/ConstantPool -sun/reflect/ConstructorAccessor -sun/reflect/ConstructorAccessorImpl -sun/reflect/DelegatingClassLoader -sun/reflect/DelegatingConstructorAccessorImpl -sun/reflect/DelegatingMethodAccessorImpl -sun/reflect/FieldAccessor -sun/reflect/FieldAccessorImpl -sun/reflect/Label -sun/reflect/Label$PatchInfo -sun/reflect/LangReflectAccess -sun/reflect/MagicAccessorImpl -sun/reflect/MethodAccessor -sun/reflect/MethodAccessorGenerator -sun/reflect/MethodAccessorGenerator$1 -sun/reflect/MethodAccessorImpl -sun/reflect/NativeConstructorAccessorImpl -sun/reflect/NativeMethodAccessorImpl -sun/reflect/Reflection -sun/reflect/ReflectionFactory -sun/reflect/ReflectionFactory$1 -sun/reflect/ReflectionFactory$GetReflectionFactoryAction -sun/reflect/SerializationConstructorAccessorImpl -sun/reflect/UTF8 -sun/reflect/UnsafeFieldAccessorFactory -sun/reflect/UnsafeFieldAccessorImpl -sun/reflect/UnsafeObjectFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl -sun/reflect/UnsafeStaticFieldAccessorImpl -sun/reflect/annotation/AnnotationType -sun/reflect/generics/repository/AbstractRepository -sun/reflect/generics/repository/ClassRepository -sun/reflect/generics/repository/GenericDeclRepository -sun/reflect/misc/MethodUtil -sun/reflect/misc/MethodUtil$1 -sun/reflect/misc/ReflectUtil -sun/security/action/GetBooleanAction -sun/security/action/GetIntegerAction -sun/security/action/GetPropertyAction -sun/security/action/PutAllAction -sun/security/jca/GetInstance -sun/security/jca/GetInstance$Instance -sun/security/jca/ProviderConfig -sun/security/jca/ProviderConfig$1 -sun/security/jca/ProviderConfig$2 -sun/security/jca/ProviderConfig$3 -sun/security/jca/ProviderList -sun/security/jca/ProviderList$1 -sun/security/jca/ProviderList$2 -sun/security/jca/ProviderList$3 -sun/security/jca/ProviderList$ServiceList -sun/security/jca/ProviderList$ServiceList$1 -sun/security/jca/Providers -sun/security/jca/ServiceId -sun/security/pkcs/ContentInfo -sun/security/pkcs/PKCS7 -sun/security/pkcs/PKCS8Key -sun/security/pkcs/PKCS9Attribute -sun/security/pkcs/SignerInfo -sun/security/provider/ByteArrayAccess -sun/security/provider/DSAKeyFactory -sun/security/provider/DSAParameters -sun/security/provider/DSAPublicKey -sun/security/provider/DSAPublicKeyImpl -sun/security/provider/DigestBase -sun/security/provider/NativePRNG -sun/security/provider/NativePRNG$1 -sun/security/provider/NativePRNG$2 -sun/security/provider/NativePRNG$Blocking -sun/security/provider/NativePRNG$NonBlocking -sun/security/provider/NativePRNG$RandomIO -sun/security/provider/NativePRNG$Variant -sun/security/provider/SHA2 -sun/security/provider/SHA2$SHA256 -sun/security/provider/Sun -sun/security/provider/SunEntries -sun/security/provider/SunEntries$1 -sun/security/provider/X509Factory -sun/security/provider/certpath/X509CertPath -sun/security/rsa/RSACore -sun/security/rsa/RSAKeyFactory -sun/security/rsa/RSAPadding -sun/security/rsa/RSAPrivateCrtKeyImpl -sun/security/rsa/RSAPrivateKeyImpl -sun/security/rsa/RSAPublicKeyImpl -sun/security/rsa/RSASignature -sun/security/rsa/RSASignature$SHA256withRSA -sun/security/rsa/SunRsaSign -sun/security/rsa/SunRsaSignEntries -sun/security/util/BitArray -sun/security/util/ByteArrayLexOrder -sun/security/util/ByteArrayTagOrder -sun/security/util/Cache -sun/security/util/Cache$EqualByteArray -sun/security/util/Debug -sun/security/util/DerEncoder -sun/security/util/DerIndefLenConverter -sun/security/util/DerInputBuffer -sun/security/util/DerInputStream -sun/security/util/DerOutputStream -sun/security/util/DerValue -sun/security/util/Length -sun/security/util/ManifestDigester -sun/security/util/ManifestDigester$Entry -sun/security/util/ManifestDigester$Position -sun/security/util/ManifestEntryVerifier -sun/security/util/ManifestEntryVerifier$SunProviderHolder -sun/security/util/MemoryCache -sun/security/util/MemoryCache$CacheEntry -sun/security/util/MemoryCache$HardCacheEntry -sun/security/util/MemoryCache$SoftCacheEntry -sun/security/util/ObjectIdentifier -sun/security/util/PropertyExpander -sun/security/util/SignatureFileVerifier -sun/security/x509/AVA -sun/security/x509/AVAKeyword -sun/security/x509/AlgorithmId -sun/security/x509/AuthorityKeyIdentifierExtension -sun/security/x509/BasicConstraintsExtension -sun/security/x509/CertAttrSet -sun/security/x509/CertificateAlgorithmId -sun/security/x509/CertificateExtensions -sun/security/x509/CertificateSerialNumber -sun/security/x509/CertificateValidity -sun/security/x509/CertificateVersion -sun/security/x509/CertificateX509Key -sun/security/x509/Extension -sun/security/x509/GeneralName -sun/security/x509/GeneralNameInterface -sun/security/x509/GeneralNames -sun/security/x509/KeyIdentifier -sun/security/x509/KeyUsageExtension -sun/security/x509/NetscapeCertTypeExtension -sun/security/x509/NetscapeCertTypeExtension$MapEntry -sun/security/x509/OIDMap -sun/security/x509/OIDMap$OIDInfo -sun/security/x509/PKIXExtensions -sun/security/x509/RDN -sun/security/x509/RFC822Name -sun/security/x509/SerialNumber -sun/security/x509/SubjectAlternativeNameExtension -sun/security/x509/SubjectKeyIdentifierExtension -sun/security/x509/X500Name -sun/security/x509/X500Name$1 -sun/security/x509/X509AttributeName -sun/security/x509/X509CertImpl -sun/security/x509/X509CertInfo -sun/security/x509/X509Key -sun/swing/DefaultLookup -sun/swing/ImageIconUIResource -sun/swing/JLightweightFrame -sun/swing/MenuItemLayoutHelper -sun/swing/MenuItemLayoutHelper$ColumnAlignment -sun/swing/MenuItemLayoutHelper$LayoutResult -sun/swing/MenuItemLayoutHelper$RectSize -sun/swing/PrintColorUIResource -sun/swing/StringUIClientPropertyKey -sun/swing/SwingAccessor -sun/swing/SwingAccessor$JTextComponentAccessor -sun/swing/SwingLazyValue -sun/swing/SwingLazyValue$1 -sun/swing/SwingUtilities2 -sun/swing/SwingUtilities2$2 -sun/swing/SwingUtilities2$AATextInfo -sun/swing/SwingUtilities2$LSBCacheEntry -sun/swing/UIAction -sun/swing/UIClientPropertyKey -sun/swing/table/DefaultTableCellHeaderRenderer -sun/swing/table/DefaultTableCellHeaderRenderer$EmptyIcon -sun/text/ComposedCharIter -sun/text/IntHashtable -sun/text/UCompactIntArray -sun/text/normalizer/CharTrie -sun/text/normalizer/CharTrie$FriendAgent -sun/text/normalizer/ICUBinary -sun/text/normalizer/ICUBinary$Authenticate -sun/text/normalizer/ICUData -sun/text/normalizer/IntTrie -sun/text/normalizer/NormalizerBase -sun/text/normalizer/NormalizerBase$1 -sun/text/normalizer/NormalizerBase$Mode -sun/text/normalizer/NormalizerBase$NFCMode -sun/text/normalizer/NormalizerBase$NFDMode -sun/text/normalizer/NormalizerBase$NFKCMode -sun/text/normalizer/NormalizerBase$NFKDMode -sun/text/normalizer/NormalizerBase$QuickCheckResult -sun/text/normalizer/NormalizerDataReader -sun/text/normalizer/NormalizerImpl -sun/text/normalizer/NormalizerImpl$AuxTrieImpl -sun/text/normalizer/NormalizerImpl$DecomposeArgs -sun/text/normalizer/NormalizerImpl$FCDTrieImpl -sun/text/normalizer/NormalizerImpl$NormTrieImpl -sun/text/normalizer/Trie -sun/text/normalizer/Trie$DataManipulate -sun/text/normalizer/UTF16 -sun/text/normalizer/UnicodeMatcher -sun/text/normalizer/UnicodeSet -sun/text/resources/CollationData -sun/text/resources/FormatData -sun/text/resources/en/FormatData_en -sun/text/resources/en/FormatData_en_US -sun/util/CoreResourceBundleControl -sun/util/PreHashedMap -sun/util/ResourceBundleEnumeration -sun/util/calendar/AbstractCalendar -sun/util/calendar/BaseCalendar -sun/util/calendar/BaseCalendar$Date -sun/util/calendar/CalendarDate -sun/util/calendar/CalendarSystem -sun/util/calendar/CalendarUtils -sun/util/calendar/Gregorian -sun/util/calendar/Gregorian$Date -sun/util/calendar/ZoneInfo -sun/util/calendar/ZoneInfoFile -sun/util/calendar/ZoneInfoFile$1 -sun/util/calendar/ZoneInfoFile$Checksum -sun/util/calendar/ZoneInfoFile$ZoneOffsetTransitionRule -sun/util/locale/BaseLocale -sun/util/locale/BaseLocale$Cache -sun/util/locale/BaseLocale$Key -sun/util/locale/LanguageTag -sun/util/locale/LocaleObjectCache -sun/util/locale/LocaleObjectCache$CacheEntry -sun/util/locale/LocaleUtils -sun/util/locale/provider/AuxLocaleProviderAdapter -sun/util/locale/provider/AuxLocaleProviderAdapter$NullProvider -sun/util/locale/provider/AvailableLanguageTags -sun/util/locale/provider/CalendarDataProviderImpl -sun/util/locale/provider/CalendarDataUtility -sun/util/locale/provider/CalendarDataUtility$CalendarWeekParameterGetter -sun/util/locale/provider/CalendarProviderImpl -sun/util/locale/provider/CollatorProviderImpl -sun/util/locale/provider/CurrencyNameProviderImpl -sun/util/locale/provider/DateFormatSymbolsProviderImpl -sun/util/locale/provider/DecimalFormatSymbolsProviderImpl -sun/util/locale/provider/JRELocaleProviderAdapter -sun/util/locale/provider/JRELocaleProviderAdapter$1 -sun/util/locale/provider/LocaleDataMetaInfo -sun/util/locale/provider/LocaleProviderAdapter -sun/util/locale/provider/LocaleProviderAdapter$1 -sun/util/locale/provider/LocaleProviderAdapter$Type -sun/util/locale/provider/LocaleResources -sun/util/locale/provider/LocaleResources$ResourceReference -sun/util/locale/provider/LocaleServiceProviderPool -sun/util/locale/provider/LocaleServiceProviderPool$LocalizedObjectGetter -sun/util/locale/provider/NumberFormatProviderImpl -sun/util/locale/provider/ResourceBundleBasedAdapter -sun/util/locale/provider/SPILocaleProviderAdapter -sun/util/locale/provider/SPILocaleProviderAdapter$1 -sun/util/locale/provider/TimeZoneNameProviderImpl -sun/util/locale/provider/TimeZoneNameUtility -sun/util/locale/provider/TimeZoneNameUtility$TimeZoneNameGetter -sun/util/logging/LoggingProxy -sun/util/logging/LoggingSupport -sun/util/logging/LoggingSupport$1 -sun/util/logging/LoggingSupport$2 -sun/util/logging/PlatformLogger -sun/util/logging/PlatformLogger$1 -sun/util/logging/PlatformLogger$DefaultLoggerProxy -sun/util/logging/PlatformLogger$JavaLoggerProxy -sun/util/logging/PlatformLogger$Level -sun/util/logging/PlatformLogger$LoggerProxy -sun/util/logging/resources/logging -sun/util/resources/CalendarData -sun/util/resources/CurrencyNames -sun/util/resources/LocaleData -sun/util/resources/LocaleData$1 -sun/util/resources/LocaleData$LocaleDataResourceBundleControl -sun/util/resources/LocaleNamesBundle -sun/util/resources/OpenListResourceBundle -sun/util/resources/ParallelListResourceBundle -sun/util/resources/ParallelListResourceBundle$KeySet -sun/util/resources/TimeZoneNames -sun/util/resources/TimeZoneNamesBundle -sun/util/resources/en/CalendarData_en -sun/util/resources/en/CurrencyNames_en_US -sun/util/resources/en/TimeZoneNames_en -sun/util/spi/CalendarProvider -# fcfd7386dfd2b3ad diff --git a/jdk/make/data/classlist/classlist.windows b/jdk/make/data/classlist/classlist.windows deleted file mode 100644 index debed79c4a4..00000000000 --- a/jdk/make/data/classlist/classlist.windows +++ /dev/null @@ -1,2378 +0,0 @@ -com/sun/java/swing/SwingUtilities3 -com/sun/java/swing/plaf/windows/WindowsPopupWindow -com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI -com/sun/swing/internal/plaf/basic/resources/basic -com/sun/swing/internal/plaf/metal/resources/metal -java/applet/Applet -java/awt/AWTEvent -java/awt/AWTEvent$1 -java/awt/AWTEventMulticaster -java/awt/AWTKeyStroke -java/awt/AWTKeyStroke$1 -java/awt/ActiveEvent -java/awt/Adjustable -java/awt/AlphaComposite -java/awt/BasicStroke -java/awt/BorderLayout -java/awt/BufferCapabilities -java/awt/Canvas -java/awt/CardLayout -java/awt/CardLayout$Card -java/awt/Color -java/awt/Component -java/awt/Component$1 -java/awt/Component$3 -java/awt/Component$AWTTreeLock -java/awt/Component$AccessibleAWTComponent -java/awt/Component$BaselineResizeBehavior -java/awt/Component$BltBufferStrategy -java/awt/Component$BltSubRegionBufferStrategy -java/awt/Component$DummyRequestFocusController -java/awt/Component$FlipBufferStrategy -java/awt/ComponentOrientation -java/awt/Composite -java/awt/Conditional -java/awt/Container -java/awt/Container$1 -java/awt/Container$AccessibleAWTContainer -java/awt/ContainerOrderFocusTraversalPolicy -java/awt/Cursor -java/awt/Cursor$1 -java/awt/Cursor$CursorDisposer -java/awt/DefaultFocusTraversalPolicy -java/awt/DefaultKeyboardFocusManager -java/awt/DefaultKeyboardFocusManager$1 -java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent -java/awt/DefaultKeyboardFocusManager$TypeAheadMarker -java/awt/Dialog -java/awt/Dialog$ModalExclusionType -java/awt/Dialog$ModalityType -java/awt/Dimension -java/awt/Event -java/awt/EventDispatchThread -java/awt/EventDispatchThread$1 -java/awt/EventDispatchThread$HierarchyEventFilter -java/awt/EventFilter -java/awt/EventFilter$FilterAction -java/awt/EventQueue -java/awt/EventQueue$1 -java/awt/EventQueue$1AWTInvocationLock -java/awt/EventQueue$2 -java/awt/EventQueue$3 -java/awt/EventQueue$4 -java/awt/EventQueue$5 -java/awt/FlowLayout -java/awt/FocusTraversalPolicy -java/awt/Font -java/awt/Font$FontAccessImpl -java/awt/FontMetrics -java/awt/Frame -java/awt/Frame$1 -java/awt/Graphics -java/awt/Graphics2D -java/awt/GraphicsCallback -java/awt/GraphicsCallback$PaintCallback -java/awt/GraphicsConfiguration -java/awt/GraphicsDevice -java/awt/GraphicsEnvironment -java/awt/GraphicsEnvironment$1 -java/awt/GridLayout -java/awt/Image -java/awt/Image$1 -java/awt/ImageCapabilities -java/awt/ImageMediaEntry -java/awt/Insets -java/awt/ItemSelectable -java/awt/KeyEventDispatcher -java/awt/KeyEventPostProcessor -java/awt/KeyboardFocusManager -java/awt/KeyboardFocusManager$1 -java/awt/KeyboardFocusManager$3 -java/awt/KeyboardFocusManager$HeavyweightFocusRequest -java/awt/KeyboardFocusManager$LightweightFocusRequest -java/awt/Label -java/awt/LayoutManager -java/awt/LayoutManager2 -java/awt/LightweightDispatcher -java/awt/LightweightDispatcher$2 -java/awt/MediaEntry -java/awt/MediaTracker -java/awt/MenuBar -java/awt/MenuComponent -java/awt/MenuContainer -java/awt/ModalEventFilter -java/awt/Paint -java/awt/Panel -java/awt/Point -java/awt/PrintGraphics -java/awt/Queue -java/awt/Rectangle -java/awt/RenderingHints -java/awt/RenderingHints$Key -java/awt/SentEvent -java/awt/SequencedEvent -java/awt/SequencedEvent$1 -java/awt/Shape -java/awt/SplashScreen -java/awt/Stroke -java/awt/Toolkit -java/awt/Toolkit$1 -java/awt/Toolkit$2 -java/awt/Toolkit$3 -java/awt/Toolkit$4 -java/awt/Toolkit$5 -java/awt/Toolkit$DesktopPropertyChangeSupport -java/awt/Toolkit$DesktopPropertyChangeSupport$1 -java/awt/Toolkit$SelectiveAWTEventListener -java/awt/Toolkit$ToolkitEventMulticaster -java/awt/Transparency -java/awt/TrayIcon -java/awt/VKCollection -java/awt/Window -java/awt/Window$1 -java/awt/Window$1DisposeAction -java/awt/Window$Type -java/awt/Window$WindowDisposerRecord -java/awt/color/ColorSpace -java/awt/color/ICC_ColorSpace -java/awt/color/ICC_Profile -java/awt/color/ICC_Profile$1 -java/awt/color/ICC_ProfileRGB -java/awt/datatransfer/ClipboardOwner -java/awt/datatransfer/FlavorMap -java/awt/datatransfer/FlavorTable -java/awt/datatransfer/SystemFlavorMap -java/awt/dnd/DropTarget -java/awt/dnd/DropTargetContext -java/awt/dnd/DropTargetListener -java/awt/dnd/peer/DragSourceContextPeer -java/awt/dnd/peer/DropTargetPeer -java/awt/event/AWTEventListener -java/awt/event/AWTEventListenerProxy -java/awt/event/ActionEvent -java/awt/event/ActionListener -java/awt/event/AdjustmentEvent -java/awt/event/AdjustmentListener -java/awt/event/ComponentAdapter -java/awt/event/ComponentEvent -java/awt/event/ComponentListener -java/awt/event/ContainerEvent -java/awt/event/ContainerListener -java/awt/event/FocusAdapter -java/awt/event/FocusEvent -java/awt/event/FocusListener -java/awt/event/HierarchyBoundsListener -java/awt/event/HierarchyListener -java/awt/event/InputEvent -java/awt/event/InputEvent$1 -java/awt/event/InputMethodEvent -java/awt/event/InputMethodListener -java/awt/event/InvocationEvent -java/awt/event/InvocationEvent$1 -java/awt/event/ItemEvent -java/awt/event/ItemListener -java/awt/event/KeyAdapter -java/awt/event/KeyEvent -java/awt/event/KeyEvent$1 -java/awt/event/KeyListener -java/awt/event/MouseAdapter -java/awt/event/MouseEvent -java/awt/event/MouseListener -java/awt/event/MouseMotionAdapter -java/awt/event/MouseMotionListener -java/awt/event/MouseWheelListener -java/awt/event/NativeLibLoader -java/awt/event/NativeLibLoader$1 -java/awt/event/PaintEvent -java/awt/event/TextListener -java/awt/event/WindowAdapter -java/awt/event/WindowEvent -java/awt/event/WindowFocusListener -java/awt/event/WindowListener -java/awt/event/WindowStateListener -java/awt/font/FontRenderContext -java/awt/font/GlyphVector -java/awt/font/LineMetrics -java/awt/font/TextAttribute -java/awt/geom/AffineTransform -java/awt/geom/Dimension2D -java/awt/geom/GeneralPath -java/awt/geom/Line2D -java/awt/geom/Line2D$Float -java/awt/geom/LineIterator -java/awt/geom/Path2D -java/awt/geom/Path2D$Float -java/awt/geom/PathIterator -java/awt/geom/Point2D -java/awt/geom/Point2D$Float -java/awt/geom/RectIterator -java/awt/geom/Rectangle2D -java/awt/geom/Rectangle2D$Float -java/awt/geom/RectangularShape -java/awt/im/InputContext -java/awt/im/InputMethodRequests -java/awt/im/spi/InputMethod -java/awt/im/spi/InputMethodContext -java/awt/im/spi/InputMethodDescriptor -java/awt/image/BufferStrategy -java/awt/image/BufferedImage -java/awt/image/BufferedImage$1 -java/awt/image/ColorModel -java/awt/image/ColorModel$1 -java/awt/image/ComponentSampleModel -java/awt/image/DataBuffer -java/awt/image/DataBuffer$1 -java/awt/image/DataBufferByte -java/awt/image/DataBufferInt -java/awt/image/DirectColorModel -java/awt/image/FilteredImageSource -java/awt/image/ImageConsumer -java/awt/image/ImageFilter -java/awt/image/ImageObserver -java/awt/image/ImageProducer -java/awt/image/IndexColorModel -java/awt/image/PackedColorModel -java/awt/image/PixelInterleavedSampleModel -java/awt/image/RGBImageFilter -java/awt/image/Raster -java/awt/image/RenderedImage -java/awt/image/SampleModel -java/awt/image/SinglePixelPackedSampleModel -java/awt/image/VolatileImage -java/awt/image/WritableRaster -java/awt/image/WritableRenderedImage -java/awt/peer/CanvasPeer -java/awt/peer/ComponentPeer -java/awt/peer/ContainerPeer -java/awt/peer/FontPeer -java/awt/peer/FramePeer -java/awt/peer/KeyboardFocusManagerPeer -java/awt/peer/LabelPeer -java/awt/peer/LightweightPeer -java/awt/peer/PanelPeer -java/awt/peer/WindowPeer -java/awt/print/PrinterGraphics -java/beans/ChangeListenerMap -java/beans/PropertyChangeEvent -java/beans/PropertyChangeListener -java/beans/PropertyChangeListenerProxy -java/beans/PropertyChangeSupport -java/beans/PropertyChangeSupport$PropertyChangeListenerMap -java/beans/VetoableChangeListener -java/io/Bits -java/io/BufferedInputStream -java/io/BufferedOutputStream -java/io/BufferedReader -java/io/BufferedWriter -java/io/ByteArrayInputStream -java/io/ByteArrayOutputStream -java/io/Closeable -java/io/DataInput -java/io/DataInputStream -java/io/DataOutput -java/io/DataOutputStream -java/io/DefaultFileSystem -java/io/EOFException -java/io/ExpiringCache -java/io/ExpiringCache$1 -java/io/ExpiringCache$Entry -java/io/Externalizable -java/io/File -java/io/File$PathStatus -java/io/FileDescriptor -java/io/FileDescriptor$1 -java/io/FileInputStream -java/io/FileInputStream$1 -java/io/FileNotFoundException -java/io/FileOutputStream -java/io/FileOutputStream$1 -java/io/FilePermission -java/io/FilePermission$1 -java/io/FilePermissionCollection -java/io/FileReader -java/io/FileSystem -java/io/FileWriter -java/io/FilenameFilter -java/io/FilterInputStream -java/io/FilterOutputStream -java/io/FilterReader -java/io/Flushable -java/io/IOException -java/io/InputStream -java/io/InputStreamReader -java/io/InterruptedIOException -java/io/ObjectInput -java/io/ObjectInputStream -java/io/ObjectInputStream$BlockDataInputStream -java/io/ObjectInputStream$GetField -java/io/ObjectInputStream$GetFieldImpl -java/io/ObjectInputStream$HandleTable -java/io/ObjectInputStream$HandleTable$HandleList -java/io/ObjectInputStream$PeekInputStream -java/io/ObjectInputStream$ValidationList -java/io/ObjectOutput -java/io/ObjectOutputStream -java/io/ObjectOutputStream$BlockDataOutputStream -java/io/ObjectOutputStream$HandleTable -java/io/ObjectOutputStream$ReplaceTable -java/io/ObjectStreamClass -java/io/ObjectStreamClass$1 -java/io/ObjectStreamClass$2 -java/io/ObjectStreamClass$3 -java/io/ObjectStreamClass$4 -java/io/ObjectStreamClass$5 -java/io/ObjectStreamClass$Caches -java/io/ObjectStreamClass$ClassDataSlot -java/io/ObjectStreamClass$EntryFuture -java/io/ObjectStreamClass$ExceptionInfo -java/io/ObjectStreamClass$FieldReflector -java/io/ObjectStreamClass$FieldReflectorKey -java/io/ObjectStreamClass$MemberSignature -java/io/ObjectStreamClass$WeakClassKey -java/io/ObjectStreamConstants -java/io/ObjectStreamField -java/io/OutputStream -java/io/OutputStreamWriter -java/io/PrintStream -java/io/PushbackInputStream -java/io/RandomAccessFile -java/io/RandomAccessFile$1 -java/io/Reader -java/io/SerialCallbackContext -java/io/Serializable -java/io/StringReader -java/io/StringWriter -java/io/UnsupportedEncodingException -java/io/WinNTFileSystem -java/io/Writer -java/lang/AbstractStringBuilder -java/lang/Appendable -java/lang/ApplicationShutdownHooks -java/lang/ApplicationShutdownHooks$1 -java/lang/ArithmeticException -java/lang/ArrayIndexOutOfBoundsException -java/lang/ArrayStoreException -java/lang/AutoCloseable -java/lang/Boolean -java/lang/BootstrapMethodError -java/lang/Byte -java/lang/CharSequence -java/lang/Character -java/lang/Character$CharacterCache -java/lang/CharacterData -java/lang/CharacterData00 -java/lang/CharacterDataLatin1 -java/lang/Class -java/lang/Class$1 -java/lang/Class$3 -java/lang/Class$4 -java/lang/Class$AnnotationData -java/lang/Class$Atomic -java/lang/Class$ReflectionData -java/lang/ClassCastException -java/lang/ClassFormatError -java/lang/ClassLoader -java/lang/ClassLoader$2 -java/lang/ClassLoader$3 -java/lang/ClassLoader$NativeLibrary -java/lang/ClassLoader$ParallelLoaders -java/lang/ClassLoaderHelper -java/lang/ClassNotFoundException -java/lang/ClassValue$ClassValueMap -java/lang/CloneNotSupportedException -java/lang/Cloneable -java/lang/Comparable -java/lang/Compiler -java/lang/Compiler$1 -java/lang/Double -java/lang/Enum -java/lang/Error -java/lang/Exception -java/lang/ExceptionInInitializerError -java/lang/Float -java/lang/IllegalAccessError -java/lang/IllegalAccessException -java/lang/IllegalArgumentException -java/lang/IllegalMonitorStateException -java/lang/IllegalStateException -java/lang/IncompatibleClassChangeError -java/lang/IndexOutOfBoundsException -java/lang/InheritableThreadLocal -java/lang/InstantiationException -java/lang/Integer -java/lang/Integer$IntegerCache -java/lang/InternalError -java/lang/InterruptedException -java/lang/Iterable -java/lang/LinkageError -java/lang/Long -java/lang/Long$LongCache -java/lang/Math -java/lang/NoClassDefFoundError -java/lang/NoSuchFieldException -java/lang/NoSuchMethodError -java/lang/NoSuchMethodException -java/lang/NullPointerException -java/lang/Number -java/lang/NumberFormatException -java/lang/Object -java/lang/OutOfMemoryError -java/lang/Package -java/lang/ProcessEnvironment -java/lang/ProcessEnvironment$CheckedEntry -java/lang/ProcessEnvironment$CheckedEntrySet -java/lang/ProcessEnvironment$CheckedEntrySet$1 -java/lang/ProcessEnvironment$EntryComparator -java/lang/ProcessEnvironment$NameComparator -java/lang/Readable -java/lang/ReflectiveOperationException -java/lang/Runnable -java/lang/Runtime -java/lang/RuntimeException -java/lang/RuntimePermission -java/lang/SecurityException -java/lang/SecurityManager -java/lang/Short -java/lang/Short$ShortCache -java/lang/Shutdown -java/lang/Shutdown$Lock -java/lang/StackOverflowError -java/lang/StackTraceElement -java/lang/StrictMath -java/lang/String -java/lang/String$CaseInsensitiveComparator -java/lang/StringBuffer -java/lang/StringBuilder -java/lang/StringCoding -java/lang/StringCoding$StringDecoder -java/lang/StringCoding$StringEncoder -java/lang/StringIndexOutOfBoundsException -java/lang/System -java/lang/System$2 -java/lang/SystemClassLoaderAction -java/lang/Terminator -java/lang/Terminator$1 -java/lang/Thread -java/lang/Thread$State -java/lang/Thread$UncaughtExceptionHandler -java/lang/ThreadDeath -java/lang/ThreadGroup -java/lang/ThreadLocal -java/lang/ThreadLocal$ThreadLocalMap -java/lang/ThreadLocal$ThreadLocalMap$Entry -java/lang/Throwable -java/lang/Throwable$PrintStreamOrWriter -java/lang/Throwable$WrappedPrintStream -java/lang/UnsatisfiedLinkError -java/lang/UnsupportedOperationException -java/lang/VirtualMachineError -java/lang/Void -java/lang/annotation/Annotation -java/lang/invoke/CallSite -java/lang/invoke/ConstantCallSite -java/lang/invoke/DirectMethodHandle -java/lang/invoke/Invokers -java/lang/invoke/LambdaForm -java/lang/invoke/LambdaForm$NamedFunction -java/lang/invoke/MemberName -java/lang/invoke/MemberName$Factory -java/lang/invoke/MethodHandle -java/lang/invoke/MethodHandleImpl -java/lang/invoke/MethodHandleNatives -java/lang/invoke/MethodHandleStatics -java/lang/invoke/MethodHandleStatics$1 -java/lang/invoke/MethodType -java/lang/invoke/MethodType$ConcurrentWeakInternSet -java/lang/invoke/MethodType$ConcurrentWeakInternSet$WeakEntry -java/lang/invoke/MethodTypeForm -java/lang/invoke/MutableCallSite -java/lang/invoke/VolatileCallSite -java/lang/ref/FinalReference -java/lang/ref/Finalizer -java/lang/ref/Finalizer$FinalizerThread -java/lang/ref/PhantomReference -java/lang/ref/Reference -java/lang/ref/Reference$Lock -java/lang/ref/Reference$ReferenceHandler -java/lang/ref/ReferenceQueue -java/lang/ref/ReferenceQueue$Lock -java/lang/ref/ReferenceQueue$Null -java/lang/ref/SoftReference -java/lang/ref/WeakReference -java/lang/reflect/AccessibleObject -java/lang/reflect/AnnotatedElement -java/lang/reflect/Array -java/lang/reflect/Constructor -java/lang/reflect/Executable -java/lang/reflect/Field -java/lang/reflect/GenericDeclaration -java/lang/reflect/InvocationHandler -java/lang/reflect/InvocationTargetException -java/lang/reflect/Member -java/lang/reflect/Method -java/lang/reflect/Modifier -java/lang/reflect/Parameter -java/lang/reflect/Proxy -java/lang/reflect/Proxy$KeyFactory -java/lang/reflect/Proxy$ProxyClassFactory -java/lang/reflect/ReflectAccess -java/lang/reflect/ReflectPermission -java/lang/reflect/Type -java/lang/reflect/WeakCache -java/math/BigInteger -java/math/BigInteger$UnsafeHolder -java/math/MutableBigInteger -java/math/RoundingMode -java/math/SignedMutableBigInteger -java/net/AbstractPlainDatagramSocketImpl -java/net/AbstractPlainDatagramSocketImpl$1 -java/net/AbstractPlainSocketImpl -java/net/AbstractPlainSocketImpl$1 -java/net/Authenticator -java/net/BindException -java/net/ConnectException -java/net/DatagramPacket -java/net/DatagramPacket$1 -java/net/DatagramSocket -java/net/DatagramSocket$1 -java/net/DatagramSocketImpl -java/net/DefaultDatagramSocketImplFactory$1 -java/net/DefaultInterface -java/net/DualStackPlainDatagramSocketImpl -java/net/DualStackPlainSocketImpl -java/net/FileNameMap -java/net/HttpURLConnection -java/net/Inet4Address -java/net/Inet4AddressImpl -java/net/Inet6Address -java/net/Inet6Address$Inet6AddressHolder -java/net/Inet6AddressImpl -java/net/InetAddress -java/net/InetAddress$1 -java/net/InetAddress$2 -java/net/InetAddress$Cache -java/net/InetAddress$Cache$Type -java/net/InetAddress$CacheEntry -java/net/InetAddress$InetAddressHolder -java/net/InetAddressImpl -java/net/InetAddressImplFactory -java/net/InetSocketAddress -java/net/InetSocketAddress$InetSocketAddressHolder -java/net/InterfaceAddress -java/net/JarURLConnection -java/net/MalformedURLException -java/net/MulticastSocket -java/net/NetworkInterface -java/net/NetworkInterface$1 -java/net/NoRouteToHostException -java/net/Parts -java/net/PlainSocketImpl -java/net/PlainSocketImpl$1 -java/net/Proxy -java/net/Proxy$Type -java/net/ProxySelector -java/net/ServerSocket -java/net/Socket -java/net/SocketAddress -java/net/SocketException -java/net/SocketImpl -java/net/SocketImplFactory -java/net/SocketOptions -java/net/SocketTimeoutException -java/net/SocksConsts -java/net/SocksSocketImpl -java/net/SocksSocketImpl$3 -java/net/TwoStacksPlainDatagramSocketImpl -java/net/URI -java/net/URI$Parser -java/net/URL -java/net/URLClassLoader -java/net/URLClassLoader$1 -java/net/URLClassLoader$2 -java/net/URLClassLoader$3 -java/net/URLClassLoader$3$1 -java/net/URLClassLoader$7 -java/net/URLConnection -java/net/URLConnection$1 -java/net/URLStreamHandler -java/net/URLStreamHandlerFactory -java/net/UnknownHostException -java/nio/Bits -java/nio/Bits$1 -java/nio/Buffer -java/nio/ByteBuffer -java/nio/ByteBufferAsCharBufferB -java/nio/ByteBufferAsIntBufferB -java/nio/ByteBufferAsShortBufferB -java/nio/ByteOrder -java/nio/CharBuffer -java/nio/DirectByteBuffer -java/nio/DirectByteBuffer$Deallocator -java/nio/DirectLongBufferU -java/nio/HeapByteBuffer -java/nio/HeapCharBuffer -java/nio/IntBuffer -java/nio/LongBuffer -java/nio/MappedByteBuffer -java/nio/ShortBuffer -java/nio/channels/ByteChannel -java/nio/channels/Channel -java/nio/channels/FileChannel -java/nio/channels/GatheringByteChannel -java/nio/channels/InterruptibleChannel -java/nio/channels/NetworkChannel -java/nio/channels/ReadableByteChannel -java/nio/channels/ScatteringByteChannel -java/nio/channels/SeekableByteChannel -java/nio/channels/SelectableChannel -java/nio/channels/SocketChannel -java/nio/channels/WritableByteChannel -java/nio/channels/spi/AbstractInterruptibleChannel -java/nio/channels/spi/AbstractInterruptibleChannel$1 -java/nio/channels/spi/AbstractSelectableChannel -java/nio/charset/Charset -java/nio/charset/CharsetDecoder -java/nio/charset/CharsetEncoder -java/nio/charset/CoderResult -java/nio/charset/CoderResult$1 -java/nio/charset/CoderResult$2 -java/nio/charset/CoderResult$Cache -java/nio/charset/CodingErrorAction -java/nio/charset/StandardCharsets -java/nio/charset/spi/CharsetProvider -java/nio/file/Path -java/nio/file/Watchable -java/nio/file/attribute/FileAttribute -java/security/AccessControlContext -java/security/AccessController -java/security/AlgorithmParameters -java/security/AlgorithmParametersSpi -java/security/AllPermission -java/security/AllPermissionCollection -java/security/BasicPermission -java/security/BasicPermissionCollection -java/security/CodeSigner -java/security/CodeSource -java/security/GeneralSecurityException -java/security/Guard -java/security/InvalidKeyException -java/security/Key -java/security/KeyException -java/security/MessageDigest -java/security/MessageDigest$Delegate -java/security/MessageDigestSpi -java/security/NoSuchAlgorithmException -java/security/Permission -java/security/PermissionCollection -java/security/Permissions -java/security/Principal -java/security/PrivateKey -java/security/PrivilegedAction -java/security/PrivilegedActionException -java/security/PrivilegedExceptionAction -java/security/ProtectionDomain -java/security/ProtectionDomain$1 -java/security/ProtectionDomain$3 -java/security/ProtectionDomain$Key -java/security/Provider -java/security/Provider$EngineDescription -java/security/Provider$Service -java/security/Provider$ServiceKey -java/security/Provider$UString -java/security/PublicKey -java/security/SecureClassLoader -java/security/Security -java/security/Security$1 -java/security/Signature -java/security/Signature$Delegate -java/security/SignatureException -java/security/SignatureSpi -java/security/UnresolvedPermission -java/security/cert/Certificate -java/security/interfaces/DSAKey -java/security/interfaces/DSAParams -java/security/interfaces/DSAPrivateKey -java/security/interfaces/DSAPublicKey -java/security/spec/AlgorithmParameterSpec -java/security/spec/DSAParameterSpec -java/text/AttributedCharacterIterator$Attribute -java/text/CharacterIterator -java/text/Collator -java/text/DateFormat -java/text/DateFormat$Field -java/text/DateFormatSymbols -java/text/DecimalFormat -java/text/DecimalFormatSymbols -java/text/DigitList -java/text/DontCareFieldPosition -java/text/DontCareFieldPosition$1 -java/text/EntryPair -java/text/FieldPosition -java/text/Format -java/text/Format$Field -java/text/Format$FieldDelegate -java/text/MergeCollation -java/text/MessageFormat -java/text/MessageFormat$Field -java/text/NumberFormat -java/text/NumberFormat$Field -java/text/ParseException -java/text/PatternEntry -java/text/PatternEntry$Parser -java/text/RBCollationTables -java/text/RBCollationTables$BuildAPI -java/text/RuleBasedCollator -java/text/SimpleDateFormat -java/text/spi/BreakIteratorProvider -java/text/spi/CollatorProvider -java/text/spi/DateFormatProvider -java/text/spi/DateFormatSymbolsProvider -java/text/spi/DecimalFormatSymbolsProvider -java/text/spi/NumberFormatProvider -java/util/AbstractCollection -java/util/AbstractList -java/util/AbstractList$Itr -java/util/AbstractList$ListItr -java/util/AbstractMap -java/util/AbstractQueue -java/util/AbstractSequentialList -java/util/AbstractSet -java/util/ArrayDeque -java/util/ArrayList -java/util/ArrayList$Itr -java/util/ArrayList$ListItr -java/util/ArrayList$SubList -java/util/ArrayList$SubList$1 -java/util/Arrays -java/util/Arrays$ArrayList -java/util/Arrays$LegacyMergeSort -java/util/BitSet -java/util/Calendar -java/util/Calendar$Builder -java/util/Collection -java/util/Collections -java/util/Collections$3 -java/util/Collections$EmptyEnumeration -java/util/Collections$EmptyIterator -java/util/Collections$EmptyList -java/util/Collections$EmptyMap -java/util/Collections$EmptySet -java/util/Collections$SetFromMap -java/util/Collections$SynchronizedCollection -java/util/Collections$SynchronizedMap -java/util/Collections$SynchronizedSet -java/util/Collections$UnmodifiableCollection -java/util/Collections$UnmodifiableCollection$1 -java/util/Collections$UnmodifiableList -java/util/Collections$UnmodifiableList$1 -java/util/Collections$UnmodifiableMap -java/util/Collections$UnmodifiableRandomAccessList -java/util/Collections$UnmodifiableSet -java/util/ComparableTimSort -java/util/Comparator -java/util/Currency -java/util/Currency$1 -java/util/Currency$CurrencyNameGetter -java/util/Date -java/util/Deque -java/util/Dictionary -java/util/Enumeration -java/util/EventListener -java/util/EventListenerProxy -java/util/EventObject -java/util/GregorianCalendar -java/util/HashMap -java/util/HashMap$EntryIterator -java/util/HashMap$EntrySet -java/util/HashMap$HashIterator -java/util/HashMap$KeyIterator -java/util/HashMap$KeySet -java/util/HashMap$Node -java/util/HashMap$TreeNode -java/util/HashMap$ValueIterator -java/util/HashMap$Values -java/util/HashSet -java/util/Hashtable -java/util/Hashtable$Entry -java/util/Hashtable$EntrySet -java/util/Hashtable$Enumerator -java/util/Hashtable$ValueCollection -java/util/IdentityHashMap -java/util/IdentityHashMap$IdentityHashMapIterator -java/util/IdentityHashMap$KeyIterator -java/util/IdentityHashMap$KeySet -java/util/IdentityHashMap$ValueIterator -java/util/IdentityHashMap$Values -java/util/Iterator -java/util/LinkedHashMap -java/util/LinkedHashMap$Entry -java/util/LinkedHashMap$LinkedEntryIterator -java/util/LinkedHashMap$LinkedEntrySet -java/util/LinkedHashMap$LinkedHashIterator -java/util/LinkedHashMap$LinkedKeyIterator -java/util/LinkedHashMap$LinkedKeySet -java/util/LinkedList -java/util/LinkedList$ListItr -java/util/LinkedList$Node -java/util/List -java/util/ListIterator -java/util/ListResourceBundle -java/util/Locale -java/util/Locale$1 -java/util/Locale$Cache -java/util/Locale$Category -java/util/Locale$LocaleKey -java/util/Map -java/util/Map$Entry -java/util/MissingResourceException -java/util/NavigableMap -java/util/Objects -java/util/PriorityQueue -java/util/Properties -java/util/Properties$LineReader -java/util/PropertyResourceBundle -java/util/Queue -java/util/Random -java/util/RandomAccess -java/util/ResourceBundle -java/util/ResourceBundle$1 -java/util/ResourceBundle$BundleReference -java/util/ResourceBundle$CacheKey -java/util/ResourceBundle$CacheKeyReference -java/util/ResourceBundle$Control -java/util/ResourceBundle$Control$1 -java/util/ResourceBundle$Control$CandidateListCache -java/util/ResourceBundle$LoaderReference -java/util/ResourceBundle$RBClassLoader -java/util/ResourceBundle$RBClassLoader$1 -java/util/ResourceBundle$SingleFormatControl -java/util/ServiceLoader -java/util/ServiceLoader$1 -java/util/ServiceLoader$LazyIterator -java/util/Set -java/util/SortedMap -java/util/Stack -java/util/StringTokenizer -java/util/TimSort -java/util/TimeZone -java/util/TimeZone$1 -java/util/TreeMap -java/util/TreeMap$Entry -java/util/Vector -java/util/Vector$1 -java/util/Vector$Itr -java/util/Vector$ListItr -java/util/WeakHashMap -java/util/WeakHashMap$Entry -java/util/WeakHashMap$KeySet -java/util/concurrent/BlockingQueue -java/util/concurrent/ConcurrentHashMap -java/util/concurrent/ConcurrentHashMap$BaseIterator -java/util/concurrent/ConcurrentHashMap$CollectionView -java/util/concurrent/ConcurrentHashMap$CounterCell -java/util/concurrent/ConcurrentHashMap$EntrySetView -java/util/concurrent/ConcurrentHashMap$ForwardingNode -java/util/concurrent/ConcurrentHashMap$KeyIterator -java/util/concurrent/ConcurrentHashMap$KeySetView -java/util/concurrent/ConcurrentHashMap$Node -java/util/concurrent/ConcurrentHashMap$Segment -java/util/concurrent/ConcurrentHashMap$Traverser -java/util/concurrent/ConcurrentHashMap$ValueIterator -java/util/concurrent/ConcurrentHashMap$ValuesView -java/util/concurrent/ConcurrentMap -java/util/concurrent/CopyOnWriteArrayList -java/util/concurrent/DelayQueue -java/util/concurrent/Delayed -java/util/concurrent/TimeUnit -java/util/concurrent/TimeUnit$1 -java/util/concurrent/TimeUnit$2 -java/util/concurrent/TimeUnit$3 -java/util/concurrent/TimeUnit$4 -java/util/concurrent/TimeUnit$5 -java/util/concurrent/TimeUnit$6 -java/util/concurrent/TimeUnit$7 -java/util/concurrent/atomic/AtomicBoolean -java/util/concurrent/atomic/AtomicInteger -java/util/concurrent/atomic/AtomicLong -java/util/concurrent/atomic/AtomicMarkableReference -java/util/concurrent/atomic/AtomicMarkableReference$Pair -java/util/concurrent/atomic/AtomicReferenceFieldUpdater -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl -java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 -java/util/concurrent/locks/AbstractOwnableSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer -java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject -java/util/concurrent/locks/AbstractQueuedSynchronizer$Node -java/util/concurrent/locks/Condition -java/util/concurrent/locks/Lock -java/util/concurrent/locks/LockSupport -java/util/concurrent/locks/ReadWriteLock -java/util/concurrent/locks/ReentrantLock -java/util/concurrent/locks/ReentrantLock$NonfairSync -java/util/concurrent/locks/ReentrantLock$Sync -java/util/concurrent/locks/ReentrantReadWriteLock -java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync -java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock -java/util/concurrent/locks/ReentrantReadWriteLock$Sync -java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter -java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock -java/util/function/BiFunction -java/util/jar/Attributes -java/util/jar/Attributes$Name -java/util/jar/JarEntry -java/util/jar/JarFile -java/util/jar/JarFile$JarEntryIterator -java/util/jar/JarFile$JarFileEntry -java/util/jar/JarVerifier -java/util/jar/JarVerifier$3 -java/util/jar/JavaUtilJarAccessImpl -java/util/jar/Manifest -java/util/jar/Manifest$FastInputStream -java/util/logging/Handler -java/util/logging/Level -java/util/logging/Level$KnownLevel -java/util/logging/LogManager -java/util/logging/LogManager$1 -java/util/logging/LogManager$2 -java/util/logging/LogManager$3 -java/util/logging/LogManager$5 -java/util/logging/LogManager$Cleaner -java/util/logging/LogManager$LogNode -java/util/logging/LogManager$LoggerContext -java/util/logging/LogManager$LoggerContext$1 -java/util/logging/LogManager$LoggerWeakRef -java/util/logging/LogManager$RootLogger -java/util/logging/LogManager$SystemLoggerContext -java/util/logging/Logger -java/util/logging/Logger$1 -java/util/logging/LoggingPermission -java/util/logging/LoggingProxyImpl -java/util/spi/CalendarDataProvider -java/util/spi/CurrencyNameProvider -java/util/spi/LocaleNameProvider -java/util/spi/LocaleServiceProvider -java/util/spi/ResourceBundleControlProvider -java/util/spi/TimeZoneNameProvider -java/util/zip/CRC32 -java/util/zip/Checksum -java/util/zip/DeflaterOutputStream -java/util/zip/GZIPInputStream -java/util/zip/Inflater -java/util/zip/InflaterInputStream -java/util/zip/ZStreamRef -java/util/zip/ZipCoder -java/util/zip/ZipConstants -java/util/zip/ZipEntry -java/util/zip/ZipFile -java/util/zip/ZipFile$1 -java/util/zip/ZipFile$ZipEntryIterator -java/util/zip/ZipFile$ZipFileInflaterInputStream -java/util/zip/ZipFile$ZipFileInputStream -java/util/zip/ZipInputStream -java/util/zip/ZipUtils -javax/accessibility/Accessible -javax/accessibility/AccessibleAction -javax/accessibility/AccessibleBundle -javax/accessibility/AccessibleComponent -javax/accessibility/AccessibleContext -javax/accessibility/AccessibleExtendedComponent -javax/accessibility/AccessibleRelationSet -javax/accessibility/AccessibleState -javax/accessibility/AccessibleText -javax/accessibility/AccessibleValue -javax/security/auth/Destroyable -javax/sound/sampled/Control$Type -javax/sound/sampled/DataLine -javax/sound/sampled/DataLine$Info -javax/sound/sampled/FloatControl$Type -javax/sound/sampled/Line -javax/sound/sampled/Line$Info -javax/sound/sampled/LineUnavailableException -javax/sound/sampled/UnsupportedAudioFileException -javax/swing/AbstractAction -javax/swing/AbstractButton -javax/swing/AbstractButton$AccessibleAbstractButton -javax/swing/AbstractButton$Handler -javax/swing/AbstractCellEditor -javax/swing/AbstractListModel -javax/swing/Action -javax/swing/ActionMap -javax/swing/AncestorNotifier -javax/swing/ArrayTable -javax/swing/BorderFactory -javax/swing/BoundedRangeModel -javax/swing/Box -javax/swing/Box$Filler -javax/swing/BoxLayout -javax/swing/BufferStrategyPaintManager -javax/swing/BufferStrategyPaintManager$BufferInfo -javax/swing/ButtonGroup -javax/swing/ButtonModel -javax/swing/CellEditor -javax/swing/CellRendererPane -javax/swing/ClientPropertyKey -javax/swing/ClientPropertyKey$1 -javax/swing/ComboBoxEditor -javax/swing/ComboBoxModel -javax/swing/ComponentInputMap -javax/swing/DefaultBoundedRangeModel -javax/swing/DefaultButtonModel -javax/swing/DefaultCellEditor -javax/swing/DefaultCellEditor$1 -javax/swing/DefaultCellEditor$EditorDelegate -javax/swing/DefaultComboBoxModel -javax/swing/DefaultListCellRenderer -javax/swing/DefaultListCellRenderer$UIResource -javax/swing/DefaultListModel -javax/swing/DefaultListSelectionModel -javax/swing/DefaultSingleSelectionModel -javax/swing/DropMode -javax/swing/FocusManager -javax/swing/GrayFilter -javax/swing/Icon -javax/swing/ImageIcon -javax/swing/ImageIcon$1 -javax/swing/ImageIcon$2 -javax/swing/ImageIcon$2$1 -javax/swing/ImageIcon$3 -javax/swing/InputMap -javax/swing/InternalFrameFocusTraversalPolicy -javax/swing/JButton -javax/swing/JCheckBox -javax/swing/JCheckBoxMenuItem -javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem -javax/swing/JComboBox -javax/swing/JComboBox$1 -javax/swing/JComboBox$KeySelectionManager -javax/swing/JComponent -javax/swing/JComponent$1 -javax/swing/JComponent$2 -javax/swing/JComponent$AccessibleJComponent -javax/swing/JDialog -javax/swing/JEditorPane -javax/swing/JFrame -javax/swing/JInternalFrame -javax/swing/JLabel -javax/swing/JLayer -javax/swing/JLayeredPane -javax/swing/JList -javax/swing/JList$3 -javax/swing/JList$ListSelectionHandler -javax/swing/JMenu -javax/swing/JMenu$MenuChangeListener -javax/swing/JMenu$WinListener -javax/swing/JMenuBar -javax/swing/JMenuItem -javax/swing/JMenuItem$AccessibleJMenuItem -javax/swing/JMenuItem$MenuItemFocusListener -javax/swing/JPanel -javax/swing/JPopupMenu -javax/swing/JPopupMenu$Separator -javax/swing/JProgressBar -javax/swing/JProgressBar$ModelListener -javax/swing/JRadioButton -javax/swing/JRadioButtonMenuItem -javax/swing/JRootPane -javax/swing/JRootPane$1 -javax/swing/JRootPane$RootLayout -javax/swing/JScrollBar -javax/swing/JScrollBar$ModelListener -javax/swing/JScrollPane -javax/swing/JScrollPane$ScrollBar -javax/swing/JSeparator -javax/swing/JSlider -javax/swing/JSlider$ModelListener -javax/swing/JSplitPane -javax/swing/JTabbedPane -javax/swing/JTabbedPane$ModelListener -javax/swing/JTabbedPane$Page -javax/swing/JTable -javax/swing/JTable$2 -javax/swing/JTable$5 -javax/swing/JTable$Resizable2 -javax/swing/JTable$Resizable3 -javax/swing/JTextArea -javax/swing/JTextField -javax/swing/JTextField$NotifyAction -javax/swing/JTextField$ScrollRepainter -javax/swing/JToggleButton -javax/swing/JToggleButton$ToggleButtonModel -javax/swing/JToolBar -javax/swing/JToolBar$DefaultToolBarLayout -javax/swing/JToolBar$Separator -javax/swing/JToolTip -javax/swing/JTree -javax/swing/JTree$TreeModelHandler -javax/swing/JTree$TreeSelectionRedirector -javax/swing/JViewport -javax/swing/JViewport$ViewListener -javax/swing/JWindow -javax/swing/KeyStroke -javax/swing/KeyboardManager -javax/swing/KeyboardManager$ComponentKeyStrokePair -javax/swing/LayoutComparator -javax/swing/LayoutFocusTraversalPolicy -javax/swing/ListCellRenderer -javax/swing/ListModel -javax/swing/ListSelectionModel -javax/swing/LookAndFeel -javax/swing/MenuElement -javax/swing/MenuSelectionManager -javax/swing/MultiUIDefaults -javax/swing/MutableComboBoxModel -javax/swing/Popup$HeavyWeightWindow -javax/swing/RepaintManager -javax/swing/RepaintManager$1 -javax/swing/RepaintManager$1$1 -javax/swing/RepaintManager$2 -javax/swing/RepaintManager$3 -javax/swing/RepaintManager$DisplayChangedHandler -javax/swing/RepaintManager$PaintManager -javax/swing/RepaintManager$ProcessingRunnable -javax/swing/RootPaneContainer -javax/swing/ScrollPaneConstants -javax/swing/ScrollPaneLayout -javax/swing/ScrollPaneLayout$UIResource -javax/swing/Scrollable -javax/swing/SingleSelectionModel -javax/swing/SizeRequirements -javax/swing/SortingFocusTraversalPolicy -javax/swing/SwingConstants -javax/swing/SwingContainerOrderFocusTraversalPolicy -javax/swing/SwingDefaultFocusTraversalPolicy -javax/swing/SwingPaintEventDispatcher -javax/swing/SwingUtilities -javax/swing/SwingUtilities$SharedOwnerFrame -javax/swing/Timer -javax/swing/Timer$DoPostEvent -javax/swing/TimerQueue -javax/swing/TimerQueue$1 -javax/swing/TimerQueue$DelayedTimer -javax/swing/ToolTipManager -javax/swing/ToolTipManager$AccessibilityKeyListener -javax/swing/ToolTipManager$MoveBeforeEnterListener -javax/swing/ToolTipManager$insideTimerAction -javax/swing/ToolTipManager$outsideTimerAction -javax/swing/ToolTipManager$stillInsideTimerAction -javax/swing/TransferHandler -javax/swing/TransferHandler$DropHandler -javax/swing/TransferHandler$HasGetTransferHandler -javax/swing/TransferHandler$SwingDropTarget -javax/swing/TransferHandler$TransferAction -javax/swing/TransferHandler$TransferSupport -javax/swing/UIDefaults -javax/swing/UIDefaults$ActiveValue -javax/swing/UIDefaults$LazyInputMap -javax/swing/UIDefaults$LazyValue -javax/swing/UIDefaults$TextAndMnemonicHashMap -javax/swing/UIManager -javax/swing/UIManager$1 -javax/swing/UIManager$2 -javax/swing/UIManager$LAFState -javax/swing/UIManager$LookAndFeelInfo -javax/swing/UnsupportedLookAndFeelException -javax/swing/ViewportLayout -javax/swing/WindowConstants -javax/swing/border/AbstractBorder -javax/swing/border/BevelBorder -javax/swing/border/Border -javax/swing/border/CompoundBorder -javax/swing/border/EmptyBorder -javax/swing/border/EtchedBorder -javax/swing/border/LineBorder -javax/swing/border/MatteBorder -javax/swing/border/TitledBorder -javax/swing/event/AncestorListener -javax/swing/event/CaretEvent -javax/swing/event/CaretListener -javax/swing/event/CellEditorListener -javax/swing/event/ChangeEvent -javax/swing/event/ChangeListener -javax/swing/event/DocumentEvent -javax/swing/event/DocumentEvent$ElementChange -javax/swing/event/DocumentEvent$EventType -javax/swing/event/DocumentListener -javax/swing/event/EventListenerList -javax/swing/event/ListDataEvent -javax/swing/event/ListDataListener -javax/swing/event/ListSelectionEvent -javax/swing/event/ListSelectionListener -javax/swing/event/MenuDragMouseListener -javax/swing/event/MenuEvent -javax/swing/event/MenuKeyListener -javax/swing/event/MenuListener -javax/swing/event/MouseInputAdapter -javax/swing/event/MouseInputListener -javax/swing/event/PopupMenuListener -javax/swing/event/RowSorterListener -javax/swing/event/SwingPropertyChangeSupport -javax/swing/event/TableColumnModelEvent -javax/swing/event/TableColumnModelListener -javax/swing/event/TableModelEvent -javax/swing/event/TableModelListener -javax/swing/event/TreeExpansionListener -javax/swing/event/TreeModelEvent -javax/swing/event/TreeModelListener -javax/swing/event/TreeSelectionEvent -javax/swing/event/TreeSelectionListener -javax/swing/event/UndoableEditEvent -javax/swing/event/UndoableEditListener -javax/swing/filechooser/FileFilter -javax/swing/filechooser/FileSystemView -javax/swing/filechooser/FileSystemView$1 -javax/swing/filechooser/WindowsFileSystemView -javax/swing/plaf/ActionMapUIResource -javax/swing/plaf/BorderUIResource -javax/swing/plaf/BorderUIResource$CompoundBorderUIResource -javax/swing/plaf/BorderUIResource$EmptyBorderUIResource -javax/swing/plaf/BorderUIResource$LineBorderUIResource -javax/swing/plaf/ButtonUI -javax/swing/plaf/ColorUIResource -javax/swing/plaf/ComboBoxUI -javax/swing/plaf/ComponentInputMapUIResource -javax/swing/plaf/ComponentUI -javax/swing/plaf/DimensionUIResource -javax/swing/plaf/FontUIResource -javax/swing/plaf/InputMapUIResource -javax/swing/plaf/InsetsUIResource -javax/swing/plaf/LabelUI -javax/swing/plaf/ListUI -javax/swing/plaf/MenuBarUI -javax/swing/plaf/MenuItemUI -javax/swing/plaf/PanelUI -javax/swing/plaf/PopupMenuUI -javax/swing/plaf/ProgressBarUI -javax/swing/plaf/RootPaneUI -javax/swing/plaf/ScrollBarUI -javax/swing/plaf/ScrollPaneUI -javax/swing/plaf/SeparatorUI -javax/swing/plaf/SliderUI -javax/swing/plaf/SplitPaneUI -javax/swing/plaf/TabbedPaneUI -javax/swing/plaf/TableHeaderUI -javax/swing/plaf/TableUI -javax/swing/plaf/TextUI -javax/swing/plaf/ToolBarUI -javax/swing/plaf/TreeUI -javax/swing/plaf/UIResource -javax/swing/plaf/ViewportUI -javax/swing/plaf/basic/BasicArrowButton -javax/swing/plaf/basic/BasicBorders -javax/swing/plaf/basic/BasicBorders$ButtonBorder -javax/swing/plaf/basic/BasicBorders$MarginBorder -javax/swing/plaf/basic/BasicBorders$RadioButtonBorder -javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder -javax/swing/plaf/basic/BasicBorders$SplitPaneBorder -javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder -javax/swing/plaf/basic/BasicButtonListener -javax/swing/plaf/basic/BasicButtonUI -javax/swing/plaf/basic/BasicCheckBoxMenuItemUI -javax/swing/plaf/basic/BasicComboBoxEditor -javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField -javax/swing/plaf/basic/BasicComboBoxEditor$UIResource -javax/swing/plaf/basic/BasicComboBoxRenderer -javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource -javax/swing/plaf/basic/BasicComboBoxUI -javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager -javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager -javax/swing/plaf/basic/BasicComboBoxUI$Handler -javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicComboPopup -javax/swing/plaf/basic/BasicComboPopup$1 -javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass -javax/swing/plaf/basic/BasicComboPopup$Handler -javax/swing/plaf/basic/BasicGraphicsUtils -javax/swing/plaf/basic/BasicHTML -javax/swing/plaf/basic/BasicLabelUI -javax/swing/plaf/basic/BasicListUI -javax/swing/plaf/basic/BasicListUI$Handler -javax/swing/plaf/basic/BasicListUI$ListTransferHandler -javax/swing/plaf/basic/BasicLookAndFeel -javax/swing/plaf/basic/BasicLookAndFeel$1 -javax/swing/plaf/basic/BasicLookAndFeel$2 -javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper -javax/swing/plaf/basic/BasicMenuBarUI -javax/swing/plaf/basic/BasicMenuBarUI$Handler -javax/swing/plaf/basic/BasicMenuItemUI -javax/swing/plaf/basic/BasicMenuItemUI$Handler -javax/swing/plaf/basic/BasicMenuUI -javax/swing/plaf/basic/BasicMenuUI$Handler -javax/swing/plaf/basic/BasicPanelUI -javax/swing/plaf/basic/BasicPopupMenuUI -javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener -javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper -javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 -javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber -javax/swing/plaf/basic/BasicProgressBarUI -javax/swing/plaf/basic/BasicProgressBarUI$Handler -javax/swing/plaf/basic/BasicRadioButtonMenuItemUI -javax/swing/plaf/basic/BasicRadioButtonUI -javax/swing/plaf/basic/BasicRootPaneUI -javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap -javax/swing/plaf/basic/BasicScrollBarUI -javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener -javax/swing/plaf/basic/BasicScrollBarUI$Handler -javax/swing/plaf/basic/BasicScrollBarUI$ModelListener -javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener -javax/swing/plaf/basic/BasicScrollBarUI$TrackListener -javax/swing/plaf/basic/BasicScrollPaneUI -javax/swing/plaf/basic/BasicScrollPaneUI$Handler -javax/swing/plaf/basic/BasicSeparatorUI -javax/swing/plaf/basic/BasicSliderUI -javax/swing/plaf/basic/BasicSliderUI$Actions -javax/swing/plaf/basic/BasicSliderUI$Handler -javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler -javax/swing/plaf/basic/BasicSliderUI$ScrollListener -javax/swing/plaf/basic/BasicSliderUI$TrackListener -javax/swing/plaf/basic/BasicSplitPaneDivider -javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout -javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler -javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler -javax/swing/plaf/basic/BasicSplitPaneUI -javax/swing/plaf/basic/BasicSplitPaneUI$1 -javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager -javax/swing/plaf/basic/BasicSplitPaneUI$Handler -javax/swing/plaf/basic/BasicTabbedPaneUI -javax/swing/plaf/basic/BasicTabbedPaneUI$Handler -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout -javax/swing/plaf/basic/BasicTableHeaderUI -javax/swing/plaf/basic/BasicTableHeaderUI$1 -javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler -javax/swing/plaf/basic/BasicTableUI -javax/swing/plaf/basic/BasicTableUI$Handler -javax/swing/plaf/basic/BasicTableUI$TableTransferHandler -javax/swing/plaf/basic/BasicTextAreaUI -javax/swing/plaf/basic/BasicTextFieldUI -javax/swing/plaf/basic/BasicTextUI -javax/swing/plaf/basic/BasicTextUI$BasicCaret -javax/swing/plaf/basic/BasicTextUI$BasicCursor -javax/swing/plaf/basic/BasicTextUI$BasicHighlighter -javax/swing/plaf/basic/BasicTextUI$DragListener -javax/swing/plaf/basic/BasicTextUI$FocusAction -javax/swing/plaf/basic/BasicTextUI$RootView -javax/swing/plaf/basic/BasicTextUI$TextActionWrapper -javax/swing/plaf/basic/BasicTextUI$TextTransferHandler -javax/swing/plaf/basic/BasicTextUI$UpdateHandler -javax/swing/plaf/basic/BasicToggleButtonUI -javax/swing/plaf/basic/BasicToolBarSeparatorUI -javax/swing/plaf/basic/BasicToolBarUI -javax/swing/plaf/basic/BasicToolBarUI$DockingListener -javax/swing/plaf/basic/BasicToolBarUI$Handler -javax/swing/plaf/basic/BasicTreeUI -javax/swing/plaf/basic/BasicTreeUI$Actions -javax/swing/plaf/basic/BasicTreeUI$Handler -javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler -javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler -javax/swing/plaf/basic/BasicViewportUI -javax/swing/plaf/basic/ComboPopup -javax/swing/plaf/basic/DefaultMenuLayout -javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag -javax/swing/plaf/basic/LazyActionMap -javax/swing/plaf/metal/BumpBuffer -javax/swing/plaf/metal/DefaultMetalTheme -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate -javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 -javax/swing/plaf/metal/MetalBorders -javax/swing/plaf/metal/MetalBorders$ButtonBorder -javax/swing/plaf/metal/MetalBorders$Flush3DBorder -javax/swing/plaf/metal/MetalBorders$MenuBarBorder -javax/swing/plaf/metal/MetalBorders$MenuItemBorder -javax/swing/plaf/metal/MetalBorders$PopupMenuBorder -javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder -javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder -javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder -javax/swing/plaf/metal/MetalBorders$TextFieldBorder -javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder -javax/swing/plaf/metal/MetalBorders$ToolBarBorder -javax/swing/plaf/metal/MetalBumps -javax/swing/plaf/metal/MetalButtonUI -javax/swing/plaf/metal/MetalCheckBoxUI -javax/swing/plaf/metal/MetalComboBoxButton -javax/swing/plaf/metal/MetalComboBoxButton$1 -javax/swing/plaf/metal/MetalComboBoxEditor -javax/swing/plaf/metal/MetalComboBoxEditor$1 -javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder -javax/swing/plaf/metal/MetalComboBoxEditor$UIResource -javax/swing/plaf/metal/MetalComboBoxIcon -javax/swing/plaf/metal/MetalComboBoxUI -javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager -javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener -javax/swing/plaf/metal/MetalIconFactory -javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon -javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon -javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 -javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon -javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon -javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon -javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon -javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon -javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon -javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon -javax/swing/plaf/metal/MetalLabelUI -javax/swing/plaf/metal/MetalLookAndFeel -javax/swing/plaf/metal/MetalLookAndFeel$AATextListener -javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue -javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue$1 -javax/swing/plaf/metal/MetalPopupMenuSeparatorUI -javax/swing/plaf/metal/MetalProgressBarUI -javax/swing/plaf/metal/MetalRadioButtonUI -javax/swing/plaf/metal/MetalRootPaneUI -javax/swing/plaf/metal/MetalScrollBarUI -javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener -javax/swing/plaf/metal/MetalScrollButton -javax/swing/plaf/metal/MetalScrollPaneUI -javax/swing/plaf/metal/MetalScrollPaneUI$1 -javax/swing/plaf/metal/MetalSeparatorUI -javax/swing/plaf/metal/MetalSliderUI -javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener -javax/swing/plaf/metal/MetalSplitPaneDivider -javax/swing/plaf/metal/MetalSplitPaneDivider$1 -javax/swing/plaf/metal/MetalSplitPaneDivider$2 -javax/swing/plaf/metal/MetalSplitPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI -javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout -javax/swing/plaf/metal/MetalTextFieldUI -javax/swing/plaf/metal/MetalTheme -javax/swing/plaf/metal/MetalToggleButtonUI -javax/swing/plaf/metal/MetalToolBarUI -javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener -javax/swing/plaf/metal/MetalTreeUI -javax/swing/plaf/metal/MetalTreeUI$LineListener -javax/swing/plaf/metal/MetalUtils -javax/swing/plaf/metal/OceanTheme -javax/swing/plaf/metal/OceanTheme$1 -javax/swing/plaf/metal/OceanTheme$2 -javax/swing/plaf/metal/OceanTheme$3 -javax/swing/plaf/metal/OceanTheme$4 -javax/swing/plaf/metal/OceanTheme$5 -javax/swing/plaf/metal/OceanTheme$6 -javax/swing/plaf/synth/SynthConstants -javax/swing/plaf/synth/SynthUI -javax/swing/table/AbstractTableModel -javax/swing/table/DefaultTableCellRenderer -javax/swing/table/DefaultTableColumnModel -javax/swing/table/DefaultTableModel -javax/swing/table/JTableHeader -javax/swing/table/TableCellEditor -javax/swing/table/TableCellRenderer -javax/swing/table/TableColumn -javax/swing/table/TableColumnModel -javax/swing/table/TableModel -javax/swing/text/AbstractDocument -javax/swing/text/AbstractDocument$1 -javax/swing/text/AbstractDocument$AbstractElement -javax/swing/text/AbstractDocument$AttributeContext -javax/swing/text/AbstractDocument$BidiElement -javax/swing/text/AbstractDocument$BidiRootElement -javax/swing/text/AbstractDocument$BranchElement -javax/swing/text/AbstractDocument$Content -javax/swing/text/AbstractDocument$DefaultDocumentEvent -javax/swing/text/AbstractDocument$ElementEdit -javax/swing/text/AbstractDocument$InsertStringResult -javax/swing/text/AbstractDocument$LeafElement -javax/swing/text/AttributeSet -javax/swing/text/AttributeSet$CharacterAttribute -javax/swing/text/AttributeSet$ColorAttribute -javax/swing/text/AttributeSet$FontAttribute -javax/swing/text/AttributeSet$ParagraphAttribute -javax/swing/text/Caret -javax/swing/text/DefaultCaret -javax/swing/text/DefaultCaret$Handler -javax/swing/text/DefaultEditorKit -javax/swing/text/DefaultEditorKit$BeepAction -javax/swing/text/DefaultEditorKit$BeginAction -javax/swing/text/DefaultEditorKit$BeginLineAction -javax/swing/text/DefaultEditorKit$BeginParagraphAction -javax/swing/text/DefaultEditorKit$BeginWordAction -javax/swing/text/DefaultEditorKit$CopyAction -javax/swing/text/DefaultEditorKit$CutAction -javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction -javax/swing/text/DefaultEditorKit$DeleteNextCharAction -javax/swing/text/DefaultEditorKit$DeletePrevCharAction -javax/swing/text/DefaultEditorKit$DeleteWordAction -javax/swing/text/DefaultEditorKit$DumpModelAction -javax/swing/text/DefaultEditorKit$EndAction -javax/swing/text/DefaultEditorKit$EndLineAction -javax/swing/text/DefaultEditorKit$EndParagraphAction -javax/swing/text/DefaultEditorKit$EndWordAction -javax/swing/text/DefaultEditorKit$InsertBreakAction -javax/swing/text/DefaultEditorKit$InsertContentAction -javax/swing/text/DefaultEditorKit$InsertTabAction -javax/swing/text/DefaultEditorKit$NextVisualPositionAction -javax/swing/text/DefaultEditorKit$NextWordAction -javax/swing/text/DefaultEditorKit$PageAction -javax/swing/text/DefaultEditorKit$PasteAction -javax/swing/text/DefaultEditorKit$PreviousWordAction -javax/swing/text/DefaultEditorKit$ReadOnlyAction -javax/swing/text/DefaultEditorKit$SelectAllAction -javax/swing/text/DefaultEditorKit$SelectLineAction -javax/swing/text/DefaultEditorKit$SelectParagraphAction -javax/swing/text/DefaultEditorKit$SelectWordAction -javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction -javax/swing/text/DefaultEditorKit$UnselectAction -javax/swing/text/DefaultEditorKit$VerticalPageAction -javax/swing/text/DefaultEditorKit$WritableAction -javax/swing/text/DefaultHighlighter -javax/swing/text/DefaultHighlighter$DefaultHighlightPainter -javax/swing/text/DefaultHighlighter$SafeDamager -javax/swing/text/Document -javax/swing/text/EditorKit -javax/swing/text/Element -javax/swing/text/FieldView -javax/swing/text/GapContent -javax/swing/text/GapContent$InsertUndo -javax/swing/text/GapContent$MarkData -javax/swing/text/GapContent$MarkVector -javax/swing/text/GapContent$StickyPosition -javax/swing/text/GapVector -javax/swing/text/Highlighter -javax/swing/text/Highlighter$Highlight -javax/swing/text/Highlighter$HighlightPainter -javax/swing/text/JTextComponent -javax/swing/text/JTextComponent$1 -javax/swing/text/JTextComponent$DefaultKeymap -javax/swing/text/JTextComponent$KeymapActionMap -javax/swing/text/JTextComponent$KeymapWrapper -javax/swing/text/JTextComponent$MutableCaretEvent -javax/swing/text/Keymap -javax/swing/text/LayeredHighlighter -javax/swing/text/LayeredHighlighter$LayerPainter -javax/swing/text/MutableAttributeSet -javax/swing/text/PlainDocument -javax/swing/text/PlainView -javax/swing/text/Position -javax/swing/text/Position$Bias -javax/swing/text/Segment -javax/swing/text/SegmentCache -javax/swing/text/SegmentCache$CachedSegment -javax/swing/text/SimpleAttributeSet -javax/swing/text/SimpleAttributeSet$EmptyAttributeSet -javax/swing/text/Style -javax/swing/text/StyleConstants -javax/swing/text/StyleConstants$CharacterConstants -javax/swing/text/StyleConstants$ColorConstants -javax/swing/text/StyleConstants$FontConstants -javax/swing/text/StyleConstants$ParagraphConstants -javax/swing/text/StyleContext -javax/swing/text/StyleContext$FontKey -javax/swing/text/StyleContext$KeyEnumeration -javax/swing/text/StyleContext$NamedStyle -javax/swing/text/StyleContext$SmallAttributeSet -javax/swing/text/TabExpander -javax/swing/text/TextAction -javax/swing/text/Utilities -javax/swing/text/View -javax/swing/text/ViewFactory -javax/swing/tree/AbstractLayoutCache -javax/swing/tree/AbstractLayoutCache$NodeDimensions -javax/swing/tree/DefaultMutableTreeNode -javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration -javax/swing/tree/DefaultTreeCellEditor -javax/swing/tree/DefaultTreeCellEditor$1 -javax/swing/tree/DefaultTreeCellEditor$DefaultTextField -javax/swing/tree/DefaultTreeCellEditor$EditorContainer -javax/swing/tree/DefaultTreeCellRenderer -javax/swing/tree/DefaultTreeModel -javax/swing/tree/DefaultTreeSelectionModel -javax/swing/tree/MutableTreeNode -javax/swing/tree/PathPlaceHolder -javax/swing/tree/RowMapper -javax/swing/tree/TreeCellEditor -javax/swing/tree/TreeCellRenderer -javax/swing/tree/TreeModel -javax/swing/tree/TreeNode -javax/swing/tree/TreePath -javax/swing/tree/TreeSelectionModel -javax/swing/tree/VariableHeightLayoutCache -javax/swing/tree/VariableHeightLayoutCache$TreeStateNode -javax/swing/undo/AbstractUndoableEdit -javax/swing/undo/CompoundEdit -javax/swing/undo/UndoableEdit -javax/xml/parsers/DocumentBuilder -javax/xml/parsers/DocumentBuilderFactory -javax/xml/parsers/FactoryFinder -javax/xml/parsers/FactoryFinder$1 -javax/xml/parsers/ParserConfigurationException -javax/xml/parsers/SecuritySupport -javax/xml/parsers/SecuritySupport$2 -javax/xml/parsers/SecuritySupport$5 -org/w3c/dom/Attr -org/w3c/dom/CDATASection -org/w3c/dom/CharacterData -org/w3c/dom/Comment -org/w3c/dom/DOMException -org/w3c/dom/Document -org/w3c/dom/DocumentFragment -org/w3c/dom/DocumentType -org/w3c/dom/Element -org/w3c/dom/Entity -org/w3c/dom/EntityReference -org/w3c/dom/NamedNodeMap -org/w3c/dom/Node -org/w3c/dom/NodeList -org/w3c/dom/Notation -org/w3c/dom/ProcessingInstruction -org/w3c/dom/Text -org/w3c/dom/events/DocumentEvent -org/w3c/dom/events/Event -org/w3c/dom/events/EventException -org/w3c/dom/events/EventTarget -org/w3c/dom/events/MutationEvent -org/w3c/dom/ranges/DocumentRange -org/w3c/dom/ranges/Range -org/w3c/dom/traversal/DocumentTraversal -org/w3c/dom/traversal/NodeIterator -org/w3c/dom/traversal/TreeWalker -org/xml/sax/AttributeList -org/xml/sax/ContentHandler -org/xml/sax/DTDHandler -org/xml/sax/EntityResolver -org/xml/sax/ErrorHandler -org/xml/sax/InputSource -org/xml/sax/Locator -org/xml/sax/SAXException -org/xml/sax/SAXNotRecognizedException -org/xml/sax/SAXNotSupportedException -org/xml/sax/SAXParseException -org/xml/sax/helpers/DefaultHandler -sun/awt/AWTAccessor -sun/awt/AWTAccessor$AWTEventAccessor -sun/awt/AWTAccessor$ClientPropertyKeyAccessor -sun/awt/AWTAccessor$ComponentAccessor -sun/awt/AWTAccessor$ContainerAccessor -sun/awt/AWTAccessor$CursorAccessor -sun/awt/AWTAccessor$DefaultKeyboardFocusManagerAccessor -sun/awt/AWTAccessor$EventQueueAccessor -sun/awt/AWTAccessor$FrameAccessor -sun/awt/AWTAccessor$InputEventAccessor -sun/awt/AWTAccessor$InvocationEventAccessor -sun/awt/AWTAccessor$KeyEventAccessor -sun/awt/AWTAccessor$KeyboardFocusManagerAccessor -sun/awt/AWTAccessor$SequencedEventAccessor -sun/awt/AWTAccessor$ToolkitAccessor -sun/awt/AWTAccessor$WindowAccessor -sun/awt/AWTAutoShutdown -sun/awt/AWTAutoShutdown$1 -sun/awt/AppContext -sun/awt/AppContext$1 -sun/awt/AppContext$2 -sun/awt/AppContext$3 -sun/awt/AppContext$6 -sun/awt/AppContext$GetAppContextLock -sun/awt/AppContext$PostShutdownEventRunnable -sun/awt/AppContext$State -sun/awt/CausedFocusEvent -sun/awt/CausedFocusEvent$Cause -sun/awt/ComponentFactory -sun/awt/ConstrainableGraphics -sun/awt/DisplayChangedListener -sun/awt/EmbeddedFrame -sun/awt/EventQueueDelegate -sun/awt/EventQueueItem -sun/awt/ExtendedKeyCodes -sun/awt/FontConfiguration -sun/awt/FontConfiguration$2 -sun/awt/FontDescriptor -sun/awt/GlobalCursorManager -sun/awt/GlobalCursorManager$NativeUpdater -sun/awt/HeadlessToolkit -sun/awt/InputMethodSupport -sun/awt/KeyboardFocusManagerPeerImpl -sun/awt/KeyboardFocusManagerPeerProvider -sun/awt/LightweightFrame -sun/awt/ModalExclude -sun/awt/ModalityListener -sun/awt/MostRecentKeyValue -sun/awt/NativeLibLoader -sun/awt/NativeLibLoader$1 -sun/awt/NullComponentPeer -sun/awt/OSInfo -sun/awt/OSInfo$1 -sun/awt/OSInfo$OSType -sun/awt/OSInfo$WindowsVersion -sun/awt/PaintEventDispatcher -sun/awt/PeerEvent -sun/awt/PlatformFont -sun/awt/PostEventQueue -sun/awt/RepaintArea -sun/awt/RequestFocusController -sun/awt/SubRegionShowable -sun/awt/SunDisplayChanger -sun/awt/SunGraphicsCallback -sun/awt/SunHints -sun/awt/SunHints$Key -sun/awt/SunHints$LCDContrastKey -sun/awt/SunHints$Value -sun/awt/SunToolkit -sun/awt/SunToolkit$ModalityListenerList -sun/awt/Symbol -sun/awt/Symbol$Encoder -sun/awt/TimedWindowEvent -sun/awt/Win32FontManager -sun/awt/Win32FontManager$1 -sun/awt/Win32FontManager$2 -sun/awt/Win32GraphicsConfig -sun/awt/Win32GraphicsDevice -sun/awt/Win32GraphicsEnvironment -sun/awt/WindowClosingListener -sun/awt/WindowClosingSupport -sun/awt/dnd/SunDragSourceContextPeer -sun/awt/dnd/SunDropTargetEvent -sun/awt/event/IgnorePaintEvent -sun/awt/geom/PathConsumer2D -sun/awt/im/ExecutableInputMethodManager -sun/awt/im/ExecutableInputMethodManager$3 -sun/awt/im/InputContext -sun/awt/im/InputMethodAdapter -sun/awt/im/InputMethodContext -sun/awt/im/InputMethodLocator -sun/awt/im/InputMethodManager -sun/awt/im/InputMethodWindow -sun/awt/image/BufImgSurfaceData -sun/awt/image/BufImgSurfaceData$ICMColorData -sun/awt/image/BufImgSurfaceManager -sun/awt/image/BufImgVolatileSurfaceManager -sun/awt/image/BufferedImageDevice -sun/awt/image/BufferedImageGraphicsConfig -sun/awt/image/ByteComponentRaster -sun/awt/image/ByteInterleavedRaster -sun/awt/image/BytePackedRaster -sun/awt/image/FetcherInfo -sun/awt/image/GifFrame -sun/awt/image/GifImageDecoder -sun/awt/image/ImageConsumerQueue -sun/awt/image/ImageDecoder -sun/awt/image/ImageDecoder$1 -sun/awt/image/ImageFetchable -sun/awt/image/ImageFetcher -sun/awt/image/ImageFetcher$1 -sun/awt/image/ImageRepresentation -sun/awt/image/ImageWatched -sun/awt/image/ImageWatched$Link -sun/awt/image/ImageWatched$WeakLink -sun/awt/image/InputStreamImageSource -sun/awt/image/IntegerComponentRaster -sun/awt/image/IntegerInterleavedRaster -sun/awt/image/NativeLibLoader -sun/awt/image/NativeLibLoader$1 -sun/awt/image/OffScreenImage -sun/awt/image/PNGFilterInputStream -sun/awt/image/PNGImageDecoder -sun/awt/image/PixelConverter -sun/awt/image/PixelConverter$Argb -sun/awt/image/PixelConverter$ArgbBm -sun/awt/image/PixelConverter$ArgbPre -sun/awt/image/PixelConverter$Bgrx -sun/awt/image/PixelConverter$ByteGray -sun/awt/image/PixelConverter$Rgba -sun/awt/image/PixelConverter$RgbaPre -sun/awt/image/PixelConverter$Rgbx -sun/awt/image/PixelConverter$Ushort4444Argb -sun/awt/image/PixelConverter$Ushort555Rgb -sun/awt/image/PixelConverter$Ushort555Rgbx -sun/awt/image/PixelConverter$Ushort565Rgb -sun/awt/image/PixelConverter$UshortGray -sun/awt/image/PixelConverter$Xbgr -sun/awt/image/PixelConverter$Xrgb -sun/awt/image/SunVolatileImage -sun/awt/image/SunWritableRaster -sun/awt/image/SunWritableRaster$DataStealer -sun/awt/image/SurfaceManager -sun/awt/image/SurfaceManager$FlushableCacheData -sun/awt/image/SurfaceManager$ImageAccessor -sun/awt/image/SurfaceManager$ProxiedGraphicsConfig -sun/awt/image/ToolkitImage -sun/awt/image/URLImageSource -sun/awt/image/VolatileSurfaceManager -sun/awt/resources/awt -sun/awt/util/IdentityArrayList -sun/awt/windows/ThemeReader -sun/awt/windows/WCanvasPeer -sun/awt/windows/WColor -sun/awt/windows/WComponentPeer -sun/awt/windows/WComponentPeer$2 -sun/awt/windows/WDesktopProperties -sun/awt/windows/WDesktopProperties$WinPlaySound -sun/awt/windows/WFontConfiguration -sun/awt/windows/WFontPeer -sun/awt/windows/WFramePeer -sun/awt/windows/WGlobalCursorManager -sun/awt/windows/WInputMethod -sun/awt/windows/WInputMethodDescriptor -sun/awt/windows/WKeyboardFocusManagerPeer -sun/awt/windows/WLabelPeer -sun/awt/windows/WObjectPeer -sun/awt/windows/WPanelPeer -sun/awt/windows/WToolkit -sun/awt/windows/WToolkit$1 -sun/awt/windows/WToolkit$2 -sun/awt/windows/WToolkit$3 -sun/awt/windows/WToolkit$3$1 -sun/awt/windows/WToolkit$ToolkitDisposer -sun/awt/windows/WWindowPeer -sun/awt/windows/WWindowPeer$ActiveWindowListener -sun/awt/windows/WWindowPeer$GuiDisposedListener -sun/awt/windows/WingDings -sun/awt/windows/WingDings$Encoder -sun/dc/DuctusRenderingEngine -sun/dc/path/PathConsumer -sun/dc/pr/PathDasher -sun/dc/pr/PathDasher$1 -sun/dc/pr/PathStroker -sun/dc/pr/PathStroker$1 -sun/font/AttributeValues -sun/font/CMap -sun/font/CMap$CMapFormat4 -sun/font/CMap$NullCMapClass -sun/font/CharToGlyphMapper -sun/font/CompositeFont -sun/font/CompositeFontDescriptor -sun/font/CompositeGlyphMapper -sun/font/CompositeStrike -sun/font/CoreMetrics -sun/font/EAttribute -sun/font/FileFont -sun/font/FileFontStrike -sun/font/Font2D -sun/font/Font2DHandle -sun/font/FontAccess -sun/font/FontDesignMetrics -sun/font/FontDesignMetrics$KeyReference -sun/font/FontDesignMetrics$MetricsKey -sun/font/FontFamily -sun/font/FontLineMetrics -sun/font/FontManager -sun/font/FontManagerFactory -sun/font/FontManagerFactory$1 -sun/font/FontManagerForSGE -sun/font/FontManagerNativeLibrary -sun/font/FontManagerNativeLibrary$1 -sun/font/FontScaler -sun/font/FontStrike -sun/font/FontStrikeDesc -sun/font/FontStrikeDisposer -sun/font/FontUtilities -sun/font/FontUtilities$1 -sun/font/GlyphList -sun/font/PhysicalFont -sun/font/PhysicalStrike -sun/font/StandardGlyphVector -sun/font/StandardGlyphVector$GlyphStrike -sun/font/StrikeCache -sun/font/StrikeCache$1 -sun/font/StrikeCache$DisposableStrike -sun/font/StrikeCache$SoftDisposerRef -sun/font/StrikeMetrics -sun/font/SunFontManager -sun/font/SunFontManager$1 -sun/font/SunFontManager$11 -sun/font/SunFontManager$12 -sun/font/SunFontManager$2 -sun/font/SunFontManager$3 -sun/font/SunFontManager$FamilyDescription -sun/font/SunFontManager$FontRegistrationInfo -sun/font/SunFontManager$T1Filter -sun/font/SunFontManager$TTFilter -sun/font/T2KFontScaler -sun/font/T2KFontScaler$1 -sun/font/TrueTypeFont -sun/font/TrueTypeFont$1 -sun/font/TrueTypeFont$DirectoryEntry -sun/font/TrueTypeFont$TTDisposerRecord -sun/font/TrueTypeGlyphMapper -sun/font/Type1Font -sun/io/Win32ErrorMode -sun/java2d/DefaultDisposerRecord -sun/java2d/DestSurfaceProvider -sun/java2d/Disposer -sun/java2d/Disposer$1 -sun/java2d/Disposer$2 -sun/java2d/Disposer$PollDisposable -sun/java2d/DisposerRecord -sun/java2d/DisposerTarget -sun/java2d/FontSupport -sun/java2d/InvalidPipeException -sun/java2d/NullSurfaceData -sun/java2d/ScreenUpdateManager -sun/java2d/StateTrackable -sun/java2d/StateTrackable$State -sun/java2d/StateTrackableDelegate -sun/java2d/StateTrackableDelegate$2 -sun/java2d/StateTracker -sun/java2d/StateTracker$1 -sun/java2d/StateTracker$2 -sun/java2d/SunGraphics2D -sun/java2d/SunGraphicsEnvironment -sun/java2d/SunGraphicsEnvironment$1 -sun/java2d/Surface -sun/java2d/SurfaceData -sun/java2d/SurfaceData$PixelToPgramLoopConverter -sun/java2d/SurfaceData$PixelToShapeLoopConverter -sun/java2d/SurfaceDataProxy -sun/java2d/SurfaceDataProxy$1 -sun/java2d/SurfaceManagerFactory -sun/java2d/WindowsSurfaceManagerFactory -sun/java2d/cmm/ProfileActivator -sun/java2d/cmm/ProfileDeferralInfo -sun/java2d/cmm/ProfileDeferralMgr -sun/java2d/d3d/D3DContext$D3DContextCaps -sun/java2d/d3d/D3DGraphicsConfig -sun/java2d/d3d/D3DGraphicsDevice -sun/java2d/d3d/D3DGraphicsDevice$1 -sun/java2d/d3d/D3DGraphicsDevice$1Result -sun/java2d/d3d/D3DRenderQueue -sun/java2d/d3d/D3DRenderQueue$1 -sun/java2d/d3d/D3DScreenUpdateManager -sun/java2d/d3d/D3DScreenUpdateManager$1 -sun/java2d/d3d/D3DScreenUpdateManager$1$1 -sun/java2d/d3d/D3DSurfaceData -sun/java2d/d3d/D3DSurfaceData$D3DWindowSurfaceData -sun/java2d/loops/Blit -sun/java2d/loops/BlitBg -sun/java2d/loops/CompositeType -sun/java2d/loops/CustomComponent -sun/java2d/loops/DrawGlyphList -sun/java2d/loops/DrawGlyphListAA -sun/java2d/loops/DrawGlyphListLCD -sun/java2d/loops/DrawLine -sun/java2d/loops/DrawParallelogram -sun/java2d/loops/DrawPath -sun/java2d/loops/DrawPolygons -sun/java2d/loops/DrawRect -sun/java2d/loops/FillParallelogram -sun/java2d/loops/FillPath -sun/java2d/loops/FillRect -sun/java2d/loops/FillSpans -sun/java2d/loops/FontInfo -sun/java2d/loops/GeneralRenderer -sun/java2d/loops/GraphicsPrimitive -sun/java2d/loops/GraphicsPrimitiveMgr -sun/java2d/loops/GraphicsPrimitiveMgr$1 -sun/java2d/loops/GraphicsPrimitiveMgr$2 -sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec -sun/java2d/loops/GraphicsPrimitiveProxy -sun/java2d/loops/MaskBlit -sun/java2d/loops/MaskFill -sun/java2d/loops/RenderCache -sun/java2d/loops/RenderCache$Entry -sun/java2d/loops/RenderLoops -sun/java2d/loops/ScaledBlit -sun/java2d/loops/SurfaceType -sun/java2d/loops/TransformHelper -sun/java2d/loops/XORComposite -sun/java2d/opengl/OGLGraphicsConfig -sun/java2d/opengl/WGLGraphicsConfig -sun/java2d/pipe/AAShapePipe -sun/java2d/pipe/AATextRenderer -sun/java2d/pipe/AlphaColorPipe -sun/java2d/pipe/AlphaPaintPipe -sun/java2d/pipe/CompositePipe -sun/java2d/pipe/DrawImage -sun/java2d/pipe/DrawImagePipe -sun/java2d/pipe/GeneralCompositePipe -sun/java2d/pipe/GlyphListLoopPipe -sun/java2d/pipe/GlyphListPipe -sun/java2d/pipe/LCDTextRenderer -sun/java2d/pipe/LoopBasedPipe -sun/java2d/pipe/LoopPipe -sun/java2d/pipe/NullPipe -sun/java2d/pipe/OutlineTextRenderer -sun/java2d/pipe/ParallelogramPipe -sun/java2d/pipe/PixelDrawPipe -sun/java2d/pipe/PixelFillPipe -sun/java2d/pipe/PixelToParallelogramConverter -sun/java2d/pipe/PixelToShapeConverter -sun/java2d/pipe/Region -sun/java2d/pipe/Region$ImmutableRegion -sun/java2d/pipe/RegionIterator -sun/java2d/pipe/RenderBuffer -sun/java2d/pipe/RenderQueue -sun/java2d/pipe/RenderingEngine -sun/java2d/pipe/RenderingEngine$1 -sun/java2d/pipe/ShapeDrawPipe -sun/java2d/pipe/ShapeSpanIterator -sun/java2d/pipe/SolidTextRenderer -sun/java2d/pipe/SpanClipRenderer -sun/java2d/pipe/SpanIterator -sun/java2d/pipe/SpanShapeRenderer -sun/java2d/pipe/SpanShapeRenderer$Composite -sun/java2d/pipe/TextPipe -sun/java2d/pipe/TextRenderer -sun/java2d/pipe/ValidatePipe -sun/java2d/pipe/hw/AccelGraphicsConfig -sun/java2d/pipe/hw/AccelSurface -sun/java2d/pipe/hw/BufferedContextProvider -sun/java2d/pipe/hw/ContextCapabilities -sun/java2d/windows/GDIBlitLoops -sun/java2d/windows/GDIRenderer -sun/java2d/windows/GDIWindowSurfaceData -sun/java2d/windows/WindowsFlags -sun/java2d/windows/WindowsFlags$1 -sun/launcher/LauncherHelper -sun/launcher/LauncherHelper$FXHelper -sun/misc/ASCIICaseInsensitiveComparator -sun/misc/Cleaner -sun/misc/CompoundEnumeration -sun/misc/ExtensionDependency -sun/misc/FDBigInteger -sun/misc/FileURLMapper -sun/misc/FloatingDecimal -sun/misc/FloatingDecimal$1 -sun/misc/FloatingDecimal$ASCIIToBinaryBuffer -sun/misc/FloatingDecimal$ASCIIToBinaryConverter -sun/misc/FloatingDecimal$BinaryToASCIIBuffer -sun/misc/FloatingDecimal$BinaryToASCIIConverter -sun/misc/FloatingDecimal$ExceptionalBinaryToASCIIBuffer -sun/misc/FloatingDecimal$PreparedASCIIToBinaryBuffer -sun/misc/IOUtils -sun/misc/JarIndex -sun/misc/JavaAWTAccess -sun/misc/JavaIOFileDescriptorAccess -sun/misc/JavaLangAccess -sun/misc/JavaNetAccess -sun/misc/JavaNioAccess -sun/misc/JavaSecurityAccess -sun/misc/JavaSecurityProtectionDomainAccess -sun/misc/JavaUtilJarAccess -sun/misc/JavaUtilZipFileAccess -sun/misc/Launcher -sun/misc/Launcher$AppClassLoader -sun/misc/Launcher$AppClassLoader$1 -sun/misc/Launcher$BootClassPathHolder -sun/misc/Launcher$BootClassPathHolder$1 -sun/misc/Launcher$ExtClassLoader -sun/misc/Launcher$ExtClassLoader$1 -sun/misc/Launcher$Factory -sun/misc/MetaIndex -sun/misc/NativeSignalHandler -sun/misc/OSEnvironment -sun/misc/Perf -sun/misc/Perf$GetPerfAction -sun/misc/PerfCounter -sun/misc/PerfCounter$CoreCounters -sun/misc/PerfCounter$WindowsClientCounters -sun/misc/PerformanceLogger -sun/misc/PerformanceLogger$TimeData -sun/misc/PostVMInitHook -sun/misc/Resource -sun/misc/SharedSecrets -sun/misc/Signal -sun/misc/SignalHandler -sun/misc/SoftCache -sun/misc/SoftCache$ValueCell -sun/misc/URLClassPath -sun/misc/URLClassPath$1 -sun/misc/URLClassPath$2 -sun/misc/URLClassPath$3 -sun/misc/URLClassPath$FileLoader -sun/misc/URLClassPath$JarLoader -sun/misc/URLClassPath$JarLoader$1 -sun/misc/URLClassPath$JarLoader$2 -sun/misc/URLClassPath$Loader -sun/misc/Unsafe -sun/misc/VM -sun/misc/Version -sun/net/DefaultProgressMeteringPolicy -sun/net/InetAddressCachePolicy -sun/net/InetAddressCachePolicy$1 -sun/net/InetAddressCachePolicy$2 -sun/net/NetHooks -sun/net/NetProperties -sun/net/NetProperties$1 -sun/net/ProgressMeteringPolicy -sun/net/ProgressMonitor -sun/net/ResourceManager -sun/net/spi/DefaultProxySelector -sun/net/spi/DefaultProxySelector$1 -sun/net/spi/DefaultProxySelector$3 -sun/net/spi/DefaultProxySelector$NonProxyInfo -sun/net/spi/nameservice/NameService -sun/net/util/IPAddressUtil -sun/net/util/URLUtil -sun/net/www/MessageHeader -sun/net/www/MimeEntry -sun/net/www/MimeTable -sun/net/www/MimeTable$1 -sun/net/www/MimeTable$DefaultInstanceHolder -sun/net/www/MimeTable$DefaultInstanceHolder$1 -sun/net/www/ParseUtil -sun/net/www/URLConnection -sun/net/www/protocol/file/FileURLConnection -sun/net/www/protocol/file/Handler -sun/net/www/protocol/http/Handler -sun/net/www/protocol/jar/Handler -sun/net/www/protocol/jar/JarFileFactory -sun/net/www/protocol/jar/JarURLConnection -sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream -sun/net/www/protocol/jar/URLJarFile -sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController -sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry -sun/nio/ByteBuffered -sun/nio/ch/DirectBuffer -sun/nio/ch/FileChannelImpl -sun/nio/ch/FileDispatcher -sun/nio/ch/FileDispatcherImpl -sun/nio/ch/IOStatus -sun/nio/ch/IOUtil -sun/nio/ch/IOUtil$1 -sun/nio/ch/Interruptible -sun/nio/ch/NativeDispatcher -sun/nio/ch/NativeThread -sun/nio/ch/NativeThreadSet -sun/nio/ch/Util -sun/nio/ch/Util$1 -sun/nio/ch/Util$BufferCache -sun/nio/cs/ArrayDecoder -sun/nio/cs/ArrayEncoder -sun/nio/cs/FastCharsetProvider -sun/nio/cs/HistoricallyNamedCharset -sun/nio/cs/ISO_8859_1 -sun/nio/cs/MS1252 -sun/nio/cs/SingleByte -sun/nio/cs/SingleByte$Decoder -sun/nio/cs/SingleByte$Encoder -sun/nio/cs/StandardCharsets -sun/nio/cs/StandardCharsets$Aliases -sun/nio/cs/StandardCharsets$Cache -sun/nio/cs/StandardCharsets$Classes -sun/nio/cs/StreamDecoder -sun/nio/cs/StreamEncoder -sun/nio/cs/Surrogate -sun/nio/cs/Surrogate$Parser -sun/nio/cs/US_ASCII -sun/nio/cs/UTF_16 -sun/nio/cs/UTF_16$Decoder -sun/nio/cs/UTF_16BE -sun/nio/cs/UTF_16LE -sun/nio/cs/UTF_16LE$Decoder -sun/nio/cs/UTF_16LE$Encoder -sun/nio/cs/UTF_8 -sun/nio/cs/UTF_8$Decoder -sun/nio/cs/UTF_8$Encoder -sun/nio/cs/Unicode -sun/nio/cs/UnicodeDecoder -sun/nio/cs/UnicodeEncoder -sun/print/PrinterGraphicsConfig -sun/reflect/AccessorGenerator -sun/reflect/BootstrapConstructorAccessorImpl -sun/reflect/ByteVector -sun/reflect/ByteVectorFactory -sun/reflect/ByteVectorImpl -sun/reflect/CallerSensitive -sun/reflect/ClassDefiner -sun/reflect/ClassDefiner$1 -sun/reflect/ClassFileAssembler -sun/reflect/ClassFileConstants -sun/reflect/ConstantPool -sun/reflect/ConstructorAccessor -sun/reflect/ConstructorAccessorImpl -sun/reflect/DelegatingClassLoader -sun/reflect/DelegatingConstructorAccessorImpl -sun/reflect/DelegatingMethodAccessorImpl -sun/reflect/FieldAccessor -sun/reflect/FieldAccessorImpl -sun/reflect/Label -sun/reflect/Label$PatchInfo -sun/reflect/LangReflectAccess -sun/reflect/MagicAccessorImpl -sun/reflect/MethodAccessor -sun/reflect/MethodAccessorGenerator -sun/reflect/MethodAccessorGenerator$1 -sun/reflect/MethodAccessorImpl -sun/reflect/NativeConstructorAccessorImpl -sun/reflect/NativeMethodAccessorImpl -sun/reflect/Reflection -sun/reflect/ReflectionFactory -sun/reflect/ReflectionFactory$1 -sun/reflect/ReflectionFactory$GetReflectionFactoryAction -sun/reflect/SerializationConstructorAccessorImpl -sun/reflect/UTF8 -sun/reflect/UnsafeFieldAccessorFactory -sun/reflect/UnsafeFieldAccessorImpl -sun/reflect/UnsafeObjectFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl -sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl -sun/reflect/UnsafeStaticFieldAccessorImpl -sun/reflect/annotation/AnnotationType -sun/reflect/generics/repository/AbstractRepository -sun/reflect/generics/repository/ClassRepository -sun/reflect/generics/repository/GenericDeclRepository -sun/reflect/misc/MethodUtil -sun/reflect/misc/MethodUtil$1 -sun/reflect/misc/ReflectUtil -sun/security/action/GetBooleanAction -sun/security/action/GetIntegerAction -sun/security/action/GetPropertyAction -sun/security/jca/GetInstance -sun/security/jca/GetInstance$Instance -sun/security/jca/ProviderConfig -sun/security/jca/ProviderConfig$2 -sun/security/jca/ProviderList -sun/security/jca/ProviderList$1 -sun/security/jca/ProviderList$2 -sun/security/jca/ProviderList$3 -sun/security/jca/ProviderList$ServiceList -sun/security/jca/ProviderList$ServiceList$1 -sun/security/jca/Providers -sun/security/jca/ServiceId -sun/security/provider/ByteArrayAccess -sun/security/provider/DSA -sun/security/provider/DSA$LegacyDSA -sun/security/provider/DSA$SHA1withDSA -sun/security/provider/DSAParameters -sun/security/provider/DSAPublicKey -sun/security/provider/DigestBase -sun/security/provider/NativePRNG -sun/security/provider/NativePRNG$Blocking -sun/security/provider/NativePRNG$NonBlocking -sun/security/provider/SHA -sun/security/provider/Sun -sun/security/provider/SunEntries -sun/security/provider/SunEntries$1 -sun/security/util/ByteArrayLexOrder -sun/security/util/ByteArrayTagOrder -sun/security/util/Debug -sun/security/util/DerEncoder -sun/security/util/DerIndefLenConverter -sun/security/util/DerInputBuffer -sun/security/util/DerInputStream -sun/security/util/DerOutputStream -sun/security/util/DerValue -sun/security/util/ManifestEntryVerifier -sun/security/util/ObjectIdentifier -sun/security/util/SignatureFileVerifier -sun/security/x509/AlgorithmId -sun/security/x509/X509Key -sun/swing/DefaultLookup -sun/swing/ImageIconUIResource -sun/swing/JLightweightFrame -sun/swing/MenuItemLayoutHelper -sun/swing/MenuItemLayoutHelper$ColumnAlignment -sun/swing/MenuItemLayoutHelper$LayoutResult -sun/swing/MenuItemLayoutHelper$RectSize -sun/swing/PrintColorUIResource -sun/swing/StringUIClientPropertyKey -sun/swing/SwingAccessor -sun/swing/SwingAccessor$JTextComponentAccessor -sun/swing/SwingLazyValue -sun/swing/SwingLazyValue$1 -sun/swing/SwingUtilities2 -sun/swing/SwingUtilities2$2 -sun/swing/SwingUtilities2$AATextInfo -sun/swing/SwingUtilities2$LSBCacheEntry -sun/swing/UIAction -sun/swing/UIClientPropertyKey -sun/swing/table/DefaultTableCellHeaderRenderer -sun/swing/table/DefaultTableCellHeaderRenderer$EmptyIcon -sun/text/ComposedCharIter -sun/text/IntHashtable -sun/text/UCompactIntArray -sun/text/normalizer/CharTrie -sun/text/normalizer/CharTrie$FriendAgent -sun/text/normalizer/ICUBinary -sun/text/normalizer/ICUBinary$Authenticate -sun/text/normalizer/ICUData -sun/text/normalizer/IntTrie -sun/text/normalizer/NormalizerDataReader -sun/text/normalizer/NormalizerImpl -sun/text/normalizer/NormalizerImpl$AuxTrieImpl -sun/text/normalizer/NormalizerImpl$DecomposeArgs -sun/text/normalizer/NormalizerImpl$FCDTrieImpl -sun/text/normalizer/NormalizerImpl$NormTrieImpl -sun/text/normalizer/Trie -sun/text/normalizer/Trie$DataManipulate -sun/text/normalizer/UTF16 -sun/text/normalizer/UnicodeMatcher -sun/text/normalizer/UnicodeSet -sun/text/resources/CollationData -sun/text/resources/FormatData -sun/text/resources/en/FormatData_en -sun/text/resources/en/FormatData_en_US -sun/util/CoreResourceBundleControl -sun/util/PreHashedMap -sun/util/ResourceBundleEnumeration -sun/util/calendar/AbstractCalendar -sun/util/calendar/BaseCalendar -sun/util/calendar/BaseCalendar$Date -sun/util/calendar/CalendarDate -sun/util/calendar/CalendarSystem -sun/util/calendar/CalendarUtils -sun/util/calendar/Gregorian -sun/util/calendar/Gregorian$Date -sun/util/calendar/ZoneInfo -sun/util/calendar/ZoneInfoFile -sun/util/calendar/ZoneInfoFile$1 -sun/util/calendar/ZoneInfoFile$Checksum -sun/util/calendar/ZoneInfoFile$ZoneOffsetTransitionRule -sun/util/locale/BaseLocale -sun/util/locale/BaseLocale$Cache -sun/util/locale/BaseLocale$Key -sun/util/locale/InternalLocaleBuilder -sun/util/locale/InternalLocaleBuilder$CaseInsensitiveChar -sun/util/locale/LanguageTag -sun/util/locale/LocaleObjectCache -sun/util/locale/LocaleObjectCache$CacheEntry -sun/util/locale/LocaleUtils -sun/util/locale/ParseStatus -sun/util/locale/StringTokenIterator -sun/util/locale/provider/AuxLocaleProviderAdapter -sun/util/locale/provider/AuxLocaleProviderAdapter$NullProvider -sun/util/locale/provider/AvailableLanguageTags -sun/util/locale/provider/CalendarDataProviderImpl -sun/util/locale/provider/CalendarDataUtility -sun/util/locale/provider/CalendarDataUtility$CalendarWeekParameterGetter -sun/util/locale/provider/CalendarProviderImpl -sun/util/locale/provider/CollatorProviderImpl -sun/util/locale/provider/CurrencyNameProviderImpl -sun/util/locale/provider/DateFormatSymbolsProviderImpl -sun/util/locale/provider/DecimalFormatSymbolsProviderImpl -sun/util/locale/provider/JRELocaleProviderAdapter -sun/util/locale/provider/JRELocaleProviderAdapter$1 -sun/util/locale/provider/LocaleDataMetaInfo -sun/util/locale/provider/LocaleProviderAdapter -sun/util/locale/provider/LocaleProviderAdapter$1 -sun/util/locale/provider/LocaleProviderAdapter$Type -sun/util/locale/provider/LocaleResources -sun/util/locale/provider/LocaleResources$ResourceReference -sun/util/locale/provider/LocaleServiceProviderPool -sun/util/locale/provider/LocaleServiceProviderPool$LocalizedObjectGetter -sun/util/locale/provider/NumberFormatProviderImpl -sun/util/locale/provider/ResourceBundleBasedAdapter -sun/util/locale/provider/SPILocaleProviderAdapter -sun/util/locale/provider/SPILocaleProviderAdapter$1 -sun/util/locale/provider/TimeZoneNameProviderImpl -sun/util/locale/provider/TimeZoneNameUtility -sun/util/locale/provider/TimeZoneNameUtility$TimeZoneNameGetter -sun/util/logging/LoggingProxy -sun/util/logging/LoggingSupport -sun/util/logging/LoggingSupport$1 -sun/util/logging/LoggingSupport$2 -sun/util/logging/PlatformLogger -sun/util/logging/PlatformLogger$1 -sun/util/logging/PlatformLogger$DefaultLoggerProxy -sun/util/logging/PlatformLogger$JavaLoggerProxy -sun/util/logging/PlatformLogger$Level -sun/util/logging/PlatformLogger$LoggerProxy -sun/util/logging/resources/logging -sun/util/resources/CalendarData -sun/util/resources/CurrencyNames -sun/util/resources/LocaleData -sun/util/resources/LocaleData$1 -sun/util/resources/LocaleData$LocaleDataResourceBundleControl -sun/util/resources/LocaleNamesBundle -sun/util/resources/OpenListResourceBundle -sun/util/resources/ParallelListResourceBundle -sun/util/resources/ParallelListResourceBundle$KeySet -sun/util/resources/TimeZoneNames -sun/util/resources/TimeZoneNamesBundle -sun/util/resources/en/CalendarData_en -sun/util/resources/en/CurrencyNames_en_US -sun/util/resources/en/TimeZoneNames_en -sun/util/spi/CalendarProvider -# 729efa63b41fc759 diff --git a/jdk/make/data/x11wrappergen/sizes.32 b/jdk/make/data/x11wrappergen/sizes.32 index aa77c69f026..2ac1cb32307 100644 --- a/jdk/make/data/x11wrappergen/sizes.32 +++ b/jdk/make/data/x11wrappergen/sizes.32 @@ -206,7 +206,8 @@ ColorData.img_oda_green 28 ColorData.img_oda_blue 32 ColorData.pGrayInverseLutData 36 ColorData.screendata 40 -ColorData 44 +ColorData.representsPrimaries 44 +ColorData 48 XFontStruct.ext_data 0 XFontStruct.fid 4 XFontStruct.direction 8 diff --git a/jdk/make/data/x11wrappergen/sizes.64 b/jdk/make/data/x11wrappergen/sizes.64 index f771daf8c6a..9f0e60fa4e7 100644 --- a/jdk/make/data/x11wrappergen/sizes.64 +++ b/jdk/make/data/x11wrappergen/sizes.64 @@ -206,6 +206,7 @@ ColorData.img_oda_green 56 ColorData.img_oda_blue 64 ColorData.pGrayInverseLutData 72 ColorData.screendata 80 +ColorData.representsPrimaries 84 ColorData 88 XFontStruct.ext_data 0 XFontStruct.fid 8 diff --git a/jdk/make/data/x11wrappergen/sizes.64-solaris-i386 b/jdk/make/data/x11wrappergen/sizes.64-solaris-i386 index f771daf8c6a..9f0e60fa4e7 100644 --- a/jdk/make/data/x11wrappergen/sizes.64-solaris-i386 +++ b/jdk/make/data/x11wrappergen/sizes.64-solaris-i386 @@ -206,6 +206,7 @@ ColorData.img_oda_green 56 ColorData.img_oda_blue 64 ColorData.pGrayInverseLutData 72 ColorData.screendata 80 +ColorData.representsPrimaries 84 ColorData 88 XFontStruct.ext_data 0 XFontStruct.fid 8 diff --git a/jdk/make/data/x11wrappergen/xlibtypes.txt b/jdk/make/data/x11wrappergen/xlibtypes.txt index 975565c9d67..aa68c212c40 100644 --- a/jdk/make/data/x11wrappergen/xlibtypes.txt +++ b/jdk/make/data/x11wrappergen/xlibtypes.txt @@ -749,6 +749,7 @@ ColorData img_oda_blue pointer byte pGrayInverseLutData pointer int screendata int + representsPrimaries int AwtGraphicsConfigData awt_depth int diff --git a/jdk/make/gendata/Gendata-java.base.gmk b/jdk/make/gendata/Gendata-java.base.gmk index 5c6de721b64..8547f205011 100644 --- a/jdk/make/gendata/Gendata-java.base.gmk +++ b/jdk/make/gendata/Gendata-java.base.gmk @@ -75,14 +75,3 @@ $(GENDATA_JAVA_SECURITY): $(BUILD_TOOLS) $(GENDATA_JAVA_SECURITY_SRC) $(RESTRICT TARGETS += $(GENDATA_JAVA_SECURITY) ################################################################################ - -$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist: \ - $(JDK_TOPDIR)/make/data/classlist/classlist.$(OPENJDK_TARGET_OS) - $(call MakeDir, $(@D)) - $(RM) $@ $@.tmp - $(TOOL_ADDJSUM) $< $@.tmp - $(MV) $@.tmp $@ - -TARGETS += $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist - -################################################################################ diff --git a/jdk/make/gendata/GendataBreakIterator.gmk b/jdk/make/gendata/GendataBreakIterator.gmk index 5ee97d77595..06d3c2ac490 100644 --- a/jdk/make/gendata/GendataBreakIterator.gmk +++ b/jdk/make/gendata/GendataBreakIterator.gmk @@ -62,10 +62,13 @@ $(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_LD, \ BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata)) ifeq ($(BOOT_JDK_MODULAR), true) - BREAK_ITERATOR_BOOTCLASSPATH := -Xpatch:$(BREAK_ITERATOR_CLASSES) \ - -XaddExports:java.base/sun.text=ALL-UNNAMED \ - -XaddExports:java.base/sun.text.resources=ALL-UNNAMED \ - -XaddExports:jdk.localedata/sun.text.resources.ext=ALL-UNNAMED + BREAK_ITERATOR_BOOTCLASSPATH := \ + -Xpatch:java.base=$(BREAK_ITERATOR_CLASSES)/java.base \ + -Xpatch:jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \ + -XaddExports:java.base/sun.text=ALL-UNNAMED \ + -XaddExports:java.base/sun.text.resources=ALL-UNNAMED \ + -XaddExports:jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \ + # else BREAK_ITERATOR_BOOTCLASSPATH := -Xbootclasspath/p:$(call PathList, \ $(BREAK_ITERATOR_CLASSES)/java.base \ diff --git a/jdk/make/launcher/Launcher-java.desktop.gmk b/jdk/make/launcher/Launcher-java.desktop.gmk index c9f730f4d71..b6b95cb24ed 100644 --- a/jdk/make/launcher/Launcher-java.desktop.gmk +++ b/jdk/make/launcher/Launcher-java.desktop.gmk @@ -31,7 +31,7 @@ $(eval $(call IncludeCustomExtension, jdk, launcher/Launcher-java.desktop.gmk)) ifndef BUILD_HEADLESS_ONLY $(eval $(call SetupBuildLauncher, appletviewer, \ MAIN_CLASS := sun.applet.Main, \ - JAVA_ARGS := -addmods ALL-SYSTEM, \ + JAVA_ARGS := -addmods ALL-DEFAULT, \ LIBS_unix := $(X_LIBS), \ )) endif diff --git a/jdk/make/launcher/Launcher-java.scripting.gmk b/jdk/make/launcher/Launcher-java.scripting.gmk index bf8f97084ec..6f3f59da268 100644 --- a/jdk/make/launcher/Launcher-java.scripting.gmk +++ b/jdk/make/launcher/Launcher-java.scripting.gmk @@ -27,4 +27,5 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, jrunscript, \ MAIN_CLASS := com.sun.tools.script.shell.Main, \ + JAVA_ARGS := -addmods ALL-DEFAULT, \ )) diff --git a/jdk/make/launcher/Launcher-jdk.compiler.gmk b/jdk/make/launcher/Launcher-jdk.compiler.gmk index d1947dae9f2..0259eb0ff8c 100644 --- a/jdk/make/launcher/Launcher-jdk.compiler.gmk +++ b/jdk/make/launcher/Launcher-jdk.compiler.gmk @@ -27,7 +27,8 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, javac, \ MAIN_CLASS := com.sun.tools.javac.Main, \ - CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \ + JAVA_ARGS := -addmods ALL-DEFAULT, \ + CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ )) diff --git a/jdk/make/launcher/Launcher-jdk.javadoc.gmk b/jdk/make/launcher/Launcher-jdk.javadoc.gmk index afdb687b0ab..365443618f2 100644 --- a/jdk/make/launcher/Launcher-jdk.javadoc.gmk +++ b/jdk/make/launcher/Launcher-jdk.javadoc.gmk @@ -27,6 +27,7 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, javadoc, \ MAIN_CLASS := jdk.javadoc.internal.tool.Main, \ + JAVA_ARGS := -addmods ALL-DEFAULT, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ )) diff --git a/jdk/make/launcher/Launcher-jdk.jlink.gmk b/jdk/make/launcher/Launcher-jdk.jlink.gmk index acf8228b6c4..b1edcbc93c0 100644 --- a/jdk/make/launcher/Launcher-jdk.jlink.gmk +++ b/jdk/make/launcher/Launcher-jdk.jlink.gmk @@ -32,6 +32,7 @@ $(eval $(call SetupBuildLauncher, jimage,\ $(eval $(call SetupBuildLauncher, jlink,\ MAIN_CLASS := jdk.tools.jlink.internal.Main, \ + JAVA_ARGS := -addmods ALL-DEFAULT, \ CFLAGS := -DENABLE_ARG_FILES \ -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ diff --git a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk index 3dd56d3a554..b6349b56365 100644 --- a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk +++ b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk @@ -27,6 +27,6 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, jjs, \ MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \ - JAVA_ARGS := -addmods ALL-SYSTEM, \ + JAVA_ARGS := -addmods ALL-DEFAULT, \ CFLAGS := -DENABLE_ARG_FILES, \ )) diff --git a/jdk/make/src/classes/build/tools/classlist/HelloClasslist.java b/jdk/make/src/classes/build/tools/classlist/HelloClasslist.java new file mode 100644 index 00000000000..e32b8d77766 --- /dev/null +++ b/jdk/make/src/classes/build/tools/classlist/HelloClasslist.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2016, 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. + */ + +/** + * This application is meant to be run to create a classlist file representing + * common use. + * + * The classlist is produced by adding -XX:DumpLoadedClassList=classlist + */ +package build.tools.classlist; + +import java.net.InetAddress; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.stream.Stream; +import java.util.logging.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.text.DateFormat; + +import static java.util.stream.Collectors.*; + +/** + * This class is used to generate a classlist during build. Intent + * is to touch a reasonable amount of JDK classes that are commonly + * loaded and used early. + */ +public class HelloClasslist { + + private static final Logger LOGGER = Logger.getLogger("Hello"); + + public static void main(String ... args) { + + List strings = Arrays.asList("Hello", "World!", "From: ", + InetAddress.getLoopbackAddress().toString()); + + String helloWorld = strings.parallelStream() + .map(s -> s.toLowerCase(Locale.ROOT)) + .collect(joining(",")); + + Stream.of(helloWorld.split(",")) + .forEach(System.out::println); + + String newDate = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format( + LocalDateTime.now(ZoneId.of("GMT"))); + + String oldDate = String.format("%s%n", + DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ROOT) + .format(new Date())); + + LOGGER.log(Level.INFO, "New Date: " + newDate + " - old: " + oldDate); + } + +} diff --git a/jdk/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java b/jdk/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java index 8a2307d2ff6..46b2a8a7eb2 100644 --- a/jdk/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java +++ b/jdk/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java @@ -102,7 +102,7 @@ public class LinuxFileSystemProvider extends UnixFileSystemProvider { @Override FileTypeDetector getFileTypeDetector() { - String userHome = GetPropertyAction.getProperty("user.home"); + String userHome = GetPropertyAction.privilegedGetProperty("user.home"); Path userMimeTypes = Paths.get(userHome, ".mime.types"); Path etcMimeTypes = Paths.get("/etc/mime.types"); diff --git a/jdk/src/java.base/linux/native/libnio/ch/EPollArrayWrapper.c b/jdk/src/java.base/linux/native/libnio/ch/EPollArrayWrapper.c index c7b391f930a..12b1c8524bc 100644 --- a/jdk/src/java.base/linux/native/libnio/ch/EPollArrayWrapper.c +++ b/jdk/src/java.base/linux/native/libnio/ch/EPollArrayWrapper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -53,7 +53,7 @@ iepoll(int epfd, struct epoll_event *events, int numfds, jlong timeout) start = t.tv_sec * 1000 + t.tv_usec / 1000; for (;;) { - int res = epoll_wait(epfd, events, numfds, timeout); + int res = epoll_wait(epfd, events, numfds, remaining); if (res < 0 && errno == EINTR) { if (remaining >= 0) { gettimeofday(&t, NULL); diff --git a/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java b/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java index 7598cf9e37f..d85434504d6 100644 --- a/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java +++ b/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java @@ -84,7 +84,8 @@ class KQueueArrayWrapper { static { IOUtil.load(); initStructSizes(); - String datamodel = GetPropertyAction.getProperty("sun.arch.data.model"); + String datamodel = + GetPropertyAction.privilegedGetProperty("sun.arch.data.model"); is64bit = "64".equals(datamodel); } diff --git a/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystem.java b/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystem.java index 0305171589d..fb88c794e5f 100644 --- a/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystem.java +++ b/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystem.java @@ -29,8 +29,6 @@ import java.nio.file.*; import java.io.IOException; import java.util.*; import java.util.regex.Pattern; -import java.security.AccessController; -import sun.security.action.GetPropertyAction; import static sun.nio.fs.MacOSXNativeDispatcher.*; diff --git a/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java b/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java index 6b9a56a9fa7..43a40283c80 100644 --- a/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java +++ b/jdk/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java @@ -46,8 +46,8 @@ public class MacOSXFileSystemProvider extends BsdFileSystemProvider { @Override FileTypeDetector getFileTypeDetector() { - Path userMimeTypes = Paths.get( - GetPropertyAction.getProperty("user.home"), ".mime.types"); + Path userMimeTypes = Paths.get(GetPropertyAction + .privilegedGetProperty("user.home"), ".mime.types"); return chain(new MimeTypesFileTypeDetector(userMimeTypes), new UTIFileTypeDetector()); diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/HmacCore.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/HmacCore.java index bc865c63f47..68a263ce219 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/HmacCore.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/HmacCore.java @@ -262,4 +262,14 @@ abstract class HmacCore extends MacSpi implements Cloneable { super("SHA-512", 128); } } + public static final class HmacSHA512_224 extends HmacCore { + public HmacSHA512_224() throws NoSuchAlgorithmException { + super("SHA-512/224", 128); + } + } + public static final class HmacSHA512_256 extends HmacCore { + public HmacSHA512_256() throws NoSuchAlgorithmException { + super("SHA-512/256", 128); + } + } } diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java index 089a662dce5..e7ab016b5d9 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java @@ -704,6 +704,12 @@ public final class SunJCE extends Provider { put("Alg.Alias.Mac.OID.1.2.840.113549.2.11", "HmacSHA512"); put("Alg.Alias.Mac.1.2.840.113549.2.11", "HmacSHA512"); + // TODO: aliases with OIDs + put("Mac.HmacSHA512/224", + "com.sun.crypto.provider.HmacCore$HmacSHA512_224"); + put("Mac.HmacSHA512/256", + "com.sun.crypto.provider.HmacCore$HmacSHA512_256"); + put("Mac.HmacPBESHA1", "com.sun.crypto.provider.HmacPKCS12PBESHA1"); diff --git a/jdk/src/java.base/share/classes/java/io/File.java b/jdk/src/java.base/share/classes/java/io/File.java index 7f23340920b..41eff3eb92d 100644 --- a/jdk/src/java.base/share/classes/java/io/File.java +++ b/jdk/src/java.base/share/classes/java/io/File.java @@ -1896,7 +1896,7 @@ public class File // temporary directory location private static final File tmpdir = new File( - GetPropertyAction.getProperty("java.io.tmpdir")); + GetPropertyAction.privilegedGetProperty("java.io.tmpdir")); static File location() { return tmpdir; } diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java index 3ea9467a45f..2327b7699d7 100644 --- a/jdk/src/java.base/share/classes/java/lang/Class.java +++ b/jdk/src/java.base/share/classes/java/lang/Class.java @@ -470,7 +470,7 @@ public final class Class implements java.io.Serializable, * expression with an empty argument list. The class is initialized if it * has not already been initialized. * - *

Note that this method propagates any exception thrown by the + * @deprecated This method propagates any exception thrown by the * nullary constructor, including a checked exception. Use of * this method effectively bypasses the compile-time exception * checking that would otherwise be performed by the compiler. @@ -500,6 +500,7 @@ public final class Class implements java.io.Serializable, * of this class. */ @CallerSensitive + @Deprecated(since="9") public T newInstance() throws InstantiationException, IllegalAccessException { diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java index 61123302a3c..013912384d8 100644 --- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java @@ -2615,7 +2615,7 @@ public abstract class ClassLoader { ServicesCatalog createOrGetServicesCatalog() { ServicesCatalog catalog = servicesCatalog; if (catalog == null) { - catalog = new ServicesCatalog(); + catalog = ServicesCatalog.create(); boolean set = trySetObjectField("servicesCatalog", catalog); if (!set) { // beaten by someone else diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java index 638be0e9f72..31406459d93 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java @@ -468,7 +468,7 @@ public final class ProcessBuilder */ public abstract static class Redirect { private static final File NULL_FILE = new File( - (GetPropertyAction.getProperty("os.name") + (GetPropertyAction.privilegedGetProperty("os.name") .startsWith("Windows") ? "NUL" : "/dev/null") ); diff --git a/jdk/src/java.base/share/classes/java/lang/StackFrameInfo.java b/jdk/src/java.base/share/classes/java/lang/StackFrameInfo.java index 187a737d7c4..376b91e09ea 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackFrameInfo.java +++ b/jdk/src/java.base/share/classes/java/lang/StackFrameInfo.java @@ -29,21 +29,20 @@ import jdk.internal.misc.SharedSecrets; import static java.lang.StackWalker.Option.*; import java.lang.StackWalker.StackFrame; -import java.lang.reflect.Module; import java.util.Optional; import java.util.OptionalInt; class StackFrameInfo implements StackFrame { - private final static JavaLangInvokeAccess jlInvokeAccess = + private final static JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess(); // Footprint improvement: MemberName::clazz can replace // StackFrameInfo::declaringClass. - final StackWalker walker; - final Class declaringClass; - final Object memberName; - final short bci; + private final StackWalker walker; + private final Class declaringClass; + private final Object memberName; + private final short bci; private volatile StackTraceElement ste; /* @@ -54,9 +53,17 @@ class StackFrameInfo implements StackFrame { this.walker = walker; this.declaringClass = null; this.bci = -1; - this.memberName = jlInvokeAccess.newMemberName(); + this.memberName = JLIA.newMemberName(); } + // package-private called by StackStreamFactory to skip + // the capability check + Class declaringClass() { + return declaringClass; + } + + // ----- implementation of StackFrame methods + @Override public String getClassName() { return declaringClass.getName(); @@ -70,31 +77,39 @@ class StackFrameInfo implements StackFrame { @Override public String getMethodName() { - return jlInvokeAccess.getName(memberName); + return JLIA.getName(memberName); } @Override - public final Optional getFileName() { - StackTraceElement ste = toStackTraceElement(); - return ste.getFileName() != null ? Optional.of(ste.getFileName()) : Optional.empty(); + public int getByteCodeIndex() { + return bci; } @Override - public final OptionalInt getLineNumber() { - StackTraceElement ste = toStackTraceElement(); - return ste.getLineNumber() > 0 ? OptionalInt.of(ste.getLineNumber()) : OptionalInt.empty(); + public String getFileName() { + if (isNativeMethod()) + return null; + + return toStackTraceElement().getFileName(); } @Override - public final boolean isNativeMethod() { - StackTraceElement ste = toStackTraceElement(); - return ste.isNativeMethod(); + public int getLineNumber() { + if (isNativeMethod()) + return -2; + + return toStackTraceElement().getLineNumber(); + } + + + @Override + public boolean isNativeMethod() { + return JLIA.isNative(memberName); } @Override public String toString() { - StackTraceElement ste = toStackTraceElement(); - return ste.toString(); + return toStackTraceElement().toString(); } /** diff --git a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java index 73446062bea..a96aa01335c 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java +++ b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java @@ -78,7 +78,8 @@ final class StackStreamFactory { * Performance work and extensive testing is needed to replace the * VM built-in backtrace filled in Throwable with the StackWalker. */ - final static boolean isDebug = getProperty("stackwalk.debug", false); + final static boolean isDebug = + "true".equals(GetPropertyAction.privilegedGetProperty("stackwalk.debug")); static StackFrameTraverser makeStackTraverser(StackWalker walker, Function, ? extends T> function) @@ -491,7 +492,7 @@ final class StackStreamFactory { @Override final Class at(int index) { - return stackFrames[index].declaringClass; + return stackFrames[index].declaringClass(); } } @@ -760,7 +761,7 @@ final class StackStreamFactory { @Override final Class at(int index) { - return stackFrames[index].declaringClass; + return stackFrames[index].declaringClass(); } } @@ -988,11 +989,4 @@ final class StackStreamFactory { c.getName().startsWith("java.lang.invoke.LambdaForm"); } - private static boolean getProperty(String key, boolean value) { - String s = GetPropertyAction.getProperty(key); - if (s != null) { - return Boolean.parseBoolean(s); - } - return value; - } } diff --git a/jdk/src/java.base/share/classes/java/lang/StackWalker.java b/jdk/src/java.base/share/classes/java/lang/StackWalker.java index 7eeef016681..aef9c729a92 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackWalker.java +++ b/jdk/src/java.base/share/classes/java/lang/StackWalker.java @@ -126,6 +126,20 @@ public final class StackWalker { */ public Class getDeclaringClass(); + /** + * Returns the index to the code array of the {@code Code} attribute + * containing the execution point represented by this stack frame. + * The code array gives the actual bytes of Java Virtual Machine code + * that implement the method. + * + * @return the index to the code array of the {@code Code} attribute + * containing the execution point represented by this stack frame, + * or a negative number if the method is native. + * + * @jvms 4.7.3 The {@code Code} Attribute + */ + public int getByteCodeIndex(); + /** * Returns the name of the source file containing the execution point * represented by this stack frame. Generally, this corresponds @@ -135,12 +149,12 @@ public final class StackWalker { * other than a file, such as an entry in a source repository. * * @return the name of the file containing the execution point - * represented by this stack frame, or empty {@code Optional} - * is unavailable. + * represented by this stack frame, or {@code null} if + * this information is unavailable. * * @jvms 4.7.10 The {@code SourceFile} Attribute */ - public Optional getFileName(); + public String getFileName(); /** * Returns the line number of the source line containing the execution @@ -150,12 +164,12 @@ public final class StackWalker { * Specification. * * @return the line number of the source line containing the execution - * point represented by this stack frame, or empty - * {@code Optional} if this information is unavailable. + * point represented by this stack frame, or a negative number if + * this information is unavailable. * * @jvms 4.7.12 The {@code LineNumberTable} Attribute */ - public OptionalInt getLineNumber(); + public int getLineNumber(); /** * Returns {@code true} if the method containing the execution point diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java index d6e80e71908..ab7bb02c1f7 100644 --- a/jdk/src/java.base/share/classes/java/lang/System.java +++ b/jdk/src/java.base/share/classes/java/lang/System.java @@ -69,7 +69,6 @@ import jdk.internal.logger.LazyLoggers; import jdk.internal.logger.LocalizedLoggerWrapper; import jdk.internal.module.ModuleBootstrap; -import jdk.internal.module.Modules; import jdk.internal.module.ServicesCatalog; /** @@ -1924,10 +1923,6 @@ public final class System { // initialize the module system System.bootLayer = ModuleBootstrap.boot(); - // base module needs to be loose (CODETOOLS-7901619) - Module base = Object.class.getModule(); - Modules.addReads(base, null); - // module system initialized VM.initLevel(2); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java index 21e45d85663..f9c864a1ac1 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java @@ -33,8 +33,6 @@ import sun.invoke.util.VerifyType; import sun.invoke.util.Wrapper; import java.lang.ref.WeakReference; -import java.lang.reflect.Field; -import java.lang.reflect.Method; import java.util.Arrays; import java.util.Objects; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index a0df622f501..0c814bdd470 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -88,7 +88,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; static { final String key = "jdk.internal.lambda.dumpProxyClasses"; - String path = GetPropertyAction.getProperty(key); + String path = GetPropertyAction.privilegedGetProperty(key); dumper = (null == path) ? null : ProxyClassesDumper.getInstance(path); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java index bb6a8824058..29cc430f877 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -396,7 +396,7 @@ class Invokers { LambdaForm lform = new LambdaForm(name + ":VarHandle_invoke_MT_" + shortenSignature(basicTypeSignature(mtype)), ARG_LIMIT + 1, names); - lform.prepare(); + lform.compileToBytecode(); return lform; } @@ -448,7 +448,7 @@ class Invokers { LambdaForm lform = new LambdaForm(name + ":VarHandle_exactInvoker" + shortenSignature(basicTypeSignature(mtype)), ARG_LIMIT, names); - lform.prepare(); + lform.compileToBytecode(); return lform; } @@ -497,44 +497,33 @@ class Invokers { /*non-public*/ static @ForceInline - MethodHandle checkVarHandleGenericType(VarHandle vh, VarHandle.AccessDescriptor vad) { - MethodType expected = vad.symbolicMethodType; - MethodType actual = VarHandle.AccessType.getMethodType(vad.type, vh); - - MemberName mn = VarHandle.AccessMode.getMemberName(vad.mode, vh.vform); - if (mn == null) - throw vh.unsupported(); - // TODO the following MH is not constant, cache in stable field array - // on VarForm? - MethodHandle mh = DirectMethodHandle.make(mn); - if (actual == expected) { + MethodHandle checkVarHandleGenericType(VarHandle handle, VarHandle.AccessDescriptor ad) { + // Test for exact match on invoker types + // TODO match with erased types and add cast of return value to lambda form + MethodHandle mh = handle.getMethodHandle(ad.mode); + if (mh.type() == ad.symbolicMethodTypeInvoker) { return mh; } else { - // Adapt to the actual (which should never fail since mh's method - // type is in the basic form), then to the expected (which my fail - // if the symbolic type descriptor does not match) - // TODO optimize for the case of actual.erased() == expected.erased() - return mh.asType(actual.insertParameterTypes(0, VarHandle.class)). - asType(expected.insertParameterTypes(0, VarHandle.class)); + return mh.asType(ad.symbolicMethodTypeInvoker); } } /*non-public*/ static @ForceInline - void checkVarHandleExactType(VarHandle vh, VarHandle.AccessDescriptor vad) { - MethodType expected = vad.symbolicMethodType; - MethodType actual = VarHandle.AccessType.getMethodType(vad.type, vh); - if (actual != expected) - throw newWrongMethodTypeException(expected, actual); + void checkVarHandleExactType(VarHandle handle, VarHandle.AccessDescriptor ad) { + MethodType erasedTarget = handle.vform.methodType_table[ad.type]; + MethodType erasedSymbolic = ad.symbolicMethodTypeErased; + if (erasedTarget != erasedSymbolic) + throw newWrongMethodTypeException(erasedTarget, erasedSymbolic); } /*non-public*/ static @ForceInline - MemberName getVarHandleMemberName(VarHandle vh, VarHandle.AccessDescriptor vad) { - MemberName mn = VarHandle.AccessMode.getMemberName(vad.mode, vh.vform); + MemberName getVarHandleMemberName(VarHandle handle, VarHandle.AccessDescriptor ad) { + MemberName mn = handle.vform.memberName_table[ad.mode]; if (mn == null) { - throw vh.unsupported(); + throw handle.unsupported(); } return mn; } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java index de4e3c15537..0154bf39373 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java @@ -25,6 +25,8 @@ package java.lang.invoke; +import jdk.internal.misc.JavaLangInvokeAccess; +import jdk.internal.misc.SharedSecrets; import sun.invoke.util.BytecodeDescriptor; import sun.invoke.util.VerifyAccess; @@ -1143,15 +1145,25 @@ import java.util.Objects; } static { - // Allow privileged classes outside of java.lang - jdk.internal.misc.SharedSecrets.setJavaLangInvokeAccess(new jdk.internal.misc.JavaLangInvokeAccess() { + // StackFrameInfo stores Member and this provides the shared secrets + // for stack walker to access MemberName information. + SharedSecrets.setJavaLangInvokeAccess(new JavaLangInvokeAccess() { + @Override public Object newMemberName() { return new MemberName(); } + + @Override public String getName(Object mname) { MemberName memberName = (MemberName)mname; return memberName.getName(); } + + @Override + public boolean isNative(Object mname) { + MemberName memberName = (MemberName)mname; + return memberName.isNative(); + } }); } } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index 67c197dd709..b364a3e5ace 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -430,14 +430,14 @@ class MethodHandleNatives { // If not polymorphic in the return type, such as the compareAndSet // methods that return boolean - if (ak.isPolyMorphicInReturnType) { - if (ak.returnType != mtype.returnType()) { + if (ak.at.isMonomorphicInReturnType) { + if (ak.at.returnType != mtype.returnType()) { // The caller contains a different return type than that // defined by the method throw newNoSuchMethodErrorOnVarHandle(name, mtype); } // Adjust the return type of the signature method type - sigType = sigType.changeReturnType(ak.returnType); + sigType = sigType.changeReturnType(ak.at.returnType); } // Get the guard method type for linking @@ -455,26 +455,25 @@ class MethodHandleNatives { MemberName linker = new MemberName( VarHandleGuards.class, "guard_" + getVarHandleMethodSignature(sigType), guardType, REF_invokeStatic); - try { - return MemberName.getFactory().resolveOrFail( - REF_invokeStatic, linker, VarHandleGuards.class, ReflectiveOperationException.class); - } catch (ReflectiveOperationException ex) { - // Fall back to lambda form linkage if guard method is not available - // TODO Optionally log fallback ? + + linker = MemberName.getFactory().resolveOrNull(REF_invokeStatic, linker, + VarHandleGuards.class); + if (linker != null) { + return linker; } + // Fall back to lambda form linkage if guard method is not available + // TODO Optionally log fallback ? } return Invokers.varHandleInvokeLinkerMethod(name, mtype); } static String getVarHandleMethodSignature(MethodType mt) { - StringBuilder sb = new StringBuilder(mt.parameterCount() + 1); + StringBuilder sb = new StringBuilder(mt.parameterCount() + 2); for (int i = 0; i < mt.parameterCount(); i++) { Class pt = mt.parameterType(i); sb.append(getCharType(pt)); } - sb.append('_').append(getCharType(mt.returnType())); - return sb.toString(); } static char getCharType(Class pt) { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java index 4fbc1d84671..bfaba660776 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java @@ -53,7 +53,7 @@ import sun.security.action.GetPropertyAction; static final boolean VAR_HANDLE_GUARDS; static { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); DEBUG_METHOD_HANDLE_NAMES = Boolean.parseBoolean( props.getProperty("java.lang.invoke.MethodHandle.DEBUG_NAMES")); DUMP_CLASS_FILES = Boolean.parseBoolean( diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java index f302c75af79..0d965ed5a54 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java @@ -197,7 +197,7 @@ public final class StringConcatFactory { // DEBUG = false; // implied // DUMPER = null; // implied - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); final String strategy = props.getProperty("java.lang.invoke.stringConcat"); CACHE_ENABLE = Boolean.parseBoolean( diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VarForm.java b/jdk/src/java.base/share/classes/java/lang/invoke/VarForm.java index 54f9f8e3f18..0f8875809d8 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarForm.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarForm.java @@ -24,42 +24,102 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.Stable; import java.lang.invoke.VarHandle.AccessMode; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * A var handle form containing a set of member name, one for each operation. * Each member characterizes a static method. */ -class VarForm { +final class VarForm { - // Holds VarForm for VarHandle implementation classes - private static final ClassValue VFORMS - = new ClassValue<>() { - @Override - protected VarForm computeValue(Class impl) { - return new VarForm(linkFromStatic(impl)); + final @Stable MethodType[] methodType_table; + + final @Stable MemberName[] memberName_table; + + VarForm(Class implClass, Class receiver, Class value, Class... intermediate) { + this.methodType_table = new MethodType[VarHandle.AccessType.values().length]; + + // TODO lazily calculate + this.memberName_table = linkFromStatic(implClass); + + // (Receiver, ) + List> l = new ArrayList<>(); + if (receiver != null) + l.add(receiver); + l.addAll(Arrays.asList(intermediate)); + + // (Receiver, )Value + methodType_table[VarHandle.AccessType.GET.ordinal()] = + MethodType.methodType(value, l).erase(); + + // (Receiver, , Value)void + l.add(value); + methodType_table[VarHandle.AccessType.SET.ordinal()] = + MethodType.methodType(void.class, l).erase(); + + // (Receiver, , Value)Value + methodType_table[VarHandle.AccessType.GET_AND_UPDATE.ordinal()] = + MethodType.methodType(value, l).erase(); + + // (Receiver, , Value, Value)boolean + l.add(value); + methodType_table[VarHandle.AccessType.COMPARE_AND_SWAP.ordinal()] = + MethodType.methodType(boolean.class, l).erase(); + + // (Receiver, , Value, Value)Value + methodType_table[VarHandle.AccessType.COMPARE_AND_EXCHANGE.ordinal()] = + MethodType.methodType(value, l).erase(); + } + + @ForceInline + final MethodType getMethodType(int type) { + return methodType_table[type]; + } + + @ForceInline + final MemberName getMemberName(int mode) { + // TODO calculate lazily + MemberName mn = memberName_table[mode]; + if (mn == null) { + throw new UnsupportedOperationException(); } - }; - - final @Stable MemberName[] table; - - VarForm(MemberName[] table) { - this.table = table; + return mn; } - /** - * Creates a var form given an VarHandle implementation class. - * Each signature polymorphic method is linked to a static method of the - * same name on the implementation class or a super class. - */ - static VarForm createFromStatic(Class impl) { - return VFORMS.get(impl); + + @Stable + MethodType[] methodType_V_table; + + @ForceInline + final MethodType[] getMethodType_V_init() { + MethodType[] table = new MethodType[VarHandle.AccessType.values().length]; + for (int i = 0; i < methodType_table.length; i++) { + MethodType mt = methodType_table[i]; + // TODO only adjust for sig-poly methods returning Object + table[i] = mt.changeReturnType(void.class); + } + methodType_V_table = table; + return table; } + @ForceInline + final MethodType getMethodType_V(int type) { + MethodType[] table = methodType_V_table; + if (table == null) { + table = getMethodType_V_init(); + } + return table[type]; + } + + /** * Link all signature polymorphic methods. */ diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java index 4eb7f260a6c..78a75bf05cc 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java @@ -27,10 +27,9 @@ package java.lang.invoke; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.Stable; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -406,42 +405,10 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * @since 9 */ public abstract class VarHandle { - // Use explicit final fields rather than an @Stable array as - // this can reduce the memory per handle - // e.g. by 24 bytes on 64 bit architectures - final MethodType typeGet; - final MethodType typeSet; - final MethodType typeCompareSwap; - final MethodType typeCompareExchange; - final MethodType typeGetAndUpdate; - final VarForm vform; - VarHandle(VarForm vform, Class receiver, Class value, Class... intermediate) { + VarHandle(VarForm vform) { this.vform = vform; - - // (Receiver, ) - List> l = new ArrayList<>(); - if (receiver != null) - l.add(receiver); - l.addAll(Arrays.asList(intermediate)); - - // (Receiver, )Value - this.typeGet = MethodType.methodType(value, l); - - // (Receiver, , Value)void - l.add(value); - this.typeSet = MethodType.methodType(void.class, l); - - // (Receiver, , Value)Value - this.typeGetAndUpdate = MethodType.methodType(value, l); - - // (Receiver, , Value, Value)boolean - l.add(value); - this.typeCompareSwap = MethodType.methodType(boolean.class, l); - - // (Receiver, , Value, Value)Value - this.typeCompareExchange = MethodType.methodType(value, l); } RuntimeException unsupported() { @@ -1090,36 +1057,83 @@ public abstract class VarHandle { Object addAndGet(Object... args); enum AccessType { - GET, // 0 - SET, // 1 - COMPARE_AND_SWAP, // 2 - COMPARE_AND_EXCHANGE, // 3 - GET_AND_UPDATE; // 4 + GET(Object.class) { + @Override + MethodType accessModeType(Class receiver, Class value, + Class... intermediate) { + Class[] ps = allocateParameters(0, receiver, intermediate); + fillParameters(ps, receiver, intermediate); + return MethodType.methodType(value, ps); + } + }, + SET(void.class) { + @Override + MethodType accessModeType(Class receiver, Class value, + Class... intermediate) { + Class[] ps = allocateParameters(1, receiver, intermediate); + int i = fillParameters(ps, receiver, intermediate); + ps[i] = value; + return MethodType.methodType(void.class, ps); + } + }, + COMPARE_AND_SWAP(boolean.class) { + @Override + MethodType accessModeType(Class receiver, Class value, + Class... intermediate) { + Class[] ps = allocateParameters(2, receiver, intermediate); + int i = fillParameters(ps, receiver, intermediate); + ps[i++] = value; + ps[i] = value; + return MethodType.methodType(boolean.class, ps); + } + }, + COMPARE_AND_EXCHANGE(Object.class) { + @Override + MethodType accessModeType(Class receiver, Class value, + Class... intermediate) { + Class[] ps = allocateParameters(2, receiver, intermediate); + int i = fillParameters(ps, receiver, intermediate); + ps[i++] = value; + ps[i] = value; + return MethodType.methodType(value, ps); + } + }, + GET_AND_UPDATE(Object.class) { + @Override + MethodType accessModeType(Class receiver, Class value, + Class... intermediate) { + Class[] ps = allocateParameters(1, receiver, intermediate); + int i = fillParameters(ps, receiver, intermediate); + ps[i] = value; + return MethodType.methodType(value, ps); + } + }; - MethodType getMethodType(VarHandle vh) { - return getMethodType(this.ordinal(), vh); + final Class returnType; + final boolean isMonomorphicInReturnType; + + AccessType(Class returnType) { + this.returnType = returnType; + isMonomorphicInReturnType = returnType != Object.class; } - @ForceInline - static MethodType getMethodType(int ordinal, VarHandle vh) { - if (ordinal == 0) { - return vh.typeGet; - } - else if (ordinal == 1) { - return vh.typeSet; - } - else if (ordinal == 2) { - return vh.typeCompareSwap; - } - else if (ordinal == 3) { - return vh.typeCompareExchange; - } - else if (ordinal == 4) { - return vh.typeGetAndUpdate; - } - else { - throw new IllegalStateException("Illegal access type: " + ordinal); - } + abstract MethodType accessModeType(Class receiver, Class value, + Class... intermediate); + + private static Class[] allocateParameters(int values, + Class receiver, Class... intermediate) { + int size = ((receiver != null) ? 1 : 0) + intermediate.length + values; + return new Class[size]; + } + + private static int fillParameters(Class[] ps, + Class receiver, Class... intermediate) { + int i = 0; + if (receiver != null) + ps[i++] = receiver; + for (int j = 0; j < intermediate.length; j++) + ps[i++] = intermediate[j]; + return i; } } @@ -1133,115 +1147,115 @@ public abstract class VarHandle { * method * {@link VarHandle#get VarHandle.get} */ - GET("get", AccessType.GET, Object.class), + GET("get", AccessType.GET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#set VarHandle.set} */ - SET("set", AccessType.SET, void.class), + SET("set", AccessType.SET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#getVolatile VarHandle.getVolatile} */ - GET_VOLATILE("getVolatile", AccessType.GET, Object.class), + GET_VOLATILE("getVolatile", AccessType.GET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#setVolatile VarHandle.setVolatile} */ - SET_VOLATILE("setVolatile", AccessType.SET, void.class), + SET_VOLATILE("setVolatile", AccessType.SET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#getAcquire VarHandle.getAcquire} */ - GET_ACQUIRE("getAcquire", AccessType.GET, Object.class), + GET_ACQUIRE("getAcquire", AccessType.GET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#setRelease VarHandle.setRelease} */ - SET_RELEASE("setRelease", AccessType.SET, void.class), + SET_RELEASE("setRelease", AccessType.SET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#getOpaque VarHandle.getOpaque} */ - GET_OPAQUE("getOpaque", AccessType.GET, Object.class), + GET_OPAQUE("getOpaque", AccessType.GET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#setOpaque VarHandle.setOpaque} */ - SET_OPAQUE("setOpaque", AccessType.SET, void.class), + SET_OPAQUE("setOpaque", AccessType.SET), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#compareAndSet VarHandle.compareAndSet} */ - COMPARE_AND_SET("compareAndSet", AccessType.COMPARE_AND_SWAP, boolean.class), + COMPARE_AND_SET("compareAndSet", AccessType.COMPARE_AND_SWAP), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#compareAndExchangeVolatile VarHandle.compareAndExchangeVolatile} */ - COMPARE_AND_EXCHANGE_VOLATILE("compareAndExchangeVolatile", AccessType.COMPARE_AND_EXCHANGE, Object.class), + COMPARE_AND_EXCHANGE_VOLATILE("compareAndExchangeVolatile", AccessType.COMPARE_AND_EXCHANGE), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#compareAndExchangeAcquire VarHandle.compareAndExchangeAcquire} */ - COMPARE_AND_EXCHANGE_ACQUIRE("compareAndExchangeAcquire", AccessType.COMPARE_AND_EXCHANGE, Object.class), + COMPARE_AND_EXCHANGE_ACQUIRE("compareAndExchangeAcquire", AccessType.COMPARE_AND_EXCHANGE), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#compareAndExchangeRelease VarHandle.compareAndExchangeRelease} */ - COMPARE_AND_EXCHANGE_RELEASE("compareAndExchangeRelease", AccessType.COMPARE_AND_EXCHANGE, Object.class), + COMPARE_AND_EXCHANGE_RELEASE("compareAndExchangeRelease", AccessType.COMPARE_AND_EXCHANGE), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#weakCompareAndSet VarHandle.weakCompareAndSet} */ - WEAK_COMPARE_AND_SET("weakCompareAndSet", AccessType.COMPARE_AND_SWAP, boolean.class), + WEAK_COMPARE_AND_SET("weakCompareAndSet", AccessType.COMPARE_AND_SWAP), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#weakCompareAndSetVolatile VarHandle.weakCompareAndSetVolatile} */ - WEAK_COMPARE_AND_SET_VOLATILE("weakCompareAndSetVolatile", AccessType.COMPARE_AND_SWAP, boolean.class), + WEAK_COMPARE_AND_SET_VOLATILE("weakCompareAndSetVolatile", AccessType.COMPARE_AND_SWAP), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#weakCompareAndSetAcquire VarHandle.weakCompareAndSetAcquire} */ - WEAK_COMPARE_AND_SET_ACQUIRE("weakCompareAndSetAcquire", AccessType.COMPARE_AND_SWAP, boolean.class), + WEAK_COMPARE_AND_SET_ACQUIRE("weakCompareAndSetAcquire", AccessType.COMPARE_AND_SWAP), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#weakCompareAndSetRelease VarHandle.weakCompareAndSetRelease} */ - WEAK_COMPARE_AND_SET_RELEASE("weakCompareAndSetRelease", AccessType.COMPARE_AND_SWAP, boolean.class), + WEAK_COMPARE_AND_SET_RELEASE("weakCompareAndSetRelease", AccessType.COMPARE_AND_SWAP), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#getAndSet VarHandle.getAndSet} */ - GET_AND_SET("getAndSet", AccessType.GET_AND_UPDATE, Object.class), + GET_AND_SET("getAndSet", AccessType.GET_AND_UPDATE), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#getAndAdd VarHandle.getAndAdd} */ - GET_AND_ADD("getAndAdd", AccessType.GET_AND_UPDATE, Object.class), + GET_AND_ADD("getAndAdd", AccessType.GET_AND_UPDATE), /** * The access mode whose access is specified by the corresponding * method * {@link VarHandle#addAndGet VarHandle.addAndGet} */ - ADD_AND_GET("addAndGet", AccessType.GET_AND_UPDATE, Object.class), + ADD_AND_GET("addAndGet", AccessType.GET_AND_UPDATE), ; static final Map methodNameToAccessMode; @@ -1256,10 +1270,8 @@ public abstract class VarHandle { final String methodName; final AccessType at; - final boolean isPolyMorphicInReturnType; - final Class returnType; - AccessMode(final String methodName, AccessType at, Class returnType) { + AccessMode(final String methodName, AccessType at) { this.methodName = methodName; this.at = at; @@ -1267,10 +1279,7 @@ public abstract class VarHandle { assert methodName.equals(toMethodName(name())); // Assert that return type is correct // Otherwise, when disabled avoid using reflection - assert returnType == getReturnType(methodName); - - this.returnType = returnType; - isPolyMorphicInReturnType = returnType != Object.class; + assert at.returnType == getReturnType(methodName); } /** @@ -1324,17 +1333,21 @@ public abstract class VarHandle { @ForceInline static MemberName getMemberName(int ordinal, VarForm vform) { - return vform.table[ordinal]; + return vform.memberName_table[ordinal]; } } static final class AccessDescriptor { - final MethodType symbolicMethodType; + final MethodType symbolicMethodTypeErased; + final MethodType symbolicMethodTypeInvoker; + final Class returnType; final int type; final int mode; public AccessDescriptor(MethodType symbolicMethodType, int type, int mode) { - this.symbolicMethodType = symbolicMethodType; + this.symbolicMethodTypeErased = symbolicMethodType.erase(); + this.symbolicMethodTypeInvoker = symbolicMethodType.insertParameterTypes(0, VarHandle.class); + this.returnType = symbolicMethodType.returnType(); this.type = type; this.mode = mode; } @@ -1346,6 +1359,7 @@ public abstract class VarHandle { * @return the variable type of variables referenced by this VarHandle */ public final Class varType() { + MethodType typeSet = accessModeType(AccessMode.SET); return typeSet.parameterType(typeSet.parameterCount() - 1); } @@ -1356,6 +1370,7 @@ public abstract class VarHandle { * list is unmodifiable */ public final List> coordinateTypes() { + MethodType typeGet = accessModeType(AccessMode.GET); return typeGet.parameterList(); } @@ -1374,9 +1389,15 @@ public abstract class VarHandle { * @return the access mode type for the given access mode */ public final MethodType accessModeType(AccessMode accessMode) { - return accessMode.at.getMethodType(this); + TypesAndInvokers tis = getTypesAndInvokers(); + MethodType mt = tis.methodType_table[accessMode.at.ordinal()]; + if (mt == null) { + mt = tis.methodType_table[accessMode.at.ordinal()] = + accessModeTypeUncached(accessMode); + } + return mt; } - + abstract MethodType accessModeTypeUncached(AccessMode accessMode); /** * Returns {@code true} if the given access mode is supported, otherwise @@ -1417,9 +1438,8 @@ public abstract class VarHandle { public final MethodHandle toMethodHandle(AccessMode accessMode) { MemberName mn = AccessMode.getMemberName(accessMode.ordinal(), vform); if (mn != null) { - return DirectMethodHandle.make(mn). - bindTo(this). - asType(accessMode.at.getMethodType(this)); + MethodHandle mh = getMethodHandle(accessMode.ordinal()); + return mh.bindTo(this); } else { // Ensure an UnsupportedOperationException is thrown @@ -1428,6 +1448,51 @@ public abstract class VarHandle { } } + @Stable + TypesAndInvokers typesAndInvokers; + + static class TypesAndInvokers { + final @Stable + MethodType[] methodType_table = + new MethodType[VarHandle.AccessType.values().length]; + + final @Stable + MethodHandle[] methodHandle_table = + new MethodHandle[AccessMode.values().length]; + } + + @ForceInline + private final TypesAndInvokers getTypesAndInvokers() { + TypesAndInvokers tis = typesAndInvokers; + if (tis == null) { + tis = typesAndInvokers = new TypesAndInvokers(); + } + return tis; + } + + @ForceInline + final MethodHandle getMethodHandle(int mode) { + TypesAndInvokers tis = getTypesAndInvokers(); + MethodHandle mh = tis.methodHandle_table[mode]; + if (mh == null) { + mh = tis.methodHandle_table[mode] = getMethodHandleUncached(tis, mode); + } + return mh; + } + private final MethodHandle getMethodHandleUncached(TypesAndInvokers tis, int mode) { + MethodType mt = accessModeType(AccessMode.values()[mode]). + insertParameterTypes(0, VarHandle.class); + MemberName mn = vform.getMemberName(mode); + DirectMethodHandle dmh = DirectMethodHandle.make(mn); + // Such a method handle must not be publically exposed directly + // otherwise it can be cracked, it must be transformed or rebound + // before exposure + MethodHandle mh = dmh.copyWith(mt, dmh.form); + assert mh.type().erase() == mn.getMethodType().erase(); + return mh; + } + + /*non-public*/ final void updateVarForm(VarForm newVForm) { if (vform == newVForm) return; @@ -1453,6 +1518,10 @@ public abstract class VarHandle { catch (ReflectiveOperationException e) { throw newInternalError(e); } + + // The VarHandleGuards must be initialized to ensure correct + // compilation of the guard methods + UNSAFE.ensureClassInitialized(VarHandleGuards.class); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java index 983ea2e2080..085767076b6 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java @@ -29,1362 +29,1009 @@ import jdk.internal.vm.annotation.ForceInline; // This class is auto-generated by java.lang.invoke.VarHandles$GuardMethodGenerator. Do not edit. final class VarHandleGuards { - @ForceInline - final static MemberName getMemberName(VarHandle handle, VarHandle.AccessDescriptor ad) { - MemberName mn = VarHandle.AccessMode.getMemberName(ad.mode, handle.vform); - if (mn == null) { - throw handle.unsupported(); - } - return mn; - } - @ForceInline @LambdaForm.Compiled final static Object guard_L_L(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static void guard_LL_V(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static Object guard_LL_L(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LLL_Z(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static Object guard_LLL_L(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static int guard_L_I(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static void guard_LI_V(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static int guard_LI_I(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LII_Z(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static int guard_LII_I(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static long guard_L_J(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static void guard_LJ_V(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static long guard_LJ_J(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static long guard_LJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static float guard_L_F(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static void guard_LF_V(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static float guard_LF_F(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LFF_Z(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static float guard_LFF_F(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static double guard_L_D(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static void guard_LD_V(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static double guard_LD_D(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LDD_Z(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static double guard_LDD_D(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static Object guard__L(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle); } } @ForceInline @LambdaForm.Compiled final static void guard_L_V(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LL_Z(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static int guard__I(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle); } } @ForceInline @LambdaForm.Compiled final static void guard_I_V(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static int guard_I_I(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static boolean guard_II_Z(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static int guard_II_I(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static long guard__J(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle); } } @ForceInline @LambdaForm.Compiled final static void guard_J_V(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static long guard_J_J(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static boolean guard_JJ_Z(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static long guard_JJ_J(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static float guard__F(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle); } } @ForceInline @LambdaForm.Compiled final static void guard_F_V(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static float guard_F_F(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static boolean guard_FF_Z(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static float guard_FF_F(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static double guard__D(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle); } } @ForceInline @LambdaForm.Compiled final static void guard_D_V(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static double guard_D_D(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0); } } @ForceInline @LambdaForm.Compiled final static boolean guard_DD_Z(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static double guard_DD_D(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static Object guard_LI_L(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static void guard_LIL_V(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static Object guard_LIL_L(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LILL_Z(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static Object guard_LILL_L(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - return symbolic.returnType().cast(r); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); + return ad.returnType.cast(r); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static void guard_LII_V(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LIII_Z(VarHandle handle, Object arg0, int arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static int guard_LIII_I(VarHandle handle, Object arg0, int arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static long guard_LI_J(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static void guard_LIJ_V(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static long guard_LIJ_J(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LIJJ_Z(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static long guard_LIJJ_J(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static float guard_LI_F(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static void guard_LIF_V(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static float guard_LIF_F(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LIFF_Z(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static float guard_LIFF_F(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (float) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static double guard_LI_D(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static void guard_LID_V(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static double guard_LID_D(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LIDD_Z(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static double guard_LIDD_D(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (double) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static int guard_LJ_I(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1); } } @ForceInline @LambdaForm.Compiled final static void guard_LJI_V(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static int guard_LJI_I(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LJII_Z(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static int guard_LJII_I(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (int) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static void guard_LJJ_V(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } - else if (target.erase() == symbolic.erase()) { - MethodHandle.linkToStatic(handle, arg0, arg1, arg2, getMemberName(handle, ad)); + else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) { + MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - vh_invoker.invokeBasic(handle, arg0, arg1, arg2); + MethodHandle mh = handle.getMethodHandle(ad.mode); + mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2); } } @ForceInline @LambdaForm.Compiled final static boolean guard_LJJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (boolean) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } @ForceInline @LambdaForm.Compiled final static long guard_LJJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable { - MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle); - MethodType symbolic = ad.symbolicMethodType; - if (target == symbolic) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); - } - else if (target.erase() == symbolic.erase()) { - return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, getMemberName(handle, ad)); + if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) { + return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode)); } else { - MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic); - return (long) vh_invoker.invokeBasic(handle, arg0, arg1, arg2, arg3); + MethodHandle mh = handle.getMethodHandle(ad.mode); + return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3); } } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandles.java index 443710af502..f2f540b48bd 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandles.java @@ -280,28 +280,29 @@ final class VarHandles { // "@ForceInline\n" + // "@LambdaForm.Compiled\n" + // "final static throws Throwable {\n" + -// " MethodType target = VarHandle.AccessType.getMethodType(ad.type, handle);\n" + -// " MethodType symbolic = ad.symbolicMethodType;\n" + -// " if (target == symbolic) {\n" + -// " MethodHandle.linkToStatic();\n" + -// " }\n" + -// " else if (target.erase() == symbolic.erase()) {\n" + +// " if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodType) {\n" + // " MethodHandle.linkToStatic();\n" + // " }\n" + // " else {\n" + -// " MethodHandle vh_invoker = MethodHandles.varHandleInvoker(VarHandle.AccessMode.values()[ad.mode], symbolic);\n" + -// " vh_invoker.invokeBasic();\n" + +// " MethodHandle mh = handle.getMethodHandle(ad.mode);\n" + +// " mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic();\n" + // " }\n" + // "}"; // -// static final String GET_MEMBER_NAME_METHOD = +// static final String GUARD_METHOD_TEMPLATE_V = // "@ForceInline\n" + -// "final static MemberName getMemberName(VarHandle handle, VarHandle.AccessDescriptor ad) {\n" + -// " MemberName mn = VarHandle.AccessMode.getMemberName(ad.mode, handle.vform);\n" + -// " if (mn == null) {\n" + -// " throw handle.unsupported();\n" + +// "@LambdaForm.Compiled\n" + +// "final static throws Throwable {\n" + +// " if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodType) {\n" + +// " MethodHandle.linkToStatic();\n" + +// " }\n" + +// " else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodType) {\n" + +// " MethodHandle.linkToStatic();\n" + +// " }\n" + +// " else {\n" + +// " MethodHandle mh = handle.getMethodHandle(ad.mode);\n" + +// " mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic();\n" + // " }\n" + -// " return mn;\n" + // "}"; // // // A template for deriving the operations @@ -345,8 +346,6 @@ final class VarHandles { // System.out.println("final class VarHandleGuards {"); // // System.out.println(); -// System.out.println(GET_MEMBER_NAME_METHOD); -// System.out.println(); // // // Declare the stream of shapes // Stream hts = Stream.of( @@ -445,7 +444,10 @@ final class VarHandles { // // List LINK_TO_STATIC_ARGS = params.keySet().stream(). // collect(toList()); -// LINK_TO_STATIC_ARGS.add("getMemberName(handle, ad)"); +// LINK_TO_STATIC_ARGS.add("handle.vform.getMemberName(ad.mode)"); +// List LINK_TO_STATIC_ARGS_V = params.keySet().stream(). +// collect(toList()); +// LINK_TO_STATIC_ARGS_V.add("handle.vform.getMemberName_V(ad.mode)"); // // List LINK_TO_INVOKER_ARGS = params.keySet().stream(). // collect(toList()); @@ -464,9 +466,12 @@ final class VarHandles { // // String RETURN_ERASED = returnType != Object.class // ? "" -// : " return symbolic.returnType().cast(r);"; +// : " return ad.returnType.cast(r);"; // -// return GUARD_METHOD_TEMPLATE. +// String template = returnType == void.class +// ? GUARD_METHOD_TEMPLATE_V +// : GUARD_METHOD_TEMPLATE; +// return template. // replace("", METHOD). // replace("", NAME). // replaceAll("", RETURN). @@ -474,6 +479,8 @@ final class VarHandles { // replace("", RETURN_ERASED). // replaceAll("", LINK_TO_STATIC_ARGS.stream(). // collect(joining(", "))). +// replaceAll("", LINK_TO_STATIC_ARGS_V.stream(). +// collect(joining(", "))). // replace("", LINK_TO_INVOKER_ARGS.stream(). // collect(joining(", "))) // ; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template index 4a9d9e11e36..7a058afedec 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template +++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template @@ -41,12 +41,12 @@ final class VarHandle$Type$s { #end[Object] FieldInstanceReadOnly(Class receiverType, long fieldOffset{#if[Object]?, Class fieldType}) { - this(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadOnly.class); + this(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadOnly.FORM); } protected FieldInstanceReadOnly(Class receiverType, long fieldOffset{#if[Object]?, Class fieldType}, - Class handle) { - super(VarForm.createFromStatic(handle), receiverType, {#if[Object]?fieldType:$type$.class}); + VarForm form) { + super(form); this.fieldOffset = fieldOffset; this.receiverType = receiverType; #if[Object] @@ -54,6 +54,11 @@ final class VarHandle$Type$s { #end[Object] } + @Override + final MethodType accessModeTypeUncached(AccessMode accessMode) { + return accessMode.at.accessModeType(receiverType, {#if[Object]?fieldType:$type$.class}); + } + @ForceInline static $type$ get(FieldInstanceReadOnly handle, Object holder) { return UNSAFE.get$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), @@ -77,12 +82,14 @@ final class VarHandle$Type$s { return UNSAFE.get$Type$Acquire(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset); } + + static final VarForm FORM = new VarForm(FieldInstanceReadOnly.class, Object.class, $type$.class); } - static class FieldInstanceReadWrite extends FieldInstanceReadOnly { + static final class FieldInstanceReadWrite extends FieldInstanceReadOnly { FieldInstanceReadWrite(Class receiverType, long fieldOffset{#if[Object]?, Class fieldType}) { - super(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadWrite.class); + super(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadWrite.FORM); } @ForceInline @@ -202,6 +209,8 @@ final class VarHandle$Type$s { value) + value; } #end[AtomicAdd] + + static final VarForm FORM = new VarForm(FieldInstanceReadWrite.class, Object.class, $type$.class); } @@ -213,12 +222,12 @@ final class VarHandle$Type$s { #end[Object] FieldStaticReadOnly(Object base, long fieldOffset{#if[Object]?, Class fieldType}) { - this(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadOnly.class); + this(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadOnly.FORM); } protected FieldStaticReadOnly(Object base, long fieldOffset{#if[Object]?, Class fieldType}, - Class handle) { - super(VarForm.createFromStatic(handle), null, {#if[Object]?fieldType:$type$.class}); + VarForm form) { + super(form); this.base = base; this.fieldOffset = fieldOffset; #if[Object] @@ -226,6 +235,11 @@ final class VarHandle$Type$s { #end[Object] } + @Override + final MethodType accessModeTypeUncached(AccessMode accessMode) { + return accessMode.at.accessModeType(null, {#if[Object]?fieldType:$type$.class}); + } + @ForceInline static $type$ get(FieldStaticReadOnly handle) { return UNSAFE.get$Type$(handle.base, @@ -249,12 +263,14 @@ final class VarHandle$Type$s { return UNSAFE.get$Type$Acquire(handle.base, handle.fieldOffset); } + + static final VarForm FORM = new VarForm(FieldStaticReadOnly.class, null, $type$.class); } - static class FieldStaticReadWrite extends FieldStaticReadOnly { + static final class FieldStaticReadWrite extends FieldStaticReadOnly { FieldStaticReadWrite(Object base, long fieldOffset{#if[Object]?, Class fieldType}) { - super(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadWrite.class); + super(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadWrite.FORM); } @ForceInline @@ -375,6 +391,8 @@ final class VarHandle$Type$s { value) + value; } #end[AtomicAdd] + + static final VarForm FORM = new VarForm(FieldStaticReadWrite.class, null, $type$.class); } @@ -387,8 +405,7 @@ final class VarHandle$Type$s { #end[Object] Array(int abase, int ashift{#if[Object]?, Class arrayType}) { - super(VarForm.createFromStatic(Array.class), - {#if[Object]?arrayType:$type$[].class}, {#if[Object]?arrayType.getComponentType():$type$.class}, int.class); + super(Array.FORM); this.abase = abase; this.ashift = ashift; #if[Object] @@ -397,6 +414,11 @@ final class VarHandle$Type$s { #end[Object] } + @Override + final MethodType accessModeTypeUncached(AccessMode accessMode) { + return accessMode.at.accessModeType({#if[Object]?arrayType:$type$[].class}, {#if[Object]?arrayType.getComponentType():$type$.class}, int.class); + } + @ForceInline static $type$ get(Array handle, Object oarray, int index) { #if[Object] @@ -630,5 +652,7 @@ final class VarHandle$Type$s { value) + value; } #end[AtomicAdd] + + static final VarForm FORM = new VarForm(Array.class, {#if[Object]?Object[].class:$type$[].class}, {#if[Object]?Object.class:$type$.class}, int.class); } } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template index b5bf9cba232..8639e0d342e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template +++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template @@ -59,13 +59,11 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { #end[floatingPoint] - private static class ByteArrayViewVarHandle extends VarHandle { + private static abstract class ByteArrayViewVarHandle extends VarHandle { final boolean be; - ByteArrayViewVarHandle(Class implSubType, - Class arrayType, Class component, boolean be) { - super(VarForm.createFromStatic(implSubType), - arrayType, component, int.class); + ByteArrayViewVarHandle(VarForm form, boolean be) { + super(form); this.be = be; } } @@ -73,7 +71,12 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { static final class ArrayHandle extends ByteArrayViewVarHandle { ArrayHandle(boolean be) { - super(ArrayHandle.class, byte[].class, $type$.class, be); + super(ArrayHandle.FORM, be); + } + + @Override + final MethodType accessModeTypeUncached(AccessMode accessMode) { + return accessMode.at.accessModeType(byte[].class, $type$.class, int.class); } @ForceInline @@ -286,13 +289,20 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { convEndian(handle.be, value))) + value; } #end[AtomicAdd] + + static final VarForm FORM = new VarForm(ArrayHandle.class, byte[].class, $type$.class, int.class); } static final class ByteBufferHandle extends ByteArrayViewVarHandle { ByteBufferHandle(boolean be) { - super(ByteBufferHandle.class, ByteBuffer.class, $type$.class, be); + super(ByteBufferHandle.FORM, be); + } + + @Override + final MethodType accessModeTypeUncached(AccessMode accessMode) { + return accessMode.at.accessModeType(ByteBuffer.class, $type$.class, int.class); } @ForceInline @@ -513,5 +523,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { convEndian(handle.be, value))) + value; } #end[AtomicAdd] + + static final VarForm FORM = new VarForm(ByteBufferHandle.class, ByteBuffer.class, $type$.class, int.class); } } diff --git a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java index ae9a2313ff0..4b6ab934dcf 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java +++ b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java @@ -25,6 +25,7 @@ package java.lang.module; +import java.io.PrintStream; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -183,17 +184,20 @@ public final class Configuration { this.nameToModule = Collections.emptyMap(); } - private Configuration(Configuration parent, Resolver resolver) { - Map> graph = resolver.finish(this); + private Configuration(Configuration parent, + Resolver resolver, + boolean check) + { + Map> g = resolver.finish(this, check); Map nameToModule = new HashMap<>(); - for (ResolvedModule resolvedModule : graph.keySet()) { + for (ResolvedModule resolvedModule : g.keySet()) { nameToModule.put(resolvedModule.name(), resolvedModule); } this.parent = parent; - this.graph = graph; - this.modules = Collections.unmodifiableSet(graph.keySet()); + this.graph = g; + this.modules = Collections.unmodifiableSet(g.keySet()); this.nameToModule = Collections.unmodifiableMap(nameToModule); } @@ -283,10 +287,10 @@ public final class Configuration { Objects.requireNonNull(after); Objects.requireNonNull(roots); - Resolver resolver = new Resolver(before, this, after); + Resolver resolver = new Resolver(before, this, after, null); resolver.resolveRequires(roots); - return new Configuration(this, resolver); + return new Configuration(this, resolver, true); } @@ -340,10 +344,32 @@ public final class Configuration { Objects.requireNonNull(after); Objects.requireNonNull(roots); - Resolver resolver = new Resolver(before, this, after); + Resolver resolver = new Resolver(before, this, after, null); resolver.resolveRequires(roots).resolveUses(); - return new Configuration(this, resolver); + return new Configuration(this, resolver, true); + } + + + /** + * Resolves a collection of root modules, with service binding, and with + * the empty configuration as its parent. The post resolution checks + * are optionally run. + * + * This method is used to create the configuration for the boot layer. + */ + static Configuration resolveRequiresAndUses(ModuleFinder finder, + Collection roots, + boolean check, + PrintStream traceOutput) + { + Configuration parent = empty(); + + Resolver resolver + = new Resolver(finder, parent, ModuleFinder.empty(), traceOutput); + resolver.resolveRequires(roots).resolveUses(); + + return new Configuration(parent, resolver, check); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java index 495f371422f..7c14e386d53 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java @@ -27,13 +27,17 @@ package java.lang.module; import java.io.InputStream; import java.io.IOException; +import java.io.PrintStream; import java.io.UncheckedIOException; +import java.net.URI; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -45,7 +49,7 @@ import static jdk.internal.module.Checks.*; import static java.util.Objects.*; import jdk.internal.module.Checks; -import jdk.internal.module.Hasher.DependencyHashes; +import jdk.internal.module.ModuleHashes; /** @@ -372,8 +376,9 @@ public class ModuleDescriptor private Provides(String service, Set providers, boolean check) { this.service = check ? requireServiceTypeName(service) : service; - providers = check ? Collections.unmodifiableSet(new HashSet<>(providers)) - : Collections.unmodifiableSet(providers); + providers = check + ? Collections.unmodifiableSet(new LinkedHashSet<>(providers)) + : Collections.unmodifiableSet(providers); if (providers.isEmpty()) throw new IllegalArgumentException("Empty providers set"); if (check) @@ -787,7 +792,7 @@ public class ModuleDescriptor private final String osVersion; private final Set conceals; private final Set packages; - private final DependencyHashes hashes; + private final ModuleHashes hashes; private ModuleDescriptor(String name, boolean automatic, @@ -802,7 +807,7 @@ public class ModuleDescriptor String osArch, String osVersion, Set conceals, - DependencyHashes hashes) + ModuleHashes hashes) { this.name = name; @@ -878,7 +883,8 @@ public class ModuleDescriptor String osArch, String osVersion, Set conceals, - Set packages) { + Set packages, + ModuleHashes hashes) { this.name = name; this.automatic = automatic; this.synthetic = synthetic; @@ -894,7 +900,7 @@ public class ModuleDescriptor this.osName = osName; this.osArch = osArch; this.osVersion = osVersion; - this.hashes = null; + this.hashes = hashes; } /** @@ -1063,9 +1069,9 @@ public class ModuleDescriptor } /** - * Returns the object with the hashes of the dependences. + * Returns the object with the hashes of other modules */ - Optional hashes() { + Optional hashes() { return Optional.ofNullable(hashes); } @@ -1103,7 +1109,7 @@ public class ModuleDescriptor String osArch; String osVersion; String mainClass; - DependencyHashes hashes; + ModuleHashes hashes; /** * Initializes a new builder with the given module name. @@ -1580,7 +1586,7 @@ public class ModuleDescriptor return this; } - /* package */ Builder hashes(DependencyHashes hashes) { + /* package */ Builder hashes(ModuleHashes hashes) { this.hashes = hashes; return this; } @@ -1719,7 +1725,9 @@ public class ModuleDescriptor hc = hc * 43 + Objects.hashCode(osVersion); hc = hc * 43 + Objects.hashCode(conceals); hc = hc * 43 + Objects.hashCode(hashes); - if (hc != 0) hash = hc; + if (hc == 0) + hc = -1; + hash = hc; } return hc; } @@ -1925,11 +1933,12 @@ public class ModuleDescriptor static { /** - * Setup the shared secret to allow code in other packages create - * ModuleDescriptor and associated objects directly. + * Setup the shared secret to allow code in other packages access + * private package methods in java.lang.module. */ jdk.internal.misc.SharedSecrets .setJavaLangModuleAccess(new jdk.internal.misc.JavaLangModuleAccess() { + @Override public Requires newRequires(Set ms, String mn) { return new Requires(ms, mn, false); @@ -1974,7 +1983,8 @@ public class ModuleDescriptor String osArch, String osVersion, Set conceals, - Set packages) { + Set packages, + ModuleHashes hashes) { return new ModuleDescriptor(name, automatic, synthetic, @@ -1988,7 +1998,29 @@ public class ModuleDescriptor osArch, osVersion, conceals, - packages); + packages, + hashes); + } + + @Override + public Configuration resolveRequiresAndUses(ModuleFinder finder, + Collection roots, + boolean check, + PrintStream traceOutput) + { + return Configuration.resolveRequiresAndUses(finder, roots, check, traceOutput); + } + + @Override + public ModuleReference newPatchedModule(ModuleDescriptor descriptor, + URI location, + Supplier s) { + return new ModuleReference(descriptor, location, s, true, null); + } + + @Override + public Optional hashes(ModuleDescriptor descriptor) { + return descriptor.hashes(); } }); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleInfo.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleInfo.java index f9e0bfac224..efc8c37b8a2 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleInfo.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleInfo.java @@ -37,11 +37,12 @@ import java.nio.BufferUnderflowException; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import java.util.function.Supplier; -import jdk.internal.module.Hasher.DependencyHashes; +import jdk.internal.module.ModuleHashes; import static jdk.internal.module.ClassFileConstants.*; @@ -337,7 +338,7 @@ final class ModuleInfo { // computeIfAbsent Set providers = pm.get(sn); if (providers == null) { - providers = new HashSet<>(); + providers = new LinkedHashSet<>(); // preserve order pm.put(sn, providers); } providers.add(cn); @@ -425,7 +426,7 @@ final class ModuleInfo { map.put(dn, hash); } - builder.hashes(new DependencyHashes(algorithm, map)); + builder.hashes(new ModuleHashes(algorithm, map)); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModulePath.java b/jdk/src/java.base/share/classes/java/lang/module/ModulePath.java index fbd1b471381..250de159d74 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModulePath.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModulePath.java @@ -40,7 +40,7 @@ import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -52,7 +52,6 @@ import java.util.jar.Manifest; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -190,18 +189,16 @@ class ModulePath implements ConfigurableModuleFinder { } } - if (attrs.isRegularFile() || attrs.isDirectory()) { - // packaged or exploded module - ModuleReference mref = readModule(entry, attrs); - if (mref != null) { - String name = mref.descriptor().name(); - return Collections.singletonMap(name, mref); - } + // packaged or exploded module + ModuleReference mref = readModule(entry, attrs); + if (mref != null) { + String name = mref.descriptor().name(); + return Collections.singletonMap(name, mref); + } else { + // skipped + return Collections.emptyMap(); } - // not recognized - throw new FindException("Unrecognized module: " + entry); - } catch (IOException ioe) { throw new FindException(ioe); } @@ -238,16 +235,13 @@ class ModulePath implements ConfigurableModuleFinder { // module found if (mref != null) { - // can have at most one version of a module in the directory String name = mref.descriptor().name(); if (nameToReference.put(name, mref) != null) { throw new FindException("Two versions of module " - + name + " found in " + dir); + + name + " found in " + dir); } - } - } } @@ -257,28 +251,40 @@ class ModulePath implements ConfigurableModuleFinder { /** * Locates a packaged or exploded module, returning a {@code ModuleReference} - * to the module. Returns {@code null} if the module is not recognized - * as a packaged or exploded module. + * to the module. Returns {@code null} if the entry is skipped because it is + * to a directory that does not contain a module-info.class or it's a hidden + * file. * * @throws IOException if an I/O error occurs - * @throws FindException if an error occurs parsing the module descriptor + * @throws FindException if the file is not recognized as a module or an + * error occurs parsing its module descriptor */ private ModuleReference readModule(Path entry, BasicFileAttributes attrs) throws IOException { try { - ModuleReference mref = null; if (attrs.isDirectory()) { - mref = readExplodedModule(entry); - } if (attrs.isRegularFile()) { - if (entry.toString().endsWith(".jar")) { - mref = readJar(entry); - } else if (isLinkPhase && entry.toString().endsWith(".jmod")) { - mref = readJMod(entry); + return readExplodedModule(entry); // may return null + } + + String fn = entry.getFileName().toString(); + if (attrs.isRegularFile()) { + if (fn.endsWith(".jar")) { + return readJar(entry); + } else if (fn.endsWith(".jmod")) { + if (isLinkPhase) + return readJMod(entry); + throw new FindException("JMOD files not supported: " + entry); } } - return mref; + + // skip hidden files + if (fn.startsWith(".") || Files.isHidden(entry)) { + return null; + } else { + throw new FindException("Unrecognized module: " + entry); + } } catch (InvalidModuleDescriptorException e) { throw new FindException("Error reading module: " + entry, e); @@ -292,15 +298,17 @@ class ModulePath implements ConfigurableModuleFinder { return zf.stream() .filter(e -> e.getName().startsWith("classes/") && e.getName().endsWith(".class")) - .map(e -> toPackageName(e)) + .map(e -> toPackageName(e.getName().substring(8))) .filter(pkg -> pkg.length() > 0) // module-info - .distinct() .collect(Collectors.toSet()); } /** * Returns a {@code ModuleReference} to a module in jmod file on the * file system. + * + * @throws IOException + * @throws InvalidModuleDescriptorException */ private ModuleReference readJMod(Path file) throws IOException { try (ZipFile zf = new ZipFile(file.toString())) { @@ -419,13 +427,12 @@ class ModulePath implements ConfigurableModuleFinder { // scan the entries in the JAR file to locate the .class and service // configuration file - Stream stream = jf.stream() - .map(e -> e.getName()) - .filter(e -> (e.endsWith(".class") || e.startsWith(SERVICES_PREFIX))) - .distinct(); - Map> map - = stream.collect(Collectors.partitioningBy(s -> s.endsWith(".class"), - Collectors.toSet())); + Map> map = + jf.stream() + .map(JarEntry::getName) + .filter(s -> (s.endsWith(".class") ^ s.startsWith(SERVICES_PREFIX))) + .collect(Collectors.partitioningBy(s -> s.endsWith(".class"), + Collectors.toSet())); Set classFiles = map.get(Boolean.TRUE); Set configFiles = map.get(Boolean.FALSE); @@ -433,19 +440,18 @@ class ModulePath implements ConfigurableModuleFinder { classFiles.stream() .map(c -> toPackageName(c)) .distinct() - .forEach(p -> builder.exports(p)); + .forEach(builder::exports); // map names of service configuration files to service names Set serviceNames = configFiles.stream() .map(this::toServiceName) - .filter(Optional::isPresent) - .map(Optional::get) + .flatMap(Optional::stream) .collect(Collectors.toSet()); // parse each service configuration file for (String sn : serviceNames) { JarEntry entry = jf.getJarEntry(SERVICES_PREFIX + sn); - Set providerClasses = new HashSet<>(); + Set providerClasses = new LinkedHashSet<>(); try (InputStream in = jf.getInputStream(entry)) { BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); @@ -475,19 +481,25 @@ class ModulePath implements ConfigurableModuleFinder { private Set jarPackages(JarFile jf) { return jf.stream() .filter(e -> e.getName().endsWith(".class")) - .map(e -> toPackageName(e)) + .map(e -> toPackageName(e.getName())) .filter(pkg -> pkg.length() > 0) // module-info - .distinct() .collect(Collectors.toSet()); } /** * Returns a {@code ModuleReference} to a module in modular JAR file on * the file system. + * + * @throws IOException + * @throws FindException + * @throws InvalidModuleDescriptorException */ private ModuleReference readJar(Path file) throws IOException { - try (JarFile jf = new JarFile(file.toString())) { - + try (JarFile jf = new JarFile(file.toFile(), + true, // verify + ZipFile.OPEN_READ, + JarFile.Release.RUNTIME)) + { ModuleDescriptor md; JarEntry entry = jf.getJarEntry(MODULE_INFO); if (entry == null) { @@ -520,7 +532,6 @@ class ModulePath implements ConfigurableModuleFinder { path.toString().endsWith(".class"))) .map(path -> toPackageName(dir.relativize(path))) .filter(pkg -> pkg.length() > 0) // module-info - .distinct() .collect(Collectors.toSet()); } catch (IOException x) { throw new UncheckedIOException(x); @@ -530,6 +541,9 @@ class ModulePath implements ConfigurableModuleFinder { /** * Returns a {@code ModuleReference} to an exploded module on the file * system or {@code null} if {@code module-info.class} not found. + * + * @throws IOException + * @throws InvalidModuleDescriptorException */ private ModuleReference readExplodedModule(Path dir) throws IOException { Path mi = dir.resolve(MODULE_INFO); @@ -559,19 +573,6 @@ class ModulePath implements ConfigurableModuleFinder { } } - private String toPackageName(ZipEntry entry) { - String name = entry.getName(); - assert name.endsWith(".class"); - // jmod classes in classes/, jar in / - int start = name.startsWith("classes/") ? 8 : 0; - int index = name.lastIndexOf("/"); - if (index > start) { - return name.substring(start, index).replace('/', '.'); - } else { - return ""; - } - } - private String toPackageName(Path path) { String name = path.toString(); assert name.endsWith(".class"); diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java index 140886d8626..1b77bfd8618 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java @@ -142,10 +142,11 @@ public interface ModuleReader extends Closeable { * @see ClassLoader#defineClass(String, ByteBuffer, java.security.ProtectionDomain) */ default Optional read(String name) throws IOException { - Optional in = open(name); - if (in.isPresent()) { - byte[] bytes = in.get().readAllBytes(); - return Optional.of(ByteBuffer.wrap(bytes)); + Optional oin = open(name); + if (oin.isPresent()) { + try (InputStream in = oin.get()) { + return Optional.of(ByteBuffer.wrap(in.readAllBytes())); + } } else { return Optional.empty(); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java index 781e7d3d088..10cce789949 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -32,7 +32,7 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Supplier; -import jdk.internal.module.Hasher.HashSupplier; +import jdk.internal.module.ModuleHashes.HashSupplier; /** @@ -54,12 +54,33 @@ public final class ModuleReference { private final URI location; private final Supplier readerSupplier; + // true if this is a reference to a patched module + private boolean patched; + // the function that computes the hash of this module reference private final HashSupplier hasher; // cached hash string to avoid needing to compute it many times private String cachedHash; + + /** + * Constructs a new instance of this class. + */ + ModuleReference(ModuleDescriptor descriptor, + URI location, + Supplier readerSupplier, + boolean patched, + HashSupplier hasher) + + { + this.descriptor = Objects.requireNonNull(descriptor); + this.location = location; + this.readerSupplier = Objects.requireNonNull(readerSupplier); + this.patched = patched; + this.hasher = hasher; + } + /** * Constructs a new instance of this class. */ @@ -67,11 +88,9 @@ public final class ModuleReference { URI location, Supplier readerSupplier, HashSupplier hasher) + { - this.descriptor = Objects.requireNonNull(descriptor); - this.location = location; - this.readerSupplier = Objects.requireNonNull(readerSupplier); - this.hasher = hasher; + this(descriptor, location, readerSupplier, false, hasher); } @@ -96,10 +115,9 @@ public final class ModuleReference { URI location, Supplier readerSupplier) { - this(descriptor, location, readerSupplier, null); + this(descriptor, location, readerSupplier, false, null); } - /** * Returns the module descriptor. * @@ -150,6 +168,20 @@ public final class ModuleReference { } + /** + * Returns {@code true} if this module has been patched via -Xpatch. + */ + boolean isPatched() { + return patched; + } + + /** + * Returns the hash supplier for this module. + */ + HashSupplier hasher() { + return hasher; + } + /** * Computes the hash of this module, returning it as a hex string. * Returns {@code null} if the hash cannot be computed. @@ -166,8 +198,6 @@ public final class ModuleReference { return result; } - private int hash; - /** * Computes a hash code for this module reference. * @@ -181,12 +211,17 @@ public final class ModuleReference { public int hashCode() { int hc = hash; if (hc == 0) { - hc = Objects.hash(descriptor, location, readerSupplier, hasher); - if (hc != 0) hash = hc; + hc = Objects.hash(descriptor, location, readerSupplier, hasher, + Boolean.valueOf(patched)); + if (hc == 0) + hc = -1; + hash = hc; } return hc; } + private int hash; + /** * Tests this module reference for equality with the given object. * @@ -214,7 +249,8 @@ public final class ModuleReference { return Objects.equals(this.descriptor, that.descriptor) && Objects.equals(this.location, that.location) && Objects.equals(this.readerSupplier, that.readerSupplier) - && Objects.equals(this.hasher, that.hasher); + && Objects.equals(this.hasher, that.hasher) + && this.patched == that.patched; } /** diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java index 05448e25b33..6b0b5d46fe9 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java @@ -48,8 +48,8 @@ import java.util.zip.ZipFile; import jdk.internal.misc.JavaLangAccess; import jdk.internal.misc.SharedSecrets; -import jdk.internal.module.Hasher; -import jdk.internal.module.Hasher.HashSupplier; +import jdk.internal.module.ModuleHashes; +import jdk.internal.module.ModuleHashes.HashSupplier; import jdk.internal.module.ModulePatcher; import sun.net.www.ParseUtil; @@ -89,7 +89,7 @@ class ModuleReferences { static ModuleReference newJarModule(ModuleDescriptor md, Path file) { URI uri = file.toUri(); Supplier supplier = () -> new JarModuleReader(file, uri); - HashSupplier hasher = (algorithm) -> Hasher.generate(file, algorithm); + HashSupplier hasher = (a) -> ModuleHashes.computeHashAsString(file, a); return newModule(md, uri, supplier, hasher); } @@ -99,7 +99,7 @@ class ModuleReferences { static ModuleReference newJModModule(ModuleDescriptor md, Path file) { URI uri = file.toUri(); Supplier supplier = () -> new JModModuleReader(file, uri); - HashSupplier hasher = (algorithm) -> Hasher.generate(file, algorithm); + HashSupplier hasher = (a) -> ModuleHashes.computeHashAsString(file, a); return newModule(md, file.toUri(), supplier, hasher); } @@ -122,7 +122,7 @@ class ModuleReferences { private final ReadWriteLock lock = new ReentrantReadWriteLock(); private final Lock readLock = lock.readLock(); private final Lock writeLock = lock.writeLock(); - private volatile boolean closed; + private boolean closed; SafeCloseModuleReader() { } @@ -198,7 +198,10 @@ class ModuleReferences { static JarFile newJarFile(Path path) { try { - return new JarFile(path.toFile()); + return new JarFile(path.toFile(), + true, // verify + ZipFile.OPEN_READ, + JarFile.Release.RUNTIME); } catch (IOException ioe) { throw new UncheckedIOException(ioe); } @@ -219,6 +222,8 @@ class ModuleReferences { if (je != null) { String encodedPath = ParseUtil.encodePath(name, false); String uris = "jar:" + uri + "!/" + encodedPath; + if (jf.isMultiRelease()) + uris += "#runtime"; return Optional.of(URI.create(uris)); } else { return Optional.empty(); diff --git a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java index 37eb0b1bc77..cefcf19af70 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java +++ b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java @@ -25,8 +25,8 @@ package java.lang.module; +import java.io.PrintStream; import java.lang.module.ModuleDescriptor.Requires.Modifier; -import java.lang.reflect.Layer; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; @@ -43,7 +43,7 @@ import java.util.Set; import java.util.StringJoiner; import java.util.stream.Collectors; -import jdk.internal.module.Hasher; +import jdk.internal.module.ModuleHashes; /** * The resolver used by {@link Configuration#resolveRequires} and @@ -55,6 +55,7 @@ final class Resolver { private final ModuleFinder beforeFinder; private final Configuration parent; private final ModuleFinder afterFinder; + private final PrintStream traceOutput; // maps module name to module reference private final Map nameToReference = new HashMap<>(); @@ -62,10 +63,12 @@ final class Resolver { Resolver(ModuleFinder beforeFinder, Configuration parent, - ModuleFinder afterFinder) { + ModuleFinder afterFinder, + PrintStream traceOutput) { this.beforeFinder = beforeFinder; this.parent = parent; this.afterFinder = afterFinder; + this.traceOutput = traceOutput; } @@ -76,8 +79,6 @@ final class Resolver { */ Resolver resolveRequires(Collection roots) { - long start = trace_start("Resolve"); - // create the visit stack to get us started Deque q = new ArrayDeque<>(); for (String root : roots) { @@ -95,10 +96,9 @@ final class Resolver { } } - if (TRACE) { + if (isTracing()) { trace("Root module %s located", root); - if (mref.location().isPresent()) - trace(" (%s)", mref.location().get()); + mref.location().ifPresent(uri -> trace(" (%s)", uri)); } assert mref.descriptor().name().equals(root); @@ -108,13 +108,6 @@ final class Resolver { resolve(q); - if (TRACE) { - long duration = System.currentTimeMillis() - start; - Set names = nameToReference.keySet(); - trace("Resolver completed in %s ms", duration); - names.stream().sorted().forEach(name -> trace(" %s", name)); - } - return this; } @@ -153,11 +146,10 @@ final class Resolver { q.offer(mref.descriptor()); resolved.add(mref.descriptor()); - if (TRACE) { + if (isTracing()) { trace("Module %s located, required by %s", dn, descriptor.name()); - if (mref.location().isPresent()) - trace(" (%s)", mref.location().get()); + mref.location().ifPresent(uri -> trace(" (%s)", uri)); } } @@ -175,8 +167,6 @@ final class Resolver { */ Resolver resolveUses() { - long start = trace_start("Bind"); - // Scan the finders for all available service provider modules. As // java.base uses services then then module finders will be scanned // anyway. @@ -230,10 +220,10 @@ final class Resolver { String pn = provider.name(); if (!nameToReference.containsKey(pn)) { - - if (TRACE && mref.location().isPresent()) - trace(" (%s)", mref.location().get()); - + if (isTracing()) { + mref.location() + .ifPresent(uri -> trace(" (%s)", uri)); + } nameToReference.put(pn, mref); q.push(provider); } @@ -248,14 +238,6 @@ final class Resolver { } while (!candidateConsumers.isEmpty()); - - if (TRACE) { - long duration = System.currentTimeMillis() - start; - Set names = nameToReference.keySet(); - trace("Bind completed in %s ms", duration); - names.stream().sorted().forEach(name -> trace(" %s", name)); - } - return this; } @@ -264,23 +246,33 @@ final class Resolver { * Execute post-resolution checks and returns the module graph of resolved * modules as {@code Map}. The resolved modules will be in the given * configuration. + * + * @param check {@true} to execute the post resolution checks */ - Map> finish(Configuration cf) { + Map> finish(Configuration cf, + boolean check) + { + if (isTracing()) { + trace("Result:"); + Set names = nameToReference.keySet(); + names.stream().sorted().forEach(name -> trace(" %s", name)); + } - detectCycles(); - - checkPlatformConstraints(); - - checkHashes(); + if (check) { + detectCycles(); + checkPlatformConstraints(); + checkHashes(); + } Map> graph = makeGraph(cf); - checkExportSuppliers(graph); + if (check) { + checkExportSuppliers(graph); + } return graph; } - /** * Checks the given module graph for cycles. * @@ -420,52 +412,44 @@ final class Resolver { } - /** * Checks the hashes in the module descriptor to ensure that they match - * the hash of the dependency's module reference. + * any recorded hashes. */ private void checkHashes() { - for (ModuleReference mref : nameToReference.values()) { ModuleDescriptor descriptor = mref.descriptor(); - // get map of module names to hash - Optional ohashes = descriptor.hashes(); + // get map of module hashes + Optional ohashes = descriptor.hashes(); if (!ohashes.isPresent()) continue; - Hasher.DependencyHashes hashes = ohashes.get(); - - // check dependences - for (ModuleDescriptor.Requires d : descriptor.requires()) { - String dn = d.name(); - String recordedHash = hashes.hashFor(dn); - - if (recordedHash != null) { - - ModuleReference other = nameToReference.get(dn); - if (other == null) { - other = parent.findModule(dn) - .map(ResolvedModule::reference) - .orElse(null); - } - if (other == null) - throw new InternalError(dn + " not found"); - - String actualHash = other.computeHash(hashes.algorithm()); - if (actualHash == null) - fail("Unable to compute the hash of module %s", dn); - - if (!recordedHash.equals(actualHash)) { - fail("Hash of %s (%s) differs to expected hash (%s)", - dn, actualHash, recordedHash); - } + ModuleHashes hashes = ohashes.get(); + String algorithm = hashes.algorithm(); + for (String dn : hashes.names()) { + ModuleReference other = nameToReference.get(dn); + if (other == null) { + other = parent.findModule(dn) + .map(ResolvedModule::reference) + .orElse(null); } + // skip checking the hash if the module has been patched + if (other != null && !other.isPatched()) { + String recordedHash = hashes.hashFor(dn); + String actualHash = other.computeHash(algorithm); + if (actualHash == null) + fail("Unable to compute the hash of module %s", dn); + if (!recordedHash.equals(actualHash)) { + fail("Hash of %s (%s) differs to expected hash (%s)" + + " recorded in %s", dn, actualHash, recordedHash, + descriptor.name()); + } + } } - } + } } @@ -666,7 +650,7 @@ final class Resolver { // source is exported to descriptor2 String source = export.source(); ModuleDescriptor other - = packageToExporter.put(source, descriptor2); + = packageToExporter.put(source, descriptor2); if (other != null && other != descriptor2) { // package might be local to descriptor1 @@ -690,33 +674,38 @@ final class Resolver { } } - // uses S - for (String service : descriptor1.uses()) { - String pn = packageName(service); - if (!packageToExporter.containsKey(pn)) { - fail("Module %s does not read a module that exports %s", - descriptor1.name(), pn); - } - } + // uses/provides checks not applicable to automatic modules + if (!descriptor1.isAutomatic()) { - // provides S - for (Map.Entry entry : - descriptor1.provides().entrySet()) { - String service = entry.getKey(); - ModuleDescriptor.Provides provides = entry.getValue(); - - String pn = packageName(service); - if (!packageToExporter.containsKey(pn)) { - fail("Module %s does not read a module that exports %s", - descriptor1.name(), pn); - } - - for (String provider : provides.providers()) { - if (!packages.contains(packageName(provider))) { - fail("Provider %s not in module %s", - provider, descriptor1.name()); + // uses S + for (String service : descriptor1.uses()) { + String pn = packageName(service); + if (!packageToExporter.containsKey(pn)) { + fail("Module %s does not read a module that exports %s", + descriptor1.name(), pn); } } + + // provides S + for (Map.Entry entry : + descriptor1.provides().entrySet()) { + String service = entry.getKey(); + ModuleDescriptor.Provides provides = entry.getValue(); + + String pn = packageName(service); + if (!packageToExporter.containsKey(pn)) { + fail("Module %s does not read a module that exports %s", + descriptor1.name(), pn); + } + + for (String provider : provides.providers()) { + if (!packages.contains(packageName(provider))) { + fail("Provider %s not in module %s", + provider, descriptor1.name()); + } + } + } + } } @@ -796,27 +785,18 @@ final class Resolver { throw new ResolutionException(msg); } - /** - * Tracing support, limited to boot layer for now. + * Tracing support */ - private final static boolean TRACE - = Boolean.getBoolean("jdk.launcher.traceResolver") - && (Layer.boot() == null); - - private String op; - - private long trace_start(String op) { - this.op = op; - return System.currentTimeMillis(); + private boolean isTracing() { + return traceOutput != null; } private void trace(String fmt, Object ... args) { - if (TRACE) { - System.out.print("[" + op + "] "); - System.out.format(fmt, args); - System.out.println(); + if (traceOutput != null) { + traceOutput.format("[Resolver] " + fmt, args); + traceOutput.println(); } } diff --git a/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java b/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java index 67766f9ed5b..d14ee8d60e4 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java +++ b/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java @@ -44,6 +44,7 @@ import java.util.function.Supplier; import jdk.internal.jimage.ImageLocation; import jdk.internal.jimage.ImageReader; import jdk.internal.jimage.ImageReaderFactory; +import jdk.internal.module.ModuleHashes; import jdk.internal.module.SystemModules; import jdk.internal.module.ModulePatcher; import jdk.internal.perf.PerfCounter; @@ -101,13 +102,16 @@ class SystemModuleFinder implements ModuleFinder { for (int i = 0; i < n; i++) { String mn = moduleNames[i]; ModuleDescriptor md; + String hash; if (fastLoad) { md = descriptors[i]; + hash = SystemModules.MODULES_TO_HASH[i]; } else { // fallback to read module-info.class // if fast loading of ModuleDescriptors is disabled ImageLocation location = imageReader.findLocation(mn, "module-info.class"); md = ModuleDescriptor.read(imageReader.getResourceBuffer(location)); + hash = null; } if (!md.name().equals(mn)) throw new InternalError(); @@ -123,7 +127,8 @@ class SystemModuleFinder implements ModuleFinder { } }; - ModuleReference mref = new ModuleReference(md, uri, readerSupplier); + ModuleReference mref = + new ModuleReference(md, uri, readerSupplier, hashSupplier(hash)); // may need a reference to a patched module if -Xpatch specified mref = ModulePatcher.interposeIfNeeded(mref); @@ -142,6 +147,18 @@ class SystemModuleFinder implements ModuleFinder { initTime.addElapsedTimeFrom(t0); } + private static ModuleHashes.HashSupplier hashSupplier(String hash) { + if (hash == null) + return null; + + return new ModuleHashes.HashSupplier() { + @Override + public String generate(String algorithm) { + return hash; + } + }; + } + SystemModuleFinder() { } @Override diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java b/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java index 3dde9710e8a..0ca75a874c4 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java @@ -27,6 +27,7 @@ package java.lang.reflect; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleDescriptor.Provides; import java.lang.module.ResolvedModule; import java.util.Collections; import java.util.HashMap; @@ -41,6 +42,8 @@ import java.util.stream.Collectors; import jdk.internal.loader.Loader; import jdk.internal.loader.LoaderPool; import jdk.internal.misc.SharedSecrets; +import jdk.internal.module.ServicesCatalog; +import jdk.internal.module.ServicesCatalog.ServiceProvider; import sun.security.util.SecurityConstants; @@ -549,4 +552,55 @@ public final class Layer { public static Layer boot() { return SharedSecrets.getJavaLangAccess().getBootLayer(); } + + + /** + * Returns the ServicesCatalog for this Layer, creating it if not + * already created. + */ + ServicesCatalog getServicesCatalog() { + ServicesCatalog servicesCatalog = this.servicesCatalog; + if (servicesCatalog != null) + return servicesCatalog; + + Map> map = new HashMap<>(); + for (Module m : nameToModule.values()) { + ModuleDescriptor descriptor = m.getDescriptor(); + for (Provides provides : descriptor.provides().values()) { + String service = provides.service(); + Set providers + = map.computeIfAbsent(service, k -> new HashSet<>()); + for (String pn : provides.providers()) { + providers.add(new ServiceProvider(m, pn)); + } + } + } + + ServicesCatalog catalog = new ServicesCatalog() { + @Override + public void register(Module module) { + throw new UnsupportedOperationException(); + } + @Override + public Set findServices(String service) { + Set providers = map.get(service); + if (providers == null) { + return Collections.emptySet(); + } else { + return Collections.unmodifiableSet(providers); + } + } + }; + + synchronized (this) { + servicesCatalog = this.servicesCatalog; + if (servicesCatalog == null) { + this.servicesCatalog = servicesCatalog = catalog; + } + } + + return servicesCatalog; + } + + private volatile ServicesCatalog servicesCatalog; } diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java b/jdk/src/java.base/share/classes/java/lang/reflect/Module.java index 5de7394a406..59eb856f8fb 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Module.java @@ -43,11 +43,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.WeakHashMap; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.function.Function; import java.util.stream.Stream; @@ -142,9 +138,6 @@ public final class Module { this.name = null; this.loader = loader; this.descriptor = null; - - // unnamed modules are loose - this.loose = true; } @@ -245,17 +238,27 @@ public final class Module { } - // -- readability -- + // -- - // true if this module reads all unnamed modules (a.k.a. loose module) - private volatile boolean loose; + // the special Module to mean reads or exported to "all unnamed modules" + private static final Module ALL_UNNAMED_MODULE = new Module(null); + + // special Module to mean exported to "everyone" + private static final Module EVERYONE_MODULE = new Module(null); + + // exported to all modules + private static final Set EVERYONE = Collections.singleton(EVERYONE_MODULE); + + + // -- readability -- // the modules that this module permanently reads // (will be final when the modules are defined in reverse topology order) private volatile Set reads; - // created lazily, additional modules that this module reflectively reads - private volatile WeakSet transientReads; + // additional module (2nd key) that some module (1st key) reflectively reads + private static final WeakPairMap transientReads + = new WeakPairMap<>(); /** @@ -284,22 +287,19 @@ public final class Module { // check if this module reads other if (other.isNamed()) { - Set reads = this.reads; // volatile read if (reads != null && reads.contains(other)) return true; - - } else { - - // loose modules read all unnamed modules - if (this.loose) - return true; - } // check if this module reads the other module reflectively - WeakSet tr = this.transientReads; // volatile read - if (tr != null && tr.contains(other)) + if (transientReads.containsKeyPair(this, other)) + return true; + + // if other is an unnamed module then check if this module reads + // all unnamed modules + if (!other.isNamed() + && transientReads.containsKeyPair(this, ALL_UNNAMED_MODULE)) return true; return false; @@ -346,8 +346,7 @@ public final class Module { } /** - * Makes the given {@code Module} readable to this module without - * notifying the VM. + * Updates this module to read another module without notifying the VM. * * @apiNote This method is for VM white-box testing. */ @@ -361,40 +360,28 @@ public final class Module { * If {@code syncVM} is {@code true} then the VM is notified. */ private void implAddReads(Module other, boolean syncVM) { + Objects.requireNonNull(other); // nothing to do if (other == this || !this.isNamed()) return; - // if the other is null then change this module to be loose. - if (other == null) { - if (syncVM) - addReads0(this, null); - this.loose = true; - return; - } - // check if we already read this module Set reads = this.reads; if (reads != null && reads.contains(other)) return; // update VM first, just in case it fails - if (syncVM) - addReads0(this, other); - - // add reflective read - WeakSet tr = this.transientReads; - if (tr == null) { - synchronized (this) { - tr = this.transientReads; - if (tr == null) { - tr = new WeakSet<>(); - this.transientReads = tr; - } + if (syncVM) { + if (other == ALL_UNNAMED_MODULE) { + addReads0(this, null); + } else { + addReads0(this, other); } } - tr.add(other); + + // add reflective read + transientReads.putIfAbsent(this, other, Boolean.TRUE); } @@ -404,15 +391,10 @@ public final class Module { // (will be final when the modules are defined in reverse topology order) private volatile Map> exports; - // created lazily, additional exports added at run-time - private volatile Map> transientExports; - - // the special Module to mean exported to all modules - private static final Module EVERYONE_MODULE = new Module(null); - private static final Set EVERYONE = Collections.singleton(EVERYONE_MODULE); - - // the special Module to mean exported to all unnamed modules - private static final Module ALL_UNNAMED_MODULE = new Module(null); + // additional exports added at run-time + // this module (1st key), other module (2nd key), exported packages (value) + private static final WeakPairMap> + transientExports = new WeakPairMap<>(); /** @@ -489,23 +471,9 @@ public final class Module { if (exports != null) { Set targets = exports.get(pn); - if (targets != null) { - - // exported to all modules - if (targets.contains(EVERYONE_MODULE)) - return true; - - if (other != EVERYONE_MODULE) { - // exported to other - if (targets.contains(other)) - return true; - - // other is an unnamed module && exported to all unnamed - if (!other.isNamed() && targets.contains(ALL_UNNAMED_MODULE)) - return true; - } - - } + if ((targets != null) + && (targets.contains(other) || targets.contains(EVERYONE_MODULE))) + return true; } return false; } @@ -515,29 +483,27 @@ public final class Module { * package package to the given module. */ private boolean isExportedReflectively(String pn, Module other) { - Map> te = this.transientExports; - if (te != null) { - WeakSet targets = te.get(pn); + // exported to all modules + Map exports = transientExports.get(this, EVERYONE_MODULE); + if (exports != null && exports.containsKey(pn)) + return true; - if (targets != null) { + if (other != EVERYONE_MODULE) { - // exported to all modules - if (targets.contains(EVERYONE_MODULE)) + // exported to other + exports = transientExports.get(this, other); + if (exports != null && exports.containsKey(pn)) + return true; + + // other is an unnamed module && exported to all unnamed + if (!other.isNamed()) { + exports = transientExports.get(this, ALL_UNNAMED_MODULE); + if (exports != null && exports.containsKey(pn)) return true; - - if (other != EVERYONE_MODULE) { - - // exported to other - if (targets.contains(other)) - return true; - - // other is an unnamed module && exported to all unnamed - if (!other.isNamed() && targets.contains(ALL_UNNAMED_MODULE)) - return true; - } } } + return false; } @@ -638,34 +604,19 @@ public final class Module { } } - // create transientExports if needed - Map> te = this.transientExports; // read - if (te == null) { - synchronized (this) { - te = this.transientExports; - if (te == null) { - te = new ConcurrentHashMap<>(); - this.transientExports = te; // volatile write - } - } - } - // add package name to transientExports if absent - WeakSet s = te.get(pn); - if (s == null) { - s = new WeakSet<>(); - WeakSet prev = te.putIfAbsent(pn, s); - if (prev != null) - s = prev; - } - s.add(other); + transientExports + .computeIfAbsent(this, other, + (_this, _other) -> new ConcurrentHashMap<>()) + .putIfAbsent(pn, Boolean.TRUE); } // -- services -- - // created lazily, additional service types that this module uses - private volatile WeakSet> transientUses; + // additional service type (2nd key) that some module (1st key) uses + private static final WeakPairMap, Boolean> transientUses + = new WeakPairMap<>(); /** * If the caller's module is this module then update this module to add a @@ -702,17 +653,7 @@ public final class Module { } if (!canUse(st)) { - WeakSet> uses = this.transientUses; - if (uses == null) { - synchronized (this) { - uses = this.transientUses; - if (uses == null) { - uses = new WeakSet<>(); - this.transientUses = uses; - } - } - } - uses.add(st); + transientUses.putIfAbsent(this, st, Boolean.TRUE); } } @@ -746,11 +687,7 @@ public final class Module { return true; // uses added via addUses - WeakSet> uses = this.transientUses; - if (uses != null && uses.contains(st)) - return true; - - return false; + return transientUses.containsKeyPair(this, st); } @@ -885,7 +822,7 @@ public final class Module { // -- creating Module objects -- /** - * Find the runtime Module corresponding to the given ReadDependence + * Find the runtime Module corresponding to the given ResolvedModule * in the given parent Layer (or its parents). */ private static Module find(ResolvedModule resolvedModule, Layer layer) { @@ -969,7 +906,7 @@ public final class Module { // automatic modules reads all unnamed modules if (descriptor.isAutomatic()) { - m.implAddReads(null, true); + m.implAddReads(ALL_UNNAMED_MODULE, true); } // exports @@ -1097,7 +1034,7 @@ public final class Module { * the representation is the string {@code "module"}, followed by a space, * and then the module name. For an unnamed module, the representation is * the string {@code "unnamed module"}, followed by a space, and then an - * implementation specific identifier for the unnamed module. + * implementation specific string that identifies the unnamed module. * * @return The string representation of this module */ @@ -1112,46 +1049,6 @@ public final class Module { } - // -- supporting classes -- - - - /** - * A "not-a-Set" set of weakly referenced objects that supports concurrent - * access. - */ - private static class WeakSet { - private final ReadWriteLock lock = new ReentrantReadWriteLock(); - private final Lock readLock = lock.readLock(); - private final Lock writeLock = lock.writeLock(); - - private final WeakHashMap map = new WeakHashMap<>(); - - /** - * Adds the specified element to the set. - */ - void add(E e) { - writeLock.lock(); - try { - map.put(e, Boolean.TRUE); - } finally { - writeLock.unlock(); - } - } - - /** - * Returns {@code true} if this set contains the specified element. - */ - boolean contains(E e) { - readLock.lock(); - try { - return map.containsKey(e); - } finally { - readLock.unlock(); - } - } - } - - // -- native methods -- // JVM_DefineModule @@ -1196,8 +1093,12 @@ public final class Module { m1.implAddReads(m2, true); } @Override + public void addReadsAllUnnamed(Module m) { + m.implAddReads(Module.ALL_UNNAMED_MODULE); + } + @Override public void addExports(Module m, String pn, Module other) { - m.implAddExports(pn, Objects.requireNonNull(other), true); + m.implAddExports(pn, other, true); } @Override public void addExportsToAll(Module m, String pn) { @@ -1211,6 +1112,10 @@ public final class Module { public void addPackage(Module m, String pn) { m.implAddPackage(pn, true); } + @Override + public ServicesCatalog getServicesCatalog(Layer layer) { + return layer.getServicesCatalog(); + } }); } } diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java index 8802abeda76..450930fb929 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java @@ -582,7 +582,7 @@ public class Proxy implements java.io.Serializable { } private static final String DEBUG = - GetPropertyAction.getProperty("jdk.proxy.debug", ""); + GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", ""); private static boolean isDebug() { return !DEBUG.isEmpty(); diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java b/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java new file mode 100644 index 00000000000..39a623a4704 --- /dev/null +++ b/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java @@ -0,0 +1,354 @@ +/* + * Copyright (c) 2016, 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.lang.reflect; + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import java.util.Collection; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.BiFunction; + +/** + * A WeakHashMap-like data structure that uses a pair of weakly-referenced keys + * with identity equality semantics to associate a strongly-referenced value. + * Unlike WeakHashMap, this data structure is thread-safe. + * + * @param the type of 1st key in key pair + * @param the type of 2nd key in key pair + * @param the type of value + * @author Peter Levart + */ +final class WeakPairMap { + + private final ConcurrentHashMap, V> map = new ConcurrentHashMap<>(); + private final ReferenceQueue queue = new ReferenceQueue<>(); + + /** + * Tests if the specified pair of keys are associated with a value + * in the WeakPairMap. + * + * @param k1 the 1st of the pair of keys + * @param k2 the 2nd of the pair of keys + * @return true if and only if the specified key pair is in this WeakPairMap, + * as determined by the identity comparison; false otherwise + * @throws NullPointerException if any of the specified keys is null + */ + public boolean containsKeyPair(K1 k1, K2 k2) { + expungeStaleAssociations(); + return map.containsKey(Pair.lookup(k1, k2)); + } + + /** + * Returns the value to which the specified pair of keys is mapped, or null + * if this WeakPairMap contains no mapping for the key pair. + *

More formally, if this WeakPairMap contains a mapping from a key pair + * {@code (_k1, _k2)} to a value {@code v} such that + * {@code k1 == _k1 && k2 == _k2}, then this method returns {@code v}; + * otherwise it returns {@code null}. + * (There can be at most one such mapping.) + * + * @param k1 the 1st of the pair of keys for which the mapped value is to + * be returned + * @param k2 the 2nd of the pair of keys for which the mapped value is to + * be returned + * @return the value to which the specified key pair is mapped, or null if + * this map contains no mapping for the key pair + * @throws NullPointerException if any of the specified keys is null + */ + public V get(K1 k1, K2 k2) { + expungeStaleAssociations(); + return map.get(Pair.lookup(k1, k2)); + } + + /** + * Maps the specified key pair to the specified value in this WeakPairMap. + * Neither the keys nor the value can be null. + *

The value can be retrieved by calling the {@link #get} method + * with the the same keys (compared by identity). + * + * @param k1 the 1st of the pair of keys with which the specified value is to + * be associated + * @param k2 the 2nd of the pair of keys with which the specified value is to + * be associated + * @param v value to be associated with the specified key pair + * @return the previous value associated with key pair, or {@code null} if + * there was no mapping for key pair + * @throws NullPointerException if any of the specified keys or value is null + */ + public V put(K1 k1, K2 k2, V v) { + expungeStaleAssociations(); + return map.put(Pair.weak(k1, k2, queue), v); + } + + /** + * If the specified key pair is not already associated with a value, + * associates it with the given value and returns {@code null}, else does + * nothing and returns the currently associated value. + * + * @param k1 the 1st of the pair of keys with which the specified value is to + * be associated + * @param k2 the 2nd of the pair of keys with which the specified value is to + * be associated + * @param v value to be associated with the specified key pair + * @return the previous value associated with key pair, or {@code null} if + * there was no mapping for key pair + * @throws NullPointerException if any of the specified keys or value is null + */ + public V putIfAbsent(K1 k1, K2 k2, V v) { + expungeStaleAssociations(); + return map.putIfAbsent(Pair.weak(k1, k2, queue), v); + } + + /** + * If the specified key pair is not already associated with a value, + * attempts to compute its value using the given mapping function + * and enters it into this WeakPairMap unless {@code null}. The entire + * method invocation is performed atomically, so the function is + * applied at most once per key pair. Some attempted update operations + * on this WeakPairMap by other threads may be blocked while computation + * is in progress, so the computation should be short and simple, + * and must not attempt to update any other mappings of this WeakPairMap. + * + * @param k1 the 1st of the pair of keys with which the + * computed value is to be associated + * @param k2 the 2nd of the pair of keys with which the + * computed value is to be associated + * @param mappingFunction the function to compute a value + * @return the current (existing or computed) value associated with + * the specified key pair, or null if the computed value is null + * @throws NullPointerException if any of the specified keys or + * mappingFunction is null + * @throws IllegalStateException if the computation detectably + * attempts a recursive update to this map + * that would otherwise never complete + * @throws RuntimeException or Error if the mappingFunction does so, in + * which case the mapping is left unestablished + */ + public V computeIfAbsent(K1 k1, K2 k2, + BiFunction + mappingFunction) { + expungeStaleAssociations(); + try { + return map.computeIfAbsent( + Pair.weak(k1, k2, queue), + pair -> mappingFunction.apply(pair.first(), pair.second())); + } finally { + Reference.reachabilityFence(k1); + Reference.reachabilityFence(k2); + } + } + + /** + * Returns a {@link Collection} view of the values contained in this + * WeakPairMap. The collection is backed by the WeakPairMap, so changes to + * the map are reflected in the collection, and vice-versa. The collection + * supports element removal, which removes the corresponding + * mapping from this map, via the {@code Iterator.remove}, + * {@code Collection.remove}, {@code removeAll}, + * {@code retainAll}, and {@code clear} operations. It does not + * support the {@code add} or {@code addAll} operations. + * + * @return the collection view + */ + public Collection values() { + expungeStaleAssociations(); + return map.values(); + } + + /** + * Removes associations from this WeakPairMap for which at least one of the + * keys in key pair has been found weakly-reachable and corresponding + * WeakRefPeer(s) enqueued. Called as part of each public operation. + */ + private void expungeStaleAssociations() { + WeakRefPeer peer; + while ((peer = (WeakRefPeer) queue.poll()) != null) { + map.remove(peer.weakPair()); + } + } + + /** + * Common interface of both {@link Weak} and {@link Lookup} key pairs. + */ + private interface Pair { + + static Pair weak(K1 k1, K2 k2, + ReferenceQueue queue) { + return new Weak<>(k1, k2, queue); + } + + static Pair lookup(K1 k1, K2 k2) { + return new Lookup<>(k1, k2); + } + + /** + * @return The 1st of the pair of keys (may be null for {@link Weak} + * when it gets cleared) + */ + K1 first(); + + /** + * @return The 2nd of the pair of keys (may be null for {@link Weak} + * when it gets cleared) + */ + K2 second(); + + static int hashCode(Object first, Object second) { + // assert first != null && second != null; + return System.identityHashCode(first) ^ + System.identityHashCode(second); + } + + static boolean equals(Object first, Object second, Pair p) { + return first != null && second != null && + first == p.first() && second == p.second(); + } + + /** + * A Pair where both keys are weakly-referenced. + * It is composed of two instances of {@link WeakRefPeer}s: + *
{@code
+         *
+         *     +-referent-> [K1]                +-referent-> [K2]
+         *     |                                |
+         *   +----------------+               +----------------+
+         *   | Pair.Weak <:   |-----peer----->| (anonymous) <: |
+         *   | WeakRefPeer,   |               | WeakRefPeer    |
+         *   | Pair           |<--weakPair()--|                |
+         *   +----------------+               +----------------+
+         *     |            ^
+         *     |            |
+         *     +-weakPair()-+
+         *
+         * }
+ *

+ * Pair.Weak is used for CHM keys. Both peers are associated with the + * same {@link ReferenceQueue} so when either of their referents + * becomes weakly-reachable, the corresponding entries can be + * {@link #expungeStaleAssociations() expunged} from the map. + */ + final class Weak extends WeakRefPeer implements Pair { + + // saved hash so it can be retrieved after the reference is cleared + private final int hash; + // link to peer + private final WeakRefPeer peer; + + Weak(K1 k1, K2 k2, ReferenceQueue queue) { + super(k1, queue); + hash = Pair.hashCode(k1, k2); + peer = new WeakRefPeer<>(k2, queue) { + // link back to peer + @Override + Weak weakPair() { return Weak.this; } + }; + } + + @Override + Weak weakPair() { + return this; + } + + @Override + public K1 first() { + return get(); + } + + @Override + public K2 second() { + return peer.get(); + } + + @Override + public int hashCode() { + return hash; + } + + @Override + public boolean equals(Object obj) { + return this == obj || + (obj instanceof Pair && + Pair.equals(first(), second(), (Pair) obj)); + } + } + + /** + * Optimized lookup Pair, used as lookup key in methods like + * {@link java.util.Map#get(Object)} or + * {@link java.util.Map#containsKey(Object)}) where + * there is a great chance its allocation is eliminated + * by escape analysis when such lookups are inlined by JIT. + * All its methods are purposely designed so that 'this' is never + * passed to any other method or used as identity. + */ + final class Lookup implements Pair { + private final K1 k1; + private final K2 k2; + + Lookup(K1 k1, K2 k2) { + this.k1 = Objects.requireNonNull(k1); + this.k2 = Objects.requireNonNull(k2); + } + + @Override + public K1 first() { + return k1; + } + + @Override + public K2 second() { + return k2; + } + + @Override + public int hashCode() { + return Pair.hashCode(k1, k2); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof Pair && + Pair.equals(k1, k2, (Pair) obj); + } + } + } + + /** + * Common abstract supertype of a pair of WeakReference peers. + */ + private static abstract class WeakRefPeer extends WeakReference { + + WeakRefPeer(K k, ReferenceQueue queue) { + super(Objects.requireNonNull(k), queue); + } + + /** + * @return the {@link Pair.Weak} side of the pair of peers. + */ + abstract Pair.Weak weakPair(); + } +} diff --git a/jdk/src/java.base/share/classes/java/math/BigDecimal.java b/jdk/src/java.base/share/classes/java/math/BigDecimal.java index 5c93cc291e9..557c5cc2e35 100644 --- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java +++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java @@ -1536,7 +1536,7 @@ public class BigDecimal extends Number implements Comparable { * be performed to generate a result with the specified scale, the * specified rounding mode is applied. * - *

The new {@link #divide(BigDecimal, int, RoundingMode)} method + * @deprecated The method {@link #divide(BigDecimal, int, RoundingMode)} * should be used in preference to this legacy method. * * @param divisor value by which this {@code BigDecimal} is to be divided. @@ -1558,6 +1558,7 @@ public class BigDecimal extends Number implements Comparable { * @see #ROUND_HALF_EVEN * @see #ROUND_UNNECESSARY */ + @Deprecated(since="9") public BigDecimal divide(BigDecimal divisor, int scale, int roundingMode) { if (roundingMode < ROUND_UP || roundingMode > ROUND_UNNECESSARY) throw new IllegalArgumentException("Invalid rounding mode"); @@ -1602,7 +1603,7 @@ public class BigDecimal extends Number implements Comparable { * rounding must be performed to generate a result with the given * scale, the specified rounding mode is applied. * - *

The new {@link #divide(BigDecimal, RoundingMode)} method + * @deprecated The method {@link #divide(BigDecimal, RoundingMode)} * should be used in preference to this legacy method. * * @param divisor value by which this {@code BigDecimal} is to be divided. @@ -1623,6 +1624,7 @@ public class BigDecimal extends Number implements Comparable { * @see #ROUND_HALF_EVEN * @see #ROUND_UNNECESSARY */ + @Deprecated(since="9") public BigDecimal divide(BigDecimal divisor, int roundingMode) { return this.divide(divisor, scale, roundingMode); } @@ -2267,14 +2269,20 @@ public class BigDecimal extends Number implements Comparable { * Rounding mode to round away from zero. Always increments the * digit prior to a nonzero discarded fraction. Note that this rounding * mode never decreases the magnitude of the calculated value. + * + * @deprecated Use {@link RoundingMode#UP} instead. */ + @Deprecated(since="9") public static final int ROUND_UP = 0; /** * Rounding mode to round towards zero. Never increments the digit * prior to a discarded fraction (i.e., truncates). Note that this * rounding mode never increases the magnitude of the calculated value. + * + * @deprecated Use {@link RoundingMode#DOWN} instead. */ + @Deprecated(since="9") public static final int ROUND_DOWN = 1; /** @@ -2283,7 +2291,10 @@ public class BigDecimal extends Number implements Comparable { * {@code ROUND_UP}; if negative, behaves as for * {@code ROUND_DOWN}. Note that this rounding mode never * decreases the calculated value. + * + * @deprecated Use {@link RoundingMode#CEILING} instead. */ + @Deprecated(since="9") public static final int ROUND_CEILING = 2; /** @@ -2292,7 +2303,10 @@ public class BigDecimal extends Number implements Comparable { * {@code ROUND_DOWN}; if negative, behave as for * {@code ROUND_UP}. Note that this rounding mode never * increases the calculated value. + * + * @deprecated Use {@link RoundingMode#FLOOR} instead. */ + @Deprecated(since="9") public static final int ROUND_FLOOR = 3; /** @@ -2302,7 +2316,10 @@ public class BigDecimal extends Number implements Comparable { * ≥ 0.5; otherwise, behaves as for {@code ROUND_DOWN}. Note * that this is the rounding mode that most of us were taught in * grade school. + * + * @deprecated Use {@link RoundingMode#HALF_UP} instead. */ + @Deprecated(since="9") public static final int ROUND_HALF_UP = 4; /** @@ -2311,7 +2328,10 @@ public class BigDecimal extends Number implements Comparable { * down. Behaves as for {@code ROUND_UP} if the discarded * fraction is {@literal >} 0.5; otherwise, behaves as for * {@code ROUND_DOWN}. + * + * @deprecated Use {@link RoundingMode#HALF_DOWN} instead. */ + @Deprecated(since="9") public static final int ROUND_HALF_DOWN = 5; /** @@ -2323,7 +2343,10 @@ public class BigDecimal extends Number implements Comparable { * {@code ROUND_HALF_DOWN} if it's even. Note that this is the * rounding mode that minimizes cumulative error when applied * repeatedly over a sequence of calculations. + * + * @deprecated Use {@link RoundingMode#HALF_EVEN} instead. */ + @Deprecated(since="9") public static final int ROUND_HALF_EVEN = 6; /** @@ -2331,7 +2354,10 @@ public class BigDecimal extends Number implements Comparable { * result, hence no rounding is necessary. If this rounding mode is * specified on an operation that yields an inexact result, an * {@code ArithmeticException} is thrown. + * + * @deprecated Use {@link RoundingMode#UNNECESSARY} instead. */ + @Deprecated(since="9") public static final int ROUND_UNNECESSARY = 7; @@ -2408,7 +2434,7 @@ public class BigDecimal extends Number implements Comparable { * Instead, {@code setScale} returns an object with the proper * scale; the returned object may or may not be newly allocated. * - *

The new {@link #setScale(int, RoundingMode)} method should + * @deprecated The method {@link #setScale(int, RoundingMode)} should * be used in preference to this legacy method. * * @param newScale scale of the {@code BigDecimal} value to be returned. @@ -2431,6 +2457,7 @@ public class BigDecimal extends Number implements Comparable { * @see #ROUND_HALF_EVEN * @see #ROUND_UNNECESSARY */ + @Deprecated(since="9") public BigDecimal setScale(int newScale, int roundingMode) { if (roundingMode < ROUND_UP || roundingMode > ROUND_UNNECESSARY) throw new IllegalArgumentException("Invalid rounding mode"); diff --git a/jdk/src/java.base/share/classes/java/math/RoundingMode.java b/jdk/src/java.base/share/classes/java/math/RoundingMode.java index 3a4fe97f4ab..a4a1c1aa460 100644 --- a/jdk/src/java.base/share/classes/java/math/RoundingMode.java +++ b/jdk/src/java.base/share/classes/java/math/RoundingMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -90,6 +90,7 @@ package java.math; * @author Joseph D. Darcy * @since 1.5 */ +@SuppressWarnings("deprecation") // Legacy rounding mode constants in BigDecimal public enum RoundingMode { /** diff --git a/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java b/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java index debc60f74b9..a295d862ada 100644 --- a/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java +++ b/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java @@ -52,7 +52,8 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl protected InetAddress connectedAddress = null; private int connectedPort = -1; - private static final String os = GetPropertyAction.getProperty("os.name"); + private static final String os = + GetPropertyAction.privilegedGetProperty("os.name"); /** * flag set if the native connect() call not to be used diff --git a/jdk/src/java.base/share/classes/java/net/InetAddress.java b/jdk/src/java.base/share/classes/java/net/InetAddress.java index e79c5115413..e45b590200a 100644 --- a/jdk/src/java.base/share/classes/java/net/InetAddress.java +++ b/jdk/src/java.base/share/classes/java/net/InetAddress.java @@ -1124,7 +1124,7 @@ class InetAddress implements java.io.Serializable { private static NameService createNameService() { String hostsFileName = - GetPropertyAction.getProperty("jdk.net.hosts.file"); + GetPropertyAction.privilegedGetProperty("jdk.net.hosts.file"); NameService theNameService; if (hostsFileName != null) { theNameService = new HostsFileNameService(hostsFileName); @@ -1643,9 +1643,11 @@ class InetAddress implements java.io.Serializable { * property can vary across implementations of the java. * classes. The default is an empty String "". */ - String prefix = GetPropertyAction.getProperty("impl.prefix", ""); + String prefix = GetPropertyAction.privilegedGetProperty("impl.prefix", ""); try { - impl = Class.forName("java.net." + prefix + implName).newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName("java.net." + prefix + implName).newInstance(); + impl = tmp; } catch (ClassNotFoundException e) { System.err.println("Class not found: java.net." + prefix + implName + ":\ncheck impl.prefix property " + @@ -1662,7 +1664,9 @@ class InetAddress implements java.io.Serializable { if (impl == null) { try { - impl = Class.forName(implName).newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(implName).newInstance(); + impl = tmp; } catch (Exception e) { throw new Error("System property impl.prefix incorrect"); } diff --git a/jdk/src/java.base/share/classes/java/net/ProxySelector.java b/jdk/src/java.base/share/classes/java/net/ProxySelector.java index 04c675cedc8..9b293379b59 100644 --- a/jdk/src/java.base/share/classes/java/net/ProxySelector.java +++ b/jdk/src/java.base/share/classes/java/net/ProxySelector.java @@ -71,7 +71,9 @@ public abstract class ProxySelector { try { Class c = Class.forName("sun.net.spi.DefaultProxySelector"); if (c != null && ProxySelector.class.isAssignableFrom(c)) { - theProxySelector = (ProxySelector) c.newInstance(); + @SuppressWarnings("deprecation") + ProxySelector tmp = (ProxySelector) c.newInstance(); + theProxySelector = tmp; } } catch (Exception e) { theProxySelector = null; diff --git a/jdk/src/java.base/share/classes/java/net/SocksSocketImpl.java b/jdk/src/java.base/share/classes/java/net/SocksSocketImpl.java index c3a0d1c675a..f8ea9ce6c16 100644 --- a/jdk/src/java.base/share/classes/java/net/SocksSocketImpl.java +++ b/jdk/src/java.base/share/classes/java/net/SocksSocketImpl.java @@ -178,7 +178,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { userName = pw.getUserName(); password = new String(pw.getPassword()); } else { - userName = GetPropertyAction.getProperty("user.name"); + userName = GetPropertyAction.privilegedGetProperty("user.name"); } if (userName == null) return false; @@ -1088,7 +1088,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { userName = System.getProperty("user.name"); } catch (SecurityException se) { /* swallow Exception */ } } else { - userName = GetPropertyAction.getProperty("user.name"); + userName = GetPropertyAction.privilegedGetProperty("user.name"); } return userName; } diff --git a/jdk/src/java.base/share/classes/java/net/URL.java b/jdk/src/java.base/share/classes/java/net/URL.java index 099e8b9e0c8..f071d3ad695 100644 --- a/jdk/src/java.base/share/classes/java/net/URL.java +++ b/jdk/src/java.base/share/classes/java/net/URL.java @@ -1198,8 +1198,9 @@ public final class URL implements java.io.Serializable { public URLStreamHandler createURLStreamHandler(String protocol) { String name = PREFIX + "." + protocol + ".Handler"; try { - Class c = Class.forName(name); - return (URLStreamHandler)c.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName(name).newInstance(); + return (URLStreamHandler)o; } catch (ClassNotFoundException x) { // ignore } catch (Exception e) { @@ -1212,7 +1213,7 @@ public final class URL implements java.io.Serializable { private static URLStreamHandler lookupViaProperty(String protocol) { String packagePrefixList = - GetPropertyAction.getProperty(protocolPathProp); + GetPropertyAction.privilegedGetProperty(protocolPathProp); if (packagePrefixList == null) { // not set return null; @@ -1234,7 +1235,9 @@ public final class URL implements java.io.Serializable { } } if (cls != null) { - handler = (URLStreamHandler)cls.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = cls.newInstance(); + handler = (URLStreamHandler)tmp; } } catch (Exception e) { // any number of exceptions can get thrown here diff --git a/jdk/src/java.base/share/classes/java/net/URLConnection.java b/jdk/src/java.base/share/classes/java/net/URLConnection.java index 459a820bcde..4ad051cafe2 100644 --- a/jdk/src/java.base/share/classes/java/net/URLConnection.java +++ b/jdk/src/java.base/share/classes/java/net/URLConnection.java @@ -1323,7 +1323,9 @@ public abstract class URLConnection { } } if (cls != null) { - return (ContentHandler) cls.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = cls.newInstance(); + return (ContentHandler) tmp; } } catch(Exception ignored) { } } @@ -1397,7 +1399,7 @@ public abstract class URLConnection { */ private String getContentHandlerPkgPrefixes() { String packagePrefixList = - GetPropertyAction.getProperty(contentPathProp, ""); + GetPropertyAction.privilegedGetProperty(contentPathProp, ""); if (packagePrefixList != "") { packagePrefixList += "|"; diff --git a/jdk/src/java.base/share/classes/java/net/URLEncoder.java b/jdk/src/java.base/share/classes/java/net/URLEncoder.java index 2f2c3e6c9c4..91bc9ecf273 100644 --- a/jdk/src/java.base/share/classes/java/net/URLEncoder.java +++ b/jdk/src/java.base/share/classes/java/net/URLEncoder.java @@ -133,7 +133,7 @@ public class URLEncoder { dontNeedEncoding.set('.'); dontNeedEncoding.set('*'); - dfltEncName = GetPropertyAction.getProperty("file.encoding"); + dfltEncName = GetPropertyAction.privilegedGetProperty("file.encoding"); } /** diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java index f720261d03b..6a77d3db966 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java @@ -94,9 +94,10 @@ public abstract class AsynchronousChannelProvider { if (cn == null) return null; try { - Class c = Class.forName(cn, true, - ClassLoader.getSystemClassLoader()); - return (AsynchronousChannelProvider)c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(cn, true, + ClassLoader.getSystemClassLoader()).newInstance(); + return (AsynchronousChannelProvider)tmp; } catch (ClassNotFoundException x) { throw new ServiceConfigurationError(null, x); } catch (IllegalAccessException x) { diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java index cfe444a0041..c162eed8ed6 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java @@ -95,9 +95,10 @@ public abstract class SelectorProvider { if (cn == null) return false; try { - Class c = Class.forName(cn, true, - ClassLoader.getSystemClassLoader()); - provider = (SelectorProvider)c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(cn, true, + ClassLoader.getSystemClassLoader()).newInstance(); + provider = (SelectorProvider)tmp; return true; } catch (ClassNotFoundException x) { throw new ServiceConfigurationError(null, x); diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java index de49a8c6271..81209891bb4 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java @@ -283,8 +283,8 @@ public abstract class Charset if (level == null) { if (!VM.isBooted()) return false; - bugLevel = level = - GetPropertyAction.getProperty("sun.nio.cs.bugLevel", ""); + bugLevel = level = GetPropertyAction + .privilegedGetProperty("sun.nio.cs.bugLevel", ""); } return level.equals(bl); } @@ -609,7 +609,8 @@ public abstract class Charset public static Charset defaultCharset() { if (defaultCharset == null) { synchronized (Charset.class) { - String csn = GetPropertyAction.getProperty("file.encoding"); + String csn = GetPropertyAction + .privilegedGetProperty("file.encoding"); Charset cs = lookup(csn); if (cs != null) defaultCharset = cs; diff --git a/jdk/src/java.base/share/classes/java/nio/file/TempFileHelper.java b/jdk/src/java.base/share/classes/java/nio/file/TempFileHelper.java index a6af1a15b1f..03d431d80e1 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/TempFileHelper.java +++ b/jdk/src/java.base/share/classes/java/nio/file/TempFileHelper.java @@ -46,7 +46,7 @@ class TempFileHelper { // temporary directory location private static final Path tmpdir = - Paths.get(GetPropertyAction.getProperty("java.io.tmpdir")); + Paths.get(GetPropertyAction.privilegedGetProperty("java.io.tmpdir")); private static final boolean isPosix = FileSystems.getDefault().supportedFileAttributeViews().contains("posix"); diff --git a/jdk/src/java.base/share/classes/java/security/DrbgParameters.java b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java new file mode 100644 index 00000000000..f30c80da2e3 --- /dev/null +++ b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java @@ -0,0 +1,543 @@ +/* + * Copyright (c) 2016, 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.security; + +import java.util.Locale; +import java.util.Objects; + +/** + * This class specifies the parameters used by a DRBG (Deterministic + * Random Bit Generator). + *

+ * According to + * + * NIST Special Publication 800-90A Revision 1, Recommendation for Random + * Number Generation Using Deterministic Random Bit Generators (800-90Ar1), + *

+ * A DRBG is based on a DRBG mechanism as specified in this Recommendation + * and includes a source of randomness. A DRBG mechanism uses an algorithm + * (i.e., a DRBG algorithm) that produces a sequence of bits from an initial + * value that is determined by a seed that is determined from the output of + * the randomness source." + *
+ *

+ * The 800-90Ar1 specification allows for a variety of DRBG implementation + * choices, such as: + *

    + *
  • an entropy source, + *
  • a DRBG mechanism (for example, Hash_DRBG), + *
  • a DRBG algorithm (for example, SHA-256 for Hash_DRBG and AES-256 + * for CTR_DRBG. Please note that it is not the algorithm used in + * {@link SecureRandom#getInstance}, which we will call a + * SecureRandom algorithm below), + *
  • optionally features, including prediction resistance + * and reseeding supports. + *
  • highest security strength. + *
+ *

+ * These choices are set in each implementation and are not directly + * managed by the {@code SecureRandom} API. Check your DRBG provider's + * documentation to find an appropriate implementation for the situation. + *

+ * On the other hand, the 800-90Ar1 specification does have some configurable + * options, such as: + *

    + *
  • required security strength, + *
  • if prediction resistance is required, + *
  • personalization string and additional input. + *
+ *

+ * A DRBG instance can be instantiated with parameters from an + * {@link DrbgParameters.Instantiation} object and other information + * (for example, the nonce, which is not managed by this API). This maps + * to the {@code Instantiate_function} defined in NIST SP 800-90Ar1. + *

+ * A DRBG instance can be reseeded with parameters from a + * {@link DrbgParameters.Reseed} object. This maps to the + * {@code Reseed_function} defined in NIST SP 800-90Ar1. Calling + * {@link SecureRandom#reseed()} is equivalent to calling + * {@link SecureRandom#reseed(SecureRandomParameters)} with the effective + * instantiated prediction resistance flag (as returned by + * {@link SecureRandom#getParameters()}) with no additional input. + *

+ * A DRBG instance generates data with additional parameters from a + * {@link DrbgParameters.NextBytes} object. This maps to the + * {@code Generate_function} defined in NIST SP 800-90Ar1. Calling + * {@link SecureRandom#nextBytes(byte[])} is equivalent to calling + * {@link SecureRandom#nextBytes(byte[], SecureRandomParameters)} + * with the effective instantiated strength and prediction resistance flag + * (as returned by {@link SecureRandom#getParameters()}) with no + * additional input. + *

+ * A DRBG should be implemented as a subclass of {@link SecureRandomSpi}. + * It is recommended that the implementation contain the 1-arg + * {@linkplain SecureRandomSpi#SecureRandomSpi(SecureRandomParameters) constructor} + * that takes a {@code DrbgParameters.Instantiation} argument. If implemented + * this way, this implementation can be chosen by any + * {@code SecureRandom.getInstance()} method. If it is chosen by a + * {@code SecureRandom.getInstance()} with a {@link SecureRandomParameters} + * parameter, the parameter is passed into this constructor. If it is chosen + * by a {@code SecureRandom.getInstance()} without a + * {@code SecureRandomParameters} parameter, the constructor is called with + * a {@code null} argument and the implementation should choose its own + * parameters. Its {@link SecureRandom#getParameters()} must always return a + * non-null effective {@code DrbgParameters.Instantiation} object that reflects + * how the DRBG is actually instantiated. A caller can use this information + * to determine whether a {@code SecureRandom} object is a DRBG and what + * features it supports. Please note that the returned value does not + * necessarily equal to the {@code DrbgParameters.Instantiation} object passed + * into the {@code SecureRandom.getInstance()} call. For example, + * the requested capability can be {@link DrbgParameters.Capability#NONE} + * but the effective value can be {@link DrbgParameters.Capability#RESEED_ONLY} + * if the implementation supports reseeding. The implementation must implement + * the {@link SecureRandomSpi#engineNextBytes(byte[], SecureRandomParameters)} + * method which takes a {@code DrbgParameters.NextBytes} parameter. Unless + * the result of {@link SecureRandom#getParameters()} has its + * {@linkplain DrbgParameters.Instantiation#getCapability() capability} being + * {@link Capability#NONE NONE}, it must implement + * {@link SecureRandomSpi#engineReseed(SecureRandomParameters)} which takes + * a {@code DrbgParameters.Reseed} parameter. + *

+ * On the other hand, if a DRBG implementation does not contain a constructor + * that has an {@code DrbgParameters.Instantiation} argument (not recommended), + * it can only be chosen by a {@code SecureRandom.getInstance()} without + * a {@code SecureRandomParameters} parameter, but will not be chosen if + * a {@code getInstance} method with a {@code SecureRandomParameters} parameter + * is called. If implemented this way, its {@link SecureRandom#getParameters()} + * must return {@code null}, and it does not need to implement either + * {@link SecureRandomSpi#engineNextBytes(byte[], SecureRandomParameters)} + * or {@link SecureRandomSpi#engineReseed(SecureRandomParameters)}. + *

+ * A DRBG might reseed itself automatically if the seed period is bigger + * than the maximum seed life defined by the DRBG mechanism. + *

+ * A DRBG implementation should support serialization and deserialization + * by retaining the configuration and effective parameters, but the internal + * state must not be serialized and the deserialized object must be + * reinstantiated. + *

+ * Examples: + *

+ * SecureRandom drbg;
+ * byte[] buffer = new byte[32];
+ *
+ * // Any DRBG is OK
+ * drbg = SecureRandom.getInstance("DRBG");
+ * drbg.nextBytes(buffer);
+ *
+ * SecureRandomParameters params = drbg.getParameters();
+ * if (params instanceof DrbgParameters.Instantiation) {
+ *     DrbgParameters.Instantiation ins = (DrbgParameters.Instantiation) params;
+ *     if (ins.getCapability().supportsReseeding()) {
+ *         drbg.reseed();
+ *     }
+ * }
+ *
+ * // The following call requests a weak DRBG instance. It is only
+ * // guaranteed to support 112 bits of security strength.
+ * drbg = SecureRandom.getInstance("DRBG",
+ *         DrbgParameters.instantiation(112, NONE, null));
+ *
+ * // Both the next two calls will likely fail, because drbg could be
+ * // instantiated with a smaller strength with no prediction resistance
+ * // support.
+ * drbg.nextBytes(buffer,
+ *         DrbgParameters.nextBytes(256, false, "more".getBytes()));
+ * drbg.nextBytes(buffer,
+ *         DrbgParameters.nextBytes(112, true, "more".getBytes()));
+ *
+ * // The following call requests a strong DRBG instance, with a
+ * // personalization string. If it successfully returns an instance,
+ * // that instance is guaranteed to support 256 bits of security strength
+ * // with prediction resistance available.
+ * drbg = SecureRandom.getInstance("DRBG", DrbgParameters.instantiation(
+ *         256, PR_AND_RESEED, "hello".getBytes()));
+ *
+ * // Prediction resistance is not requested in this single call,
+ * // but an additional input is used.
+ * drbg.nextBytes(buffer,
+ *         DrbgParameters.nextBytes(-1, false, "more".getBytes()));
+ *
+ * // Same for this call.
+ * drbg.reseed(DrbgParameters.reseed(false, "extra".getBytes()));
+ *
+ * + * @implSpec + * By convention, a provider should name its primary DRBG implementation + * with the + * standard {@code SecureRandom} algorithm name "DRBG". + * + * @implNote + * The following notes apply to the "DRBG" implementation in the SUN provider + * of the JDK reference implementation. + *

+ * This implementation supports the Hash_DRBG and HMAC_DRBG mechanisms with + * DRBG algorithm SHA-1, SHA-224, SHA-512/224, SHA-256, SHA-512/256, + * SHA-384 and SHA-512, and CTR_DRBG (both using derivation function and + * not using derivation function) with DRBG algorithm 3KeyTDEA + * (also known as DESede in JCE), AES-128, AES-192 and AES-256. + *

+ * The mechanism name and DRBG algorithm name are determined by the + * {@linkplain Security#getProperty(String) security property} + * {@code securerandom.drbg.config}. The default choice is Hash_DRBG + * with SHA-256. + *

+ * For each combination, the security strength can be requested from 112 + * up to the highest strength it supports. Both reseeding and prediction + * resistance are supported. + *

+ * Personalization string is supported through the + * {@link DrbgParameters.Instantiation} class and additional input is supported + * through the {@link DrbgParameters.NextBytes} and + * {@link DrbgParameters.Reseed} classes. + *

+ * If a DRBG is not instantiated with a {@link DrbgParameters.Instantiation} + * object explicitly, this implementation instantiates it with a default + * requested strength of 128 bits (112 bits for CTR_DRBG with 3KeyTDEA), + * no prediction resistance request, and no personalization string. + * These default instantiation parameters can also be customized with + * the {@code securerandom.drbg.config} security property. + *

+ * This implementation reads fresh entropy from the system default entropy + * source determined by the security property {@code securerandom.source}. + *

+ * Calling {@link SecureRandom#generateSeed(int)} will directly read + * from this system default entropy source. + *

+ * This implementation has passed all tests included in the 20151104 version of + * + * The DRBG Test Vectors. + * + * @since 9 + */ +public class DrbgParameters { + + private DrbgParameters() { + // This class should not be instantiated + } + + /** + * The reseedable and prediction resistance capabilities of a DRBG. + *

+ * When this object is passed to a {@code SecureRandom.getInstance()} call, + * it is the requested minimum capability. When it's returned from + * {@code SecureRandom.getParameters()}, it is the effective capability. + *

+ * Please note that while the {@code Instantiate_function} defined in + * NIST SP 800-90Ar1 only includes a {@code prediction_resistance_flag} + * parameter, the {@code Capability} type includes an extra value + * {@link #RESEED_ONLY} because reseeding is an optional function. + * If {@code NONE} is used in an {@code Instantiation} object in calling the + * {@code SecureRandom.getInstance} method, the returned DRBG instance + * is not guaranteed to support reseeding. If {@code RESEED_ONLY} or + * {@code PR_AND_RESEED} is used, the instance must support reseeding. + *

+ * The table below lists possible effective values if a certain + * capability is requested, i.e. + *

+     * Capability requested = ...;
+     * SecureRandom s = SecureRandom.getInstance("DRBG",
+     *         DrbgParameters(-1, requested, null));
+     * Capability effective = ((DrbgParametes.Initiate) s.getParameters())
+     *         .getCapability();
+ *
+ * + * + * + * + * + * + * + * + *
Requested ValuePossible Effective Values
NONENONE, RESEED_ONLY, PR_AND_RESEED
RESEED_ONLYRESEED_ONLY, PR_AND_RESEED
PR_AND_RESEEDPR_AND_RESEED
+ *

+ * A DRBG implementation supporting prediction resistance must also + * support reseeding. + * + * @since 9 + */ + public enum Capability { + + /** + * Both prediction resistance and reseed. + */ + PR_AND_RESEED, + + /** + * Reseed but no prediction resistance. + */ + RESEED_ONLY, + + /** + * Neither prediction resistance nor reseed. + */ + NONE; + + @Override + public String toString() { + return name().toLowerCase(Locale.ROOT); + } + + /** + * Returns whether this capability supports reseeding. + * + * @return {@code true} for {@link #PR_AND_RESEED} and + * {@link #RESEED_ONLY}, and {@code false} for {@link #NONE} + */ + public boolean supportsReseeding() { + return this != NONE; + } + + /** + * Returns whether this capability supports prediction resistance. + * + * @return {@code true} for {@link #PR_AND_RESEED}, and {@code false} + * for {@link #RESEED_ONLY} and {@link #NONE} + */ + public boolean supportsPredictionResistance() { + return this == PR_AND_RESEED; + } + } + + /** + * DRBG parameters for instantiation. + *

+ * When used in + * {@link SecureRandom#getInstance(String, SecureRandomParameters)} + * or one of the other similar {@code getInstance} calls that take a + * {@code SecureRandomParameters} parameter, it means the + * requested instantiate parameters the newly created {@code SecureRandom} + * object must minimally support. When used as the return value of the + * {@link SecureRandom#getParameters()} method, it means the effective + * instantiate parameters of the {@code SecureRandom} object. + * + * @since 9 + */ + public static final class Instantiation + implements SecureRandomParameters { + + private final int strength; + private final Capability capability; + private final byte[] personalizationString; + + /** + * Returns the security strength in bits. + * + * @return If used in {@code getInstance}, returns the minimum strength + * requested, or -1 if there is no specific request on the strength. + * If used in {@code getParameters}, returns the effective strength. + * The effective strength must be greater than or equal to the minimum + * strength requested. + */ + public int getStrength() { + return strength; + } + + /** + * Returns the capability. + * + * @return If used in {@code getInstance}, returns the minimum + * capability requested. If used in {@code getParameters}, returns + * information on the effective prediction resistance flag and + * whether it supports reseeding. + */ + public Capability getCapability() { + return capability; + } + + /** + * Returns the personalization string as a byte array. + * + * @return If used in {@code getInstance}, returns the requested + * personalization string as a newly allocated array, or {@code null} + * if no personalization string is requested. The same string should + * be returned in {@code getParameters} as a new copy, or {@code null} + * if no personalization string is requested in {@code getInstance}. + */ + public byte[] getPersonalizationString() { + return (personalizationString == null) ? + null : personalizationString.clone(); + } + + private Instantiation(int strength, Capability capability, + byte[] personalizationString) { + this.strength = strength; + this.capability = capability; + this.personalizationString = (personalizationString == null) ? + null : personalizationString.clone(); + } + + /** + * Returns a Human-readable string representation of this + * {@code Instantiation}. + * + * @return the string representation + */ + @Override + public String toString() { + // I don't care what personalizationString looks like + return strength + "," + capability + "," + personalizationString; + } + } + + /** + * DRBG parameters for random bits generation. It is used in + * {@link SecureRandom#nextBytes(byte[], SecureRandomParameters)}. + * + * @since 9 + */ + public static final class NextBytes + implements SecureRandomParameters { + private final int strength; + private final boolean predictionResistance; + private final byte[] additionalInput; + + /** + * Returns the security strength requested in bits. + * + * @return the strength requested, or -1 if the effective strength + * should be used. + */ + public int getStrength() { + return strength; + } + + /** + * Returns whether prediction resistance is requested. + * + * @return whether prediction resistance is requested + */ + public boolean getPredictionResistance() { + return predictionResistance; + } + + /** + * Returns the requested additional input. + * + * @return the requested additional input, {@code null} if not + * requested. A new byte array is returned each time this method + * is called. + */ + public byte[] getAdditionalInput() { + return additionalInput == null? null: additionalInput.clone(); + } + + private NextBytes(int strength, boolean predictionResistance, + byte[] additionalInput) { + this.strength = strength; + this.predictionResistance = predictionResistance; + this.additionalInput = (additionalInput == null) ? + null : additionalInput.clone(); + } + } + + /** + * DRBG parameters for reseed. It is used in + * {@link SecureRandom#reseed(SecureRandomParameters)}. + * + * @since 9 + */ + public static final class Reseed implements SecureRandomParameters { + + private final byte[] additionalInput; + private final boolean predictionResistance; + + /** + * Returns whether prediction resistance is requested. + * + * @return whether prediction resistance is requested + */ + public boolean getPredictionResistance() { + return predictionResistance; + } + + /** + * Returns the requested additional input. + * + * @return the requested additional input, or {@code null} if + * not requested. A new byte array is returned each time this method + * is called. + */ + public byte[] getAdditionalInput() { + return additionalInput == null ? null : additionalInput.clone(); + } + + private Reseed(boolean predictionResistance, byte[] additionalInput) { + this.predictionResistance = predictionResistance; + this.additionalInput = (additionalInput == null) ? + null : additionalInput.clone(); + } + } + + /** + * Generates a {@link DrbgParameters.Instantiation} object. + * + * @param strength security strength in bits, -1 for default strength + * if used in {@code getInstance}. + * @param capability capability + * @param personalizationString personalization string as a byte array, + * can be {@code null}. The content of this + * byte array will be copied. + * @return a new {@code Instantiation} object + * @throws NullPointerException if {@code capability} is {@code null} + */ + public static Instantiation instantiation(int strength, + Capability capability, + byte[] personalizationString) { + return new Instantiation(strength, Objects.requireNonNull(capability), + personalizationString); + } + + /** + * Generates a {@link NextBytes} object. + * + * @param strength requested security strength in bits. If set to -1, the + * effective strength will be used. + * @param predictionResistance prediction resistance requested + * @param additionalInput additional input, can be {@code null}. + * The content of this byte array will be copied. + * @return a new {@code NextBytes} object + */ + public static NextBytes nextBytes(int strength, + boolean predictionResistance, + byte[] additionalInput) { + return new NextBytes(strength, predictionResistance, additionalInput); + } + + /** + * Generates a {@link Reseed} object. + * + * @param predictionResistance prediction resistance requested + * @param additionalInput additional input, can be {@code null}. + * The content of this byte array will be copied. + * @return a new {@code Reseed} object + */ + public static Reseed reseed( + boolean predictionResistance, byte[] additionalInput) { + return new Reseed(predictionResistance, additionalInput); + } +} diff --git a/jdk/src/java.base/share/classes/java/security/Policy.java b/jdk/src/java.base/share/classes/java/security/Policy.java index 79ecf9c688d..33f766f3082 100644 --- a/jdk/src/java.base/share/classes/java/security/Policy.java +++ b/jdk/src/java.base/share/classes/java/security/Policy.java @@ -222,8 +222,9 @@ public abstract class Policy { public Policy run() { try { ClassLoader scl = ClassLoader.getSystemClassLoader(); - Class c = Class.forName(policyProvider, true, scl); - return (Policy)c.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName(policyProvider, true, scl).newInstance(); + return (Policy)o; } catch (Exception e) { if (debug != null) { debug.println("policy provider " + policyProvider + diff --git a/jdk/src/java.base/share/classes/java/security/Provider.java b/jdk/src/java.base/share/classes/java/security/Provider.java index e192d23cbbe..7e3249cec18 100644 --- a/jdk/src/java.base/share/classes/java/security/Provider.java +++ b/jdk/src/java.base/share/classes/java/security/Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved + * Copyright (c) 1996, 2016, 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 @@ -142,8 +142,35 @@ public abstract class Provider extends Properties { Constructor con = clazz.getConstructor(); return con.newInstance(); } else { - Constructor con = clazz.getConstructor(ctrParamClz); - return con.newInstance(ctorParamObj); + // Looking for the constructor with a params first and fallback + // to one without if not found. This is to support the enhanced + // SecureRandom where both styles of constructors are supported. + // Before jdk9, there was no params support (only getInstance(alg)) + // and an impl only had the params-less constructor. Since jdk9, + // there is getInstance(alg,params) and an impl can contain + // an Impl(params) constructor. + try { + Constructor con = clazz.getConstructor(ctrParamClz); + return con.newInstance(ctorParamObj); + } catch (NoSuchMethodException nsme) { + // For pre-jdk9 SecureRandom implementations, they only + // have params-less constructors which still works when + // the input ctorParamObj is null. + // + // For other primitives using params, ctorParamObj should not + // be null and nsme is thrown, just like before. + if (ctorParamObj == null) { + try { + Constructor con = clazz.getConstructor(); + return con.newInstance(); + } catch (NoSuchMethodException nsme2) { + nsme.addSuppressed(nsme2); + throw nsme; + } + } else { + throw nsme; + } + } } } @@ -1384,7 +1411,8 @@ public abstract class Provider extends Properties { addEngine("KeyPairGenerator", false, null); addEngine("KeyStore", false, null); addEngine("MessageDigest", false, null); - addEngine("SecureRandom", false, null); + addEngine("SecureRandom", false, + "java.security.SecureRandomParameters"); addEngine("Signature", true, null); addEngine("CertificateFactory", false, null); addEngine("CertPathBuilder", false, null); @@ -1678,6 +1706,7 @@ public abstract class Provider extends Properties { } } } + // constructorParameter can be null if not provided return newInstanceUtil(getImplClass(), ctrParamClz, constructorParameter); } catch (NoSuchAlgorithmException e) { throw e; diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandom.java b/jdk/src/java.base/share/classes/java/security/SecureRandom.java index da7329fb9e3..f8832f049ce 100644 --- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java +++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java @@ -38,52 +38,87 @@ import sun.security.util.Debug; * This class provides a cryptographically strong random number * generator (RNG). * - *

A cryptographically strong random number - * minimally complies with the statistical random number generator tests - * specified in + *

A cryptographically strong random number minimally complies with the + * statistical random number generator tests specified in * * FIPS 140-2, Security Requirements for Cryptographic Modules, * section 4.9.1. - * Additionally, SecureRandom must produce non-deterministic output. - * Therefore any seed material passed to a SecureRandom object must be - * unpredictable, and all SecureRandom output sequences must be + * Additionally, {@code SecureRandom} must produce non-deterministic output. + * Therefore any seed material passed to a {@code SecureRandom} object must be + * unpredictable, and all {@code SecureRandom} output sequences must be * cryptographically strong, as described in * * RFC 4086: Randomness Requirements for Security. * - *

A caller obtains a SecureRandom instance via the - * no-argument constructor or one of the {@code getInstance} methods: - * - *

- *      SecureRandom random = new SecureRandom();
- * 
- * - *

Many SecureRandom implementations are in the form of a pseudo-random - * number generator (PRNG), which means they use a deterministic algorithm - * to produce a pseudo-random sequence from a true random seed. + *

Many {@code SecureRandom} implementations are in the form of a + * pseudo-random number generator (PRNG, also known as deterministic random + * bits generator or DRBG), which means they use a deterministic algorithm + * to produce a pseudo-random sequence from a random seed. * Other implementations may produce true random numbers, * and yet others may use a combination of both techniques. * - *

Typical callers of SecureRandom invoke the following methods + *

A caller obtains a {@code SecureRandom} instance via the + * no-argument constructor or one of the {@code getInstance} methods. + * For example: + * + *

+ * SecureRandom r1 = new SecureRandom();
+ * SecureRandom r2 = SecureRandom.getInstance("NativePRNG");
+ * SecureRandom r3 = SecureRandom("DRBG",
+ *         DrbgParameters.Instantiation(128, RESEED_ONLY, null));
+ *
+ * + *

The third statement above returns a {@code SecureRandom} object of the + * specific algorithm supporting the specific instantiate parameters. The + * implementation's effective instantiated parameters must match this minimum + * request but is not necessarily the same. For example, even if the request + * does not require a certain feature, the actual instantiation can provide + * the feature. An implementation may lazily instantiate a {@code SecureRandom} + * until it's actually used, but the effective instantiate parameters must be + * determined right after it's created and {@link #getParameters()} should + * always return the same result unchanged. + * + *

Typical callers of {@code SecureRandom} invoke the following methods * to retrieve random bytes: * - *

- *      SecureRandom random = new SecureRandom();
- *      byte[] bytes = new byte[20];
- *      random.nextBytes(bytes);
- * 
+ *
+ * SecureRandom random = new SecureRandom();
+ * byte[] bytes = new byte[20];
+ * random.nextBytes(bytes);
+ *
* - *

Callers may also invoke the {@code generateSeed} method + *

Callers may also invoke the {@link #generateSeed} method * to generate a given number of seed bytes (to seed other random number * generators, for example): - *

- *      byte[] seed = random.generateSeed(20);
- * 
* - * Note: Depending on the implementation, the {@code generateSeed} and - * {@code nextBytes} methods may block as entropy is being gathered, - * for example, if they need to read from /dev/random on various Unix-like - * operating systems. + *
+ * byte[] seed = random.generateSeed(20);
+ *
+ * + *

A newly created PRNG {@code SecureRandom} object is not seeded (except + * if it is created by {@link #SecureRandom(byte[])}). The first call to + * {@code nextBytes} will force it to seed itself from an implementation- + * specific entropy source. This self-seeding will not occur if {@code setSeed} + * was previously called. + * + *

A {@code SecureRandom} can be reseeded at any time by calling the + * {@code reseed} or {@code setSeed} method. The {@code reseed} method + * reads entropy input from its entropy source to reseed itself. + * The {@code setSeed} method requires the caller to provide the seed. + * + *

Please note that {@code reseed} may not be supported by all + * {@code SecureRandom} implementations. + * + *

Some {@code SecureRandom} implementations may accept a + * {@link SecureRandomParameters} parameter in its + * {@link #nextBytes(byte[], SecureRandomParameters)} and + * {@link #reseed(SecureRandomParameters)} methods to further + * control the behavior of the methods. + * + *

Note: Depending on the implementation, the {@code generateSeed}, + * {@code reseed} and {@code nextBytes} methods may block as entropy is being + * gathered, for example, if the entropy source is /dev/random on various + * Unix-like operating systems. * * @see java.security.SecureRandomSpi * @see java.util.Random @@ -132,26 +167,19 @@ public class SecureRandom extends java.util.Random { * *

This constructor traverses the list of registered security Providers, * starting with the most preferred Provider. - * A new SecureRandom object encapsulating the - * SecureRandomSpi implementation from the first - * Provider that supports a SecureRandom (RNG) algorithm is returned. + * A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the first + * Provider that supports a {@code SecureRandom} (RNG) algorithm is returned. * If none of the Providers support a RNG algorithm, * then an implementation-specific default is returned. * *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

See the SecureRandom section in the See the {@code SecureRandom} section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. - * - *

The returned SecureRandom object has not been seeded. To seed the - * returned object, call the {@code setSeed} method. - * If {@code setSeed} is not called, the first call to - * {@code nextBytes} will force the SecureRandom object to seed itself. - * This self-seeding will not occur if {@code setSeed} was - * previously called. */ public SecureRandom() { /* @@ -166,20 +194,20 @@ public class SecureRandom extends java.util.Random { /** * Constructs a secure random number generator (RNG) implementing the * default random number algorithm. - * The SecureRandom instance is seeded with the specified seed bytes. + * The {@code SecureRandom} instance is seeded with the specified seed bytes. * *

This constructor traverses the list of registered security Providers, * starting with the most preferred Provider. - * A new SecureRandom object encapsulating the - * SecureRandomSpi implementation from the first - * Provider that supports a SecureRandom (RNG) algorithm is returned. + * A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the first + * Provider that supports a {@code SecureRandom} (RNG) algorithm is returned. * If none of the Providers support a RNG algorithm, * then an implementation-specific default is returned. * *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

See the SecureRandom section in the See the {@code SecureRandom} section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. @@ -225,9 +253,9 @@ public class SecureRandom extends java.util.Random { } /** - * Creates a SecureRandom object. + * Creates a {@code SecureRandom} object. * - * @param secureRandomSpi the SecureRandom implementation. + * @param secureRandomSpi the {@code SecureRandom} implementation. * @param provider the provider. */ protected SecureRandom(SecureRandomSpi secureRandomSpi, @@ -249,25 +277,18 @@ public class SecureRandom extends java.util.Random { } /** - * Returns a SecureRandom object that implements the specified + * Returns a {@code SecureRandom} object that implements the specified * Random Number Generator (RNG) algorithm. * *

This method traverses the list of registered security Providers, * starting with the most preferred Provider. - * A new SecureRandom object encapsulating the - * SecureRandomSpi implementation from the first + * A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the first * Provider that supports the specified algorithm is returned. * *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

The returned SecureRandom object has not been seeded. To seed the - * returned object, call the {@code setSeed} method. - * If {@code setSeed} is not called, the first call to - * {@code nextBytes} will force the SecureRandom object to seed itself. - * This self-seeding will not occur if {@code setSeed} was - * previously called. - * * @implNote * The JDK Reference Implementation additionally uses the * {@code jdk.security.provider.preferred} @@ -277,15 +298,15 @@ public class SecureRandom extends java.util.Random { * {@link Security#getProviders() Security.getProviders()}. * * @param algorithm the name of the RNG algorithm. - * See the SecureRandom section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * - * @return the new SecureRandom object. + * @return the new {@code SecureRandom} object. * * @exception NoSuchAlgorithmException if no Provider supports a - * SecureRandomSpi implementation for the + * {@code SecureRandomSpi} implementation for the * specified algorithm. * * @see Provider @@ -295,49 +316,42 @@ public class SecureRandom extends java.util.Random { public static SecureRandom getInstance(String algorithm) throws NoSuchAlgorithmException { Instance instance = GetInstance.getInstance("SecureRandom", - SecureRandomSpi.class, algorithm); + SecureRandomSpi.class, algorithm); return new SecureRandom((SecureRandomSpi)instance.impl, - instance.provider, algorithm); + instance.provider, algorithm); } /** - * Returns a SecureRandom object that implements the specified + * Returns a {@code SecureRandom} object that implements the specified * Random Number Generator (RNG) algorithm. * - *

A new SecureRandom object encapsulating the - * SecureRandomSpi implementation from the specified provider + *

A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the specified provider * is returned. The specified provider must be registered * in the security provider list. * *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

The returned SecureRandom object has not been seeded. To seed the - * returned object, call the {@code setSeed} method. - * If {@code setSeed} is not called, the first call to - * {@code nextBytes} will force the SecureRandom object to seed itself. - * This self-seeding will not occur if {@code setSeed} was - * previously called. - * * @param algorithm the name of the RNG algorithm. - * See the SecureRandom section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * * @param provider the name of the provider. * - * @return the new SecureRandom object. + * @return the new {@code SecureRandom} object. * - * @exception NoSuchAlgorithmException if a SecureRandomSpi - * implementation for the specified algorithm is not - * available from the specified provider. + * @throws NoSuchAlgorithmException if a {@code SecureRandomSpi} + * implementation for the specified algorithm is not + * available from the specified provider. * - * @exception NoSuchProviderException if the specified provider is not - * registered in the security provider list. + * @throws NoSuchProviderException if the specified provider is not + * registered in the security provider list. * - * @exception IllegalArgumentException if the provider name is null - * or empty. + * @throws IllegalArgumentException if the provider name is null + * or empty. * * @see Provider * @@ -352,36 +366,29 @@ public class SecureRandom extends java.util.Random { } /** - * Returns a SecureRandom object that implements the specified + * Returns a {@code SecureRandom} object that implements the specified * Random Number Generator (RNG) algorithm. * - *

A new SecureRandom object encapsulating the - * SecureRandomSpi implementation from the specified Provider - * object is returned. Note that the specified Provider object + *

A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the specified {@code Provider} + * object is returned. Note that the specified {@code Provider} object * does not have to be registered in the provider list. * - *

The returned SecureRandom object has not been seeded. To seed the - * returned object, call the {@code setSeed} method. - * If {@code setSeed} is not called, the first call to - * {@code nextBytes} will force the SecureRandom object to seed itself. - * This self-seeding will not occur if {@code setSeed} was - * previously called. - * * @param algorithm the name of the RNG algorithm. - * See the SecureRandom section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * * @param provider the provider. * - * @return the new SecureRandom object. + * @return the new {@code SecureRandom} object. * - * @exception NoSuchAlgorithmException if a SecureRandomSpi - * implementation for the specified algorithm is not available - * from the specified Provider object. + * @throws NoSuchAlgorithmException if a {@code SecureRandomSpi} + * implementation for the specified algorithm is not available + * from the specified {@code Provider} object. * - * @exception IllegalArgumentException if the specified provider is null. + * @throws IllegalArgumentException if the specified provider is null. * * @see Provider * @@ -396,24 +403,178 @@ public class SecureRandom extends java.util.Random { } /** - * Returns the SecureRandomSpi of this SecureRandom object. + * Returns a {@code SecureRandom} object that implements the specified + * Random Number Generator (RNG) algorithm and supports the specified + * {@code SecureRandomParameters} request. + * + *

This method traverses the list of registered security Providers, + * starting with the most preferred Provider. + * A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the first + * Provider that supports the specified algorithm and the specified + * {@code SecureRandomParameters} is returned. + * + *

Note that the list of registered providers may be retrieved via + * the {@link Security#getProviders() Security.getProviders()} method. + * + * @implNote + * The JDK Reference Implementation additionally uses the + * {@code jdk.security.provider.preferred} property to determine + * the preferred provider order for the specified algorithm. This + * may be different than the order of providers returned by + * {@link Security#getProviders() Security.getProviders()}. + * + * @param algorithm the name of the RNG algorithm. + * See the {@code SecureRandom} section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard RNG algorithm names. + * + * @param params the {@code SecureRandomParameters} + * the newly created {@code SecureRandom} object must support. + * + * @return the new {@code SecureRandom} object. + * + * @throws NoSuchAlgorithmException if no Provider supports a + * {@code SecureRandomSpi} implementation for the specified + * algorithm and parameters. + * + * @throws IllegalArgumentException if the specified params is null. + * + * @see Provider + * + * @since 9 + */ + public static SecureRandom getInstance( + String algorithm, SecureRandomParameters params) + throws NoSuchAlgorithmException { + if (params == null) { + throw new IllegalArgumentException("params cannot be null"); + } + Instance instance = GetInstance.getInstance("SecureRandom", + SecureRandomSpi.class, algorithm, params); + return new SecureRandom((SecureRandomSpi)instance.impl, + instance.provider, algorithm); + } + + /** + * Returns a {@code SecureRandom} object that implements the specified + * Random Number Generator (RNG) algorithm and supports the specified + * {@code SecureRandomParameters} request. + * + *

A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the specified provider + * is returned. The specified provider must be registered + * in the security provider list. + * + *

Note that the list of registered providers may be retrieved via + * the {@link Security#getProviders() Security.getProviders()} method. + * + * @param algorithm the name of the RNG algorithm. + * See the {@code SecureRandom} section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard RNG algorithm names. + * + * @param params the {@code SecureRandomParameters} + * the newly created {@code SecureRandom} object must support. + * + * @param provider the name of the provider. + * + * @return the new {@code SecureRandom} object. + * + * @throws NoSuchAlgorithmException if the specified provider does not + * support a {@code SecureRandomSpi} implementation for the + * specified algorithm and parameters. + * + * @throws NoSuchProviderException if the specified provider is not + * registered in the security provider list. + * + * @throws IllegalArgumentException if the provider name is null + * or empty, or params is null. + * + * @see Provider + * + * @since 9 + */ + public static SecureRandom getInstance(String algorithm, + SecureRandomParameters params, String provider) + throws NoSuchAlgorithmException, NoSuchProviderException { + if (params == null) { + throw new IllegalArgumentException("params cannot be null"); + } + Instance instance = GetInstance.getInstance("SecureRandom", + SecureRandomSpi.class, algorithm, params, provider); + return new SecureRandom((SecureRandomSpi)instance.impl, + instance.provider, algorithm); + } + + /** + * Returns a {@code SecureRandom} object that implements the specified + * Random Number Generator (RNG) algorithm and supports the specified + * {@code SecureRandomParameters} request. + * + *

A new {@code SecureRandom} object encapsulating the + * {@code SecureRandomSpi} implementation from the specified + * {@code Provider} object is returned. Note that the specified + * {@code Provider} object does not have to be registered in the + * provider list. + * + * @param algorithm the name of the RNG algorithm. + * See the {@code SecureRandom} section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard RNG algorithm names. + * + * @param params the {@code SecureRandomParameters} + * the newly created {@code SecureRandom} object must support. + * + * @param provider the provider. + * + * @return the new {@code SecureRandom} object. + * + * @throws NoSuchAlgorithmException if the specified provider does not + * support a {@code SecureRandomSpi} implementation for the + * specified algorithm and parameters. + * + * @throws IllegalArgumentException if the specified provider or params + * is null. + * + * @see Provider + * + * @since 9 + */ + public static SecureRandom getInstance(String algorithm, + SecureRandomParameters params, Provider provider) + throws NoSuchAlgorithmException { + if (params == null) { + throw new IllegalArgumentException("params cannot be null"); + } + Instance instance = GetInstance.getInstance("SecureRandom", + SecureRandomSpi.class, algorithm, params, provider); + return new SecureRandom((SecureRandomSpi)instance.impl, + instance.provider, algorithm); + } + + /** + * Returns the {@code SecureRandomSpi} of this {@code SecureRandom} object. */ SecureRandomSpi getSecureRandomSpi() { return secureRandomSpi; } /** - * Returns the provider of this SecureRandom object. + * Returns the provider of this {@code SecureRandom} object. * - * @return the provider of this SecureRandom object. + * @return the provider of this {@code SecureRandom} object. */ public final Provider getProvider() { return provider; } /** - * Returns the name of the algorithm implemented by this SecureRandom - * object. + * Returns the name of the algorithm implemented by this + * {@code SecureRandom} object. * * @return the name of the algorithm or {@code unknown} * if the algorithm name cannot be determined. @@ -424,9 +585,49 @@ public class SecureRandom extends java.util.Random { } /** - * Reseeds this random object. The given seed supplements, rather than - * replaces, the existing seed. Thus, repeated calls are guaranteed - * never to reduce randomness. + * Returns a Human-readable string representation of this + * {@code SecureRandom}. + * + * @return the string representation + * + * @since 9 + */ + @Override + public String toString() { + return secureRandomSpi.toString(); + } + + /** + * Returns the effective {@link SecureRandomParameters} for this + * {@code SecureRandom} instance. + *

+ * The returned value can be different from the + * {@code SecureRandomParameters} object passed into a {@code getInstance} + * method, but it cannot change during the lifetime of this + * {@code SecureRandom} object. + *

+ * A caller can use the returned value to find out what features this + * {@code SecureRandom} supports. + * + * @return the effective {@link SecureRandomParameters} parameters, + * or {@code null} if no parameters were used. + * + * @since 9 + * @see SecureRandomSpi + */ + public SecureRandomParameters getParameters() { + return secureRandomSpi.engineGetParameters(); + } + + /** + * Reseeds this random object with the given seed. The seed supplements, + * rather than replaces, the existing seed. Thus, repeated calls are + * guaranteed never to reduce randomness. + *

+ * A PRNG {@code SecureRandom} will not seed itself automatically if + * {@code setSeed} is called before any {@code nextBytes} or {@code reseed} + * calls. The caller should make sure that the {@code seed} argument + * contains enough entropy for the security of this {@code SecureRandom}. * * @param seed the seed. * @@ -458,18 +659,13 @@ public class SecureRandom extends java.util.Random { * yet been initialized at that point. */ if (seed != 0) { - secureRandomSpi.engineSetSeed(longToByteArray(seed)); + this.secureRandomSpi.engineSetSeed(longToByteArray(seed)); } } /** * Generates a user-specified number of random bytes. * - *

If a call to {@code setSeed} had not occurred previously, - * the first call to this method forces this SecureRandom object - * to seed itself. This self-seeding will not occur if - * {@code setSeed} was previously called. - * * @param bytes the array to be filled in with random bytes. */ @Override @@ -477,6 +673,28 @@ public class SecureRandom extends java.util.Random { secureRandomSpi.engineNextBytes(bytes); } + /** + * Generates a user-specified number of random bytes with + * additional parameters. + * + * @param bytes the array to be filled in with random bytes + * @param params additional parameters + * @throws NullPointerException if {@code bytes} is null + * @throws UnsupportedOperationException if the underlying provider + * implementation has not overridden this method + * @throws IllegalArgumentException if {@code params} is {@code null}, + * illegal or unsupported by this {@code SecureRandom} + * + * @since 9 + */ + public synchronized void nextBytes( + byte[] bytes, SecureRandomParameters params) { + if (params == null) { + throw new IllegalArgumentException("params cannot be null"); + } + secureRandomSpi.engineNextBytes(Objects.requireNonNull(bytes), params); + } + /** * Generates an integer containing the user-specified number of * pseudo-random bits (right justified, with leading zeros). This @@ -512,7 +730,7 @@ public class SecureRandom extends java.util.Random { * *

This method is only included for backwards compatibility. * The caller is encouraged to use one of the alternative - * {@code getInstance} methods to obtain a SecureRandom object, and + * {@code getInstance} methods to obtain a {@code SecureRandom} object, and * then call the {@code generateSeed} method to obtain seed bytes * from that object. * @@ -537,10 +755,13 @@ public class SecureRandom extends java.util.Random { * call may be used to seed other random number generators. * * @param numBytes the number of seed bytes to generate. - * + * @throws IllegalArgumentException if {@code numBytes} is negative * @return the seed bytes. */ public byte[] generateSeed(int numBytes) { + if (numBytes < 0) { + throw new IllegalArgumentException("numBytes cannot be negative"); + } return secureRandomSpi.engineGenerateSeed(numBytes); } @@ -562,8 +783,8 @@ public class SecureRandom extends java.util.Random { /** * Gets a default PRNG algorithm by looking through all registered * providers. Returns the first PRNG algorithm of the first provider that - * has registered a SecureRandom implementation, or null if none of the - * registered providers supplies a SecureRandom implementation. + * has registered a {@code SecureRandom} implementation, or null if none of + * the registered providers supplies a {@code SecureRandom} implementation. */ private static String getPrngAlgorithm() { for (Provider p : Providers.getProviderList().providers()) { @@ -667,6 +888,42 @@ public class SecureRandom extends java.util.Random { "No strong SecureRandom impls available: " + property); } + /** + * Reseeds this {@code SecureRandom} with entropy input read from its + * entropy source. + * + * @throws UnsupportedOperationException if the underlying provider + * implementation has not overridden this method. + * + * @since 9 + */ + public synchronized void reseed() { + secureRandomSpi.engineReseed(null); + } + + /** + * Reseeds this {@code SecureRandom} with entropy input read from its + * entropy source with additional parameters. + *

+ * Note that entropy is obtained from an entropy source. While + * some data in {@code params} may contain entropy, its main usage is to + * provide diversity. + * + * @param params extra parameters + * @throws UnsupportedOperationException if the underlying provider + * implementation has not overridden this method. + * @throws IllegalArgumentException if {@code params} is {@code null}, + * illegal or unsupported by this {@code SecureRandom} + * + * @since 9 + */ + public synchronized void reseed(SecureRandomParameters params) { + if (params == null) { + throw new IllegalArgumentException("params cannot be null"); + } + secureRandomSpi.engineReseed(params); + } + // Declare serialVersionUID to be compatible with JDK1.1 static final long serialVersionUID = 4940670005562187L; @@ -685,7 +942,7 @@ public class SecureRandom extends java.util.Random { * We know that the MessageDigest class does not implement * java.io.Serializable. However, since this field is no longer * used, it will always be NULL and won't affect the serialization - * of the SecureRandom class itself. + * of the {@code SecureRandom} class itself. */ private byte[] randomBytes; /** diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandomParameters.java b/jdk/src/java.base/share/classes/java/security/SecureRandomParameters.java new file mode 100644 index 00000000000..bedf94e4ea5 --- /dev/null +++ b/jdk/src/java.base/share/classes/java/security/SecureRandomParameters.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2016, 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.security; + +/** + * A marker interface for parameters used in various {@code SecureRandom} + * methods. + *

+ * Some {@code SecureRandom} implementations might require additional + * operational parameters. Objects of classes which implement this interface + * can be passed to those implementations that support them. + * + * @see DrbgParameters + */ +public interface SecureRandomParameters { +} diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java index ef6c2433630..9aa24f57bc8 100644 --- a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java +++ b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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,13 +27,38 @@ package java.security; /** * This class defines the Service Provider Interface (SPI) - * for the {@code SecureRandom} class. + * for the {@link SecureRandom} class. + *

* All the abstract methods in this class must be implemented by each * service provider who wishes to supply the implementation * of a cryptographically strong pseudo-random number generator. * + * @implSpec + * If the {@link #SecureRandomSpi(SecureRandomParameters)} + * constructor is overridden in an implementation, it will always be called + * whenever a {@code SecureRandom} is instantiated. Precisely, if an object is + * instantiated with one of {@code SecureRandom}'s {@code getInstance} methods + * without a {@link SecureRandomParameters} parameter, + * the constructor will be called with a {@code null} argument and the + * implementation is responsible for creating its own + * {@code SecureRandomParameters} parameter for use when + * {@link #engineGetParameters()} is called. If an object + * is instantiated with one of {@code SecureRandom}'s {@code getInstance} + * methods with a {@code SecureRandomParameters} argument, + * the constructor will be called with that argument. The + * {@link #engineGetParameters()} method must not return {@code null}. + *

+ * Otherwise, if the {@code SecureRandomSpi(SecureRandomParameters)} + * constructor is not overridden in an implementation, the + * {@link #SecureRandomSpi()} constructor must be overridden and it will be + * called if an object is instantiated with one of {@code SecureRandom}'s + * {@code getInstance} methods without a + * {@code SecureRandomParameters} argument. Calling one of + * {@code SecureRandom}'s {@code getInstance} methods with + * a {@code SecureRandomParameters} argument will never + * return an instance of this implementation. The + * {@link #engineGetParameters()} method must return {@code null}. * - * @see SecureRandom * @since 1.2 */ @@ -42,9 +67,30 @@ public abstract class SecureRandomSpi implements java.io.Serializable { private static final long serialVersionUID = -2991854161009191830L; /** - * Reseeds this random object. The given seed supplements, rather than - * replaces, the existing seed. Thus, repeated calls are guaranteed - * never to reduce randomness. + * Constructor without a parameter. + */ + public SecureRandomSpi() { + // ignored + } + + /** + * Constructor with a parameter. + * + * @param params the {@link SecureRandomParameters} object. + * This argument can be {@code null}. + * @throws IllegalArgumentException if {@code params} is + * unrecognizable or unsupported by this {@code SecureRandom} + * + * @since 9 + */ + protected SecureRandomSpi(SecureRandomParameters params) { + // ignored + } + + /** + * Reseeds this random object with the given seed. The seed supplements, + * rather than replaces, the existing seed. Thus, repeated calls + * are guaranteed never to reduce randomness. * * @param seed the seed. */ @@ -52,16 +98,44 @@ public abstract class SecureRandomSpi implements java.io.Serializable { /** * Generates a user-specified number of random bytes. - * - *

If a call to {@code engineSetSeed} had not occurred previously, - * the first call to this method forces this SecureRandom implementation - * to seed itself. This self-seeding will not occur if - * {@code engineSetSeed} was previously called. + *

+ * Some random number generators can only generate a limited amount + * of random bytes per invocation. If the size of {@code bytes} + * is greater than this limit, the implementation should invoke + * its generation process multiple times to completely fill the + * buffer before returning from this method. * * @param bytes the array to be filled in with random bytes. */ protected abstract void engineNextBytes(byte[] bytes); + /** + * Generates a user-specified number of random bytes with + * additional parameters. + *

+ * Some random number generators can only generate a limited amount + * of random bytes per invocation. If the size of {@code bytes} + * is greater than this limit, the implementation should invoke + * its generation process multiple times to completely fill the + * buffer before returning from this method. + * + * @implSpec The default implementation throws + * an {@link UnsupportedOperationException}. + * + * @param bytes the array to be filled in with random bytes + * @param params additional parameters + * @throws UnsupportedOperationException if the implementation + * has not overridden this method + * @throws IllegalArgumentException if {@code params} is {@code null}, + * illegal or unsupported by this {@code SecureRandom} + * + * @since 9 + */ + protected void engineNextBytes( + byte[] bytes, SecureRandomParameters params) { + throw new UnsupportedOperationException(); + } + /** * Returns the given number of seed bytes. This call may be used to * seed other random number generators. @@ -70,5 +144,58 @@ public abstract class SecureRandomSpi implements java.io.Serializable { * * @return the seed bytes. */ - protected abstract byte[] engineGenerateSeed(int numBytes); + protected abstract byte[] engineGenerateSeed(int numBytes); + + /** + * Reseeds this random object with entropy input read from its + * entropy source with additional parameters. + *

+ * If this method is called by {@link SecureRandom#reseed()}, + * {@code params} will be {@code null}. + *

+ * Do not override this method if the implementation does not + * support reseeding. + * + * @implSpec The default implementation throws + * an {@link UnsupportedOperationException}. + * + * @param params extra parameters, can be {@code null}. + * @throws UnsupportedOperationException if the implementation + * has not overridden this method + * @throws IllegalArgumentException if {@code params} is + * illegal or unsupported by this {@code SecureRandom} + * + * @since 9 + */ + protected void engineReseed(SecureRandomParameters params) { + throw new UnsupportedOperationException(); + } + + /** + * Returns the effective {@link SecureRandomParameters} for this + * {@code SecureRandom} instance. + * + * @implSpec The default implementation returns {@code null}. + * + * @return the effective {@link SecureRandomParameters} parameters, + * or {@code null} if no parameters were used. + * + * @since 9 + */ + protected SecureRandomParameters engineGetParameters() { + return null; + } + + /** + * Returns a Human-readable string representation of this + * {@code SecureRandom}. + * + * @return the string representation + * + * @since 9 + */ + @Override + public String toString() { + return getClass().getSimpleName(); + } } diff --git a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java index a36d1b5e142..17364aef1e4 100644 --- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -1488,7 +1488,7 @@ public final class DateTimeFormatterBuilder { * d 1 appendValue(ChronoField.DAY_OF_MONTH) * dd 2 appendValue(ChronoField.DAY_OF_MONTH, 2) * D 1 appendValue(ChronoField.DAY_OF_YEAR) - * DD 2 appendValue(ChronoField.DAY_OF_YEAR, 2) + * DD 2 appendValue(ChronoField.DAY_OF_YEAR, 2, 3, SignStyle.NOT_NEGATIVE) * DDD 3 appendValue(ChronoField.DAY_OF_YEAR, 3) * F 1 appendValue(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH) * g..g 1..n appendValue(JulianFields.MODIFIED_JULIAN_DAY, n, 19, SignStyle.NORMAL) @@ -1527,12 +1527,9 @@ public final class DateTimeFormatterBuilder { * ss 2 appendValue(ChronoField.SECOND_OF_MINUTE, 2) * * S..S 1..n appendFraction(ChronoField.NANO_OF_SECOND, n, n, false) - * A 1 appendValue(ChronoField.MILLI_OF_DAY) - * A..A 2..n appendValue(ChronoField.MILLI_OF_DAY, n) - * n 1 appendValue(ChronoField.NANO_OF_SECOND) - * n..n 2..n appendValue(ChronoField.NANO_OF_SECOND, n) - * N 1 appendValue(ChronoField.NANO_OF_DAY) - * N..N 2..n appendValue(ChronoField.NANO_OF_DAY, n) + * A..A 1..n appendValue(ChronoField.MILLI_OF_DAY, n, 19, SignStyle.NOT_NEGATIVE) + * n..n 1..n appendValue(ChronoField.NANO_OF_SECOND, n, 19, SignStyle.NOT_NEGATIVE) + * N..N 1..n appendValue(ChronoField.NANO_OF_DAY, n, 19, SignStyle.NOT_NEGATIVE) * *

* Zone ID: Pattern letters to output {@code ZoneId}. @@ -1841,8 +1838,8 @@ public final class DateTimeFormatterBuilder { case 'D': if (count == 1) { appendValue(field); - } else if (count <= 3) { - appendValue(field, count); + } else if (count == 2 || count == 3) { + appendValue(field, count, 3, SignStyle.NOT_NEGATIVE); } else { throw new IllegalArgumentException("Too many pattern letters: " + cur); } @@ -1850,6 +1847,11 @@ public final class DateTimeFormatterBuilder { case 'g': appendValue(field, count, 19, SignStyle.NORMAL); break; + case 'A': + case 'n': + case 'N': + appendValue(field, count, 19, SignStyle.NOT_NEGATIVE); + break; default: if (count == 1) { appendValue(field); diff --git a/jdk/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java b/jdk/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java index 0905d9c3957..8e91eae0bbd 100644 --- a/jdk/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java +++ b/jdk/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java @@ -147,6 +147,7 @@ public abstract class ZoneRulesProvider { if (prop != null) { try { Class c = Class.forName(prop, true, ClassLoader.getSystemClassLoader()); + @SuppressWarnings("deprecation") ZoneRulesProvider provider = ZoneRulesProvider.class.cast(c.newInstance()); registerProvider(provider); loaded.add(provider); diff --git a/jdk/src/java.base/share/classes/java/util/Currency.java b/jdk/src/java.base/share/classes/java/util/Currency.java index 8648147bcfe..cea4cdc4f3c 100644 --- a/jdk/src/java.base/share/classes/java/util/Currency.java +++ b/jdk/src/java.base/share/classes/java/util/Currency.java @@ -545,6 +545,33 @@ public final class Currency implements Serializable { return numericCode; } + /** + * Returns the 3 digit ISO 4217 numeric code of this currency as a {@code String}. + * Unlike {@link getNumericCode()}, which returns the numeric code as {@code int}, + * this method always returns the numeric code as a 3 digit string. + * e.g. a numeric value of 32 would be returned as "032", + * and a numeric value of 6 would be returned as "006". + * + * @return the 3 digit ISO 4217 numeric code of this currency as a {@code String} + * @since 9 + */ + public String getNumericCodeAsString() { + /* numeric code could be returned as a 3 digit string simply by using + String.format("%03d",numericCode); which uses regex to parse the format, + "%03d" in this case. Parsing a regex gives an extra performance overhead, + so String.format() approach is avoided in this scenario. + */ + if (numericCode < 100) { + StringBuilder sb = new StringBuilder(); + sb.append('0'); + if (numericCode < 10) { + sb.append('0'); + } + return sb.append(numericCode).toString(); + } + return String.valueOf(numericCode); + } + /** * Gets the name that is suitable for displaying this currency for * the default {@link Locale.Category#DISPLAY DISPLAY} locale. @@ -788,3 +815,4 @@ public final class Currency implements Serializable { } } } + diff --git a/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java b/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java new file mode 100644 index 00000000000..74fdfc5a210 --- /dev/null +++ b/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java @@ -0,0 +1,657 @@ +/* + * Copyright (c) 2016, 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; + +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; +import java.io.ObjectStreamException; +import java.io.Serializable; + +/** + * Container class for immutable collections. Not part of the public API. + * Mainly for namespace management and shared infrastructure. + * + * Serial warnings are suppressed throughout because all implementation + * classes use a serial proxy and thus have no need to declare serialVersionUID. + */ +@SuppressWarnings("serial") +class ImmutableCollections { + /** + * A "salt" value used for randomizing iteration order. This is initialized once + * and stays constant for the lifetime of the JVM. It need not be truly random, but + * it needs to vary sufficiently from one run to the next so that iteration order + * will vary between JVM runs. + */ + static final int SALT; + static { + SALT = new Random().nextInt(); + } + + /** No instances. */ + private ImmutableCollections() { } + + /** + * The reciprocal of load factor. Given a number of elements + * to store, multiply by this factor to get the table size. + */ + static final double EXPAND_FACTOR = 2.0; + + // ---------- List Implementations ---------- + + static final class List0 extends AbstractList implements RandomAccess, Serializable { + List0() { } + + @Override + public int size() { + return 0; + } + + @Override + public E get(int index) { + Objects.checkIndex(index, 0); // always throws IndexOutOfBoundsException + return null; // but the compiler doesn't know this + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_LIST); + } + } + + static final class List1 extends AbstractList implements RandomAccess, Serializable { + private final E e0; + + List1(E e0) { + this.e0 = Objects.requireNonNull(e0); + } + + @Override + public int size() { + return 1; + } + + @Override + public E get(int index) { + Objects.checkIndex(index, 1); + // assert index == 0 + return e0; + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_LIST, e0); + } + } + + static final class List2 extends AbstractList implements RandomAccess, Serializable { + private final E e0; + private final E e1; + + List2(E e0, E e1) { + this.e0 = Objects.requireNonNull(e0); + this.e1 = Objects.requireNonNull(e1); + } + + @Override + public int size() { + return 2; + } + + @Override + public E get(int index) { + Objects.checkIndex(index, 2); + if (index == 0) { + return e0; + } else { // index == 1 + return e1; + } + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_LIST, e0, e1); + } + } + + static final class ListN extends AbstractList implements RandomAccess, Serializable { + private final E[] elements; + + @SafeVarargs + ListN(E... input) { + // copy and check manually to avoid TOCTOU + @SuppressWarnings("unchecked") + E[] tmp = (E[])new Object[input.length]; // implicit nullcheck of input + for (int i = 0; i < input.length; i++) { + tmp[i] = Objects.requireNonNull(input[i]); + } + this.elements = tmp; + } + + @Override + public int size() { + return elements.length; + } + + @Override + public E get(int index) { + Objects.checkIndex(index, elements.length); + return elements[index]; + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_LIST, elements); + } + } + + // ---------- Set Implementations ---------- + + static final class Set0 extends AbstractSet implements Serializable { + Set0() { } + + @Override + public int size() { + return 0; + } + + @Override + public boolean contains(Object o) { + return super.contains(Objects.requireNonNull(o)); + } + + @Override + public Iterator iterator() { + return Collections.emptyIterator(); + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_SET); + } + } + + static final class Set1 extends AbstractSet implements Serializable { + private final E e0; + + Set1(E e0) { + this.e0 = Objects.requireNonNull(e0); + } + + @Override + public int size() { + return 1; + } + + @Override + public boolean contains(Object o) { + return super.contains(Objects.requireNonNull(o)); + } + + @Override + public Iterator iterator() { + return Collections.singletonIterator(e0); + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_SET, e0); + } + } + + static final class Set2 extends AbstractSet implements Serializable { + private final E e0; + private final E e1; + + Set2(E e0, E e1) { + Objects.requireNonNull(e0); + Objects.requireNonNull(e1); + + if (e0.equals(e1)) { + throw new IllegalArgumentException("duplicate element: " + e0); + } + + if (SALT >= 0) { + this.e0 = e0; + this.e1 = e1; + } else { + this.e0 = e1; + this.e1 = e0; + } + } + + @Override + public int size() { + return 2; + } + + @Override + public boolean contains(Object o) { + return super.contains(Objects.requireNonNull(o)); + } + + @Override + public Iterator iterator() { + return new Iterator() { + private int idx = 0; + + @Override + public boolean hasNext() { + return idx < 2; + } + + @Override + public E next() { + if (idx == 0) { + idx = 1; + return e0; + } else if (idx == 1) { + idx = 2; + return e1; + } else { + throw new NoSuchElementException(); + } + } + }; + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_SET, e0, e1); + } + } + + /** + * An array-based Set implementation. The element array must be strictly + * larger than the size (the number of contained elements) so that at + * least one null is always present. + * @param the element type + */ + static final class SetN extends AbstractSet implements Serializable { + private final E[] elements; + private final int size; + + @SafeVarargs + @SuppressWarnings("unchecked") + SetN(E... input) { + size = input.length; // implicit nullcheck of input + + elements = (E[])new Object[(int)Math.ceil(EXPAND_FACTOR * input.length)]; + for (int i = 0; i < input.length; i++) { + E e = Objects.requireNonNull(input[i]); + int idx = probe(e); + if (idx >= 0) { + throw new IllegalArgumentException("duplicate element: " + e); + } else { + elements[-(idx + 1)] = e; + } + } + } + + @Override + public int size() { + return size; + } + + @Override + public boolean contains(Object o) { + Objects.requireNonNull(o); + return probe(o) >= 0; + } + + @Override + public Iterator iterator() { + return new Iterator() { + private int idx = 0; + + @Override + public boolean hasNext() { + while (idx < elements.length) { + if (elements[idx] != null) + return true; + idx++; + } + return false; + } + + @Override + public E next() { + if (! hasNext()) { + throw new NoSuchElementException(); + } + return elements[idx++]; + } + }; + } + + // returns index at which element is present; or if absent, + // (-i - 1) where i is location where element should be inserted + private int probe(Object pe) { + int idx = Math.floorMod(pe.hashCode() ^ SALT, elements.length); + while (true) { + E ee = elements[idx]; + if (ee == null) { + return -idx - 1; + } else if (pe.equals(ee)) { + return idx; + } else if (++idx == elements.length) { + idx = 0; + } + } + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + Object[] array = new Object[size]; + int dest = 0; + for (Object o : elements) { + if (o != null) { + array[dest++] = o; + } + } + return new CollSer(CollSer.IMM_SET, array); + } + } + + // ---------- Map Implementations ---------- + + static final class Map0 extends AbstractMap implements Serializable { + Map0() { } + + @Override + public Set> entrySet() { + return Set.of(); + } + + @Override + public boolean containsKey(Object o) { + return super.containsKey(Objects.requireNonNull(o)); + } + + @Override + public boolean containsValue(Object o) { + return super.containsValue(Objects.requireNonNull(o)); + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_MAP); + } + } + + static final class Map1 extends AbstractMap implements Serializable { + private final K k0; + private final V v0; + + Map1(K k0, V v0) { + this.k0 = Objects.requireNonNull(k0); + this.v0 = Objects.requireNonNull(v0); + } + + @Override + public Set> entrySet() { + return Set.of(new KeyValueHolder<>(k0, v0)); + } + + @Override + public boolean containsKey(Object o) { + return super.containsKey(Objects.requireNonNull(o)); + } + + @Override + public boolean containsValue(Object o) { + return super.containsValue(Objects.requireNonNull(o)); + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + return new CollSer(CollSer.IMM_MAP, k0, v0); + } + } + + /** + * An array-based Map implementation. There is a single array "table" that + * contains keys and values interleaved: table[0] is kA, table[1] is vA, + * table[2] is kB, table[3] is vB, etc. The table size must be even. It must + * also be strictly larger than the size (the number of key-value pairs contained + * in the map) so that at least one null key is always present. + * @param the key type + * @param the value type + */ + static final class MapN extends AbstractMap implements Serializable { + private final Object[] table; // pairs of key, value + private final int size; // number of pairs + + MapN(Object... input) { + Objects.requireNonNull(input); + if ((input.length & 1) != 0) { + throw new InternalError("length is odd"); + } + size = input.length >> 1; + + int len = (int)Math.ceil(EXPAND_FACTOR * input.length); + len = (len + 1) & ~1; // ensure table is even length + table = new Object[len]; + + for (int i = 0; i < input.length; i += 2) { + @SuppressWarnings("unchecked") + K k = Objects.requireNonNull((K)input[i]); + @SuppressWarnings("unchecked") + V v = Objects.requireNonNull((V)input[i+1]); + int idx = probe(k); + if (idx >= 0) { + throw new IllegalArgumentException("duplicate key: " + k); + } else { + int dest = -(idx + 1); + table[dest] = k; + table[dest+1] = v; + } + } + } + + @Override + public boolean containsKey(Object o) { + return probe(Objects.requireNonNull(o)) >= 0; + } + + @Override + public boolean containsValue(Object o) { + return super.containsValue(Objects.requireNonNull(o)); + } + + @Override + @SuppressWarnings("unchecked") + public V get(Object o) { + int i = probe(o); + if (i >= 0) { + return (V)table[i+1]; + } else { + return null; + } + } + + @Override + public int size() { + return size; + } + + @Override + public Set> entrySet() { + return new AbstractSet>() { + @Override + public int size() { + return MapN.this.size; + } + + @Override + public Iterator> iterator() { + return new Iterator>() { + int idx = 0; + + @Override + public boolean hasNext() { + while (idx < table.length) { + if (table[idx] != null) + return true; + idx += 2; + } + return false; + } + + @Override + public Map.Entry next() { + if (hasNext()) { + @SuppressWarnings("unchecked") + Map.Entry e = + new KeyValueHolder<>((K)table[idx], (V)table[idx+1]); + idx += 2; + return e; + } else { + throw new NoSuchElementException(); + } + } + }; + } + }; + } + + // returns index at which the probe key is present; or if absent, + // (-i - 1) where i is location where element should be inserted + private int probe(Object pk) { + int idx = Math.floorMod(pk.hashCode() ^ SALT, table.length >> 1) << 1; + while (true) { + @SuppressWarnings("unchecked") + K ek = (K)table[idx]; + if (ek == null) { + return -idx - 1; + } else if (pk.equals(ek)) { + return idx; + } else if ((idx += 2) == table.length) { + idx = 0; + } + } + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new InvalidObjectException("not serial proxy"); + } + + private Object writeReplace() { + Object[] array = new Object[2 * size]; + int len = table.length; + int dest = 0; + for (int i = 0; i < len; i += 2) { + if (table[i] != null) { + array[dest++] = table[i]; + array[dest++] = table[i+1]; + } + } + return new CollSer(CollSer.IMM_MAP, array); + } + } +} + +// ---------- Serialization Proxy ---------- + +/** + * Serialization proxy class for immutable collections. + */ +final class CollSer implements Serializable { + private static final long serialVersionUID = 6309168927139932177L; + + static final int IMM_LIST = 1; + static final int IMM_SET = 2; + static final int IMM_MAP = 3; + + private final int flags; + private final Object[] array; + + CollSer(int f, Object... a) { + flags = f; + array = a; + } + + private Object readResolve() throws ObjectStreamException { + try { + if (array == null) { + throw new InvalidObjectException("null array"); + } + + // use low order 8 bits to indicate "kind" + // ignore high order bits + switch (flags & 0xff) { + case IMM_LIST: + return List.of(array); + case IMM_SET: + return Set.of(array); + case IMM_MAP: + if (array.length == 0) { + return new ImmutableCollections.Map0<>(); + } else if (array.length == 2) { + return new ImmutableCollections.Map1<>(array[0], array[1]); + } else { + return new ImmutableCollections.MapN<>(array); + } + default: + throw new InvalidObjectException(String.format("invalid flags 0x%x", flags)); + } + } catch (NullPointerException|IllegalArgumentException ex) { + InvalidObjectException ioe = new InvalidObjectException("invalid object"); + ioe.initCause(ex); + throw ioe; + } + } +} diff --git a/jdk/src/java.base/share/classes/java/util/List.java b/jdk/src/java.base/share/classes/java/util/List.java index 48464801316..4fa78032311 100644 --- a/jdk/src/java.base/share/classes/java/util/List.java +++ b/jdk/src/java.base/share/classes/java/util/List.java @@ -765,7 +765,7 @@ public interface List extends Collection { * @since 9 */ static List of() { - return Collections.emptyList(); + return new ImmutableCollections.List0<>(); } /** @@ -781,7 +781,7 @@ public interface List extends Collection { * @since 9 */ static List of(E e1) { - return Collections.singletonList(Objects.requireNonNull(e1)); + return new ImmutableCollections.List1<>(e1); } /** @@ -798,9 +798,7 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2))); + return new ImmutableCollections.List2<>(e1, e2); } /** @@ -818,10 +816,7 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3))); + return new ImmutableCollections.ListN<>(e1, e2, e3); } /** @@ -840,11 +835,7 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4); } /** @@ -864,12 +855,7 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4, E e5) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4, e5); } /** @@ -890,13 +876,8 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4, E e5, E e6) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4, e5, + e6); } /** @@ -918,14 +899,8 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4, e5, + e6, e7); } /** @@ -948,15 +923,8 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7), - Objects.requireNonNull(e8))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4, e5, + e6, e7, e8); } /** @@ -980,16 +948,8 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7), - Objects.requireNonNull(e8), - Objects.requireNonNull(e9))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4, e5, + e6, e7, e8, e9); } /** @@ -1014,17 +974,8 @@ public interface List extends Collection { * @since 9 */ static List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) { - return Collections.unmodifiableList( - Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7), - Objects.requireNonNull(e8), - Objects.requireNonNull(e9), - Objects.requireNonNull(e10))); + return new ImmutableCollections.ListN<>(e1, e2, e3, e4, e5, + e6, e7, e8, e9, e10); } /** @@ -1055,10 +1006,16 @@ public interface List extends Collection { @SafeVarargs @SuppressWarnings("varargs") static List of(E... elements) { - elements = elements.clone(); // throws NPE if es is null - for (E e : elements) { - Objects.requireNonNull(e); + Objects.requireNonNull(elements); + switch (elements.length) { + case 0: + return new ImmutableCollections.List0<>(); + case 1: + return new ImmutableCollections.List1<>(elements[0]); + case 2: + return new ImmutableCollections.List2<>(elements[0], elements[1]); + default: + return new ImmutableCollections.ListN<>(elements); } - return Collections.unmodifiableList(Arrays.asList(elements)); } } diff --git a/jdk/src/java.base/share/classes/java/util/Locale.java b/jdk/src/java.base/share/classes/java/util/Locale.java index e05904f6f6b..dfe71769d11 100644 --- a/jdk/src/java.base/share/classes/java/util/Locale.java +++ b/jdk/src/java.base/share/classes/java/util/Locale.java @@ -858,7 +858,7 @@ public final class Locale implements Cloneable, Serializable { private static Locale initDefault() { String language, region, script, country, variant; - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); language = props.getProperty("user.language", "en"); // for compatibility, check for old user.region property region = props.getProperty("user.region"); @@ -883,7 +883,7 @@ public final class Locale implements Cloneable, Serializable { } private static Locale initDefault(Locale.Category category) { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); return getInstance( props.getProperty(category.languageKey, defaultLocale.getLanguage()), diff --git a/jdk/src/java.base/share/classes/java/util/Map.java b/jdk/src/java.base/share/classes/java/util/Map.java index 615bb0a5344..7749845cbc5 100644 --- a/jdk/src/java.base/share/classes/java/util/Map.java +++ b/jdk/src/java.base/share/classes/java/util/Map.java @@ -1282,7 +1282,7 @@ public interface Map { * @since 9 */ static Map of() { - return Collections.emptyMap(); + return new ImmutableCollections.Map0<>(); } /** @@ -1299,7 +1299,7 @@ public interface Map { * @since 9 */ static Map of(K k1, V v1) { - return Collections.singletonMap(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); + return new ImmutableCollections.Map1<>(k1, v1); } /** @@ -1319,13 +1319,7 @@ public interface Map { * @since 9 */ static Map of(K k1, V v1, K k2, V v2) { - Map map = new HashMap<>(3); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - if (map.size() != 2) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2); } /** @@ -1347,14 +1341,7 @@ public interface Map { * @since 9 */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3) { - Map map = new HashMap<>(5); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - if (map.size() != 3) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3); } /** @@ -1378,15 +1365,7 @@ public interface Map { * @since 9 */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { - Map map = new HashMap<>(6); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - if (map.size() != 4) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4); } /** @@ -1412,16 +1391,7 @@ public interface Map { * @since 9 */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { - Map map = new HashMap<>(7); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - map.put(Objects.requireNonNull(k5), Objects.requireNonNull(v5)); - if (map.size() != 5) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5); } /** @@ -1450,17 +1420,8 @@ public interface Map { */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) { - Map map = new HashMap<>(9); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - map.put(Objects.requireNonNull(k5), Objects.requireNonNull(v5)); - map.put(Objects.requireNonNull(k6), Objects.requireNonNull(v6)); - if (map.size() != 6) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, + k6, v6); } /** @@ -1491,18 +1452,8 @@ public interface Map { */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) { - Map map = new HashMap<>(10); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - map.put(Objects.requireNonNull(k5), Objects.requireNonNull(v5)); - map.put(Objects.requireNonNull(k6), Objects.requireNonNull(v6)); - map.put(Objects.requireNonNull(k7), Objects.requireNonNull(v7)); - if (map.size() != 7) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, + k6, v6, k7, v7); } /** @@ -1535,19 +1486,8 @@ public interface Map { */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8) { - Map map = new HashMap<>(11); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - map.put(Objects.requireNonNull(k5), Objects.requireNonNull(v5)); - map.put(Objects.requireNonNull(k6), Objects.requireNonNull(v6)); - map.put(Objects.requireNonNull(k7), Objects.requireNonNull(v7)); - map.put(Objects.requireNonNull(k8), Objects.requireNonNull(v8)); - if (map.size() != 8) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, + k6, v6, k7, v7, k8, v8); } /** @@ -1582,20 +1522,8 @@ public interface Map { */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) { - Map map = new HashMap<>(13); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - map.put(Objects.requireNonNull(k5), Objects.requireNonNull(v5)); - map.put(Objects.requireNonNull(k6), Objects.requireNonNull(v6)); - map.put(Objects.requireNonNull(k7), Objects.requireNonNull(v7)); - map.put(Objects.requireNonNull(k8), Objects.requireNonNull(v8)); - map.put(Objects.requireNonNull(k9), Objects.requireNonNull(v9)); - if (map.size() != 9) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, + k6, v6, k7, v7, k8, v8, k9, v9); } /** @@ -1632,21 +1560,8 @@ public interface Map { */ static Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) { - Map map = new HashMap<>(14); // specify number of buckets to avoid resizing - map.put(Objects.requireNonNull(k1), Objects.requireNonNull(v1)); - map.put(Objects.requireNonNull(k2), Objects.requireNonNull(v2)); - map.put(Objects.requireNonNull(k3), Objects.requireNonNull(v3)); - map.put(Objects.requireNonNull(k4), Objects.requireNonNull(v4)); - map.put(Objects.requireNonNull(k5), Objects.requireNonNull(v5)); - map.put(Objects.requireNonNull(k6), Objects.requireNonNull(v6)); - map.put(Objects.requireNonNull(k7), Objects.requireNonNull(v7)); - map.put(Objects.requireNonNull(k8), Objects.requireNonNull(v8)); - map.put(Objects.requireNonNull(k9), Objects.requireNonNull(v9)); - map.put(Objects.requireNonNull(k10), Objects.requireNonNull(v10)); - if (map.size() != 10) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); + return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, + k6, v6, k7, v7, k8, v8, k9, v9, k10, v10); } /** @@ -1683,15 +1598,21 @@ public interface Map { @SafeVarargs @SuppressWarnings("varargs") static Map ofEntries(Entry... entries) { - Map map = new HashMap<>(entries.length * 4 / 3 + 1); // throws NPE if entries is null - for (Entry e : entries) { - // next line throws NPE if e is null - map.put(Objects.requireNonNull(e.getKey()), Objects.requireNonNull(e.getValue())); + Objects.requireNonNull(entries); + if (entries.length == 0) { + return new ImmutableCollections.Map0<>(); + } else if (entries.length == 1) { + return new ImmutableCollections.Map1<>(entries[0].getKey(), + entries[0].getValue()); + } else { + Object[] kva = new Object[entries.length << 1]; + int a = 0; + for (Entry entry : entries) { + kva[a++] = entry.getKey(); + kva[a++] = entry.getValue(); + } + return new ImmutableCollections.MapN<>(kva); } - if (map.size() != entries.length) { - throw new IllegalArgumentException("duplicate keys"); - } - return Collections.unmodifiableMap(map); } /** diff --git a/jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java b/jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java index 9c20a680733..3a481035c92 100644 --- a/jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java +++ b/jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java @@ -140,9 +140,8 @@ public class PropertyResourceBundle extends ResourceBundle { // Check whether the strict encoding is specified. // The possible encoding is either "ISO-8859-1" or "UTF-8". - private static final String encoding = - GetPropertyAction - .getProperty("java.util.PropertyResourceBundle.encoding", "") + private static final String encoding = GetPropertyAction + .privilegedGetProperty("java.util.PropertyResourceBundle.encoding", "") .toUpperCase(Locale.ROOT); /** diff --git a/jdk/src/java.base/share/classes/java/util/ServiceLoader.java b/jdk/src/java.base/share/classes/java/util/ServiceLoader.java index 7ccce279357..081b96158ff 100644 --- a/jdk/src/java.base/share/classes/java/util/ServiceLoader.java +++ b/jdk/src/java.base/share/classes/java/util/ServiceLoader.java @@ -29,8 +29,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.lang.module.ModuleDescriptor; -import java.lang.module.ModuleDescriptor.Provides; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Layer; @@ -85,7 +83,7 @@ import jdk.internal.reflect.Reflection; * and deployed as a named module must have an appropriate uses clause * in its module descriptor to declare that the module uses * implementations of the service. A corresponding requirement is that a - * provider deployed as a named modules must have an appropriate + * provider deployed as a named module must have an appropriate * provides clause in its module descriptor to declare that the module * provides an implementation of the service. The uses and * provides allow consumers of a service to be linked to @@ -550,35 +548,29 @@ public final class ServiceLoader /** * Implements lazy service provider lookup of service providers that * are provided by modules in a module Layer. - * - * For now, this iterator examines all modules in each Layer. This will - * be replaced once we decide on how the service-use graph is exposed - * in the module API. */ private class LayerLookupIterator extends RestrictedIterator { final String serviceName; Layer currentLayer; - Iterator descriptorIterator; - Iterator providersIterator; - - Module nextModule; - String nextProvider; + Iterator iterator; + ServiceProvider nextProvider; LayerLookupIterator() { serviceName = service.getName(); currentLayer = layer; // need to get us started - descriptorIterator = descriptors(layer, serviceName); + iterator = providers(currentLayer, serviceName); } - Iterator descriptors(Layer layer, String service) { - return layer.modules().stream() - .map(Module::getDescriptor) - .filter(d -> d.provides().get(service) != null) - .iterator(); + Iterator providers(Layer layer, String service) { + ServicesCatalog catalog = SharedSecrets + .getJavaLangReflectModuleAccess() + .getServicesCatalog(layer); + + return catalog.findServices(serviceName).iterator(); } @Override @@ -591,30 +583,18 @@ public final class ServiceLoader while (true) { // next provider - if (providersIterator != null && providersIterator.hasNext()) { - nextProvider = providersIterator.next(); + if (iterator != null && iterator.hasNext()) { + nextProvider = iterator.next(); return true; } - // next descriptor - if (descriptorIterator.hasNext()) { - ModuleDescriptor descriptor = descriptorIterator.next(); - - nextModule = currentLayer.findModule(descriptor.name()).get(); - - Provides provides = descriptor.provides().get(serviceName); - providersIterator = provides.providers().iterator(); - - continue; - } - // next layer Layer parent = currentLayer.parent().orElse(null); if (parent == null) return false; currentLayer = parent; - descriptorIterator = descriptors(currentLayer, serviceName); + iterator = providers(currentLayer, serviceName); } } @@ -623,13 +603,14 @@ public final class ServiceLoader if (!hasNextService()) throw new NoSuchElementException(); - assert nextModule != null && nextProvider != null; - - String cn = nextProvider; + ServiceProvider provider = nextProvider; nextProvider = null; + Module module = provider.module(); + String cn = provider.providerName(); + // attempt to load the provider - Class c = loadClassInModule(nextModule, cn); + Class c = loadClassInModule(module, cn); if (c == null) fail(service, "Provider " + cn + " not found"); if (!service.isAssignableFrom(c)) @@ -830,7 +811,9 @@ public final class ServiceLoader } S p = null; try { - p = service.cast(c.newInstance()); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + p = service.cast(tmp); } catch (Throwable x) { fail(service, "Provider " + cn + " could not be instantiated", diff --git a/jdk/src/java.base/share/classes/java/util/Set.java b/jdk/src/java.base/share/classes/java/util/Set.java index b0db7fc55bd..96f6f2d974d 100644 --- a/jdk/src/java.base/share/classes/java/util/Set.java +++ b/jdk/src/java.base/share/classes/java/util/Set.java @@ -444,7 +444,7 @@ public interface Set extends Collection { * @since 9 */ static Set of() { - return Collections.emptySet(); + return new ImmutableCollections.Set0<>(); } /** @@ -459,7 +459,7 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1) { - return Collections.singleton(Objects.requireNonNull(e1)); + return new ImmutableCollections.Set1<>(e1); } /** @@ -476,12 +476,7 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2))); - if (set.size() != 2) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.Set2<>(e1, e2); } /** @@ -499,13 +494,7 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3))); - if (set.size() != 3) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3); } /** @@ -524,14 +513,7 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4))); - if (set.size() != 4) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4); } /** @@ -551,15 +533,7 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4, E e5) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5))); - if (set.size() != 5) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4, e5); } /** @@ -580,16 +554,8 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4, E e5, E e6) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6))); - if (set.size() != 6) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4, e5, + e6); } /** @@ -611,17 +577,8 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7))); - if (set.size() != 7) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4, e5, + e6, e7); } /** @@ -644,18 +601,8 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7), - Objects.requireNonNull(e8))); - if (set.size() != 8) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4, e5, + e6, e7, e8); } /** @@ -679,19 +626,8 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7), - Objects.requireNonNull(e8), - Objects.requireNonNull(e9))); - if (set.size() != 9) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4, e5, + e6, e7, e8, e9); } /** @@ -716,20 +652,8 @@ public interface Set extends Collection { * @since 9 */ static Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) { - Set set = new HashSet<>(Arrays.asList(Objects.requireNonNull(e1), - Objects.requireNonNull(e2), - Objects.requireNonNull(e3), - Objects.requireNonNull(e4), - Objects.requireNonNull(e5), - Objects.requireNonNull(e6), - Objects.requireNonNull(e7), - Objects.requireNonNull(e8), - Objects.requireNonNull(e9), - Objects.requireNonNull(e10))); - if (set.size() != 10) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); + return new ImmutableCollections.SetN<>(e1, e2, e3, e4, e5, + e6, e7, e8, e9, e10); } /** @@ -759,15 +683,18 @@ public interface Set extends Collection { * @since 9 */ @SafeVarargs + @SuppressWarnings("varargs") static Set of(E... elements) { - for (E e : elements) { // throws NPE if es is null - Objects.requireNonNull(e); + Objects.requireNonNull(elements); + switch (elements.length) { + case 0: + return new ImmutableCollections.Set0<>(); + case 1: + return new ImmutableCollections.Set1<>(elements[0]); + case 2: + return new ImmutableCollections.Set2<>(elements[0], elements[1]); + default: + return new ImmutableCollections.SetN<>(elements); } - @SuppressWarnings("varargs") - Set set = new HashSet<>(Arrays.asList(elements)); - if (set.size() != elements.length) { - throw new IllegalArgumentException("duplicate elements"); - } - return Collections.unmodifiableSet(set); } } diff --git a/jdk/src/java.base/share/classes/java/util/TimeZone.java b/jdk/src/java.base/share/classes/java/util/TimeZone.java index 22c382cb0a2..1180d38c491 100644 --- a/jdk/src/java.base/share/classes/java/util/TimeZone.java +++ b/jdk/src/java.base/share/classes/java/util/TimeZone.java @@ -42,6 +42,7 @@ import java.io.Serializable; import java.security.AccessController; import java.security.PrivilegedAction; import java.time.ZoneId; +import java.util.Properties; import sun.security.action.GetPropertyAction; import sun.util.calendar.ZoneInfo; import sun.util.calendar.ZoneInfoFile; @@ -660,12 +661,13 @@ public abstract class TimeZone implements Serializable, Cloneable { private static synchronized TimeZone setDefaultZone() { TimeZone tz; // get the time zone ID from the system properties - String zoneID = GetPropertyAction.getProperty("user.timezone"); + Properties props = GetPropertyAction.privilegedGetProperties(); + String zoneID = props.getProperty("user.timezone"); // if the time zone ID is not set (yet), perform the // platform to Java time zone ID mapping. if (zoneID == null || zoneID.isEmpty()) { - String javaHome = GetPropertyAction.getProperty("java.home"); + String javaHome = props.getProperty("java.home"); try { zoneID = getSystemTimeZoneID(javaHome); if (zoneID == null) { @@ -693,13 +695,7 @@ public abstract class TimeZone implements Serializable, Cloneable { assert tz != null; final String id = zoneID; - AccessController.doPrivileged(new PrivilegedAction<>() { - @Override - public Void run() { - System.setProperty("user.timezone", id); - return null; - } - }); + props.setProperty("user.timezone", id); defaultTimeZone = tz; return tz; diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java index bcb6d59fcad..6ec5e6cba7e 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java @@ -3507,6 +3507,7 @@ public class ForkJoinPool extends AbstractExecutorService { * Creates and returns the common pool, respecting user settings * specified via system properties. */ + @SuppressWarnings("deprecation") // Class.newInstance static ForkJoinPool makeCommonPool() { int parallelism = -1; ForkJoinWorkerThreadFactory factory = null; diff --git a/jdk/src/java.base/share/classes/java/util/jar/JarFile.java b/jdk/src/java.base/share/classes/java/util/jar/JarFile.java index ff26faad4f4..5f08db7b1c4 100644 --- a/jdk/src/java.base/share/classes/java/util/jar/JarFile.java +++ b/jdk/src/java.base/share/classes/java/util/jar/JarFile.java @@ -155,7 +155,7 @@ class JarFile extends ZipFile { BASE_VERSION = 8; // one less than lowest version for versioned entries int runtimeVersion = jdk.Version.current().major(); String jarVersion = - GetPropertyAction.getProperty("jdk.util.jar.version"); + GetPropertyAction.privilegedGetProperty("jdk.util.jar.version"); if (jarVersion != null) { int jarVer = Integer.parseInt(jarVersion); runtimeVersion = (jarVer > runtimeVersion) @@ -163,7 +163,7 @@ class JarFile extends ZipFile { } RUNTIME_VERSION = runtimeVersion; String enableMultiRelease = GetPropertyAction - .getProperty("jdk.util.jar.enableMultiRelease", "true"); + .privilegedGetProperty("jdk.util.jar.enableMultiRelease", "true"); switch (enableMultiRelease) { case "true": default: @@ -658,6 +658,28 @@ class JarFile extends ZipFile { return vze == null ? ze : vze; } + /** + * Returns the real name of a {@code JarEntry}. If this {@code JarFile} is + * a multi-release jar file and is configured to be processed as such, the + * name returned by this method is the path name of the versioned entry + * that the {@code JarEntry} represents, rather than the path name of the + * base entry that {@link JarEntry#getName()} returns. If the + * {@code JarEntry} does not represent a versioned entry, or the + * jar file is not a multi-release jar file or {@code JarFile} is not + * configured for processing a multi-release jar file, this method returns + * the same name that {@link JarEntry#getName()} returns. + * + * @param entry the JarEntry + * @return the real name of the JarEntry + * @since 9 + */ + String getRealName(JarEntry entry) { + if (entry instanceof JarFileEntry) { + return ((JarFileEntry)entry).realName(); + } + return entry.getName(); + } + private class JarFileEntry extends JarEntry { final private String name; @@ -684,7 +706,7 @@ class JarFile extends ZipFile { throw new RuntimeException(e); } if (certs == null && jv != null) { - certs = jv.getCerts(JarFile.this, reifiedEntry()); + certs = jv.getCerts(JarFile.this, realEntry()); } return certs == null ? null : certs.clone(); } @@ -695,17 +717,20 @@ class JarFile extends ZipFile { throw new RuntimeException(e); } if (signers == null && jv != null) { - signers = jv.getCodeSigners(JarFile.this, reifiedEntry()); + signers = jv.getCodeSigners(JarFile.this, realEntry()); } return signers == null ? null : signers.clone(); } - JarFileEntry reifiedEntry() { + JarFileEntry realEntry() { if (isMultiRelease()) { String entryName = super.getName(); return entryName.equals(this.name) ? this : new JarFileEntry(entryName, this); } return this; } + String realName() { + return super.getName(); + } @Override public String getName() { @@ -876,11 +901,11 @@ class JarFile extends ZipFile { private JarEntry verifiableEntry(ZipEntry ze) { if (ze instanceof JarFileEntry) { // assure the name and entry match for verification - return ((JarFileEntry)ze).reifiedEntry(); + return ((JarFileEntry)ze).realEntry(); } ze = getJarEntry(ze.getName()); if (ze instanceof JarFileEntry) { - return ((JarFileEntry)ze).reifiedEntry(); + return ((JarFileEntry)ze).realEntry(); } return (JarEntry)ze; } diff --git a/jdk/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java b/jdk/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java index 0844b9171d1..a8c5cf73aea 100644 --- a/jdk/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java +++ b/jdk/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java @@ -60,4 +60,8 @@ class JavaUtilJarAccessImpl implements JavaUtilJarAccess { public List getManifestDigests(JarFile jar) { return jar.getManifestDigests(); } + + public String getRealName(JarFile jar, JarEntry entry) { + return jar.getRealName(entry); + } } diff --git a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java index ac47ad12032..01df2638039 100644 --- a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java +++ b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java @@ -695,7 +695,7 @@ public abstract class Pack200 { Class impl = (PACK_PROVIDER.equals(prop))? packerImpl: unpackerImpl; if (impl == null) { // The first time, we must decide which class to use. - implName = GetPropertyAction.getProperty(prop,""); + implName = GetPropertyAction.privilegedGetProperty(prop,""); if (implName != null && !implName.equals("")) impl = Class.forName(implName); else if (PACK_PROVIDER.equals(prop)) @@ -704,7 +704,9 @@ public abstract class Pack200 { impl = com.sun.java.util.jar.pack.UnpackerImpl.class; } // We have a class. Now instantiate it. - return impl.newInstance(); + @SuppressWarnings("deprecation") + Object result = impl.newInstance(); + return result; } catch (ClassNotFoundException e) { throw new Error("Class not found: " + implName + ":\ncheck property " + prop + diff --git a/jdk/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java b/jdk/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java index f7768da27da..adaf261b745 100644 --- a/jdk/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java +++ b/jdk/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java @@ -94,7 +94,7 @@ public class PatternSyntaxException } private static final String nl = - GetPropertyAction.getProperty("line.separator"); + GetPropertyAction.privilegedGetProperty("line.separator"); /** * Returns a multi-line string containing the description of the syntax diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index ff76017651b..10a0d8a0be0 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -55,7 +55,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants { */ private static final boolean inhibitZip64 = Boolean.parseBoolean( - GetPropertyAction.getProperty("jdk.util.zip.inhibitZip64")); + GetPropertyAction.privilegedGetProperty("jdk.util.zip.inhibitZip64")); private static class XEntry { final ZipEntry entry; diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java b/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java index a992a07f3d1..fea47ba0cd3 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java @@ -97,6 +97,7 @@ public abstract class SSLServerSocketFactory extends ServerSocketFactory } } log("class " + clsName + " is loaded"); + @SuppressWarnings("deprecation") SSLServerSocketFactory fac = (SSLServerSocketFactory)cls.newInstance(); log("instantiated an instance of class " + clsName); theFactory = fac; diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java index b436414308f..6375a52a1b0 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java @@ -51,7 +51,7 @@ public abstract class SSLSocketFactory extends SocketFactory static final boolean DEBUG; static { - String s = GetPropertyAction.getProperty("javax.net.debug", "") + String s = GetPropertyAction.privilegedGetProperty("javax.net.debug", "") .toLowerCase(Locale.ENGLISH); DEBUG = s.contains("all") || s.contains("ssl"); @@ -106,6 +106,7 @@ public abstract class SSLSocketFactory extends SocketFactory } } log("class " + clsName + " is loaded"); + @SuppressWarnings("deprecation") SSLSocketFactory fac = (SSLSocketFactory)cls.newInstance(); log("instantiated an instance of class " + clsName); theFactory = fac; diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java index 8db88e0c0d3..c1844d523eb 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java @@ -250,7 +250,9 @@ public abstract class Configuration { finalClass, false, Thread.currentThread().getContextClassLoader() ).asSubclass(Configuration.class); - return implClass.newInstance(); + @SuppressWarnings("deprecation") + Configuration result = implClass.newInstance(); + return result; } }); AccessController.doPrivileged( diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java index e266c4706f0..af46b200701 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java @@ -304,7 +304,9 @@ public class LoginContext { Class c = Class.forName( defaultHandler, true, finalLoader).asSubclass(CallbackHandler.class); - return c.newInstance(); + @SuppressWarnings("deprecation") + CallbackHandler result = c.newInstance(); + return result; } }); } catch (java.security.PrivilegedActionException pae) { @@ -697,8 +699,9 @@ public class LoginContext { if (moduleStack[i].module == null) { try { - moduleStack[i].module = (LoginModule) Class.forName( - name, false, contextClassLoader).newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(name, false, contextClassLoader).newInstance(); + moduleStack[i].module = (LoginModule) tmp; if (debug != null) { debug.println(name + " loaded via reflection"); } diff --git a/jdk/src/java.base/share/classes/jdk/Version.java b/jdk/src/java.base/share/classes/jdk/Version.java index 756af9ec051..8afccfba6a8 100644 --- a/jdk/src/java.base/share/classes/jdk/Version.java +++ b/jdk/src/java.base/share/classes/jdk/Version.java @@ -273,7 +273,8 @@ public final class Version */ public static Version current() { if (current == null) { - current = parse(GetPropertyAction.getProperty("java.version")); + current = parse( + GetPropertyAction.privilegedGetProperty("java.version")); } return current; } diff --git a/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java b/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java index 746d61a273c..512a3462ba7 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java +++ b/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java @@ -124,7 +124,9 @@ public final class JrtFileSystemProvider extends FileSystemProvider { ClassLoader cl = newJrtFsLoader(jrtfs); try { Class c = Class.forName(JrtFileSystemProvider.class.getName(), false, cl); - return ((FileSystemProvider)c.newInstance()).newFileSystem(uri, newEnv); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + return ((FileSystemProvider)tmp).newFileSystem(uri, newEnv); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java index 269c193dbe4..732248a377c 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java +++ b/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -68,7 +68,7 @@ public class BootLoader { } // ServiceCatalog for the boot class loader - private static final ServicesCatalog SERVICES_CATALOG = new ServicesCatalog(); + private static final ServicesCatalog SERVICES_CATALOG = ServicesCatalog.create(); // ClassLoaderValue map for boot class loader private static final ConcurrentHashMap CLASS_LOADER_VALUE_MAP = diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java index 5d7462e16c4..b6e58fb932b 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java +++ b/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java @@ -104,7 +104,7 @@ public class BuiltinClassLoader * A module defined/loaded by a built-in class loader. * * A LoadedModule encapsulates a ModuleReference along with its CodeSource - * URL to avoid needing to create this URL when define classes. + * URL to avoid needing to create this URL when defining classes. */ private static class LoadedModule { private final BuiltinClassLoader loader; diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java b/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java index 234a86a9271..aa2722c5e63 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java +++ b/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java @@ -85,7 +85,7 @@ public class URLClassPath { private static final boolean DISABLE_JAR_CHECKING; static { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); JAVA_VERSION = props.getProperty("java.version"); DEBUG = (props.getProperty("sun.misc.URLClassPath.debug") != null); String p = props.getProperty("sun.misc.URLClassPath.disableJarChecking"); @@ -372,9 +372,15 @@ public class URLClassPath { return java.security.AccessController.doPrivileged( new java.security.PrivilegedExceptionAction<>() { public Loader run() throws IOException { + String protocol = url.getProtocol(); // lower cased in URL String file = url.getFile(); - if (file != null && file.endsWith("/")) { - if ("file".equals(url.getProtocol())) { + if ("jar".equals(protocol) + && file != null && (file.indexOf("!/") == file.length() - 2)) { + // extract the nested URL + URL nestedUrl = new URL(file.substring(0, file.length() - 2)); + return new JarLoader(nestedUrl, jarHandler, lmap); + } else if (file != null && file.endsWith("/")) { + if ("file".equals(protocol)) { return new FileLoader(url); } else { return new Loader(url); @@ -718,13 +724,13 @@ public class URLClassPath { final URL url; try { + String nm; if (jar.isMultiRelease()) { - // add #runtime fragment to tell JarURLConnection to use - // runtime versioning if the underlying jar file is multi-release - url = new URL(getBaseURL(), ParseUtil.encodePath(name, false) + "#runtime"); + nm = SharedSecrets.javaUtilJarAccess().getRealName(jar, entry); } else { - url = new URL(getBaseURL(), ParseUtil.encodePath(name, false)); + nm = name; } + url = new URL(getBaseURL(), ParseUtil.encodePath(nm, false)); if (check) { URLClassPath.check(url); } @@ -940,7 +946,8 @@ public class URLClassPath { ensureOpen(); - if (SharedSecrets.javaUtilJarAccess().jarFileHasClassPathAttribute(jar)) { // Only get manifest when necessary + // Only get manifest when necessary + if (SharedSecrets.javaUtilJarAccess().jarFileHasClassPathAttribute(jar)) { Manifest man = jar.getManifest(); if (man != null) { Attributes attr = man.getMainAttributes(); diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java b/jdk/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java index 58f235d6ccd..1009968046a 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java +++ b/jdk/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java @@ -81,7 +81,7 @@ public final class LoggerFinderLoader { // Get configuration error policy private static ErrorPolicy configurationErrorPolicy() { String errorPolicy = - GetPropertyAction.getProperty("jdk.logger.finder.error"); + GetPropertyAction.privilegedGetProperty("jdk.logger.finder.error"); if (errorPolicy == null || errorPolicy.isEmpty()) { return ErrorPolicy.WARNING; } @@ -96,7 +96,7 @@ public final class LoggerFinderLoader { // This is further submitted to the configuration error policy. private static boolean ensureSingletonProvider() { return Boolean.parseBoolean( - GetPropertyAction.getProperty("jdk.logger.finder.singleton")); + GetPropertyAction.privilegedGetProperty("jdk.logger.finder.singleton")); } private static Iterator findLoggerFinderProviders() { diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java b/jdk/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java index c90a7b24e38..fb0ffe64426 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java +++ b/jdk/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java @@ -56,7 +56,7 @@ public class SimpleConsoleLogger extends LoggerConfiguration static Level getDefaultLevel() { String levelName = GetPropertyAction - .getProperty("jdk.system.logger.level", "INFO"); + .privilegedGetProperty("jdk.system.logger.level", "INFO"); try { return Level.valueOf(levelName); } catch (IllegalArgumentException iae) { @@ -426,7 +426,7 @@ public class SimpleConsoleLogger extends LoggerConfiguration static private final String[] skips; static { String additionalPkgs = - GetPropertyAction.getProperty("jdk.logger.packages"); + GetPropertyAction.privilegedGetProperty("jdk.logger.packages"); skips = additionalPkgs == null ? new String[0] : additionalPkgs.split(","); } @@ -485,7 +485,7 @@ public class SimpleConsoleLogger extends LoggerConfiguration // jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java // to fail - because that test has a testcase which somehow references // PlatformLogger and counts the number of generated lambda classes. - String format = GetPropertyAction.getProperty(key); + String format = GetPropertyAction.privilegedGetProperty(key); if (format == null && defaultPropertyGetter != null) { format = defaultPropertyGetter.apply(key); diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java index 1a4aba5d79b..5e2c4d28e93 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java @@ -35,4 +35,9 @@ public interface JavaLangInvokeAccess { * Returns the name for the given MemberName */ String getName(Object mname); + + /** + * Returns {@code true} if the given MemberName is a native method + */ + boolean isNative(Object mname); } diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java index e0c7e66cf51..1ff6d0b73b4 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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,13 +25,24 @@ package jdk.internal.misc; +import java.io.PrintStream; +import java.lang.module.Configuration; +import jdk.internal.module.ModuleHashes; + import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Exports; import java.lang.module.ModuleDescriptor.Requires; import java.lang.module.ModuleDescriptor.Provides; import java.lang.module.ModuleDescriptor.Version; +import java.lang.module.ModuleFinder; +import java.util.Collection; +import java.lang.module.ModuleReader; +import java.lang.module.ModuleReference; +import java.net.URI; import java.util.Map; +import java.util.Optional; import java.util.Set; +import java.util.function.Supplier; /** * Provides access to non-public methods in java.lang.module. @@ -89,5 +100,29 @@ public interface JavaLangModuleAccess { String osArch, String osVersion, Set conceals, - Set packages); + Set packages, + ModuleHashes hashes); + + /** + * Resolves a collection of root modules, with service binding + * and the empty configuration as the parent. The post resolution + * checks are optionally run. + */ + Configuration resolveRequiresAndUses(ModuleFinder finder, + Collection roots, + boolean check, + PrintStream traceOutput); + + /** + * Creates a ModuleReference to a "patched" module. + */ + ModuleReference newPatchedModule(ModuleDescriptor descriptor, + URI location, + Supplier readerSupplier); + + /** + * Returns the object with the hashes of other modules + */ + Optional hashes(ModuleDescriptor descriptor); + } diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java index 91aa495528c..33c86cf410b 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,9 +26,12 @@ package jdk.internal.misc; import java.lang.module.ModuleDescriptor; +import java.lang.reflect.Layer; import java.lang.reflect.Module; import java.net.URI; +import jdk.internal.module.ServicesCatalog; + /** * Provides access to non-public methods in java.lang.reflect.Module */ @@ -56,6 +59,11 @@ public interface JavaLangReflectModuleAccess { */ void addReads(Module m1, Module m2); + /** + * Updates module m to read all unnamed modules. + */ + void addReadsAllUnnamed(Module m); + /** * Updates module m1 to export a package to module m2. The export does * not result in a strong reference to m2 (m2 can be GC'ed). @@ -76,4 +84,10 @@ public interface JavaLangReflectModuleAccess { * Add a package to the given module. */ void addPackage(Module m, String pkg); -} + + /** + * Returns the ServicesCatalog for the given Layer. + */ + ServicesCatalog getServicesCatalog(Layer layer); + +} \ No newline at end of file diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java index bf59351dee6..f1f7d8be2c0 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java @@ -41,4 +41,5 @@ public interface JavaUtilJarAccess { public Enumeration entries2(JarFile jar); public void setEagerValidation(JarFile jar, boolean eager); public List getManifestDigests(JarFile jar); + public String getRealName(JarFile jar, JarEntry entry); } diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java b/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java index 8d51a5c6419..7c85e77d27e 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java @@ -74,6 +74,8 @@ final class Builder { String osName; String osArch; String osVersion; + String algorithm; + Map hashes; Builder(String name, int reqs, int exports, int provides, int conceals, int packages) { @@ -251,6 +253,25 @@ final class Builder { return this; } + /** + * Sets the algorithm of the module hashes + */ + public Builder algorithm(String algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Sets the module hash for the given module name + */ + public Builder moduleHash(String mn, String hash) { + if (hashes == null) + hashes = new HashMap<>(); + + hashes.put(mn, hash); + return this; + } + /** * Returns the set of packages that is the union of the exported and * concealed packages. @@ -273,6 +294,9 @@ final class Builder { public ModuleDescriptor build() { assert name != null; + ModuleHashes moduleHashes = + hashes != null ? new ModuleHashes(algorithm, hashes) : null; + return jlma.newModuleDescriptor(name, false, // automatic false, // assume not synthetic for now @@ -286,6 +310,7 @@ final class Builder { osArch, osVersion, conceals, - computePackages(exports, conceals)); + computePackages(exports, conceals), + moduleHashes); } } diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java b/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java index 66b48915159..73a44c8735c 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java @@ -34,6 +34,7 @@ import java.lang.module.ModuleDescriptor.Version; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; @@ -42,7 +43,6 @@ import jdk.internal.org.objectweb.asm.ByteVector; import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.Label; -import jdk.internal.module.Hasher.DependencyHashes; import static jdk.internal.module.ClassFileConstants.*; @@ -148,7 +148,7 @@ class ClassFileAttributes { for (int i=0; i new HashSet<>()).add(cn); + provides.computeIfAbsent(sn, k -> new LinkedHashSet<>()).add(cn); off += 4; } provides.entrySet().forEach(e -> builder.provides(e.getKey(), @@ -281,10 +281,10 @@ class ClassFileAttributes { * u4 attribute_length; * * // the number of entries in the packages table - * u2 package_count; + * u2 packages_count; * { // index to CONSTANT_CONSTANT_utf8_info structure with the package name * u2 package_index - * } package[package_count]; + * } packages[package_count]; * * } */ @@ -579,9 +579,9 @@ class ClassFileAttributes { * alternative is to store it as an array of u1. */ static class HashesAttribute extends Attribute { - private final DependencyHashes hashes; + private final ModuleHashes hashes; - HashesAttribute(DependencyHashes hashes) { + HashesAttribute(ModuleHashes hashes) { super(HASHES); this.hashes = hashes; } @@ -613,7 +613,7 @@ class ClassFileAttributes { map.put(dn, hash); } - DependencyHashes hashes = new DependencyHashes(algorithm, map); + ModuleHashes hashes = new ModuleHashes(algorithm, map); return new HashesAttribute(hashes); } diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java index 5b6c3c4372c..f2f7e02598c 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java @@ -26,12 +26,15 @@ package jdk.internal.module; import java.io.File; +import java.io.PrintStream; import java.lang.module.Configuration; -import java.lang.module.ModuleReference; +import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; import java.lang.module.ResolvedModule; import java.lang.reflect.Layer; import java.lang.reflect.Module; +import java.net.URI; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; @@ -41,10 +44,10 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.function.Function; -import java.util.stream.Collectors; import jdk.internal.loader.BootLoader; import jdk.internal.loader.BuiltinClassLoader; +import jdk.internal.misc.SharedSecrets; import jdk.internal.perf.PerfCounter; /** @@ -54,10 +57,9 @@ import jdk.internal.perf.PerfCounter; * the module system. In summary, the boot method creates a Configuration by * resolving a set of module names specified via the launcher (or equivalent) * -m and -addmods options. The modules are located on a module path that is - * constructed from the upgrade, system and application module paths. The - * Configuration is reified by creating the boot Layer with each module in the - * the configuration defined to one of the built-in class loaders. The mapping - * of modules to class loaders is statically mapped in a helper class. + * constructed from the upgrade module path, system modules, and application + * module path. The Configuration is instantiated as the boot Layer with each + * module in the the configuration defined to one of the built-in class loaders. */ public final class ModuleBootstrap { @@ -65,6 +67,11 @@ public final class ModuleBootstrap { private static final String JAVA_BASE = "java.base"; + private static final String JAVA_SE = "java.se"; + + // the token for "all default modules" + private static final String ALL_DEFAULT = "ALL-DEFAULT"; + // the token for "all unnamed modules" private static final String ALL_UNNAMED = "ALL-UNNAMED"; @@ -94,47 +101,65 @@ public final class ModuleBootstrap { long t0 = System.nanoTime(); - // system module path - ModuleFinder systemModulePath = ModuleFinder.ofSystem(); + // system modules + ModuleFinder systemModules = ModuleFinder.ofSystem(); - // Once we have the system module path then we define the base module. - // We do this here so that java.base is defined to the VM as early as + PerfCounters.systemModulesTime.addElapsedTimeFrom(t0); + + + long t1 = System.nanoTime(); + + // Once we have the system modules then we define the base module to + // the VM. We do this here so that java.base is defined as early as // possible and also that resources in the base module can be located // for error messages that may happen from here on. - Optional obase = systemModulePath.find(JAVA_BASE); - if (!obase.isPresent()) + ModuleReference base = systemModules.find(JAVA_BASE).orElse(null); + if (base == null) throw new InternalError(JAVA_BASE + " not found"); - ModuleReference base = obase.get(); + URI baseUri = base.location().orElse(null); + if (baseUri == null) + throw new InternalError(JAVA_BASE + " does not have a location"); BootLoader.loadModule(base); - Modules.defineModule(null, base.descriptor(), base.location().orElse(null)); + Modules.defineModule(null, base.descriptor(), baseUri); + PerfCounters.defineBaseTime.addElapsedTimeFrom(t1); + + + long t2 = System.nanoTime(); // -upgrademodulepath option specified to launcher ModuleFinder upgradeModulePath = createModulePathFinder("jdk.upgrade.module.path"); + if (upgradeModulePath != null) + systemModules = ModuleFinder.compose(upgradeModulePath, systemModules); // -modulepath option specified to the launcher ModuleFinder appModulePath = createModulePathFinder("jdk.module.path"); - // The module finder: [-upgrademodulepath] system-module-path [-modulepath] - ModuleFinder finder = systemModulePath; - if (upgradeModulePath != null) - finder = ModuleFinder.compose(upgradeModulePath, finder); + // The module finder: [-upgrademodulepath] system [-modulepath] + ModuleFinder finder = systemModules; if (appModulePath != null) finder = ModuleFinder.compose(finder, appModulePath); - // launcher -m option to specify the initial module + // The root modules to resolve + Set roots = new HashSet<>(); + + // launcher -m option to specify the main/initial module String mainModule = System.getProperty("jdk.module.main"); + if (mainModule != null) + roots.add(mainModule); // additional module(s) specified by -addmods + boolean addAllDefaultModules = false; boolean addAllSystemModules = false; boolean addAllApplicationModules = false; - Set addModules = null; String propValue = System.getProperty("jdk.launcher.addmods"); if (propValue != null) { - addModules = new HashSet<>(); for (String mod: propValue.split(",")) { switch (mod) { + case ALL_DEFAULT: + addAllDefaultModules = true; + break; case ALL_SYSTEM: addAllSystemModules = true; break; @@ -142,28 +167,12 @@ public final class ModuleBootstrap { addAllApplicationModules = true; break; default : - addModules.add(mod); + roots.add(mod); } } } - // The root modules to resolve - Set roots = new HashSet<>(); - - // main/initial module - if (mainModule != null) { - roots.add(mainModule); - if (addAllApplicationModules) - fail(ALL_MODULE_PATH + " not allowed with initial module"); - } - - // If -addmods is specified then those modules need to be resolved - if (addModules != null) - roots.addAll(addModules); - - // -limitmods - boolean limitmods = false; propValue = System.getProperty("jdk.launcher.limitmods"); if (propValue != null) { Set mods = new HashSet<>(); @@ -171,62 +180,101 @@ public final class ModuleBootstrap { mods.add(mod); } finder = limitFinder(finder, mods, roots); - limitmods = true; } - - // If there is no initial module specified then assume that the - // initial module is the unnamed module of the application class - // loader. By convention, and for compatibility, this is - // implemented by putting the names of all modules on the system - // module path into the set of modules to resolve. - // - // If `-addmods ALL-SYSTEM` is used then all modules on the system - // module path will be resolved, irrespective of whether an initial - // module is specified. - // - // If `-addmods ALL-MODULE-PATH` is used, and no initial module is - // specified, then all modules on the application module path will - // be resolved. - // - if (mainModule == null || addAllSystemModules) { - Set mrefs; - if (addAllApplicationModules) { - assert mainModule == null; - mrefs = finder.findAll(); - } else { - mrefs = systemModulePath.findAll(); - if (limitmods) { - ModuleFinder f = finder; - mrefs = mrefs.stream() - .filter(m -> f.find(m.descriptor().name()).isPresent()) - .collect(Collectors.toSet()); + // If there is no initial module specified then assume that the initial + // module is the unnamed module of the application class loader. This + // is implemented by resolving "java.se" and all (non-java.*) modules + // that export an API. If "java.se" is not observable then all java.* + // modules are resolved. + if (mainModule == null || addAllDefaultModules) { + boolean hasJava = false; + if (systemModules.find(JAVA_SE).isPresent()) { + // java.se is a system module + if (finder == systemModules || finder.find(JAVA_SE).isPresent()) { + // java.se is observable + hasJava = true; + roots.add(JAVA_SE); } } - // map to module names - for (ModuleReference mref : mrefs) { - roots.add(mref.descriptor().name()); + + for (ModuleReference mref : systemModules.findAll()) { + String mn = mref.descriptor().name(); + if (hasJava && mn.startsWith("java.")) + continue; + + // add as root if observable and exports at least one package + if ((finder == systemModules || finder.find(mn).isPresent())) { + ModuleDescriptor descriptor = mref.descriptor(); + for (ModuleDescriptor.Exports e : descriptor.exports()) { + if (!e.isQualified()) { + roots.add(mn); + break; + } + } + } } } - long t1 = System.nanoTime(); + // If `-addmods ALL-SYSTEM` is specified then all observable system + // modules will be resolved. + if (addAllSystemModules) { + ModuleFinder f = finder; // observable modules + systemModules.findAll() + .stream() + .map(ModuleReference::descriptor) + .map(ModuleDescriptor::name) + .filter(mn -> f.find(mn).isPresent()) // observable + .forEach(mn -> roots.add(mn)); + } + + // If `-addmods ALL-MODULE-PATH` is specified then all observable + // modules on the application module path will be resolved. + if (appModulePath != null && addAllApplicationModules) { + ModuleFinder f = finder; // observable modules + appModulePath.findAll() + .stream() + .map(ModuleReference::descriptor) + .map(ModuleDescriptor::name) + .filter(mn -> f.find(mn).isPresent()) // observable + .forEach(mn -> roots.add(mn)); + } + + PerfCounters.optionsAndRootsTime.addElapsedTimeFrom(t2); + + + long t3 = System.nanoTime(); + + // determine if post resolution checks are needed + boolean needPostResolutionChecks = true; + if (baseUri.getScheme().equals("jrt") // toLowerCase not needed here + && (upgradeModulePath == null) + && (appModulePath == null) + && (System.getProperty("jdk.launcher.patch.0") == null)) { + needPostResolutionChecks = false; + } + + PrintStream traceOutput = null; + if (Boolean.getBoolean("jdk.launcher.traceResolver")) + traceOutput = System.out; // run the resolver to create the configuration - - Configuration cf = Configuration.empty() + Configuration cf = SharedSecrets.getJavaLangModuleAccess() .resolveRequiresAndUses(finder, - ModuleFinder.empty(), - roots); + roots, + needPostResolutionChecks, + traceOutput); // time to create configuration - PerfCounters.resolveTime.addElapsedTimeFrom(t1); + PerfCounters.resolveTime.addElapsedTimeFrom(t3); + // mapping of modules to class loaders Function clf = ModuleLoaderMap.mappingFunction(cf); // check that all modules to be mapped to the boot loader will be - // loaded from the system module path - if (finder != systemModulePath) { + // loaded from the runtime image + if (needPostResolutionChecks) { for (ResolvedModule resolvedModule : cf.modules()) { ModuleReference mref = resolvedModule.reference(); String name = mref.descriptor().name(); @@ -237,20 +285,22 @@ public final class ModuleBootstrap { && upgradeModulePath.find(name).isPresent()) fail(name + ": cannot be loaded from upgrade module path"); - if (!systemModulePath.find(name).isPresent()) + if (!systemModules.find(name).isPresent()) fail(name + ": cannot be loaded from application module path"); } } } - long t2 = System.nanoTime(); + + long t4 = System.nanoTime(); // define modules to VM/runtime Layer bootLayer = Layer.empty().defineModules(cf, clf); - PerfCounters.layerCreateTime.addElapsedTimeFrom(t2); + PerfCounters.layerCreateTime.addElapsedTimeFrom(t4); - long t3 = System.nanoTime(); + + long t5 = System.nanoTime(); // define the module to its class loader, except java.base for (ResolvedModule resolvedModule : cf.modules()) { @@ -264,7 +314,8 @@ public final class ModuleBootstrap { } } - PerfCounters.loadModulesTime.addElapsedTimeFrom(t3); + PerfCounters.loadModulesTime.addElapsedTimeFrom(t5); + // -XaddReads and -XaddExports addExtraReads(bootLayer); @@ -295,25 +346,21 @@ public final class ModuleBootstrap { // module name -> reference Map map = new HashMap<>(); + + // root modules and their transitive dependences cf.modules().stream() .map(ResolvedModule::reference) .forEach(mref -> map.put(mref.descriptor().name(), mref)); + // additional modules + otherMods.stream() + .map(finder::find) + .flatMap(Optional::stream) + .forEach(mref -> map.putIfAbsent(mref.descriptor().name(), mref)); + // set of modules that are observable Set mrefs = new HashSet<>(map.values()); - // add the other modules - for (String mod : otherMods) { - Optional omref = finder.find(mod); - if (omref.isPresent()) { - ModuleReference mref = omref.get(); - map.putIfAbsent(mod, mref); - mrefs.add(mref); - } else { - // no need to fail - } - } - return new ModuleFinder() { @Override public Optional find(String name) { @@ -369,15 +416,15 @@ public final class ModuleBootstrap { Module other; if (ALL_UNNAMED.equals(name)) { - other = null; // loose + Modules.addReadsAllUnnamed(m); } else { om = bootLayer.findModule(name); if (!om.isPresent()) fail("Unknown module: " + name); other = om.get(); + Modules.addReads(m, other); } - Modules.addReads(m, other); } } } @@ -439,10 +486,6 @@ public final class ModuleBootstrap { * Decodes the values of -XaddReads or -XaddExports options * * The format of the options is: $KEY=$MODULE(,$MODULE)* - * - * For transition purposes, this method allows the first usage to be - * $KEY=$MODULE(,$KEY=$MODULE) - * This format will eventually be removed. */ private static Map> decode(String prefix) { int index = 0; @@ -467,42 +510,15 @@ public final class ModuleBootstrap { if (rhs.isEmpty()) fail("Unable to parse: " + value); - // new format $MODULE(,$MODULE)* or old format $(MODULE)=... - pos = rhs.indexOf('='); - // old format only allowed in first -X option - if (pos >= 0 && index > 0) - fail("Unable to parse: " + value); + // value is (,)* + if (map.containsKey(key)) + fail(key + " specified more than once"); - if (pos == -1) { - - // new format: $KEY=$MODULE(,$MODULE)* - - Set values = map.get(key); - if (values != null) - fail(key + " specified more than once"); - - values = new HashSet<>(); - map.put(key, values); - for (String s : rhs.split(",")) { - if (s.length() > 0) values.add(s); - } - - } else { - - // old format: $KEY=$MODULE(,$KEY=$MODULE)* - - assert index == 0; // old format only allowed in first usage - - for (String expr : value.split(",")) { - if (expr.length() > 0) { - String[] s = expr.split("="); - if (s.length != 2) - fail("Unable to parse: " + expr); - - map.computeIfAbsent(s[0], k -> new HashSet<>()).add(s[1]); - } - } + Set values = new HashSet<>(); + map.put(key, values); + for (String s : rhs.split(",")) { + if (s.length() > 0) values.add(s); } index++; @@ -521,6 +537,13 @@ public final class ModuleBootstrap { } static class PerfCounters { + + static PerfCounter systemModulesTime + = PerfCounter.newPerfCounter("jdk.module.bootstrap.systemModulesTime"); + static PerfCounter defineBaseTime + = PerfCounter.newPerfCounter("jdk.module.bootstrap.defineBaseTime"); + static PerfCounter optionsAndRootsTime + = PerfCounter.newPerfCounter("jdk.module.bootstrap.optionsAndRootsTime"); static PerfCounter resolveTime = PerfCounter.newPerfCounter("jdk.module.bootstrap.resolveTime"); static PerfCounter layerCreateTime diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Hasher.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java similarity index 64% rename from jdk/src/java.base/share/classes/jdk/internal/module/Hasher.java rename to jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java index 947900f63dd..2012c78c4fd 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/Hasher.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package jdk.internal.module; import java.io.IOException; @@ -32,17 +33,16 @@ import java.nio.file.Path; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Base64; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; /** - * Supporting class for computing, encoding and decoding hashes (message - * digests). + * The result of hashing the contents of a number of module artifacts. */ -public class Hasher { - private Hasher() { } +public final class ModuleHashes { /** * A supplier of an encoded message digest. @@ -51,43 +51,49 @@ public class Hasher { String generate(String algorithm); } + + private final String algorithm; + private final Map nameToHash; + /** - * Encapsulates the result of hashing the contents of a number of module - * artifacts. + * Creates a {@code ModuleHashes}. + * + * @param algorithm the algorithm used to create the hashes + * @param nameToHash the map of module name to hash value (in string form) */ - public static class DependencyHashes { - private final String algorithm; - private final Map nameToHash; - - public DependencyHashes(String algorithm, Map nameToHash) { - this.algorithm = algorithm; - this.nameToHash = nameToHash; - } - - /** - * Returns the algorithm used to hash the dependences ("SHA-256" or - * "MD5" for example). - */ - public String algorithm() { - return algorithm; - } - - /** - * Returns the set of module names for which hashes are recorded. - */ - public Set names() { - return nameToHash.keySet(); - } - - /** - * Retruns the hash string for the given module name, {@code null} - * if there is no hash recorded for the module. - */ - public String hashFor(String dn) { - return nameToHash.get(dn); - } + public ModuleHashes(String algorithm, Map nameToHash) { + this.algorithm = algorithm; + this.nameToHash = Collections.unmodifiableMap(nameToHash); } + /** + * Returns the algorithm used to hash the modules ("SHA-256" for example). + */ + public String algorithm() { + return algorithm; + } + + /** + * Returns the set of module names for which hashes are recorded. + */ + public Set names() { + return nameToHash.keySet(); + } + + /** + * Returns the hash string for the given module name, {@code null} + * if there is no hash recorded for the module. + */ + public String hashFor(String mn) { + return nameToHash.get(mn); + } + + /** + * Returns unmodifiable map of module name to hash string. + */ + public Map hashes() { + return nameToHash; + } /** * Computes the hash for the given file with the given message digest @@ -96,7 +102,7 @@ public class Hasher { * @throws UncheckedIOException if an I/O error occurs * @throws RuntimeException if the algorithm is not available */ - public static String generate(Path file, String algorithm) { + public static String computeHashAsString(Path file, String algorithm) { try { MessageDigest md = MessageDigest.getInstance(algorithm); @@ -104,8 +110,7 @@ public class Hasher { // memory when jlink is running concurrently on very large jmods try (FileChannel fc = FileChannel.open(file)) { ByteBuffer bb = ByteBuffer.allocate(32*1024); - int nread; - while ((nread = fc.read(bb)) > 0) { + while (fc.read(bb) > 0) { bb.flip(); md.update(bb); assert bb.remaining() == 0; @@ -124,19 +129,19 @@ public class Hasher { /** * Computes the hash for every entry in the given map, returning a - * {@code DependencyHashes} to encapsulate the result. The map key is + * {@code ModuleHashes} to encapsulate the result. The map key is * the entry name, typically the module name. The map value is the file * path to the entry (module artifact). * - * @return DependencyHashes encapsulate the hashes + * @return ModuleHashes encapsulate the hashes */ - public static DependencyHashes generate(Map map, String algorithm) { + public static ModuleHashes generate(Map map, String algorithm) { Map nameToHash = new HashMap<>(); for (Map.Entry entry: map.entrySet()) { String name = entry.getKey(); Path path = entry.getValue(); - nameToHash.put(name, generate(path, algorithm)); + nameToHash.put(name, computeHashAsString(path, algorithm)); } - return new DependencyHashes(algorithm, nameToHash); + return new ModuleHashes(algorithm, nameToHash); } } diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java index 91d1f8ebae3..f3314aa73e5 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -41,7 +41,6 @@ import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.org.objectweb.asm.ClassVisitor; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.internal.module.Hasher.DependencyHashes; import static jdk.internal.module.ClassFileAttributes.*; @@ -69,7 +68,7 @@ public final class ModuleInfoExtender { private String osVersion; // the hashes for the Hashes attribute - private DependencyHashes hashes; + private ModuleHashes hashes; private ModuleInfoExtender(InputStream in) { this.in = in; @@ -113,10 +112,10 @@ public final class ModuleInfoExtender { /** * The Hashes attribute will be emitted to the module-info with - * the hashes encapsulated in the given {@code DependencyHashes} + * the hashes encapsulated in the given {@code ModuleHashes} * object. */ - public ModuleInfoExtender hashes(DependencyHashes hashes) { + public ModuleInfoExtender hashes(ModuleHashes hashes) { this.hashes = hashes; return this; } diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java index f418b666a6d..1fb433b9f7c 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -49,28 +49,22 @@ public final class ModuleInfoWriter { * Writes the given module descriptor to a module-info.class file, * returning it in a byte array. */ - private static byte[] toModuleInfo(ModuleDescriptor descriptor) { + private static byte[] toModuleInfo(ModuleDescriptor md) { ClassWriter cw = new ClassWriter(0); - String name = descriptor.name().replace('.', '/') + "/module-info"; + String name = md.name().replace('.', '/') + "/module-info"; cw.visit(Opcodes.V1_8, ACC_MODULE, name, null, null, null); - cw.visitAttribute(new ModuleAttribute(descriptor)); - cw.visitAttribute(new ConcealedPackagesAttribute(descriptor.conceals())); - - Optional oversion = descriptor.version(); - if (oversion.isPresent()) - cw.visitAttribute(new VersionAttribute(oversion.get())); - - Optional omain = descriptor.mainClass(); - if (omain.isPresent()) - cw.visitAttribute(new MainClassAttribute(omain.get())); + cw.visitAttribute(new ModuleAttribute(md)); + cw.visitAttribute(new ConcealedPackagesAttribute(md.conceals())); + md.version().ifPresent(v -> cw.visitAttribute(new VersionAttribute(v))); + md.mainClass().ifPresent(mc -> cw.visitAttribute(new MainClassAttribute(mc))); // write the TargetPlatform attribute if have any of OS name/arch/version - String osName = descriptor.osName().orElse(null); - String osArch = descriptor.osArch().orElse(null); - String osVersion = descriptor.osVersion().orElse(null); + String osName = md.osName().orElse(null); + String osArch = md.osArch().orElse(null); + String osVersion = md.osVersion().orElse(null); if (osName != null || osArch != null || osVersion != null) { cw.visitAttribute(new TargetPlatformAttribute(osName, osArch, diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java index 6104b745b78..49104d8c242 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java @@ -91,56 +91,29 @@ public final class ModulePatcher { Map> map = new HashMap<>(); while (value != null) { + + // =(:)* + int pos = value.indexOf('='); - - if (pos == -1 && index > 0) + if (pos == -1) throwIAE("Unable to parse: " + value); - if (pos == 0) throwIAE("Missing module name: " + value); - if (pos > 0) { + String mn = value.substring(0, pos); + List list = map.get(mn); + if (list != null) + throwIAE("Module " + mn + " specified more than once"); + list = new ArrayList<>(); + map.put(mn, list); - // new format: =(:)* - - String mn = value.substring(0, pos); - List list = map.get(mn); - if (list != null) - throwIAE("Module " + mn + " specified more than once"); - list = new ArrayList<>(); - map.put(mn, list); - - String paths = value.substring(pos+1); - for (String path : paths.split(File.pathSeparator)) { - if (!path.isEmpty()) { - list.add(Paths.get(path)); - } + String paths = value.substring(pos+1); + for (String path : paths.split(File.pathSeparator)) { + if (!path.isEmpty()) { + list.add(Paths.get(path)); } - - } else { - - // old format: (:)* - - assert index == 0; // old format only allowed in first -Xpatch - - String[] dirs = value.split(File.pathSeparator); - for (String d : dirs) { - if (d.length() > 0) { - Path top = Paths.get(d); - try { - Files.list(top).forEach(e -> { - String mn = e.getFileName().toString(); - Path dir = top.resolve(mn); - map.computeIfAbsent(mn, k -> new ArrayList<>()) - .add(dir); - }); - } catch (IOException ignore) { } - } - } - } - index++; value = System.getProperty(PATCH_PROPERTY_PREFIX + index); } @@ -175,7 +148,8 @@ public final class ModulePatcher { for (Path file : paths) { if (Files.isRegularFile(file)) { - // JAR file + // JAR file - do not open as a multi-release JAR as this + // is not supported by the boot class loader try (JarFile jf = new JarFile(file.toFile())) { jf.stream() .filter(e -> e.getName().endsWith(".class")) @@ -209,10 +183,11 @@ public final class ModulePatcher { descriptor = JLMA.newModuleDescriptor(descriptor, packages); } - // return a new module reference + // return a module reference to the patched module URI location = mref.location().orElse(null); - return new ModuleReference(descriptor, location, - () -> new PatchedModuleReader(paths, mref)); + return JLMA.newPatchedModule(descriptor, + location, + () -> new PatchedModuleReader(paths, mref)); } diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java b/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java index b33b1a8e416..9a0248a52df 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -58,7 +58,7 @@ public class Modules { * Creates a new Module. The module has the given ModuleDescriptor and * is defined to the given class loader. * - * The resulting Module is in a larva state in that it does not not read + * The resulting Module is in a larval state in that it does not not read * any other module and does not have any exports. * * The URI is for information purposes only. @@ -74,7 +74,7 @@ public class Modules { * Define a new module to the VM. The module has the given set of * concealed packages and is defined to the given class loader. * - * The resulting Module is in a larva state in that it does not not read + * The resulting Module is in a larval state in that it does not not read * any other module and does not have any exports. */ public static Module defineModule(ClassLoader loader, @@ -95,6 +95,13 @@ public class Modules { JLRMA.addReads(m1, m2); } + /** + * Update module {@code m} to read all unnamed modules. + */ + public static void addReadsAllUnnamed(Module m) { + JLRMA.addReadsAllUnnamed(m); + } + /** * Updates module m1 to export a package to module m2. * Same as m1.addExports(pkg, m2) but without a caller check. diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java b/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java index 5d597f9ce55..92b80581d3c 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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,94 +29,105 @@ import java.lang.reflect.Module; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Provides; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.Objects; import java.util.Set; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.concurrent.ConcurrentHashMap; /** - * A services catalog. Each {@code ClassLoader} has an optional {@code - * ServicesCatalog} for modules that provide services. This is to support - * ClassLoader centric ServiceLoader.load methods. + * A services catalog. Each {@code ClassLoader} and {@code Layer} has + * an optional {@code ServicesCatalog} for modules that provide services. + * + * @see java.util.ServiceLoader */ -public class ServicesCatalog { - - // use RW locks as register is rare - private final ReadWriteLock lock = new ReentrantReadWriteLock(); - private final Lock readLock = lock.readLock(); - private final Lock writeLock = lock.writeLock(); +public interface ServicesCatalog { /** * Represents a service provider in the services catalog. */ - public class ServiceProvider { + public final class ServiceProvider { private final Module module; private final String providerName; - ServiceProvider(Module module, String providerName) { + + public ServiceProvider(Module module, String providerName) { this.module = module; this.providerName = providerName; } + public Module module() { return module; } + public String providerName() { return providerName; } - } - // service providers - private final Map> loaderServices = new HashMap<>(); + @Override + public int hashCode() { + return Objects.hash(module, providerName); + } - /** - * Creates a new module catalog. - */ - public ServicesCatalog() { } - - /** - * Registers the module in this module catalog. - */ - public void register(Module m) { - ModuleDescriptor descriptor = m.getDescriptor(); - - writeLock.lock(); - try { - // extend the services map - for (Provides ps : descriptor.provides().values()) { - String service = ps.service(); - Set providerNames = ps.providers(); - - // create a new set to replace the existing - Set result = new HashSet<>(); - Set providers = loaderServices.get(service); - if (providers != null) { - result.addAll(providers); - } - for (String pn : providerNames) { - result.add(new ServiceProvider(m, pn)); - } - loaderServices.put(service, Collections.unmodifiableSet(result)); - } - - } finally { - writeLock.unlock(); + @Override + public boolean equals(Object ob) { + if (!(ob instanceof ServiceProvider)) + return false; + ServiceProvider that = (ServiceProvider)ob; + return Objects.equals(this.module, that.module) + && Objects.equals(this.providerName, that.providerName); } } + /** + * Registers the providers in the given module in this services catalog. + * + * @throws UnsupportedOperationException + * If this services catalog is immutable + */ + void register(Module module); + /** * Returns the (possibly empty) set of service providers that implement the * given service type. - * - * @see java.util.ServiceLoader */ - public Set findServices(String service) { - readLock.lock(); - try { - return loaderServices.getOrDefault(service, Collections.emptySet()); - } finally { - readLock.unlock(); - } + Set findServices(String service); + + /** + * Creates a ServicesCatalog that supports concurrent registration and + * and lookup. + */ + static ServicesCatalog create() { + return new ServicesCatalog() { + + private Map> map = new ConcurrentHashMap<>(); + + @Override + public void register(Module m) { + ModuleDescriptor descriptor = m.getDescriptor(); + + for (Provides provides : descriptor.provides().values()) { + String service = provides.service(); + Set providerNames = provides.providers(); + + // create a new set to replace the existing + Set result = new HashSet<>(); + Set providers = map.get(service); + if (providers != null) { + result.addAll(providers); + } + for (String pn : providerNames) { + result.add(new ServiceProvider(m, pn)); + } + map.put(service, Collections.unmodifiableSet(result)); + } + + } + + @Override + public Set findServices(String service) { + return map.getOrDefault(service, Collections.emptySet()); + } + + }; } -} +} \ No newline at end of file diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java b/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java index 3bd1371ee7d..43de2cda9f7 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java +++ b/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java @@ -40,21 +40,26 @@ import java.lang.module.ModuleDescriptor; */ public final class SystemModules { /** - * Name of the installed modules. + * Name of the system modules. * - * This array provides a way for InstalledModuleFinder to fallback + * This array provides a way for SystemModuleFinder to fallback * and read module-info.class from the run-time image instead of * the fastpath. */ public static final String[] MODULE_NAMES = new String[1]; + /** + * Hash of system modules. + */ + public static String[] MODULES_TO_HASH = new String[1]; + /** * Number of packages in the boot layer from the installed modules. * * Don't make it final to avoid inlining during compile time as * the value will be changed at jlink time. */ - public static final int PACKAGES_IN_BOOT_LAYER = 1024; + public static int PACKAGES_IN_BOOT_LAYER = 1024; /** * Returns a non-empty array of ModuleDescriptors in the run-time image. @@ -64,4 +69,5 @@ public final class SystemModules { public static ModuleDescriptor[] modules() { return new ModuleDescriptor[0]; } -} \ No newline at end of file + +} diff --git a/jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java b/jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java index 8efa2a9d4e6..c4acdffe4d6 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java +++ b/jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java @@ -392,6 +392,7 @@ class MethodAccessorGenerator extends AccessorGenerator { // matter. return AccessController.doPrivileged( new PrivilegedAction() { + @SuppressWarnings("deprecation") // Class.newInstance public MagicAccessorImpl run() { try { return (MagicAccessorImpl) diff --git a/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java b/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java index 636b0940345..63c688ca171 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java +++ b/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java @@ -343,8 +343,8 @@ public class Reflection { private static void printStackTraceIfNeeded(Throwable e) { if (!printStackWhenAccessFailsSet && VM.initLevel() >= 1) { - String s = GetPropertyAction - .getProperty("sun.reflect.debugModuleAccessChecks"); + String s = GetPropertyAction.privilegedGetProperty( + "sun.reflect.debugModuleAccessChecks"); printStackWhenAccessFails = (s != null && !s.equalsIgnoreCase("false")); printStackWhenAccessFailsSet = true; diff --git a/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java b/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java index b40c584efcd..a18437d0ed1 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java +++ b/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java @@ -398,7 +398,7 @@ public class ReflectionFactory { return; } - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); String val = props.getProperty("sun.reflect.noInflation"); if (val != null && val.equals("true")) { noInflation = true; diff --git a/jdk/src/java.base/share/classes/module-info.java b/jdk/src/java.base/share/classes/module-info.java index a597253d168..9d9fe8ec11f 100644 --- a/jdk/src/java.base/share/classes/module-info.java +++ b/jdk/src/java.base/share/classes/module-info.java @@ -145,6 +145,8 @@ module java.base { jdk.scripting.nashorn; exports jdk.internal.org.objectweb.asm.signature to jdk.scripting.nashorn; + exports jdk.internal.loader to + java.instrument; exports jdk.internal.math to java.desktop; exports jdk.internal.module to @@ -166,6 +168,8 @@ module java.base { java.sql, java.xml, jdk.charsets, + jdk.jartool, + jdk.jlink, jdk.net, jdk.scripting.nashorn, jdk.unsupported, diff --git a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java index e8a4b78cff5..b1b761eb452 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java +++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java @@ -84,8 +84,10 @@ import java.util.jar.Manifest; import jdk.internal.misc.VM; -public enum LauncherHelper { - INSTANCE; +public final class LauncherHelper { + + // No instantiation + private LauncherHelper() {} // used to identify JavaFX applications private static final String JAVAFX_APPLICATION_MARKER = diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties index 52d621b414d..6390b9792d4 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties @@ -27,7 +27,7 @@ java.launcher.opt.header = Usage: {0} [options] class [args...]\n\ \ (to execute a class)\n or {0} [options] -jar jarfile [args...]\n\ \ (to execute a jar file)\n\ -\ or {0} [-options] -mp -m | /\n\ +\ or {0} [options] -mp -m [/] [args...]\n\ \ (to execute the main class in a module)\n\ where options include:\n @@ -51,8 +51,9 @@ java.launcher.opt.footer =\ -cp | /\n\ -\ the initial or main module to resolve\n\ +\ -m [/]\n\ +\ the initial module to resolve, and the name of the main class\n\ +\ to execute if not specified by the module\n\ \ -addmods [,...]\n\ \ root modules to resolve in addition to the initial module\n\ \ -limitmods [,...]\n\ diff --git a/jdk/src/java.base/share/classes/sun/net/ResourceManager.java b/jdk/src/java.base/share/classes/sun/net/ResourceManager.java index 9c68d7c6bed..fb19671578b 100644 --- a/jdk/src/java.base/share/classes/sun/net/ResourceManager.java +++ b/jdk/src/java.base/share/classes/sun/net/ResourceManager.java @@ -53,8 +53,8 @@ public class ResourceManager { private static final AtomicInteger numSockets; static { - String prop = - GetPropertyAction.getProperty("sun.net.maxDatagramSockets"); + String prop = GetPropertyAction + .privilegedGetProperty("sun.net.maxDatagramSockets"); int defmax = DEFAULT_MAX_SOCKETS; try { if (prop != null) { diff --git a/jdk/src/java.base/share/classes/sun/net/ftp/FtpClientProvider.java b/jdk/src/java.base/share/classes/sun/net/ftp/FtpClientProvider.java index bbdb1cde5bd..511f9995713 100644 --- a/jdk/src/java.base/share/classes/sun/net/ftp/FtpClientProvider.java +++ b/jdk/src/java.base/share/classes/sun/net/ftp/FtpClientProvider.java @@ -67,8 +67,9 @@ public abstract class FtpClientProvider { return false; } try { - Class c = Class.forName(cm, true, null); - provider = (FtpClientProvider) c.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName(cm, true, null).newInstance(); + provider = (FtpClientProvider)o; return true; } catch (ClassNotFoundException | IllegalAccessException | diff --git a/jdk/src/java.base/share/classes/sun/net/sdp/SdpSupport.java b/jdk/src/java.base/share/classes/sun/net/sdp/SdpSupport.java index 797bc7fed50..d5bdc6e4b93 100644 --- a/jdk/src/java.base/share/classes/sun/net/sdp/SdpSupport.java +++ b/jdk/src/java.base/share/classes/sun/net/sdp/SdpSupport.java @@ -40,7 +40,7 @@ import sun.security.action.GetPropertyAction; */ public final class SdpSupport { - private static final String os = GetPropertyAction.getProperty("os.name"); + private static final String os = GetPropertyAction.privilegedGetProperty("os.name"); private static final boolean isSupported = (os.equals("SunOS") || (os.equals("Linux"))); private static final JavaIOFileDescriptorAccess fdAccess = SharedSecrets.getJavaIOFileDescriptorAccess(); diff --git a/jdk/src/java.base/share/classes/sun/net/smtp/SmtpClient.java b/jdk/src/java.base/share/classes/sun/net/smtp/SmtpClient.java index ac3f7b8a43f..93451253f0a 100644 --- a/jdk/src/java.base/share/classes/sun/net/smtp/SmtpClient.java +++ b/jdk/src/java.base/share/classes/sun/net/smtp/SmtpClient.java @@ -157,7 +157,7 @@ public class SmtpClient extends TransferProtocolClient { } try { String s; - mailhost = GetPropertyAction.getProperty("mail.host"); + mailhost = GetPropertyAction.privilegedGetProperty("mail.host"); if (mailhost != null) { openServer(mailhost); return; @@ -183,7 +183,7 @@ public class SmtpClient extends TransferProtocolClient { setConnectTimeout(to); try { String s; - mailhost = GetPropertyAction.getProperty("mail.host"); + mailhost = GetPropertyAction.privilegedGetProperty("mail.host"); if (mailhost != null) { openServer(mailhost); return; diff --git a/jdk/src/java.base/share/classes/sun/net/www/MimeLauncher.java b/jdk/src/java.base/share/classes/sun/net/www/MimeLauncher.java index ba26f96e52e..a2cfefab33c 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/MimeLauncher.java +++ b/jdk/src/java.base/share/classes/sun/net/www/MimeLauncher.java @@ -183,7 +183,7 @@ class MimeLauncher extends Thread { } String execPathList; - execPathList = GetPropertyAction.getProperty("exec.path"); + execPathList = GetPropertyAction.privilegedGetProperty("exec.path"); if (execPathList == null) { // exec.path property not set return false; diff --git a/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java b/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java index 392d9ea52dc..580842b2faf 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java +++ b/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java @@ -145,7 +145,7 @@ public class HttpClient extends NetworkClient { } static { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); String keepAlive = props.getProperty("http.keepAlive"); String retryPost = props.getProperty("sun.net.http.retryPost"); diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java index b397ba1243f..6abb4de2778 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java @@ -278,7 +278,7 @@ public class FtpURLConnection extends URLConnection { if (user == null) { user = "anonymous"; - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); String vers = props.getProperty("java.version"); password = props.getProperty("ftp.protocol.user", "Java" + vers + "@"); diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java index b6168d0c2c5..6bcd152fdd1 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java @@ -94,7 +94,7 @@ public class AuthenticationHeader { } static { - authPref = GetPropertyAction.getProperty("http.auth.preference"); + authPref = GetPropertyAction.privilegedGetProperty("http.auth.preference"); // http.auth.preference can be set to SPNEGO or Kerberos. // In fact they means "Negotiate with SPNEGO" and "Negotiate with diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index ebabc26182e..923fbe4d66c 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -207,9 +207,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { }; static { - Properties props = GetPropertyAction.getProperties(); - maxRedirects = GetIntegerAction.getProperty("http.maxRedirects", - defaultmaxRedirects); + Properties props = GetPropertyAction.privilegedGetProperties(); + maxRedirects = GetIntegerAction.privilegedGetProperty( + "http.maxRedirects", defaultmaxRedirects); version = props.getProperty("java.version"); String agent = props.getProperty("http.agent"); if (agent == null) { @@ -225,14 +225,14 @@ public class HttpURLConnection extends java.net.HttpURLConnection { enableESBuffer = Boolean.parseBoolean( props.getProperty("sun.net.http.errorstream.enableBuffering")); - timeout4ESBuffer = GetIntegerAction - .getProperty("sun.net.http.errorstream.timeout", 300); + timeout4ESBuffer = GetIntegerAction.privilegedGetProperty( + "sun.net.http.errorstream.timeout", 300); if (timeout4ESBuffer <= 0) { timeout4ESBuffer = 300; // use the default } - bufSize4ES = GetIntegerAction - .getProperty("sun.net.http.errorstream.bufferSize", 4096); + bufSize4ES = GetIntegerAction.privilegedGetProperty( + "sun.net.http.errorstream.bufferSize", 4096); if (bufSize4ES <= 0) { bufSize4ES = 4096; // use the default } diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java index 437c3969148..eadd290e215 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java @@ -139,7 +139,7 @@ final class HttpsClient extends HttpClient // String ciphers []; String cipherString = - GetPropertyAction.getProperty("https.cipherSuites"); + GetPropertyAction.privilegedGetProperty("https.cipherSuites"); if (cipherString == null || "".equals(cipherString)) { ciphers = null; @@ -163,7 +163,7 @@ final class HttpsClient extends HttpClient // String protocols []; String protocolString = - GetPropertyAction.getProperty("https.protocols"); + GetPropertyAction.privilegedGetProperty("https.protocols"); if (protocolString == null || "".equals(protocolString)) { protocols = null; @@ -183,7 +183,8 @@ final class HttpsClient extends HttpClient } private String getUserAgent() { - String userAgent = GetPropertyAction.getProperty("https.agent"); + String userAgent = + GetPropertyAction.privilegedGetProperty("https.agent"); if (userAgent == null || userAgent.length() == 0) { userAgent = "JSSE"; } diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java index f58ce457f7a..88e6f5b7caa 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java @@ -161,7 +161,7 @@ public class JavaRuntimeURLConnection extends URLConnection { public Permission getPermission() throws IOException { Permission p = permission; if (p == null) { - String home = GetPropertyAction.getProperty("java.home"); + String home = GetPropertyAction.privilegedGetProperty("java.home"); p = new FilePermission(home + File.separator + "-", "read"); permission = p; } diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/netdoc/Handler.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/netdoc/Handler.java index 81139707655..5e441e8550b 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/netdoc/Handler.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/netdoc/Handler.java @@ -56,9 +56,9 @@ public class Handler extends URLStreamHandler { URL ru; boolean localonly = Boolean.parseBoolean( - GetPropertyAction.getProperty("newdoc.localonly")); + GetPropertyAction.privilegedGetProperty("newdoc.localonly")); - String docurl = GetPropertyAction.getProperty("doc.url"); + String docurl = GetPropertyAction.privilegedGetProperty("doc.url"); String file = u.getFile(); if (!localonly) { diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java b/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java index 8a287bc2839..deefc8529f9 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java @@ -1019,7 +1019,7 @@ public class FileChannelImpl if (!propertyChecked) { synchronized (FileChannelImpl.class) { if (!propertyChecked) { - String value = GetPropertyAction.getProperty( + String value = GetPropertyAction.privilegedGetProperty( "sun.nio.ch.disableSystemWideOverlappingFileLockCheck"); isSharedFileLockTable = ((value == null) || value.equals("false")); propertyChecked = true; diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/Net.java b/jdk/src/java.base/share/classes/sun/nio/ch/Net.java index 59d3167745b..f222dbc8ae3 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/Net.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/Net.java @@ -374,8 +374,8 @@ public class Net { } public static boolean isFastTcpLoopbackRequested() { - String loopbackProp = - GetPropertyAction.getProperty("jdk.net.useFastTcpLoopback"); + String loopbackProp = GetPropertyAction + .privilegedGetProperty("jdk.net.useFastTcpLoopback"); boolean enable; if ("".equals(loopbackProp)) { enable = true; @@ -633,8 +633,8 @@ public class Net { static { int availLevel = isExclusiveBindAvailable(); if (availLevel >= 0) { - String exclBindProp = - GetPropertyAction.getProperty("sun.net.useExclusiveBind"); + String exclBindProp = GetPropertyAction + .privilegedGetProperty("sun.net.useExclusiveBind"); if (exclBindProp != null) { exclusiveBind = exclBindProp.isEmpty() ? true : Boolean.parseBoolean(exclBindProp); diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/ThreadPool.java b/jdk/src/java.base/share/classes/sun/nio/ch/ThreadPool.java index ac03d386f08..4cdd47864a9 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/ThreadPool.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/ThreadPool.java @@ -165,14 +165,11 @@ public class ThreadPool { GetPropertyAction(DEFAULT_THREAD_POOL_THREAD_FACTORY)); if (propValue != null) { try { - Class c = Class - .forName(propValue, true, ClassLoader.getSystemClassLoader()); - return ((ThreadFactory)c.newInstance()); - } catch (ClassNotFoundException x) { - throw new Error(x); - } catch (InstantiationException x) { - throw new Error(x); - } catch (IllegalAccessException x) { + @SuppressWarnings("deprecation") + Object tmp = Class + .forName(propValue, true, ClassLoader.getSystemClassLoader()).newInstance(); + return (ThreadFactory)tmp; + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException x) { throw new Error(x); } } diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java index e71e628ede1..5a5e51d71ef 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java @@ -64,7 +64,8 @@ public class Util { * for potential future-proofing. */ private static long getMaxCachedBufferSize() { - String s = GetPropertyAction.getProperty("jdk.nio.maxCachedBufferSize"); + String s = GetPropertyAction + .privilegedGetProperty("jdk.nio.maxCachedBufferSize"); if (s != null) { try { long m = Long.parseLong(s); @@ -465,7 +466,8 @@ public class Util { if (bugLevel == null) { if (!jdk.internal.misc.VM.isBooted()) return false; - String value = GetPropertyAction.getProperty("sun.nio.ch.bugLevel"); + String value = GetPropertyAction + .privilegedGetProperty("sun.nio.ch.bugLevel"); bugLevel = (value != null) ? value : ""; } return bugLevel.equals(bl); diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/FastCharsetProvider.java b/jdk/src/java.base/share/classes/sun/nio/cs/FastCharsetProvider.java index c9fceab6ee4..d0eae762e71 100644 --- a/jdk/src/java.base/share/classes/sun/nio/cs/FastCharsetProvider.java +++ b/jdk/src/java.base/share/classes/sun/nio/cs/FastCharsetProvider.java @@ -115,10 +115,11 @@ public class FastCharsetProvider // Instantiate the charset and cache it try { - Class c = Class.forName(packagePrefix + "." + cln, + @SuppressWarnings("deprecation") + Object o= Class.forName(packagePrefix + "." + cln, true, - this.getClass().getClassLoader()); - cs = (Charset)c.newInstance(); + this.getClass().getClassLoader()).newInstance(); + cs = (Charset)o; cache.put(csn, cs); return cs; } catch (ClassNotFoundException | diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template index 2ad055e50ec..f2eeaaafdc3 100644 --- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template +++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template @@ -110,10 +110,11 @@ public class StandardCharsets extends CharsetProvider { // Instantiate the charset and cache it try { - Class c = Class.forName(packagePrefix + "." + cln, - true, - this.getClass().getClassLoader()); - cs = (Charset)c.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName(packagePrefix + "." + cln, + true, + this.getClass().getClassLoader()).newInstance(); + cs = (Charset)o; cache.put(csn, cs); return cs; } catch (ClassNotFoundException | @@ -164,7 +165,7 @@ public class StandardCharsets extends CharsetProvider { return; initialized = true; - String map = getProperty("sun.nio.cs.map"); + String map = GetPropertyAction.privilegedGetProperty("sun.nio.cs.map"); if (map != null) { String[] maps = map.split(","); for (int i = 0; i < maps.length; i++) { @@ -199,9 +200,4 @@ public class StandardCharsets extends CharsetProvider { } } - private static String getProperty(String key) { - return GetPropertyAction.getProperty(key); - } - - } diff --git a/jdk/src/java.base/share/classes/sun/nio/fs/Util.java b/jdk/src/java.base/share/classes/sun/nio/fs/Util.java index 45d90b99222..94a5def1e85 100644 --- a/jdk/src/java.base/share/classes/sun/nio/fs/Util.java +++ b/jdk/src/java.base/share/classes/sun/nio/fs/Util.java @@ -38,7 +38,7 @@ class Util { private Util() { } private static final Charset jnuEncoding = Charset.forName( - GetPropertyAction.getProperty("sun.jnu.encoding")); + GetPropertyAction.privilegedGetProperty("sun.jnu.encoding")); /** * Returns {@code Charset} corresponding to the sun.jnu.encoding property diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java index c454b431861..0c8f9413820 100644 --- a/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java +++ b/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java @@ -118,9 +118,14 @@ public class GetIntegerAction * if no security manager is present. This is unsafe for inclusion in a * public API but allowable here since this class is now encapsulated. * + * Note that this method performs a privileged action using caller-provided + * inputs. The caller of this method should take care to ensure that the + * inputs are not tainted and the returned property is not made accessible + * to untrusted code if it contains sensitive information. + * * @param theProp the name of the system property. */ - public static Integer getProperty(String theProp) { + public static Integer privilegedGetProperty(String theProp) { if (System.getSecurityManager() == null) { return Integer.getInteger(theProp); } else { @@ -134,10 +139,16 @@ public class GetIntegerAction * if no security manager is present. This is unsafe for inclusion in a * public API but allowable here since this class is now encapsulated. * + * Note that this method performs a privileged action using caller-provided + * inputs. The caller of this method should take care to ensure that the + * inputs are not tainted and the returned property is not made accessible + * to untrusted code if it contains sensitive information. + * * @param theProp the name of the system property. * @param defaultVal the default value. */ - public static Integer getProperty(String theProp, int defaultVal) { + public static Integer privilegedGetProperty(String theProp, + int defaultVal) { Integer value; if (System.getSecurityManager() == null) { value = Integer.getInteger(theProp); diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java index bba172b06bc..44ec16f89dc 100644 --- a/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java +++ b/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java @@ -93,9 +93,14 @@ public class GetPropertyAction implements PrivilegedAction { * if no security manager is present. This is unsafe for inclusion in a * public API but allowable here since this class is now encapsulated. * + * Note that this method performs a privileged action using caller-provided + * inputs. The caller of this method should take care to ensure that the + * inputs are not tainted and the returned property is not made accessible + * to untrusted code if it contains sensitive information. + * * @param theProp the name of the system property. */ - public static String getProperty(String theProp) { + public static String privilegedGetProperty(String theProp) { if (System.getSecurityManager() == null) { return System.getProperty(theProp); } else { @@ -109,10 +114,16 @@ public class GetPropertyAction implements PrivilegedAction { * if no security manager is present. This is unsafe for inclusion in a * public API but allowable here since this class is now encapsulated. * + * Note that this method performs a privileged action using caller-provided + * inputs. The caller of this method should take care to ensure that the + * inputs are not tainted and the returned property is not made accessible + * to untrusted code if it contains sensitive information. + * * @param theProp the name of the system property. * @param defaultVal the default value. */ - public static String getProperty(String theProp, String defaultVal) { + public static String privilegedGetProperty(String theProp, + String defaultVal) { if (System.getSecurityManager() == null) { return System.getProperty(theProp, defaultVal); } else { @@ -126,8 +137,13 @@ public class GetPropertyAction implements PrivilegedAction { * having to go through doPrivileged if no security manager is present. * This is unsafe for inclusion in a public API but allowable here since * this class is now encapsulated. + * + * Note that this method performs a privileged action, and callers of + * this method should take care to ensure that the returned properties + * are not made accessible to untrusted code since it may contain + * sensitive information. */ - public static Properties getProperties() { + public static Properties privilegedGetProperties() { if (System.getSecurityManager() == null) { return System.getProperties(); } else { diff --git a/jdk/src/java.base/share/classes/sun/security/jca/ProviderConfig.java b/jdk/src/java.base/share/classes/sun/security/jca/ProviderConfig.java index bf65180af6f..c12f7f3bc5f 100644 --- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderConfig.java +++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderConfig.java @@ -185,7 +185,9 @@ final class ProviderConfig { try { Class c = Class.forName("apple.security.AppleProvider"); if (Provider.class.isAssignableFrom(c)) { - return (Provider) c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + return (Provider) tmp; } else { return null; } @@ -386,6 +388,7 @@ final class ProviderConfig { Provider p = AccessController.doPrivileged (new PrivilegedExceptionAction() { + @SuppressWarnings("deprecation") // Class.newInstance public Provider run() throws Exception { return (Provider) provClass.newInstance(); } diff --git a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java index 8173bd266ad..7cdc167fd52 100644 --- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java +++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java @@ -218,11 +218,10 @@ public class PKCS8Key implements PrivateKey { } } - Object inst = null; + @SuppressWarnings("deprecation") + Object inst = (keyClass != null) ? keyClass.newInstance() : null; PKCS8Key result; - if (keyClass != null) - inst = keyClass.newInstance(); if (inst instanceof PKCS8Key) { result = (PKCS8Key) inst; result.algid = algid; diff --git a/jdk/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java b/jdk/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java new file mode 100644 index 00000000000..c4091eb39d5 --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java @@ -0,0 +1,771 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import sun.security.util.Debug; + +import java.security.*; +import java.util.Arrays; +import java.util.Objects; +import static java.security.DrbgParameters.Capability.*; + +/** + * The abstract base class for all DRBGs. + *

+ * This class creates 5 new abstract methods. 3 are defined by the SP800-90A: + *

    + *
  1. {@link #generateAlgorithm(byte[], byte[])} + *
  2. {@link #reseedAlgorithm(byte[], byte[])} (might not be supported) + *
  3. {@link #instantiateAlgorithm(byte[])} + *
+ * and 2 for implementation purpose: + *
    + *
  1. {@link #initEngine()} + *
  2. {@link #chooseAlgorithmAndStrength} + *
+ * All existing {@link SecureRandomSpi} methods are implemented based on the + * methods above as final. The initialization process is divided into 2 phases: + * configuration is eagerly called to set up parameters, and instantiation + * is lazily called only when nextBytes or reseed is called. + *

+ * Synchronized keyword should be added to all externally callable engine + * methods including {@link #engineReseed}, {@link #engineSetSeed}, and + * {@link #engineNextBytes} (but not {@link #engineGenerateSeed}). + * Internal methods like {@link #configure} and {@link #instantiateAlgorithm} + * are not synchronized. They will either be called in a constructor or + * in another synchronized method. + */ +public abstract class AbstractDrbg extends SecureRandomSpi { + + private static final long serialVersionUID = 9L; + + /** + * This field is not null if {@code -Djava.security.debug=securerandom} is + * specified on the command line. An implementation can print useful + * debug info. + */ + protected static final Debug debug = Debug.getInstance( + "securerandom", "drbg"); + + // Common working status + + private transient boolean instantiated = false; + + /** + * Reseed counter of a DRBG instance. A mechanism should increment it + * after each random bits generation and reset it in reseed. A mechanism + * does not need to compare it to {@link #reseedInterval}. + */ + protected transient int reseedCounter = 0; + + // Mech features. If not same as below, must be redefined in constructor. + + /** + * Default strength of a DRBG instance if it is not configured. + * 128 is considered secure enough now. A mechanism + * can change it in a constructor. + * + * Remember to sync with "securerandom.drbg.config" in java.security. + */ + protected static final int DEFAULT_STRENGTH = 128; + + /** + * Mechanism name, say, {@code HashDRBG}. Must be set in constructor. + * This value will be used in {@code toString}. + */ + protected String mechName = "DRBG"; + + /** + * highest_supported_security_strength of this mechanism for all algorithms + * it supports. A mechanism should update the value in its constructor + * if the value is not 256. + */ + protected int highestSupportedSecurityStrength = 256; + + /** + * Whether prediction resistance is supported. A mechanism should update + * the value in its constructor if it is not supported. + */ + protected boolean supportPredictionResistance = true; + + /** + * Whether reseed is supported. A mechanism should update + * the value in its constructor if it is not supported. + */ + protected boolean supportReseeding = true; + + // Strength features. If not same as below, must be redefined in + // chooseAlgorithmAndStrength. Among these, minLength and seedLen have no + // default value and must be redefined. If personalization string or + // additional input is not supported, set maxPersonalizationStringLength + // or maxAdditionalInputLength to -1. + + /** + * Minimum entropy input length in bytes for this DRBG instance. + * Must be assigned in {@link #chooseAlgorithmAndStrength}. + */ + protected int minLength; + + /** + * Maximum entropy input length in bytes for this DRBG instance. + * Should be assigned in {@link #chooseAlgorithmAndStrength} if it is not + * {@link Integer#MAX_VALUE}. + *

+ * In theory this value (and the values below) can be bigger than + * {@code Integer.MAX_VALUE} but a Java array can only have an int32 index. + */ + protected int maxLength = Integer.MAX_VALUE; + + /** + * Maximum personalization string length in bytes for this DRBG instance. + * Should be assigned in {@link #chooseAlgorithmAndStrength} if it is not + * {@link Integer#MAX_VALUE}. + */ + protected int maxPersonalizationStringLength = Integer.MAX_VALUE; + + /** + * Maximum additional input length in bytes for this DRBG instance. + * Should be assigned in {@link #chooseAlgorithmAndStrength} if it is not + * {@link Integer#MAX_VALUE}. + */ + protected int maxAdditionalInputLength = Integer.MAX_VALUE; + + /** + * max_number_of_bits_per_request in bytes for this DRBG instance. + * Should be assigned in {@link #chooseAlgorithmAndStrength} if it is not + * {@link Integer#MAX_VALUE}. + */ + protected int maxNumberOfBytesPerRequest = Integer.MAX_VALUE; + + /** + * Maximum number of requests between reseeds for this DRBG instance. + * Should be assigned in {@link #chooseAlgorithmAndStrength} if it is not + * {@link Integer#MAX_VALUE}. + */ + protected int reseedInterval = Integer.MAX_VALUE; + + + /** + * Algorithm used by this instance (SHA-512 or AES-256). Must be assigned + * in {@link #chooseAlgorithmAndStrength}. This field is used in + * {@link #toString()} and {@link DRBG#algorithmName}. + */ + protected String algorithm; + + // Configurable parameters + + /** + * Security strength for this instance. Must be assigned in + * {@link #chooseAlgorithmAndStrength}. Should be at least the requested + * strength. Might be smaller than the highest strength + * {@link #algorithm} supports. Must not be -1. + */ + protected int securityStrength; // in bits + + /** + * Strength requested in {@link DrbgParameters.Instantiation}. + * The real strength is based on it. Do not modify it in a mechanism. + */ + protected int requestedInstantiationSecurityStrength = -1; + + /** + * The personalization string used by this instance. Set inside + * {@link #configure(SecureRandomParameters)} and + * can be used in a mechanism. Do not modify it in a mechanism. + */ + protected byte[] personalizationString; + + /** + * The prediction resistance flag used by this instance. Set inside + * {@link #configure(SecureRandomParameters)}. + */ + private boolean predictionResistanceFlag; + + // Non-standard configurable parameters + + /** + * Whether a derivation function is used. Requested in + * {@link MoreDrbgParameters}. Only CtrDRBG uses it. + * Do not modify it in a mechanism. + */ + protected boolean usedf; + + /** + * The nonce for this instance. Set in {@link #instantiateIfNecessary}. + * After instantiation, this field is not null. Do not modify it + * in a mechanism. + */ + protected transient byte[] nonce; + + /** + * Requested nonce in {@link MoreDrbgParameters}. If set to null, + * nonce will be chosen by system, and a reinstantiated DRBG will get a + * new system-provided nonce. + */ + private byte[] requestedNonce; + + /** + * Requested algorithm in {@link MoreDrbgParameters}. + * Do not modify it in a mechanism. + */ + protected String requestedAlgorithm; + + /** + * The entropy source used by this instance. Set inside + * {@link #configure(SecureRandomParameters)}. This field + * can be null. {@link #getEntropyInput} will take care of null check. + */ + private transient EntropySource es; + + // Five abstract methods for SP 800-90A DRBG + + /** + * Decides what algorithm and strength to use (SHA-256 or AES-256, + * 128 or 256). Strength related fields must also be defined or redefined + * here. Called in {@link #configure}. A mechanism uses + * {@link #requestedAlgorithm}, + * {@link #requestedInstantiationSecurityStrength}, and + * {@link #DEFAULT_STRENGTH} to decide which algorithm and strength to use. + *

+ * If {@code requestedAlgorithm} is provided, it will always be used. + * If {@code requestedInstantiationSecurityStrength} is also provided, + * the algorithm will use the strength (an exception will be thrown if + * the strength is not supported), otherwise, the smaller one of + * the highest supported strength of the algorithm and the default strength + * will be used. + *

+ * If {@code requestedAlgorithm} is not provided, an algorithm will be + * chosen that supports {@code requestedInstantiationSecurityStrength} + * (or {@code DEFAULT_STRENGTH} if there is no request). + *

+ * Since every call to {@link #configure} will call this method, + * make sure to the calls do not contradict with each other. + *

+ * Here are some examples of the algorithm and strength chosen (suppose + * {@code DEFAULT_STRENGTH} is 128) for HashDRBG: + *

+     * requested             effective
+     * (SHA-1, -1)           (SHA-1,128)
+     * (SHA-1, 112)          (SHA-1,112)
+     * (SHA-1, 192)          IAE
+     * (SHA-256, -1)         (SHA-256,128)
+     * (SHA-256, 128)        (SHA-256,128)
+     * (SHA-3, -1)           IAE
+     * (null, -1)            (SHA-256,128)
+     * (null, 112)           (SHA-256,112)
+     * (null, 192)           (SHA-256,192)
+     * (null, 256)           (SHA-256,256)
+     * (null, 384)           IAE
+     * 
+ * + * @throws IllegalArgumentException if the requested parameters + * can not be supported or contradict with each other. + */ + protected abstract void chooseAlgorithmAndStrength(); + + /** + * Initiates security engines ({@code MessageDigest}, {@code Mac}, + * or {@code Cipher}). Must be called in deserialization. Please note + * that before instantiation the algorithm might not be available yet. + * In this case, just return and this method will be called + * automatically at instantiation. + */ + protected abstract void initEngine(); + + /** + * Instantiates a DRBG. Called automatically before the first + * {@code nextBytes} call. + *

+ * Note that the other parameters (nonce, strength, ps) are already + * stored inside at configuration. + * + * @param ei the entropy input, its length is already conditioned to be + * between {@link #minLength} and {@link #maxLength}. + */ + protected abstract void instantiateAlgorithm(byte[] ei); + + /** + * The generate function. + * + * @param result fill result here, not null + * @param additionalInput additional input, can be null. If not null, + * its length is smaller than {@link #maxAdditionalInputLength} + */ + protected abstract void generateAlgorithm( + byte[] result, byte[] additionalInput); + + /** + * The reseed function. + * + * @param ei the entropy input, its length is already conditioned to be + * between {@link #minLength} and {@link #maxLength}. + * @param additionalInput additional input, can be null. If not null, + * its length is smaller than {@link #maxAdditionalInputLength} + * @throws UnsupportedOperationException if reseed is not supported + */ + protected void reseedAlgorithm( + byte[] ei, byte[] additionalInput) { + throw new UnsupportedOperationException("No reseed function"); + } + + // SecureRandomSpi methods taken care of here. All final. + + @Override + protected final void engineNextBytes(byte[] result) { + engineNextBytes(result, DrbgParameters.nextBytes( + -1, predictionResistanceFlag, null)); + } + + @Override + protected final void engineNextBytes( + byte[] result, SecureRandomParameters params) { + + Objects.requireNonNull(result); + + if (debug != null) { + debug.println(this, "nextBytes"); + } + if (params instanceof DrbgParameters.NextBytes) { + + // 800-90Ar1 9.3: Generate Process. + + DrbgParameters.NextBytes dp = (DrbgParameters.NextBytes) params; + + // Step 2: max_number_of_bits_per_request + if (result.length > maxNumberOfBytesPerRequest) { + // generateAlgorithm should be called multiple times to fill + // up result. Unimplemented since maxNumberOfBytesPerRequest + // is now Integer.MAX_VALUE. + } + + // Step 3: check requested_security_strength + if (dp.getStrength() > securityStrength) { + throw new IllegalArgumentException("strength too high: " + + dp.getStrength()); + } + + // Step 4: check max_additional_input_length + byte[] ai = dp.getAdditionalInput(); + if (ai != null && ai.length > maxAdditionalInputLength) { + throw new IllegalArgumentException("ai too long: " + + ai.length); + } + + // Step 5: check prediction_resistance_flag + boolean pr = dp.getPredictionResistance(); + if (!predictionResistanceFlag && pr) { + throw new IllegalArgumentException("pr not available"); + } + + instantiateIfNecessary(null); + + // Step 7: Auto reseed + if (reseedCounter > reseedInterval || pr) { + reseedAlgorithm(getEntropyInput(pr), ai); + ai = null; + } + + // Step 8, 10: Generate_algorithm + // Step 9: Unnecessary. reseedCounter only updated after generation + generateAlgorithm(result, ai); + + // Step 11: Return + } else { + throw new IllegalArgumentException("unknown params type:" + + params.getClass()); + } + } + + @Override + public final void engineReseed(SecureRandomParameters params) { + if (debug != null) { + debug.println(this, "reseed with params"); + } + if (!supportReseeding) { + throw new UnsupportedOperationException("Reseed not supported"); + } + if (params == null) { + params = DrbgParameters.reseed(predictionResistanceFlag, null); + } + if (params instanceof DrbgParameters.Reseed) { + DrbgParameters.Reseed dp = (DrbgParameters.Reseed) params; + + // 800-90Ar1 9.2: Reseed Process. + + // Step 2: Check prediction_resistance_request + boolean pr = dp.getPredictionResistance(); + if (!predictionResistanceFlag && pr) { + throw new IllegalArgumentException("pr not available"); + } + + // Step 3: Check additional_input length + byte[] ai = dp.getAdditionalInput(); + if (ai != null && ai.length > maxAdditionalInputLength) { + throw new IllegalArgumentException("ai too long: " + + ai.length); + } + instantiateIfNecessary(null); + + // Step 4: Get_entropy_input + // Step 5: Check step 4 + // Step 6-7: Reseed_algorithm + reseedAlgorithm(getEntropyInput(pr), ai); + + // Step 8: Return + } else { + throw new IllegalArgumentException("unknown params type: " + + params.getClass()); + } + } + + /** + * Returns the given number of seed bytes. A DRBG always uses + * {@link SeedGenerator} to get an array with full-entropy. + *

+ * The implementation is identical to SHA1PRNG's + * {@link SecureRandom#engineGenerateSeed}. + * + * @param numBytes the number of seed bytes to generate. + * @return the seed bytes. + */ + @Override + public final byte[] engineGenerateSeed(int numBytes) { + byte[] b = new byte[numBytes]; + SeedGenerator.generateSeed(b); + return b; + } + + /** + * Reseeds this random object with the given seed. A DRBG always expands + * or truncates the input to be between {@link #minLength} and + * {@link #maxLength} and uses it to instantiate or reseed itself + * (depending on whether the DRBG is instantiated). + * + * @param input the seed + */ + @Override + public final synchronized void engineSetSeed(byte[] input) { + if (debug != null) { + debug.println(this, "setSeed"); + } + if (input.length < minLength) { + input = Arrays.copyOf(input, minLength); + } else if (input.length > maxLength) { + input = Arrays.copyOf(input, maxLength); + } + if (!instantiated) { + instantiateIfNecessary(input); + } else { + reseedAlgorithm(input, null); + } + } + + // get_entropy_input + + private byte[] getEntropyInput(boolean isPr) { + // Should the 1st arg be minEntropy or minLength? + // + // Technically it should be minEntropy, but CtrDRBG + // (not using derivation function) is so confusing + // (does it need only strength or seedlen of entropy?) + // that it's safer to assume minLength. In all other + // cases minLength equals to minEntropy. + return getEntropyInput(minLength, minLength, maxLength, isPr); + } + + private byte[] getEntropyInput(int minEntropy, int minLength, + int maxLength, boolean pr) { + if (debug != null) { + debug.println(this, "getEntropy(" + minEntropy + "," + minLength + + "," + maxLength + "," + pr + ")"); + } + EntropySource esNow = es; + if (esNow == null) { + esNow = pr ? SeederHolder.prseeder : SeederHolder.seeder; + } + return esNow.getEntropy(minEntropy, minLength, maxLength, pr); + } + + // Defaults + + /** + * The default {@code EntropySource} determined by system property + * "java.security.egd" or security property "securerandom.source". + *

+ * This object uses {@link SeedGenerator#generateSeed(byte[])} to + * return a byte array containing {@code minLength} bytes. It is + * assumed to support prediction resistance and always contains + * full-entropy. A trusted application can update this field. + */ + private final static EntropySource defaultES = + (minE, minLen, maxLen, pr) -> { + byte[] result = new byte[minLen]; + SeedGenerator.generateSeed(result); + return result; + }; + + private static class SeederHolder { + + /** + * Default EntropySource for SecureRandom with prediction resistance, + */ + static final EntropySource prseeder; + + /** + * Default EntropySource for SecureRandom without prediction resistance, + * which is backed by a DRBG whose EntropySource is {@link #prseeder}. + */ + static final EntropySource seeder; + + static { + prseeder = defaultES; + // According to SP800-90C section 7, a DRBG without live + // entropy (drbg here, with pr being false) can instantiate + // another DRBG with weaker strength. So we choose highest + // strength we support. + HashDrbg first = new HashDrbg(new MoreDrbgParameters( + prseeder, null, "SHA-256", null, false, + DrbgParameters.instantiation( + 256, NONE, + SeedGenerator.getSystemEntropy()))); + seeder = (entropy, minLen, maxLen, pr) -> { + if (pr) { + // This SEI does not support pr + throw new IllegalArgumentException("pr not supported"); + } + byte[] result = new byte[minLen]; + first.engineNextBytes(result); + return result; + }; + } + } + + // Constructor called by overridden methods, initializer... + + /** + * A constructor without argument so that an implementation does not + * need to always write {@code super(params)}. + */ + protected AbstractDrbg() { + // Nothing + } + + /** + * A mechanism shall override this constructor to setup {@link #mechName}, + * {@link #highestSupportedSecurityStrength}, + * {@link #supportPredictionResistance}, {@link #supportReseeding} + * or other features like {@link #DEFAULT_STRENGTH}. Finally it shall + * call {@link #configure} on {@code params}. + * + * @param params the {@link SecureRandomParameters} object. + * This argument can be {@code null}. + * @throws IllegalArgumentException if {@code params} is + * inappropriate for this SecureRandom. + */ + protected AbstractDrbg(SecureRandomParameters params) { + // Nothing + } + + /** + * Returns the current configuration as a {@link DrbgParameters.Instantiation} + * object. + * + * @return the curent configuration + */ + @Override + protected SecureRandomParameters engineGetParameters() { + // Or read from variable. + return DrbgParameters.instantiation( + securityStrength, + predictionResistanceFlag ? PR_AND_RESEED : + (supportReseeding ? RESEED_ONLY : NONE), + personalizationString); + } + + /** + * Configure this DRBG. This method calls + * {@link #chooseAlgorithmAndStrength()} and {@link #initEngine()} + * but does not do the actual instantiation. + * + * @param params configuration, if null, default configuration (default + * strength, pr_false, no personalization string) is used. + * @throws IllegalArgumentException if {@code params} is + * inappropriate for this SecureRandom. + */ + protected final synchronized void configure( + SecureRandomParameters params) { + if (debug != null) { + debug.println(this, "configure " + this + " with " + params); + } + if (params == null) { + params = DrbgParameters.instantiation(-1, RESEED_ONLY, null); + } + if (params instanceof MoreDrbgParameters) { + MoreDrbgParameters m = (MoreDrbgParameters)params; + this.requestedNonce = m.nonce; + this.es = m.es; + this.requestedAlgorithm = m.algorithm; + this.usedf = m.usedf; + params = m.config; + } + if (params != null) { + if (params instanceof DrbgParameters.Instantiation) { + DrbgParameters.Instantiation inst = + (DrbgParameters.Instantiation) params; + + // 800-90Ar1 9.1: Instantiate Process. Steps 1-5. + + // Step 1: Check requested_instantiation_security_strength + if (inst.getStrength() > highestSupportedSecurityStrength) { + throw new IllegalArgumentException("strength too big: " + + inst.getStrength()); + } + + // Step 2: Check prediction_resistance_flag + if (inst.getCapability().supportsPredictionResistance() + && !supportPredictionResistance) { + throw new IllegalArgumentException("pr not supported"); + } + + // Step 3: Check personalization_string + byte[] ps = inst.getPersonalizationString(); + if (ps != null && ps.length > maxPersonalizationStringLength) { + throw new IllegalArgumentException("ps too long: " + + ps.length); + } + + if (inst.getCapability().supportsReseeding() + && !supportReseeding) { + throw new IllegalArgumentException("reseed not supported"); + } + this.personalizationString = ps; + this.predictionResistanceFlag = + inst.getCapability().supportsPredictionResistance(); + this.requestedInstantiationSecurityStrength = inst.getStrength(); + } else { + throw new IllegalArgumentException("unknown params: " + + params.getClass()); + } + } + + // Step 4: Set security_strength + chooseAlgorithmAndStrength(); + instantiated = false; + + // Step 5: no-op. + + if (debug != null) { + debug.println(this, "configured " + this); + } + } + + /** + * Instantiate if necessary, + * + * @param entropy a user-provided entropy, the length is already good. + * If null, will fetch entropy input automatically. + */ + private synchronized void instantiateIfNecessary(byte[] entropy) { + if (!instantiated) { + + // 800-90Ar1 9.1: Instantiate Process. Steps 6-12. + + // Step 6: Get_entropy_input + // Step 7: check error (getEntropyInput throw no exception now) + if (entropy == null) { + entropy = getEntropyInput(predictionResistanceFlag); + } + + // Step 8. nonce + if (requestedNonce != null) { + nonce = requestedNonce; + } else { + nonce = NonceProvider.next(); + } + initEngine(); + + // Step 9-11: Instantiate_algorithm + instantiateAlgorithm(entropy); + instantiated = true; + + // Step 12: Return + } + } + + // Nonce provider + + private static class NonceProvider { + + // 128 bits of nonce can be used by 256-bit strength DRBG + private static final byte[] block = new byte[16]; + + private static synchronized byte[] next() { + int k = 15; + while ((k >= 0) && (++block[k] == 0)) { + k--; + } + return block.clone(); + } + } + + // Misc + + /** A handy method returning hexdump string with no colon or new line. + * + * @param in input byte array + * @return the hexdump string + */ + protected static String hex(byte[] in) { + StringBuilder sb = new StringBuilder(); + for (byte b : in) { + sb.append(String.format("%02x", b&0xff)); + } + return sb.toString(); + } + + /** + * Returns the smallest standard strength (112, 128, 192, 256) that is + * greater or equal to the input. + * + * @param input the input strength + * @return the standard strength + */ + protected static int getStandardStrength(int input) { + if (input <= 112) return 112; + if (input <= 128) return 128; + if (input <= 192) return 192; + if (input <= 256) return 256; + throw new IllegalArgumentException("input too big: " + input); + } + + @Override + public String toString() { + return mechName + "," + algorithm + + "," + securityStrength + "," + + (predictionResistanceFlag ? "pr_and_reseed" + : (supportReseeding ? "reseed_only" : "none")); + } +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/AbstractHashDrbg.java b/jdk/src/java.base/share/classes/sun/security/provider/AbstractHashDrbg.java new file mode 100644 index 00000000000..75edd923aca --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/AbstractHashDrbg.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import sun.security.util.HexDumpEncoder; + +import java.util.Arrays; +import java.util.Locale; + +public abstract class AbstractHashDrbg extends AbstractDrbg { + + private static final long serialVersionUID = 9L; + + protected int outLen; + protected int seedLen; + + private static int alg2strength(String algorithm) { + switch (algorithm.toUpperCase(Locale.ROOT)) { + case "SHA-1": + return 128; + case "SHA-224": + case "SHA-512/224": + return 192; + case "SHA-256": + case "SHA-512/256": + case "SHA-384": + case "SHA-512": + return 256; + default: + throw new IllegalArgumentException(algorithm + + " not supported in Hash_DBRG"); + } + } + + protected void chooseAlgorithmAndStrength() { + if (requestedAlgorithm != null) { + algorithm = requestedAlgorithm.toUpperCase(Locale.ROOT); + int supportedStrength = alg2strength(algorithm); + if (requestedInstantiationSecurityStrength >= 0) { + int tryStrength = getStandardStrength( + requestedInstantiationSecurityStrength); + if (tryStrength > supportedStrength) { + throw new IllegalArgumentException(algorithm + + " does not support strength " + + requestedInstantiationSecurityStrength); + } + this.securityStrength = tryStrength; + } else { + this.securityStrength = DEFAULT_STRENGTH > supportedStrength ? + supportedStrength : DEFAULT_STRENGTH; + } + } else { + int tryStrength = (requestedInstantiationSecurityStrength < 0) ? + DEFAULT_STRENGTH : requestedInstantiationSecurityStrength; + tryStrength = getStandardStrength(tryStrength); + // The default algorithm which is enough for all strengths. + // Remember to sync with "securerandom.drbg.config" in java.security + algorithm = "SHA-256"; + this.securityStrength = tryStrength; + } + switch (algorithm.toUpperCase(Locale.ROOT)) { + case "SHA-1": + this.seedLen = 440 / 8; + this.outLen = 160 / 8; + break; + case "SHA-224": + case "SHA-512/224": + this.seedLen = 440 / 8; + this.outLen = 224 / 8; + break; + case "SHA-256": + case "SHA-512/256": + this.seedLen = 440 / 8; + this.outLen = 256 / 8; + break; + case "SHA-384": + this.seedLen = 888 / 8; + this.outLen = 384 / 8; + break; + case "SHA-512": + this.seedLen = 888 / 8; + this.outLen = 512 / 8; + break; + default: + throw new IllegalArgumentException(algorithm + + " not supported in Hash_DBRG"); + } + this.minLength = this.securityStrength / 8; + } + + @Override + public void instantiateAlgorithm(byte[] entropy) { + if (debug != null) { + debug.println(this, "instantiate"); + } + + // 800-90Ar1 10.1.1.2: Hash_DRBG Instantiate Process. + // 800-90Ar1 10.1.2.3: Hmac_DRBG Instantiate Process. + + // Step 1: entropy_input || nonce || personalization_string. + byte[] seed = Arrays.copyOf(entropy, entropy.length + nonce.length + + ((personalizationString == null) ? 0 + : personalizationString.length)); + System.arraycopy(nonce, 0, seed, entropy.length, nonce.length); + if (personalizationString != null) { + System.arraycopy(personalizationString, 0, + seed, entropy.length + nonce.length, + personalizationString.length); + } + hashReseedInternal(seed); + } + + @Override + protected void reseedAlgorithm( + byte[] ei, + byte[] additionalInput) { + if (debug != null) { + debug.println(this, "reseedAlgorithm\n" + + new HexDumpEncoder().encodeBuffer(ei) + "\n" + + ((additionalInput == null) ? "" : + new HexDumpEncoder().encodeBuffer(additionalInput))); + } + + // 800-90Ar1 10.1.1.3: Hash_DRBG Reseed Process. + // 800-90Ar1 10.1.2.4: Hmac_DRBG Reseed Process. + + // Step 1: entropy_input || additional_input. + if (additionalInput != null) { + ei = Arrays.copyOf(ei, ei.length + additionalInput.length); + System.arraycopy(additionalInput, 0, ei, + ei.length - additionalInput.length, additionalInput.length); + } + hashReseedInternal(ei); + } + + protected abstract void hashReseedInternal(byte[] seed); +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/CtrDrbg.java b/jdk/src/java.base/share/classes/sun/security/provider/CtrDrbg.java new file mode 100644 index 00000000000..e1904cbbbbf --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/CtrDrbg.java @@ -0,0 +1,530 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import java.io.IOException; +import java.security.*; +import java.util.Arrays; +import java.util.Locale; + +public class CtrDrbg extends AbstractDrbg { + + private static final long serialVersionUID = 9L; + private static final int AES_LIMIT; + + static { + try { + AES_LIMIT = Cipher.getMaxAllowedKeyLength("AES"); + } catch (Exception e) { + // should not happen + throw new AssertionError("Cannot detect AES", e); + } + } + + private transient Cipher cipher; + + private String cipherAlg; + private String keyAlg; + + private int ctrLen; + private int blockLen; + private int keyLen; + private int seedLen; + + private transient byte[] v; + private transient byte[] k; + + public CtrDrbg(SecureRandomParameters params) { + mechName = "CTR_DRBG"; + configure(params); + } + + private static int alg2strength(String algorithm) { + switch (algorithm.toUpperCase(Locale.ROOT)) { + case "TDEA": + case "3KEYTDEA": + case "3 KEY TDEA": + case "DESEDE": + return 112; + case "AES-128": + return 128; + case "AES-192": + return 192; + case "AES-256": + return 256; + default: + throw new IllegalArgumentException(algorithm + + " not supported in CTR_DBRG"); + } + } + + @Override + protected void chooseAlgorithmAndStrength() { + if (requestedAlgorithm != null) { + algorithm = requestedAlgorithm.toUpperCase(); + int supportedStrength = alg2strength(algorithm); + if (requestedInstantiationSecurityStrength >= 0) { + int tryStrength = getStandardStrength( + requestedInstantiationSecurityStrength); + if (tryStrength > supportedStrength) { + throw new IllegalArgumentException(algorithm + + " does not support strength " + + requestedInstantiationSecurityStrength); + } + this.securityStrength = tryStrength; + } else { + this.securityStrength = (DEFAULT_STRENGTH > supportedStrength) ? + supportedStrength : DEFAULT_STRENGTH; + } + } else { + int tryStrength = (requestedInstantiationSecurityStrength < 0) ? + DEFAULT_STRENGTH : requestedInstantiationSecurityStrength; + tryStrength = getStandardStrength(tryStrength); + // Default algorithm, use AES-128 if AES-256 is not available. + // Remember to sync with "securerandom.drbg.config" in java.security + if (tryStrength <= 128 && AES_LIMIT < 256) { + algorithm = "AES-128"; + } else if (AES_LIMIT >= 256) { + algorithm = "AES-256"; + } else { + throw new IllegalArgumentException("unsupported strength " + + requestedInstantiationSecurityStrength); + } + this.securityStrength = tryStrength; + } + switch (algorithm.toUpperCase(Locale.ROOT)) { + case "TDEA": + case "3KEYTDEA": + case "3 KEY TDEA": + case "DESEDE": + algorithm = "DESede"; + this.keyAlg = "DESede"; + this.cipherAlg = "DESede/ECB/NoPadding"; + this.blockLen = 64 / 8; + this.keyLen = 168 / 8; + break; + case "AES-128": + case "AES-192": + case "AES-256": + this.keyAlg = "AES"; + this.cipherAlg = "AES/ECB/NoPadding"; + switch (algorithm) { + case "AES-128": + this.keyLen = 128 / 8; + break; + case "AES-192": + this.keyLen = 192 / 8; + if (AES_LIMIT < 192) { + throw new IllegalArgumentException(algorithm + + " not available (because policy) in CTR_DBRG"); + } + break; + case "AES-256": + this.keyLen = 256 / 8; + if (AES_LIMIT < 256) { + throw new IllegalArgumentException(algorithm + + " not available (because policy) in CTR_DBRG"); + } + break; + default: + throw new IllegalArgumentException(algorithm + + " not supported in CTR_DBRG"); + } + this.blockLen = 128 / 8; + break; + default: + throw new IllegalArgumentException(algorithm + + " not supported in CTR_DBRG"); + } + this.seedLen = this.blockLen + this.keyLen; + this.ctrLen = this.blockLen; // TODO + if (usedf) { + this.minLength = this.securityStrength / 8; + } else { + this.minLength = this.maxLength = + this.maxPersonalizationStringLength = + this.maxAdditionalInputLength = seedLen; + } + } + + /** + * This call, used by the constructors, instantiates the digest. + */ + @Override + protected void initEngine() { + try { + /* + * Use the local SUN implementation to avoid native + * performance overhead. + */ + cipher = Cipher.getInstance(cipherAlg, "SunJCE"); + } catch (NoSuchProviderException | NoSuchAlgorithmException + | NoSuchPaddingException e) { + // Fallback to any available. + try { + cipher = Cipher.getInstance(cipherAlg); + } catch (NoSuchAlgorithmException | NoSuchPaddingException exc) { + throw new InternalError( + "internal error: " + cipherAlg + " not available.", exc); + } + } + } + + private void status() { + if (debug != null) { + debug.println(this, "Key = " + hex(k)); + debug.println(this, "V = " + hex(v)); + debug.println(this, "reseed counter = " + reseedCounter); + } + } + + // 800-90Ar1 10.2.1.2. CTR_DRBG_Update + private void update(byte[] input) { + if (input.length != seedLen) { + // Should not happen + throw new IllegalArgumentException("input length not seedLen: " + + input.length); + } + try { + + int m = (seedLen + blockLen - 1) / blockLen; + byte[] temp = new byte[m * blockLen]; + + // Step 1. temp = Null. + + // Step 2. Loop + for (int i = 0; i < m; i++) { + // Step 2.1. Increment + addOne(v, ctrLen); + // Step 2.2. Block_Encrypt + cipher.init(Cipher.ENCRYPT_MODE, getKey(keyAlg, k)); + // Step 2.3. Encrypt into right position, no need to cat + cipher.doFinal(v, 0, blockLen, temp, i * blockLen); + } + + // Step 3. Truncate + temp = Arrays.copyOf(temp, seedLen); + + // Step 4: Add + for (int i = 0; i < seedLen; i++) { + temp[i] ^= input[i]; + } + + // Step 5: leftmost + k = Arrays.copyOf(temp, keyLen); + + // Step 6: rightmost + v = Arrays.copyOfRange(temp, seedLen - blockLen, seedLen); + + // Step 7. Return + } catch (GeneralSecurityException e) { + throw new InternalError(e); + } + } + + @Override + protected void instantiateAlgorithm(byte[] ei) { + if (debug != null) { + debug.println(this, "instantiate"); + } + byte[] more; + if (usedf) { + // 800-90Ar1 10.2.1.3.2 Step 1-2. cat bytes + if (personalizationString == null) { + more = nonce; + } else { + more = Arrays.copyOf( + nonce, nonce.length + personalizationString.length); + System.arraycopy(personalizationString, 0, more, nonce.length, + personalizationString.length); + } + } else { + // 800-90Ar1 10.2.1.3.1 + // Step 1-2, no need to expand personalizationString, we only XOR + // with shorter length + more = personalizationString; + } + reseedAlgorithm(ei, more); + } + + private byte[] df(byte[] input) { + int l = input.length; + int n = seedLen; + int slen = 4 + 4 + l + 1; + byte[] s = new byte[(slen + blockLen - 1) / blockLen * blockLen]; + s[0] = (byte)(l >> 24); + s[1] = (byte)(l >> 16); + s[2] = (byte)(l >> 8); + s[3] = (byte)(l); + s[4] = (byte)(n >> 24); + s[5] = (byte)(n >> 16); + s[6] = (byte)(n >> 8); + s[7] = (byte)(n); + System.arraycopy(input, 0, s, 8, l); + s[8+l] = (byte)0x80; + + byte[] k = new byte[keyLen]; + for (int i = 0; i < k.length; i++) { + k[i] = (byte)i; + } + + byte[] temp = new byte[seedLen]; + + for (int i = 0; i * blockLen < temp.length; i++) { + byte[] iv = new byte[blockLen + s.length]; + iv[0] = (byte)(i >> 24); + iv[1] = (byte)(i >> 16); + iv[2] = (byte)(i >> 8); + iv[3] = (byte)(i); + System.arraycopy(s, 0, iv, blockLen, s.length); + int tailLen = temp.length - blockLen*i; + if (tailLen > blockLen) { + tailLen = blockLen; + } + System.arraycopy(bcc(k, iv), 0, temp, blockLen*i, tailLen); + } + + k = Arrays.copyOf(temp, keyLen); + byte[] x = Arrays.copyOfRange(temp, keyLen, temp.length); + + for (int i = 0; i * blockLen < seedLen; i++) { + try { + cipher.init(Cipher.ENCRYPT_MODE, getKey(keyAlg, k)); + int tailLen = temp.length - blockLen*i; + if (tailLen > blockLen) { + tailLen = blockLen; + } + x = cipher.doFinal(x); + System.arraycopy(x, 0, temp, blockLen * i, tailLen); + } catch (GeneralSecurityException e) { + throw new InternalError(e); + } + } + return temp; + } + + private byte[] bcc(byte[] k, byte[] data) { + byte[] chain = new byte[blockLen]; + int n = data.length / blockLen; + for (int i = 0; i < n; i++) { + byte[] inputBlock = Arrays.copyOfRange( + data, i * blockLen, i * blockLen + blockLen); + for (int j = 0; j < blockLen; j++) { + inputBlock[j] ^= chain[j]; + } + try { + cipher.init(Cipher.ENCRYPT_MODE, getKey(keyAlg, k)); + chain = cipher.doFinal(inputBlock); + } catch (GeneralSecurityException e) { + throw new InternalError(e); + } + } + return chain; + } + + @Override + protected void reseedAlgorithm( + byte[] ei, + byte[] additionalInput) { + if (usedf) { + // 800-90Ar1 10.2.1.3.2 Instantiate. + // 800-90Ar1 10.2.1.4.2 Reseed. + + // Step 1: cat bytes + if (additionalInput != null) { + byte[] temp = Arrays.copyOf( + ei, ei.length + additionalInput.length); + System.arraycopy(additionalInput, 0, temp, ei.length, + additionalInput.length); + ei = temp; + } + // Step 2. df (seed_material, seedlen). + ei = df(ei); + } else { + // 800-90Ar1 10.2.1.3.1 Instantiate + // 800-90Ar1 10.2.1.4.1 Reseed + // Step 1-2. Needless + // Step 3. seed_material = entropy_input XOR more + if (additionalInput != null) { + // additionalInput.length <= seedLen + for (int i = 0; i < additionalInput.length; i++) { + ei[i] ^= additionalInput[i]; + } + } + } + + if (v == null) { + // 800-90Ar1 10.2.1.3.2 Instantiate. Step 3-4 + // 800-90Ar1 10.2.1.3.1 Instantiate. Step 4-5 + k = new byte[keyLen]; + v = new byte[blockLen]; + } + //status(); + + // 800-90Ar1 10.2.1.3.1 Instantiate. Step 6 + // 800-90Ar1 10.2.1.3.2 Instantiate. Step 5 + // 800-90Ar1 10.2.1.4.1 Reseed. Step 4 + // 800-90Ar1 10.2.1.4.2 Reseed. Step 3 + update(ei); + // 800-90Ar1 10.2.1.3.1 Instantiate. Step 7 + // 800-90Ar1 10.2.1.3.2 Instantiate. Step 6 + // 800-90Ar1 10.2.1.4.1 Reseed. Step 5 + // 800-90Ar1 10.2.1.4.2 Reseed. Step 4 + reseedCounter = 1; + //status(); + + // Whatever step. Return + } + + /** + * Add one to data, only touch the last len bytes. + */ + private static void addOne(byte[] data, int len) { + for (int i = 0; i < len; i++) { + data[data.length - 1 - i]++; + if (data[data.length - 1 - i] != 0) { + break; + } + } + } + + @Override + public synchronized void generateAlgorithm( + byte[] result, byte[] additionalInput) { + + if (debug != null) { + debug.println(this, "generateAlgorithm"); + } + + // 800-90Ar1 10.2.1.5.1 Generate + // 800-90Ar1 10.2.1.5.2 Generate + + // Step 1: Check reseed_counter. Will not fail. Already checked in + // AbstractDrbg#engineNextBytes. + + if (additionalInput != null) { + if (usedf) { + // 10.2.1.5.2 Step 2.1 + additionalInput = df(additionalInput); + } else { + // 10.2.1.5.1 Step 2.1-2.2 + additionalInput = Arrays.copyOf(additionalInput, seedLen); + } + // 10.2.1.5.1 Step 2.3 + // 10.2.1.5.2 Step 2.2 + update(additionalInput); + } else { + // 10.2.1.5.1 Step 2 Else + // 10.2.1.5.2 Step 2 Else + additionalInput = new byte[seedLen]; + } + + // Step 3. temp = Null + int pos = 0; + + // Step 4. Loop + while (pos < result.length) { + int tailLen = result.length - pos; + // Step 4.1. Increment + addOne(v, ctrLen); + try { + // Step 4.2. Encrypt + cipher.init(Cipher.ENCRYPT_MODE, getKey(keyAlg, k)); + byte[] out = cipher.doFinal(v); + + // Step 4.3 and 5. Cat bytes and leftmost + System.arraycopy(out, 0, result, pos, + (tailLen > blockLen) ? blockLen : tailLen); + } catch (GeneralSecurityException e) { + throw new InternalError(e); + } + pos += blockLen; + } + + // Step 6. Update + update(additionalInput); + + // Step 7. reseed_counter++ + reseedCounter++; + + //status(); + + // Step 8. Return + } + + private static void des7to8( + byte[] key56, int off56, byte[] key64, int off64) { + key64[off64 + 0] = (byte) + (key56[off56 + 0] & 0xFE); // << 0 + key64[off64 + 1] = (byte) + ((key56[off56 + 0] << 7) | ((key56[off56 + 1] & 0xFF) >>> 1)); + key64[off64 + 2] = (byte) + ((key56[off56 + 1] << 6) | ((key56[off56 + 2] & 0xFF) >>> 2)); + key64[off64 + 3] = (byte) + ((key56[off56 + 2] << 5) | ((key56[off56 + 3] & 0xFF) >>> 3)); + key64[off64 + 4] = (byte) + ((key56[off56 + 3] << 4) | ((key56[off56 + 4] & 0xFF) >>> 4)); + key64[off64 + 5] = (byte) + ((key56[off56 + 4] << 3) | ((key56[off56 + 5] & 0xFF) >>> 5)); + key64[off64 + 6] = (byte) + ((key56[off56 + 5] << 2) | ((key56[off56 + 6] & 0xFF) >>> 6)); + key64[off64 + 7] = (byte) + (key56[off56 + 6] << 1); + + for (int i = 0; i < 8; i++) { + // if even # bits, make uneven, XOR with 1 (uneven & 1) + // for uneven # bits, make even, XOR with 0 (even & 1) + key64[off64 + i] ^= Integer.bitCount(key64[off64 + i] ^ 1) & 1; + } + } + + private static SecretKey getKey(String keyAlg, byte[] k) { + if (keyAlg.equals("DESede")) { + byte[] k2 = new byte[24]; + des7to8(k, 0, k2, 0); + des7to8(k, 7, k2, 8); + des7to8(k, 14, k2, 16); + k = k2; + } + return new SecretKeySpec(k, keyAlg); + } + + private void readObject(java.io.ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject (); + initEngine(); + } + + @Override + public String toString() { + return super.toString() + "/" + + (usedf ? "use_df" : "no_df"); + } +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/DRBG.java b/jdk/src/java.base/share/classes/sun/security/provider/DRBG.java new file mode 100644 index 00000000000..b5fa3c4c4d2 --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/DRBG.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import java.security.AccessController; +import java.security.DrbgParameters; +import java.security.PrivilegedAction; +import java.security.SecureRandomParameters; +import java.security.SecureRandomSpi; +import java.security.Security; +import java.util.Locale; +import static java.security.DrbgParameters.Capability.*; + +/** + * Implement the "SecureRandom.DRBG" algorithm. + * + * About the default "securerandom.drbg.config" value: + * + * The default value in java.security is set to "". This is because + * the default values of different aspects are dependent (For example, + * strength depends on algorithm) and if we write a full string there + * it will be difficult to modify one and keep all others legal. + * + * When changing default values, touch all places including: + * + * 1. comments of the security property in java.security + * 2. Default mech, cap, usedf set in this class + * 3. Default algorithm set in final implementation of each mech + * 4. Default strength set in AbstractDrbg, but the effective + * value can be smaller if an algorithm does not support it. + * + * The default value is also mentioned in the @implNote part of + * {@link DrbgParameters} class. + */ +public final class DRBG extends SecureRandomSpi { + + private static final String PROP_NAME = "securerandom.drbg.config"; + + private static final long serialVersionUID = 9L; + + private final AbstractDrbg impl; + + private final String mechName; + + private final String algorithmName; + + public DRBG(SecureRandomParameters params) { + + // All parameters at unset status (null or -1). + + // Configurable with the "securerandom.drbg.config" security property + String mech = null; + Boolean usedf = null; + String algorithm = null; + + // Default instantiate parameters also configurable with + // "securerandom.drbg.config", and can be changed with params + // in getInstance("drbg", params) + int strength = -1; + DrbgParameters.Capability cap = null; + byte[] ps = null; + + // Not configurable with public interfaces, but is a part of + // MoreDrbgParameters + EntropySource es = null; + byte[] nonce = null; + + // Can be configured with a security property + + String config = AccessController.doPrivileged((PrivilegedAction) + () -> Security.getProperty(PROP_NAME)); + + if (config != null && !config.isEmpty()) { + for (String part : config.split(",")) { + part = part.trim(); + switch (part.toLowerCase(Locale.ROOT)) { + case "": + throw new IllegalArgumentException( + "aspect in " + PROP_NAME + " cannot be empty"); + case "pr_and_reseed": + checkTwice(cap != null, "capability"); + cap = PR_AND_RESEED; + break; + case "reseed_only": + checkTwice(cap != null, "capability"); + cap = RESEED_ONLY; + break; + case "none": + checkTwice(cap != null, "capability"); + cap = NONE; + break; + case "hash_drbg": + case "hmac_drbg": + case "ctr_drbg": + checkTwice(mech != null, "mechanism name"); + mech = part; + break; + case "no_df": + checkTwice(usedf != null, "usedf flag"); + usedf = false; + break; + case "use_df": + checkTwice(usedf != null, "usedf flag"); + usedf = true; + break; + default: + // For all other parts of the property, it is + // either an algorithm name or a strength + try { + int tmp = Integer.parseInt(part); + if (tmp < 0) { + throw new IllegalArgumentException( + "strength in " + PROP_NAME + + " cannot be negative: " + part); + } + checkTwice(strength >= 0, "strength"); + strength = tmp; + } catch (NumberFormatException e) { + checkTwice(algorithm != null, "algorithm name"); + algorithm = part; + } + } + } + } + + // Can be updated by params + + if (params != null) { + // MoreDrbgParameters is used for testing. + if (params instanceof MoreDrbgParameters) { + MoreDrbgParameters m = (MoreDrbgParameters)params; + params = m.config; + + // No need to check null for es and nonce, they are still null + es = m.es; + nonce = m.nonce; + + if (m.mech != null) { + mech = m.mech; + } + if (m.algorithm != null) { + algorithm = m.algorithm; + } + usedf = m.usedf; + } + if (params instanceof DrbgParameters.Instantiation) { + DrbgParameters.Instantiation dp = + (DrbgParameters.Instantiation) params; + + // ps is still null by now + ps = dp.getPersonalizationString(); + + int tmp = dp.getStrength(); + if (tmp != -1) { + strength = tmp; + } + cap = dp.getCapability(); + } else { + throw new IllegalArgumentException("Unsupported params: " + + params.getClass()); + } + } + + // Hardcoded defaults. + // Remember to sync with "securerandom.drbg.config" in java.security. + + if (cap == null) { + cap = NONE; + } + if (mech == null) { + mech = "Hash_DRBG"; + } + if (usedf == null) { + usedf = true; + } + + MoreDrbgParameters m = new MoreDrbgParameters( + es, mech, algorithm, nonce, usedf, + DrbgParameters.instantiation(strength, cap, ps)); + + switch (mech.toLowerCase(Locale.ROOT)) { + case "hash_drbg": + impl = new HashDrbg(m); + break; + case "hmac_drbg": + impl = new HmacDrbg(m); + break; + case "ctr_drbg": + impl = new CtrDrbg(m); + break; + default: + throw new IllegalArgumentException("Unsupported mech: " + mech); + } + + mechName = mech; + algorithmName = impl.algorithm; + } + + @Override + protected void engineSetSeed(byte[] seed) { + impl.engineSetSeed(seed); + } + + @Override + protected void engineNextBytes(byte[] bytes) { + impl.engineNextBytes(bytes); + } + + @Override + protected byte[] engineGenerateSeed(int numBytes) { + return impl.engineGenerateSeed(numBytes); + } + + @Override + protected void engineNextBytes( + byte[] bytes, SecureRandomParameters params) { + impl.engineNextBytes(bytes, params); + } + + @Override + protected void engineReseed(SecureRandomParameters params) { + impl.engineReseed(params); + } + + @Override + protected SecureRandomParameters engineGetParameters() { + return impl.engineGetParameters(); + } + + @Override + public String toString() { + return impl.toString(); + } + + /** + * Ensures an aspect is not set more than once. + * + * @param flag true if set more than once + * @param name the name of aspect shown in IAE + * @throws IllegalArgumentException if it happens + */ + private static void checkTwice(boolean flag, String name) { + if (flag) { + throw new IllegalArgumentException(name + + " cannot be provided more than once in " + PROP_NAME); + } + } +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/DSAKeyFactory.java b/jdk/src/java.base/share/classes/sun/security/provider/DSAKeyFactory.java index 731f6b13e45..0dc0a614d51 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/DSAKeyFactory.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/DSAKeyFactory.java @@ -70,7 +70,7 @@ public class DSAKeyFactory extends KeyFactorySpi { * By default this is false. * This incompatibility was introduced by 4532506. */ - String prop = GetPropertyAction.getProperty(SERIAL_PROP); + String prop = GetPropertyAction.privilegedGetProperty(SERIAL_PROP); SERIAL_INTEROP = "true".equalsIgnoreCase(prop); } diff --git a/jdk/src/java.base/share/classes/sun/security/provider/EntropySource.java b/jdk/src/java.base/share/classes/sun/security/provider/EntropySource.java new file mode 100644 index 00000000000..0a15d3b10d3 --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/EntropySource.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +/** + * An interface of a source of entropy input. + * + * @since 9 + */ +public interface EntropySource { + /** + * Returns a byte array containing entropy. + *

+ * This maps to the {@code Get_entropy_input} function defined in + * Section 9 of NIST SP 800-90Ar1. + * + * @param minEntropy minimum entropy required, in bytes + * @param minLength minimum length of output, in bytes + * @param maxLength maximum length of output, in bytes + * @param pr whether prediction resistance is required + * @return the byte array containing entropy + */ + byte[] getEntropy(int minEntropy, int minLength, int maxLength, boolean pr); +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/HashDrbg.java b/jdk/src/java.base/share/classes/sun/security/provider/HashDrbg.java new file mode 100644 index 00000000000..0b59f7d4c33 --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/HashDrbg.java @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.DigestException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.SecureRandomParameters; +import java.util.Arrays; + +public class HashDrbg extends AbstractHashDrbg { + + private static final long serialVersionUID = 9L; + + private static final byte[] ZERO = new byte[1]; + private static final byte[] ONE = new byte[]{1}; + + private transient MessageDigest digest; + + private transient byte[] v; + private transient byte[] c; + + public HashDrbg(SecureRandomParameters params) { + mechName = "Hash_DRBG"; + configure(params); + } + + /** + * This call, used by the constructors, instantiates the digest. + */ + @Override + protected void initEngine() { + try { + /* + * Use the local SUN implementation to avoid native + * performance overhead. + */ + digest = MessageDigest.getInstance(algorithm, "SUN"); + } catch (NoSuchProviderException | NoSuchAlgorithmException e) { + // Fallback to any available. + try { + digest = MessageDigest.getInstance(algorithm); + } catch (NoSuchAlgorithmException exc) { + throw new InternalError( + "internal error: " + algorithm + " not available.", exc); + } + } + } + + private byte[] hashDf(int requested, byte[]... inputs) { + return hashDf(digest, outLen, requested, inputs); + } + + /** + * A hash-based derivation function defined in NIST SP 800-90Ar1 10.3.1. + * The function is used inside Hash_DRBG, and can also be used as an + * approved conditioning function as described in 800-90B 6.4.2.2. + * + * @param digest a {@code MessageDigest} object in reset state + * @param outLen {@link MessageDigest#getDigestLength} of {@code digest} + * @param requested requested output length, in bytes + * @param inputs input data + * @return the condensed/expanded output + */ + public static byte[] hashDf(MessageDigest digest, int outLen, + int requested, byte[]... inputs) { + int len = (requested + outLen - 1) / outLen; + byte[] temp = new byte[len * outLen]; + int counter = 1; + + for (int i=0; i> 21)); // requested*8 as int32 + digest.update((byte)(requested >> 13)); + digest.update((byte)(requested >> 5)); + digest.update((byte)(requested << 3)); + for (byte[] input : inputs) { + digest.update(input); + } + try { + digest.digest(temp, i * outLen, outLen); + } catch (DigestException e) { + throw new AssertionError("will not happen", e); + } + counter++; + } + return temp.length == requested? temp: Arrays.copyOf(temp, requested); + } + + // This method is used by both instantiation and reseeding. + @Override + protected final void hashReseedInternal(byte[] input) { + + // 800-90Ar1 10.1.1.2: Instantiate Process. + // 800-90Ar1 10.1.1.3: Reseed Process. + byte[] seed; + + // Step 2: seed = Hash_df (seed_material, seedlen). + if (v != null) { + // Step 1 of 10.1.1.3: Prepend 0x01 || V + seed = hashDf(seedLen, ONE, v, input); + } else { + seed = hashDf(seedLen, input); + } + + // Step 3. V = seed. + v = seed; + + // Step 4. C = Hash_df ((0x00 || V), seedlen). + c = hashDf(seedLen, ZERO, v); + + // Step 5. reseed_counter = 1. + reseedCounter = 1; + + //status(); + + // Step 6: Return + } + + private void status() { + if (debug != null) { + debug.println(this, "V = " + hex(v)); + debug.println(this, "C = " + hex(c)); + debug.println(this, "reseed counter = " + reseedCounter); + } + } + + /** + * Adds byte arrays into an existing one. + * + * @param out existing array + * @param data more arrays, can be of different length + */ + private static void addBytes(byte[] out, int len, byte[]... data) { + for (byte[] d: data) { + int dlen = d.length; + int carry = 0; + for (int i = 0; i < len; i++) { + int sum = (out[len - i - 1] & 0xff) + carry; + if (i < dlen) { + sum += (d[dlen - i - 1] & 0xff); + } + out[len - i - 1] = (byte) sum; + carry = sum >> 8; + if (i >= dlen - 1 && carry == 0) break; + } + } + } + + /** + * Generates a user-specified number of random bytes. + * + * @param result the array to be filled in with random bytes. + */ + @Override + public final synchronized void generateAlgorithm( + byte[] result, byte[] additionalInput) { + + if (debug != null) { + debug.println(this, "generateAlgorithm"); + } + + // 800-90Ar1 10.1.1.4: Hash_DRBG_Generate Process + + // Step 1: Check reseed_counter. Will not fail. Already checked in + // AbstractDrbg#engineNextBytes. + + // Step 2: additional_input + if (additionalInput != null) { + digest.update((byte)2); + digest.update(v); + digest.update(additionalInput); + addBytes(v, seedLen, digest.digest()); + } + + // Step 3. Hashgen (requested_number_of_bits, V). + hashGen(result, result.length, v); + + // Step 4. H = Hash (0x03 || V). + digest.update((byte)3); + digest.update(v); + byte[] h = digest.digest(); + + // Step 5. V = (V + H + C + reseed_counter) mod 2seedlen. + byte[] rcBytes; + if (reseedCounter < 256) { + rcBytes = new byte[]{(byte)reseedCounter}; + } else { + rcBytes = BigInteger.valueOf(reseedCounter).toByteArray(); + } + addBytes(v, seedLen, h, c, rcBytes); + + // Step 6. reseed_counter = reseed_counter + 1. + reseedCounter++; + + //status(); + + // Step 7: Return. + } + + // 800-90Ar1 10.1.1.4: Hashgen + private void hashGen(byte[] output, int len, byte[] v) { + + // Step 1. m + int m = (len + outLen - 1) / outLen; + + // Step 2. data = V + byte[] data = v; + + // Step 3: W is output not filled + + // Step 4: For i = 1 to m + for (int i = 0; i < m; i++) { + int tailLen = len - i * outLen; + if (tailLen < outLen) { + // Step 4.1 w = Hash (data). + // Step 4.2 W = W || w. + System.arraycopy(digest.digest(data), 0, output, i * outLen, + tailLen); + } else { + try { + // Step 4.1 w = Hash (data). + digest.update(data); + // Step 4.2 digest into right position, no need to cat + digest.digest(output, i*outLen, outLen); + } catch (DigestException e) { + throw new AssertionError("will not happen", e); + } + } + // Unless this is the last around, we will need to increment data. + // but we cannot change v, so a copy is made. + if (i != m - 1) { + if (data == v) { + data = Arrays.copyOf(v, v.length); + } + // Step 4.3 data = (data + 1) mod 2^seedlen. + addBytes(data, seedLen, ONE); + } + } + + // Step 5: No need to truncate + // Step 6: Return + } + + private void readObject(java.io.ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject (); + initEngine(); + } +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/HmacDrbg.java b/jdk/src/java.base/share/classes/sun/security/provider/HmacDrbg.java new file mode 100644 index 00000000000..c4a1fe543d2 --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/HmacDrbg.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.IOException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.SecureRandomParameters; +import java.util.Arrays; + +public class HmacDrbg extends AbstractHashDrbg { + + private static final long serialVersionUID = 9L; + + private transient Mac mac; + + private String macAlg; + + private transient byte[] v; + private transient byte[] k; + + public HmacDrbg(SecureRandomParameters params) { + mechName = "HMAC_DRBG"; + configure(params); + } + + private void status() { + if (debug != null) { + debug.println(this, "V = " + hex(v)); + debug.println(this, "Key = " + hex(k)); + debug.println(this, "reseed counter = " + reseedCounter); + } + } + + // 800-90Ar1 10.1.2.2: HMAC_DRBG Update Process + private void update(byte[]... inputs) { + try { + // Step 1. K = HMAC (K, V || 0x00 || provided_data). + mac.init(new SecretKeySpec(k, macAlg)); + mac.update(v); + mac.update((byte) 0); + for (byte[] input: inputs) { + mac.update(input); + } + k = mac.doFinal(); + + // Step 2. V = HMAC (K, V). + mac.init(new SecretKeySpec(k, macAlg)); + v = mac.doFinal(v); + + if (inputs.length != 0) { + // Step 4. K = HMAC (K, V || 0x01 || provided_data). + mac.update(v); + mac.update((byte) 1); + for (byte[] input: inputs) { + mac.update(input); + } + k = mac.doFinal(); + + // Step 5. V=HMAC(K,V). + mac.init(new SecretKeySpec(k, macAlg)); + v = mac.doFinal(v); + } // else Step 3 + + // Step 6. Return + } catch (InvalidKeyException e) { + throw new InternalError(e); + } + } + + /** + * This call, used by the constructors, instantiates the digest. + */ + @Override + protected void initEngine() { + macAlg = "HmacSHA" + algorithm.substring(4); + try { + mac = Mac.getInstance(macAlg, "SunJCE"); + } catch (NoSuchProviderException | NoSuchAlgorithmException e) { + // Fallback to any available. + try { + mac = Mac.getInstance(macAlg); + } catch (NoSuchAlgorithmException exc) { + throw new InternalError( + "internal error: " + macAlg + " not available.", exc); + } + } + } + + // This method is used by both instantiation and reseeding. + @Override + protected final void hashReseedInternal(byte[] input) { + + // 800-90Ar1 10.1.2.3: Instantiate Process. + // 800-90Ar1 10.1.2.4: Reseed Process. + if (v == null) { + k = new byte[outLen]; + v = new byte[outLen]; + Arrays.fill(v, (byte) 1); + } + + // Step 2: HMAC_DRBG_Update + update(input); + + // Step 3: reseed_counter = 1. + reseedCounter = 1; + //status(); + + // Step 4: Return + } + + /** + * Generates a user-specified number of random bytes. + * + * @param result the array to be filled in with random bytes. + */ + @Override + public synchronized void generateAlgorithm( + byte[] result, byte[] additionalInput) { + + if (debug != null) { + debug.println(this, "generateAlgorithm"); + } + + // 800-90Ar1 10.1.2.5: HMAC_DRBG_Generate Process + + // Step 1: Check reseed_counter. Will not fail. Already checked in + // AbstractDrbg#engineNextBytes. + + // Step 2. HMAC_DRBG_Update + if (additionalInput != null) { + update(additionalInput); + } + + // Step 3. temp = Null. + int pos = 0; + + // Step 4. Loop + while (pos < result.length) { + int tailLen = result.length - pos; + + // Step 4.1 V = HMAC (Key, V). + try { + mac.init(new SecretKeySpec(k, macAlg)); + } catch (InvalidKeyException e) { + throw new InternalError(e); + } + v = mac.doFinal(v); + // Step 4.2 temp = temp || V. + System.arraycopy(v, 0, result, pos, + tailLen > outLen ? outLen : tailLen); + pos += outLen; + } + + // Step 5: No need to truncate + + // Step 6. HMAC_DRBG_Update (additional_input, Key, V). + if (additionalInput != null) { + update(additionalInput); + } else { + update(); + } + + // Step 7. reseed_counter = reseed_counter + 1. + reseedCounter++; + + //status(); + + // Step 8. Return + } + + private void readObject(java.io.ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject (); + initEngine(); + } +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/MoreDrbgParameters.java b/jdk/src/java.base/share/classes/sun/security/provider/MoreDrbgParameters.java new file mode 100644 index 00000000000..7a2e8c75ca6 --- /dev/null +++ b/jdk/src/java.base/share/classes/sun/security/provider/MoreDrbgParameters.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, 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.security.provider; + +import java.security.DrbgParameters; +import java.security.SecureRandomParameters; + +/** + * Extra non-standard parameters that can be used by DRBGs. + */ +public class MoreDrbgParameters implements SecureRandomParameters { + + final String mech; + final String algorithm; + final EntropySource es; + final byte[] nonce; + final boolean usedf; + final DrbgParameters.Instantiation config; + + /** + * Creates a new {@code MoreDrbgParameters} object. + * + * @param es the {@link EntropySource} to use. If set to {@code null}, + * a default entropy source will be used. + * @param mech mech name. If set to {@code null}, the one in + * securerandom.drbg.config is used. This argument is ignored + * when passing to HashDrbg/HmacDrbg/CtrDrbg. + * @param algorithm the requested algorithm to use. If set to {@code null}, + * the algorithm will be decided by strength. + * @param nonce the nonce to use. If set to {@code null}, + * a nonce will be assigned. + * @param usedf whether a derivation function should be used + * @param config a {@link DrbgParameters.Instantiation} object + */ + public MoreDrbgParameters(EntropySource es, String mech, + String algorithm, byte[] nonce, boolean usedf, + DrbgParameters.Instantiation config) { + this.mech = mech; + this.algorithm = algorithm; + this.es = es; + this.nonce = nonce; + this.usedf = usedf; + this.config = config; + } + + @Override + public String toString() { + return mech + "," + algorithm + "," + usedf + "," + config; + } +} diff --git a/jdk/src/java.base/share/classes/sun/security/provider/SHA5.java b/jdk/src/java.base/share/classes/sun/security/provider/SHA5.java index 73cfb3292de..163d30e3fb9 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/SHA5.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/SHA5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, 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,9 +25,7 @@ package sun.security.provider; -import java.security.*; import java.util.Objects; -import java.math.BigInteger; import jdk.internal.HotSpotIntrinsicCandidate; import static sun.security.provider.ByteArrayAccess.*; @@ -118,7 +116,14 @@ abstract class SHA5 extends DigestBase { i2bBig4((int)bitsProcessed, buffer, 124); implCompress(buffer, 0); - l2bBig(state, 0, out, ofs, engineGetDigestLength()); + int len = engineGetDigestLength(); + if (len == 28) { + // Special case for SHA-512/224 + l2bBig(state, 0, out, ofs, 24); + i2bBig4((int)(state[3] >> 32), out, ofs + 24); + } else { + l2bBig(state, 0, out, ofs, len); + } } /** @@ -306,4 +311,31 @@ abstract class SHA5 extends DigestBase { super("SHA-384", 48, INITIAL_HASHES); } } + public static final class SHA512_224 extends SHA5 { + + private static final long[] INITIAL_HASHES = { + 0x8C3D37C819544DA2L, 0x73E1996689DCD4D6L, + 0x1DFAB7AE32FF9C82L, 0x679DD514582F9FCFL, + 0x0F6D2B697BD44DA8L, 0x77E36F7304C48942L, + 0x3F9D85A86A1D36C8L, 0x1112E6AD91D692A1L + }; + + public SHA512_224() { + super("SHA-512/224", 28, INITIAL_HASHES); + } + } + + public static final class SHA512_256 extends SHA5 { + + private static final long[] INITIAL_HASHES = { + 0x22312194FC2BF72CL, 0x9F555FA3C84C64C2L, + 0x2393B86B6F53B151L, 0x963877195940EABDL, + 0x96283EE2A88EFFE3L, 0xBE5E1E2553863992L, + 0x2B0199FC2C85B8AAL, 0x0EB72DDC81C52CA2L + }; + + public SHA512_256() { + super("SHA-512/256", 32, INITIAL_HASHES); + } + } } diff --git a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java index 3cd946a76ec..0ff50002713 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -97,6 +97,9 @@ final class SunEntries { map.put("SecureRandom.NativePRNG", "sun.security.provider.NativePRNG"); } + + map.put("SecureRandom.DRBG", "sun.security.provider.DRBG"); + map.put("SecureRandom.SHA1PRNG", "sun.security.provider.SecureRandom"); if (nativeAvailable && !useNativePRNG) { @@ -199,6 +202,14 @@ final class SunEntries { map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.3", "SHA-512"); map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.3", "SHA-512"); + map.put("MessageDigest.SHA-512/224", "sun.security.provider.SHA5$SHA512_224"); + map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.5", "SHA-512/224"); + map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.5", + "SHA-512/224"); + map.put("MessageDigest.SHA-512/256", "sun.security.provider.SHA5$SHA512_256"); + map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.6", "SHA-512/256"); + map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.6", + "SHA-512/256"); /* * Algorithm Parameter Generator engines diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java index 3955dc6566d..002a6c37776 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java @@ -43,7 +43,6 @@ import javax.security.auth.x500.X500Principal; import static sun.security.provider.certpath.OCSP.*; import static sun.security.provider.certpath.PKIX.*; -import sun.security.action.GetPropertyAction; import sun.security.x509.*; import static sun.security.x509.PKIXExtensions.*; import sun.security.util.Debug; diff --git a/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java b/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java index d3497aea557..067187f0573 100644 --- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java +++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java @@ -84,7 +84,7 @@ public final class RSAKeyFactory extends KeyFactorySpi { public static final int MAX_RESTRICTED_EXPLEN = 64; private static final boolean restrictExpLen = - "true".equalsIgnoreCase(GetPropertyAction.getProperty( + "true".equalsIgnoreCase(GetPropertyAction.privilegedGetProperty( "sun.security.rsa.restrictRSAExponent", "true")); // instance used for static translateKey(); diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java index 3d2bb763a7b..649bfd7be2b 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java @@ -933,10 +933,8 @@ final class ClientHandshaker extends Handshaker { ECParameterSpec params = ((ECPublicKey)publicKey).getParams(); int index = - SupportedEllipticCurvesExtension.getCurveIndex( - params); - if (!SupportedEllipticCurvesExtension.isSupported( - index)) { + EllipticCurvesExtension.getCurveIndex(params); + if (!EllipticCurvesExtension.isSupported(index)) { publicKey = null; } } diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java b/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java index 8f849f8d54f..266ceab62ad 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java @@ -50,7 +50,7 @@ public interface ClientKeyExchangeService { providers = new HashMap<>(); static { - String path = GetPropertyAction.getProperty("java.home"); + String path = GetPropertyAction.privilegedGetProperty("java.home"); ServiceLoader sc = AccessController.doPrivileged( (PrivilegedAction>) diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/Debug.java b/jdk/src/java.base/share/classes/sun/security/ssl/Debug.java index c05505edf4a..4748330e4d6 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/Debug.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/Debug.java @@ -45,7 +45,7 @@ public class Debug { private static String args; static { - args = GetPropertyAction.getProperty("javax.net.debug", ""); + args = GetPropertyAction.privilegedGetProperty("javax.net.debug", ""); args = args.toLowerCase(Locale.ENGLISH); if (args.equals("help")) { Help(); @@ -178,11 +178,11 @@ public class Debug { /** * Return the value of the boolean System property propName. * - * Note use of doPrivileged(). Do make accessible to applications. + * Note use of privileged action. Do NOT make accessible to applications. */ static boolean getBooleanProperty(String propName, boolean defaultValue) { // if set, require value of either true or false - String b = GetPropertyAction.getProperty(propName); + String b = GetPropertyAction.privilegedGetProperty(propName); if (b == null) { return defaultValue; } else if (b.equalsIgnoreCase("false")) { diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java b/jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java similarity index 95% rename from jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java rename to jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java index 264ae90ac93..1e38fb6bd94 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, 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 @@ -32,10 +32,10 @@ import java.util.Map; import javax.net.ssl.SSLProtocolException; -final class SupportedEllipticCurvesExtension extends HelloExtension { +final class EllipticCurvesExtension extends HelloExtension { // the extension value to send in the ClientHello message - static final SupportedEllipticCurvesExtension DEFAULT; + static final EllipticCurvesExtension DEFAULT; private static final boolean fips; @@ -56,17 +56,17 @@ final class SupportedEllipticCurvesExtension extends HelloExtension { 23, 1, 3, 19, 21, 6, 7, 9, 10, 24, 11, 12, 25, 13, 14, }; } - DEFAULT = new SupportedEllipticCurvesExtension(ids); + DEFAULT = new EllipticCurvesExtension(ids); } private final int[] curveIds; - private SupportedEllipticCurvesExtension(int[] curveIds) { + private EllipticCurvesExtension(int[] curveIds) { super(ExtensionType.EXT_ELLIPTIC_CURVES); this.curveIds = curveIds; } - SupportedEllipticCurvesExtension(HandshakeInStream s, int len) + EllipticCurvesExtension(HandshakeInStream s, int len) throws IOException { super(ExtensionType.EXT_ELLIPTIC_CURVES); int k = s.getInt16(); diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticPointFormatsExtension.java b/jdk/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java similarity index 89% rename from jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticPointFormatsExtension.java rename to jdk/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java index 776f4494847..e6c45276b34 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/SupportedEllipticPointFormatsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, 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,24 +31,23 @@ import java.util.List; import javax.net.ssl.SSLProtocolException; -final class SupportedEllipticPointFormatsExtension extends HelloExtension { +final class EllipticPointFormatsExtension extends HelloExtension { static final int FMT_UNCOMPRESSED = 0; static final int FMT_ANSIX962_COMPRESSED_PRIME = 1; static final int FMT_ANSIX962_COMPRESSED_CHAR2 = 2; static final HelloExtension DEFAULT = - new SupportedEllipticPointFormatsExtension( - new byte[] {FMT_UNCOMPRESSED}); + new EllipticPointFormatsExtension(new byte[] {FMT_UNCOMPRESSED}); private final byte[] formats; - private SupportedEllipticPointFormatsExtension(byte[] formats) { + private EllipticPointFormatsExtension(byte[] formats) { super(ExtensionType.EXT_EC_POINT_FORMATS); this.formats = formats; } - SupportedEllipticPointFormatsExtension(HandshakeInStream s, int len) + EllipticPointFormatsExtension(HandshakeInStream s, int len) throws IOException { super(ExtensionType.EXT_EC_POINT_FORMATS); formats = s.getBytes8(); diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java b/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java index 99eaf14dec3..2ef416964ef 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java @@ -314,8 +314,8 @@ static final class ClientHello extends HandshakeMessage { } if (cipherSuites.containsEC()) { - extensions.add(SupportedEllipticCurvesExtension.DEFAULT); - extensions.add(SupportedEllipticPointFormatsExtension.DEFAULT); + extensions.add(EllipticCurvesExtension.DEFAULT); + extensions.add(EllipticPointFormatsExtension.DEFAULT); } clnt_random = new RandomCookie(generator); @@ -1401,7 +1401,7 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange { ECParameterSpec params = publicKey.getParams(); ECPoint point = publicKey.getW(); pointBytes = JsseJce.encodePoint(point, params.getCurve()); - curveId = SupportedEllipticCurvesExtension.getCurveIndex(params); + curveId = EllipticCurvesExtension.getCurveIndex(params); if (privateKey == null) { // ECDH_anon @@ -1439,13 +1439,11 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange { // the supported curves during the exchange of the Hello messages. if (curveType == CURVE_NAMED_CURVE) { curveId = input.getInt16(); - if (SupportedEllipticCurvesExtension.isSupported(curveId) - == false) { + if (!EllipticCurvesExtension.isSupported(curveId)) { throw new SSLHandshakeException( "Unsupported curveId: " + curveId); } - String curveOid = - SupportedEllipticCurvesExtension.getCurveOid(curveId); + String curveOid = EllipticCurvesExtension.getCurveOid(curveId); if (curveOid == null) { throw new SSLHandshakeException( "Unknown named curve: " + curveId); diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java b/jdk/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java index 93addad50eb..f831db12391 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, 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 @@ -49,8 +49,8 @@ import javax.net.ssl.*; * explicitly support. * . ServerNameExtension: the server_name extension. * . SignatureAlgorithmsExtension: the signature_algorithms extension. - * . SupportedEllipticCurvesExtension: the ECC supported curves extension. - * . SupportedEllipticPointFormatsExtension: the ECC supported point formats + * . EllipticCurvesExtension: the ECC supported curves extension. + * . EllipticPointFormatsExtension: the ECC supported point formats * (compressed/uncompressed) extension. * . ALPNExtension: the application_layer_protocol_negotiation extension. * @@ -80,10 +80,9 @@ final class HelloExtensions { } else if (extType == ExtensionType.EXT_SIGNATURE_ALGORITHMS) { extension = new SignatureAlgorithmsExtension(s, extlen); } else if (extType == ExtensionType.EXT_ELLIPTIC_CURVES) { - extension = new SupportedEllipticCurvesExtension(s, extlen); + extension = new EllipticCurvesExtension(s, extlen); } else if (extType == ExtensionType.EXT_EC_POINT_FORMATS) { - extension = - new SupportedEllipticPointFormatsExtension(s, extlen); + extension = new EllipticPointFormatsExtension(s, extlen); } else if (extType == ExtensionType.EXT_RENEGOTIATION_INFO) { extension = new RenegotiationInfoExtension(s, extlen); } else if (extType == ExtensionType.EXT_ALPN) { diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java index f3384c5b746..3eb4ae86d4c 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java @@ -656,7 +656,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { // the provider service. Instead, please handle the initialization // exception in the caller's constructor. static { - String property = GetPropertyAction.getProperty(PROPERTY_NAME); + String property = GetPropertyAction + .privilegedGetProperty(PROPERTY_NAME); if (property != null && property.length() != 0) { // remove double quote marks from beginning/end of the property if (property.length() > 1 && property.charAt(0) == '"' && diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java b/jdk/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java index 5ce147a3af3..72fc39cf24f 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java @@ -94,7 +94,7 @@ final class ServerHandshaker extends Handshaker { // we remember it for the RSA premaster secret version check private ProtocolVersion clientRequestedVersion; - private SupportedEllipticCurvesExtension supportedCurves; + private EllipticCurvesExtension supportedCurves; // the preferable signature algorithm used by ServerKeyExchange message SignatureAndHashAlgorithm preferableSignatureAlgorithm; @@ -119,8 +119,8 @@ final class ServerHandshaker extends Handshaker { private long statusRespTimeout; static { - String property = - GetPropertyAction.getProperty("jdk.tls.ephemeralDHKeySize"); + String property = GetPropertyAction + .privilegedGetProperty("jdk.tls.ephemeralDHKeySize"); if (property == null || property.length() == 0) { useLegacyEphemeralDHKeys = false; useSmartEphemeralDHKeys = false; @@ -741,7 +741,7 @@ final class ServerHandshaker extends Handshaker { throw new SSLException("Client did not resume a session"); } - supportedCurves = (SupportedEllipticCurvesExtension) + supportedCurves = (EllipticCurvesExtension) mesg.extensions.get(ExtensionType.EXT_ELLIPTIC_CURVES); // We only need to handle the "signature_algorithm" extension @@ -1577,7 +1577,7 @@ final class ServerHandshaker extends Handshaker { // if the client sent the supported curves extension, pick the // first one that we support; for (int curveId : supportedCurves.curveIds()) { - if (SupportedEllipticCurvesExtension.isSupported(curveId)) { + if (EllipticCurvesExtension.isSupported(curveId)) { index = curveId; break; } @@ -1588,9 +1588,9 @@ final class ServerHandshaker extends Handshaker { } } else { // pick our preference - index = SupportedEllipticCurvesExtension.DEFAULT.curveIds()[0]; + index = EllipticCurvesExtension.DEFAULT.curveIds()[0]; } - String oid = SupportedEllipticCurvesExtension.getCurveOid(index); + String oid = EllipticCurvesExtension.getCurveOid(index); ecdh = new ECDHCrypt(oid, sslContext.getSecureRandom()); return true; } @@ -1633,15 +1633,15 @@ final class ServerHandshaker extends Handshaker { return false; } // For ECC certs, check whether we support the EC domain parameters. - // If the client sent a SupportedEllipticCurves ClientHello extension, + // If the client sent a EllipticCurves ClientHello extension, // check against that too. if (keyAlgorithm.equals("EC")) { if (publicKey instanceof ECPublicKey == false) { return false; } ECParameterSpec params = ((ECPublicKey)publicKey).getParams(); - int index = SupportedEllipticCurvesExtension.getCurveIndex(params); - if (SupportedEllipticCurvesExtension.isSupported(index) == false) { + int index = EllipticCurvesExtension.getCurveIndex(params); + if (!EllipticCurvesExtension.isSupported(index)) { return false; } if ((supportedCurves != null) && !supportedCurves.contains(index)) { diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java b/jdk/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java index 3e21616e48e..0cc7cec686e 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java @@ -73,8 +73,8 @@ final class StatusResponseManager { DEFAULT_CACHE_LIFETIME)); cacheLifetime = life > 0 ? life : 0; - String uriStr = - GetPropertyAction.getProperty("jdk.tls.stapling.responderURI"); + String uriStr = GetPropertyAction + .privilegedGetProperty("jdk.tls.stapling.responderURI"); URI tmpURI; try { tmpURI = ((uriStr != null && !uriStr.isEmpty()) ? diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java index 15cc364b540..94969b84196 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -728,6 +728,7 @@ public final class Main { provClass = Class.forName(provName); } + @SuppressWarnings("deprecation") Object obj = provClass.newInstance(); if (!(obj instanceof Provider)) { MessageFormat form = new MessageFormat diff --git a/jdk/src/java.base/share/classes/sun/security/util/Debug.java b/jdk/src/java.base/share/classes/sun/security/util/Debug.java index 514608dc73c..b8018c8fe21 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/Debug.java +++ b/jdk/src/java.base/share/classes/sun/security/util/Debug.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -43,10 +43,10 @@ public class Debug { private static String args; static { - args = GetPropertyAction.getProperty("java.security.debug"); + args = GetPropertyAction.privilegedGetProperty("java.security.debug"); - String args2 = - GetPropertyAction.getProperty("java.security.auth.debug"); + String args2 = GetPropertyAction + .privilegedGetProperty("java.security.auth.debug"); if (args == null) { args = args2; @@ -87,6 +87,7 @@ public class Debug { System.err.println("pkcs12 PKCS12 KeyStore debugging"); System.err.println("sunpkcs11 SunPKCS11 provider debugging"); System.err.println("scl permissions SecureClassLoader assigns"); + System.err.println("securerandom SecureRandom"); System.err.println("ts timestamping"); System.err.println(); System.err.println("The following can be used with access:"); @@ -174,6 +175,16 @@ public class Debug { System.err.println(prefix + ": "+message); } + /** + * print a message to stderr that is prefixed with the prefix + * created from the call to getInstance and obj. + */ + public void println(Object obj, String message) + { + System.err.println(prefix + " [" + obj.getClass().getSimpleName() + + "@" + System.identityHashCode(obj) + "]: "+message); + } + /** * print a blank line to stderr that is prefixed with the prefix. */ diff --git a/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java b/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java index b43aa234833..c8c08c5eff8 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java +++ b/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java @@ -196,8 +196,9 @@ public class KeyStoreDelegator extends KeyStoreSpi { // A new keystore is always created in the primary keystore format if (stream == null) { try { - keystore = primaryKeyStore.newInstance(); - + @SuppressWarnings("deprecation") + KeyStoreSpi tmp = primaryKeyStore.newInstance(); + keystore = tmp; } catch (InstantiationException | IllegalAccessException e) { // can safely ignore } @@ -214,7 +215,9 @@ public class KeyStoreDelegator extends KeyStoreSpi { bufferedStream.mark(Integer.MAX_VALUE); try { - keystore = primaryKeyStore.newInstance(); + @SuppressWarnings("deprecation") + KeyStoreSpi tmp = primaryKeyStore.newInstance(); + keystore = tmp; type = primaryType; keystore.engineLoad(bufferedStream, password); @@ -232,7 +235,9 @@ public class KeyStoreDelegator extends KeyStoreSpi { throw e; } - keystore = secondaryKeyStore.newInstance(); + @SuppressWarnings("deprecation") + KeyStoreSpi tmp= secondaryKeyStore.newInstance(); + keystore = tmp; type = secondaryType; bufferedStream.reset(); keystore.engineLoad(bufferedStream, password); @@ -284,7 +289,9 @@ public class KeyStoreDelegator extends KeyStoreSpi { boolean result = false; try { - keystore = primaryKeyStore.newInstance(); + @SuppressWarnings("deprecation") + KeyStoreSpi tmp = primaryKeyStore.newInstance(); + keystore = tmp; type = primaryType; result = keystore.engineProbe(stream); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509Key.java b/jdk/src/java.base/share/classes/sun/security/x509/X509Key.java index 5384ac785ae..a11fa27dff8 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509Key.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509Key.java @@ -255,11 +255,10 @@ public class X509Key implements PublicKey { } } - Object inst = null; + @SuppressWarnings("deprecation") + Object inst = (keyClass != null) ? keyClass.newInstance() : null; X509Key result; - if (keyClass != null) - inst = keyClass.newInstance(); if (inst instanceof X509Key) { result = (X509Key) inst; result.algid = algid; diff --git a/jdk/src/java.base/share/classes/sun/util/calendar/CalendarSystem.java b/jdk/src/java.base/share/classes/sun/util/calendar/CalendarSystem.java index 59fae3b7c0e..71c7212c644 100644 --- a/jdk/src/java.base/share/classes/sun/util/calendar/CalendarSystem.java +++ b/jdk/src/java.base/share/classes/sun/util/calendar/CalendarSystem.java @@ -157,8 +157,9 @@ public abstract class CalendarSystem { cal = LocalGregorianCalendar.getLocalGregorianCalendar(calendarName); } else { try { - Class cl = Class.forName(className); - cal = (CalendarSystem) cl.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(className).newInstance(); + cal = (CalendarSystem) tmp; } catch (Exception e) { throw new InternalError(e); } diff --git a/jdk/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java b/jdk/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java index 90389c73252..6830000d22f 100644 --- a/jdk/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java +++ b/jdk/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java @@ -144,7 +144,7 @@ public class LocalGregorianCalendar extends BaseCalendar { // Append an era to the predefined eras if it's given by the property. String prop = GetPropertyAction - .getProperty("jdk.calendar.japanese.supplemental.era"); + .privilegedGetProperty("jdk.calendar.japanese.supplemental.era"); if (prop != null) { Era era = parseEraEntry(prop); if (era != null) { diff --git a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java b/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java index 58c0c5bbe01..659567caf63 100644 --- a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java +++ b/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java @@ -246,7 +246,7 @@ public final class ZoneInfoFile { static { String oldmapping = GetPropertyAction - .getProperty("sun.timezone.ids.oldmapping", "false") + .privilegedGetProperty("sun.timezone.ids.oldmapping", "false") .toLowerCase(Locale.ROOT); USE_OLDMAPPING = (oldmapping.equals("yes") || oldmapping.equals("true")); AccessController.doPrivileged(new PrivilegedAction() { diff --git a/jdk/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java b/jdk/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java index 75f235c73e7..a5ab411adb4 100644 --- a/jdk/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java +++ b/jdk/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java @@ -116,7 +116,7 @@ public abstract class LocaleProviderAdapter { adapterCache = new ConcurrentHashMap<>(); static { - String order = GetPropertyAction.getProperty("java.locale.providers"); + String order = GetPropertyAction.privilegedGetProperty("java.locale.providers"); List typeList = new ArrayList<>(); // Check user specified adapter preference @@ -171,8 +171,9 @@ public abstract class LocaleProviderAdapter { if (cached == null) { try { // lazily load adapters here - adapter = (LocaleProviderAdapter)Class.forName(type.getAdapterClassName()) - .newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(type.getAdapterClassName()).newInstance(); + adapter = (LocaleProviderAdapter)tmp; cached = adapterInstances.putIfAbsent(type, adapter); if (cached != null) { adapter = cached; diff --git a/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java b/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java index 9cd8c0d1a2f..4066fcdabfd 100644 --- a/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java +++ b/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java @@ -73,7 +73,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { try { return AccessController.doPrivileged(new PrivilegedExceptionAction

() { @Override - @SuppressWarnings("unchecked") + @SuppressWarnings(value={"unchecked", "deprecation"}) public P run() { P delegate = null; diff --git a/jdk/src/java.base/share/conf/security/java.policy b/jdk/src/java.base/share/conf/security/java.policy index a6b3b1bfb24..0400ebfd546 100644 --- a/jdk/src/java.base/share/conf/security/java.policy +++ b/jdk/src/java.base/share/conf/security/java.policy @@ -8,6 +8,19 @@ grant codeBase "jrt:/java.corba" { permission java.security.AllPermission; }; +grant codeBase "jrt:/java.compiler" { + permission java.security.AllPermission; +}; + +grant codeBase "jrt:/jdk.charsets" { + permission java.io.FilePermission "${java.home}/-", "read"; + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "sun.nio.cs.map", "read"; + permission java.lang.RuntimePermission "charsetProvider"; + permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc"; + permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.cs"; +}; + grant codeBase "jrt:/jdk.crypto.ucrypto" { permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*"; permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch"; diff --git a/jdk/src/java.base/share/conf/security/java.security b/jdk/src/java.base/share/conf/security/java.security index fa2da13c195..5e6afc59363 100644 --- a/jdk/src/java.base/share/conf/security/java.security +++ b/jdk/src/java.base/share/conf/security/java.security @@ -120,30 +120,30 @@ jdk.security.provider.preferred=AES:SunJCE, RSA:SunRsaSign # # Sun Provider SecureRandom seed source. # -# Select the primary source of seed data for the "SHA1PRNG" and -# "NativePRNG" SecureRandom implementations in the "Sun" provider. +# Select the primary source of seed data for the "NativePRNG", "SHA1PRNG" +# and "DRBG" SecureRandom implementations in the "Sun" provider. # (Other SecureRandom implementations might also use this property.) # # On Unix-like systems (for example, Solaris/Linux/MacOS), the -# "NativePRNG" and "SHA1PRNG" implementations obtains seed data from +# "NativePRNG", "SHA1PRNG" and "DRBG" implementations obtains seed data from # special device files such as file:/dev/random. # # On Windows systems, specifying the URLs "file:/dev/random" or # "file:/dev/urandom" will enable the native Microsoft CryptoAPI seeding -# mechanism for SHA1PRNG. +# mechanism for SHA1PRNG and DRBG. # # By default, an attempt is made to use the entropy gathering device # specified by the "securerandom.source" Security property. If an # exception occurs while accessing the specified URL: # -# SHA1PRNG: -# the traditional system/thread activity algorithm will be used. -# # NativePRNG: # a default value of /dev/random will be used. If neither # are available, the implementation will be disabled. # "file" is the only currently supported protocol type. # +# SHA1PRNG and DRBG: +# the traditional system/thread activity algorithm will be used. +# # The entropy gathering device can also be specified with the System # property "java.security.egd". For example: # @@ -154,7 +154,7 @@ jdk.security.provider.preferred=AES:SunJCE, RSA:SunRsaSign # # In addition, if "file:/dev/random" or "file:/dev/urandom" is # specified, the "NativePRNG" implementation will be more preferred than -# SHA1PRNG in the Sun provider. +# DRBG and SHA1PRNG in the Sun provider. # securerandom.source=file:/dev/random @@ -169,12 +169,78 @@ securerandom.source=file:/dev/random # entries. # #ifdef windows -securerandom.strongAlgorithms=Windows-PRNG:SunMSCAPI,SHA1PRNG:SUN +securerandom.strongAlgorithms=Windows-PRNG:SunMSCAPI,DRBG:SUN #endif #ifndef windows -securerandom.strongAlgorithms=NativePRNGBlocking:SUN +securerandom.strongAlgorithms=NativePRNGBlocking:SUN,DRBG:SUN #endif +# +# Sun provider DRBG configuration and default instantiation request. +# +# NIST SP 800-90Ar1 lists several DRBG mechanisms. Each can be configured +# with a DRBG algorithm name, and can be instantiated with a security strength, +# prediction resistance support, etc. This property defines the configuration +# and the default instantiation request of "DRBG" SecureRandom implementations +# in the SUN provider. (Other DRBG implementations can also use this property.) +# Applications can request different instantiation parameters like security +# strength, capability, personalization string using one of the +# getInstance(...,SecureRandomParameters,...) methods with a +# DrbgParameters.Instantiation argument, but other settings such as the +# mechanism and DRBG algorithm names are not currently configurable by any API. +# +# Please note that the SUN implementation of DRBG always supports reseeding. +# +# The value of this property is a comma-separated list of all configurable +# aspects. The aspects can appear in any order but the same aspect can only +# appear at most once. Its BNF-style definition is: +# +# Value: +# aspect { "," aspect } +# +# aspect: +# mech_name | algorithm_name | strength | capability | df +# +# // The DRBG mechanism to use. Default "Hash_DRBG" +# mech_name: +# "Hash_DRBG" | "HMAC_DRBG" | "CTR_DRBG" +# +# // The DRBG algorithm name. The "SHA-***" names are for Hash_DRBG and +# // HMAC_DRBG, default "SHA-256". "3KeyTDEA" and "AES-***" names are for +# // CTR_DRBG, default "AES-128" when using the limited cryptographic +# // or "AES-256" when using the unlimited. +# algorithm_name: +# "SHA-1" | "SHA-224" | "SHA-512/224" | "SHA-256" | +# "SHA-512/256" | "SHA-384" | "SHA-512" | +# "3KeyTDEA" | "AES-128" | "AES-192" | "AES-256" +# +# // Security strength requested. Default "128", or "112" +# // if mech_name is CTR_DRBG and algorithm_name is "3KeyTDEA" +# strength: +# "112" | "128" | "192" | "256" +# +# // Prediction resistance and reseeding request. Default "none" +# // "pr_and_reseed" - Both prediction resistance and reseeding +# // support requested +# // "reseed_only" - Only reseeding support requested +# // "none" - Neither prediction resistance not reseeding +# // support requested +# pr: +# "pr_and_reseed" | "reseed_only" | "none" +# +# // Whether a derivation function should be used. only applicable +# // to CTR_DRBG. Default "use_df" +# df: +# "use_df" | "no_df" +# +# Examples, +# securerandom.drbg.config=Hash_DRBG,SHA-1,112,none +# securerandom.drbg.config=CTR_DRBG,AES-256,192,pr_and_reseed,use_df +# +# The default value is an empty string, which is equivalent to +# securerandom.drbg.config=Hash_DRBG,SHA-256,128,none +securerandom.drbg.config= + # # Class to instantiate as the javax.security.auth.login.Configuration # provider. diff --git a/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystem.java b/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystem.java index 140473283c8..5d58058398d 100644 --- a/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystem.java +++ b/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystem.java @@ -42,7 +42,7 @@ class SolarisFileSystem extends UnixFileSystem { super(provider, dir); // check os.version - String osversion = GetPropertyAction.getProperty("os.version"); + String osversion = GetPropertyAction.privilegedGetProperty("os.version"); String[] vers = Util.split(osversion, '.'); assert vers.length >= 2; int majorVersion = Integer.parseInt(vers[0]); diff --git a/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java b/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java index affdfb96c7f..c50b4a8b7f0 100644 --- a/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java +++ b/jdk/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java @@ -85,7 +85,7 @@ public class SolarisFileSystemProvider extends UnixFileSystemProvider { @Override FileTypeDetector getFileTypeDetector() { Path userMimeTypes = Paths.get( - GetPropertyAction.getProperty("user.home"), ".mime.types"); + GetPropertyAction.privilegedGetProperty("user.home"), ".mime.types"); Path etcMimeTypes = Paths.get("/etc/mime.types"); return chain(new GioFileTypeDetector(), diff --git a/jdk/src/java.base/solaris/native/libnio/ch/DevPollArrayWrapper.c b/jdk/src/java.base/solaris/native/libnio/ch/DevPollArrayWrapper.c index 962f5e49263..6860a167bbc 100644 --- a/jdk/src/java.base/solaris/native/libnio/ch/DevPollArrayWrapper.c +++ b/jdk/src/java.base/solaris/native/libnio/ch/DevPollArrayWrapper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -94,6 +94,7 @@ idevpoll(jint wfd, int dpctl, struct dvpoll a) return 0; } start = now; + a.dp_timeout = remaining; } } else { return res; diff --git a/jdk/src/java.base/unix/classes/java/io/UnixFileSystem.java b/jdk/src/java.base/unix/classes/java/io/UnixFileSystem.java index c829994cc85..20370e13d4b 100644 --- a/jdk/src/java.base/unix/classes/java/io/UnixFileSystem.java +++ b/jdk/src/java.base/unix/classes/java/io/UnixFileSystem.java @@ -36,7 +36,7 @@ class UnixFileSystem extends FileSystem { private final String javaHome; public UnixFileSystem() { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); slash = props.getProperty("file.separator").charAt(0); colon = props.getProperty("path.separator").charAt(0); javaHome = props.getProperty("java.home"); diff --git a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java index 8a1b8ca085e..cdf144411d5 100644 --- a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java +++ b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java @@ -125,7 +125,7 @@ final class ProcessImpl extends Process { } String helperPath() { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); return helperPath(props.getProperty("java.home"), props.getProperty("os.arch")); } @@ -159,7 +159,7 @@ final class ProcessImpl extends Process { } static Platform get() { - String osName = GetPropertyAction.getProperty("os.name"); + String osName = GetPropertyAction.privilegedGetProperty("os.name"); if (osName.equals("Linux")) { return LINUX; } if (osName.contains("OS X")) { return BSD; } diff --git a/jdk/src/java.base/unix/classes/java/net/DefaultDatagramSocketImplFactory.java b/jdk/src/java.base/unix/classes/java/net/DefaultDatagramSocketImplFactory.java index dd1a6548d6a..706a14eb046 100644 --- a/jdk/src/java.base/unix/classes/java/net/DefaultDatagramSocketImplFactory.java +++ b/jdk/src/java.base/unix/classes/java/net/DefaultDatagramSocketImplFactory.java @@ -40,7 +40,7 @@ class DefaultDatagramSocketImplFactory { static { String prefix = null; try { - prefix = GetPropertyAction.getProperty("impl.prefix", null); + prefix = GetPropertyAction.privilegedGetProperty("impl.prefix"); if (prefix != null) prefixImplClass = Class.forName("java.net."+prefix+"DatagramSocketImpl"); } catch (Exception e) { @@ -61,7 +61,9 @@ class DefaultDatagramSocketImplFactory { throws SocketException { if (prefixImplClass != null) { try { - return (DatagramSocketImpl)prefixImplClass.newInstance(); + @SuppressWarnings("deprecation") + DatagramSocketImpl result = (DatagramSocketImpl)prefixImplClass.newInstance(); + return result; } catch (Exception e) { throw new SocketException("can't instantiate DatagramSocketImpl"); } diff --git a/jdk/src/java.base/unix/classes/sun/net/NetHooks.java b/jdk/src/java.base/unix/classes/sun/net/NetHooks.java index 92cb4eaf4d1..b64e638f46a 100644 --- a/jdk/src/java.base/unix/classes/sun/net/NetHooks.java +++ b/jdk/src/java.base/unix/classes/sun/net/NetHooks.java @@ -28,9 +28,6 @@ package sun.net; import java.net.InetAddress; import java.io.FileDescriptor; import java.io.IOException; -import java.security.AccessController; -import java.security.PrivilegedAction; -import sun.security.action.GetPropertyAction; /** * Defines static methods to be invoked prior to binding or connecting TCP sockets. diff --git a/jdk/src/java.base/unix/classes/sun/net/sdp/SdpProvider.java b/jdk/src/java.base/unix/classes/sun/net/sdp/SdpProvider.java index a9f15a617f0..6cc4b0094b9 100644 --- a/jdk/src/java.base/unix/classes/sun/net/sdp/SdpProvider.java +++ b/jdk/src/java.base/unix/classes/sun/net/sdp/SdpProvider.java @@ -55,8 +55,9 @@ public class SdpProvider extends NetHooks.Provider { private PrintStream log; public SdpProvider() { + Properties props = GetPropertyAction.privilegedGetProperties(); // if this property is not defined then there is nothing to do. - String file = GetPropertyAction.getProperty("com.sun.sdp.conf"); + String file = props.getProperty("com.sun.sdp.conf"); if (file == null) { this.enabled = false; this.rules = null; @@ -65,17 +66,15 @@ public class SdpProvider extends NetHooks.Provider { // load configuration file List list = null; - if (file != null) { - try { - list = loadRulesFromFile(file); - } catch (IOException e) { - fail("Error reading %s: %s", file, e.getMessage()); - } + try { + list = loadRulesFromFile(file); + } catch (IOException e) { + fail("Error reading %s: %s", file, e.getMessage()); } // check if debugging is enabled PrintStream out = null; - String logfile = GetPropertyAction.getProperty("com.sun.sdp.debug"); + String logfile = props.getProperty("com.sun.sdp.debug"); if (logfile != null) { out = System.out; if (logfile.length() > 0) { diff --git a/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java index f205eaf7545..85bbd53ad43 100644 --- a/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java +++ b/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java @@ -76,7 +76,7 @@ public class NTLMAuthentication extends AuthenticationInfo { private String hostname; /* Domain to use if not specified by user */ private static String defaultDomain = - GetPropertyAction.getProperty("http.auth.ntlm.domain", ""); + GetPropertyAction.privilegedGetProperty("http.auth.ntlm.domain", ""); public static boolean supportsTransparentAuth () { return false; @@ -141,7 +141,7 @@ public class NTLMAuthentication extends AuthenticationInfo { password = pw.getPassword(); init0(); try { - String version = GetPropertyAction.getProperty("ntlm.version"); + String version = GetPropertyAction.privilegedGetProperty("ntlm.version"); client = new Client(version, hostname, username, ntdomain, password); } catch (NTLMException ne) { try { diff --git a/jdk/src/java.base/unix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/jdk/src/java.base/unix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java index 9018f0fe6a0..248c6a154d2 100644 --- a/jdk/src/java.base/unix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java +++ b/jdk/src/java.base/unix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java @@ -48,7 +48,9 @@ public class DefaultAsynchronousChannelProvider { throw new AssertionError(x); } try { - return c.newInstance(); + @SuppressWarnings("deprecation") + AsynchronousChannelProvider result = c.newInstance(); + return result; } catch (IllegalAccessException | InstantiationException x) { throw new AssertionError(x); } @@ -59,7 +61,7 @@ public class DefaultAsynchronousChannelProvider { * Returns the default AsynchronousChannelProvider. */ public static AsynchronousChannelProvider create() { - String osname = GetPropertyAction.getProperty("os.name"); + String osname = GetPropertyAction.privilegedGetProperty("os.name"); if (osname.equals("SunOS")) return createProvider("sun.nio.ch.SolarisAsynchronousChannelProvider"); if (osname.equals("Linux")) diff --git a/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java index f8c31b5ac94..558a58a2513 100644 --- a/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java +++ b/jdk/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java @@ -46,8 +46,8 @@ class UnixAsynchronousSocketChannelImpl private static final boolean disableSynchronousRead; static { - String propValue = GetPropertyAction - .getProperty("sun.nio.ch.disableSynchronousRead", "false"); + String propValue = GetPropertyAction.privilegedGetProperty( + "sun.nio.ch.disableSynchronousRead", "false"); disableSynchronousRead = (propValue.length() == 0) ? true : Boolean.valueOf(propValue); } diff --git a/jdk/src/java.base/unix/classes/sun/nio/fs/DefaultFileSystemProvider.java b/jdk/src/java.base/unix/classes/sun/nio/fs/DefaultFileSystemProvider.java index 62f6d5ce145..42064456453 100644 --- a/jdk/src/java.base/unix/classes/sun/nio/fs/DefaultFileSystemProvider.java +++ b/jdk/src/java.base/unix/classes/sun/nio/fs/DefaultFileSystemProvider.java @@ -44,7 +44,9 @@ public class DefaultFileSystemProvider { throw new AssertionError(x); } try { - return c.newInstance(); + @SuppressWarnings("deprecation") + FileSystemProvider result = c.newInstance(); + return result; } catch (IllegalAccessException | InstantiationException x) { throw new AssertionError(x); } @@ -54,7 +56,7 @@ public class DefaultFileSystemProvider { * Returns the default FileSystemProvider. */ public static FileSystemProvider create() { - String osname = GetPropertyAction.getProperty("os.name"); + String osname = GetPropertyAction.privilegedGetProperty("os.name"); if (osname.equals("SunOS")) return createProvider("sun.nio.fs.SolarisFileSystemProvider"); if (osname.equals("Linux")) diff --git a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java index 7cf295b0d6d..96225f08d6f 100644 --- a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java +++ b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java @@ -57,7 +57,7 @@ abstract class UnixFileSystem // process working directory then paths must be resolved against the // default directory. String propValue = GetPropertyAction - .getProperty("sun.nio.fs.chdirAllowed", "false"); + .privilegedGetProperty("sun.nio.fs.chdirAllowed", "false"); boolean chdirAllowed = (propValue.length() == 0) ? true : Boolean.valueOf(propValue); if (chdirAllowed) { diff --git a/jdk/src/java.base/windows/classes/java/io/WinNTFileSystem.java b/jdk/src/java.base/windows/classes/java/io/WinNTFileSystem.java index 50ccacc3d1e..edd756bf3bf 100644 --- a/jdk/src/java.base/windows/classes/java/io/WinNTFileSystem.java +++ b/jdk/src/java.base/windows/classes/java/io/WinNTFileSystem.java @@ -42,7 +42,7 @@ class WinNTFileSystem extends FileSystem { private final char semicolon; public WinNTFileSystem() { - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); slash = props.getProperty("file.separator").charAt(0); semicolon = props.getProperty("path.separator").charAt(0); altSlash = (this.slash == '\\') ? '/' : '\\'; diff --git a/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java b/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java index c12378da67d..a85e701efc2 100644 --- a/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java +++ b/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java @@ -56,7 +56,7 @@ class DefaultDatagramSocketImplFactory static { Class prefixImplClassLocal = null; - Properties props = GetPropertyAction.getProperties(); + Properties props = GetPropertyAction.privilegedGetProperties(); preferIPv4Stack = Boolean.parseBoolean( props.getProperty("java.net.preferIPv4Stack")); @@ -90,7 +90,9 @@ class DefaultDatagramSocketImplFactory throws SocketException { if (prefixImplClass != null) { try { - return (DatagramSocketImpl) prefixImplClass.newInstance(); + @SuppressWarnings("deprecation") + Object result = prefixImplClass.newInstance(); + return (DatagramSocketImpl) result; } catch (Exception e) { throw new SocketException("can't instantiate DatagramSocketImpl"); } diff --git a/jdk/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/jdk/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java index 5583842d0cb..50e056862c9 100644 --- a/jdk/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java +++ b/jdk/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java @@ -53,8 +53,8 @@ public class NTLMAuthentication extends AuthenticationInfo { private static String defaultDomain; /* Domain to use if not specified by user */ static { - defaultDomain = GetPropertyAction.getProperty("http.auth.ntlm.domain", - "domain"); + defaultDomain = GetPropertyAction + .privilegedGetProperty("http.auth.ntlm.domain", "domain"); }; private void init0() { diff --git a/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java b/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java index 5390b55a3ab..42bc1327c88 100644 --- a/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java +++ b/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java @@ -120,7 +120,7 @@ class FileDispatcherImpl extends FileDispatcher { static boolean isFastFileTransferRequested() { String fileTransferProp = GetPropertyAction - .getProperty("jdk.nio.enableFastFileTransfer"); + .privilegedGetProperty("jdk.nio.enableFastFileTransfer"); boolean enable; if ("".equals(fileTransferProp)) { enable = true; diff --git a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java index 4d2d3e97c4c..bba794e21a7 100644 --- a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java +++ b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java @@ -114,8 +114,8 @@ class WindowsFileAttributes // indicates if accurate metadata is required (interesting on NTFS only) private static final boolean ensureAccurateMetadata; static { - String propValue = GetPropertyAction - .getProperty("sun.nio.fs.ensureAccurateMetadata", "false"); + String propValue = GetPropertyAction.privilegedGetProperty( + "sun.nio.fs.ensureAccurateMetadata", "false"); ensureAccurateMetadata = (propValue.length() == 0) ? true : Boolean.valueOf(propValue); } diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java index 3bf3cf8f44e..652875738b7 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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,15 @@ package sun.lwawt.macosx; +import sun.lwawt.LWWindowPeer; + import java.awt.*; import java.beans.*; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.concurrent.Callable; +import sun.awt.AWTAccessor; import javax.accessibility.*; import javax.swing.*; @@ -421,6 +424,8 @@ class CAccessibility implements PropertyChangeListener { } public static AccessibleAction getAccessibleAction(final Accessible a, final Component c) { + if (a == null) return null; + return invokeAndWait(new Callable() { public AccessibleAction call() throws Exception { final AccessibleContext ac = a.getAccessibleContext(); @@ -667,4 +672,28 @@ class CAccessibility implements PropertyChangeListener { } }, c); } + + /** + * @return AWTView ptr, a peer of the CPlatformView associated with the toplevel container of the Accessible, if any + */ + private static long getAWTView(Accessible a) { + Accessible ax = CAccessible.getSwingAccessible(a); + if (!(ax instanceof Component)) return 0; + + return invokeAndWait(new Callable() { + public Long call() throws Exception { + Component cont = (Component) ax; + while (cont != null && !(cont instanceof Window)) { + cont = cont.getParent(); + } + if (cont != null) { + LWWindowPeer peer = (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(cont); + if (peer != null) { + return ((CPlatformWindow) peer.getPlatformWindow()).getContentView().getAWTView(); + } + } + return 0L; + } + }, (Component)ax); + } } diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibleText.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibleText.java index 0237ef92d66..6abf06ecd08 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibleText.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibleText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -264,6 +264,8 @@ class CAccessibleText { final double localY = boundsUnion.getY(); final Point componentLocation = ac.getAccessibleComponent().getLocationOnScreen(); + if (componentLocation == null) return ret; + final double screenX = componentLocation.getX() + localX; final double screenY = componentLocation.getY() + localY; diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h index 0344aebfe44..9f64001212c 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -62,6 +62,8 @@ - (void) deliverJavaMouseEvent: (NSEvent *) event; - (jobject) awtComponent:(JNIEnv *)env; ++ (AWTView *) awtView:(JNIEnv *)env ofAccessible:(jobject)jaccessible; + // Input method-related events - (void)setInputMethod:(jobject)inputMethod; - (void)abandonInput; diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m index 67115418d38..119056ed562 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m @@ -29,6 +29,7 @@ #import "AWTWindow.h" #import "JavaComponentAccessibility.h" #import "JavaTextAccessibility.h" +#import "JavaAccessibilityUtilities.h" #import "GeomUtilities.h" #import "OSVersion.h" #import "ThreadUtilities.h" @@ -129,7 +130,7 @@ static BOOL shouldUsePressAndHold() { self.cglLayer = nil; JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; - (*env)->DeleteGlobalRef(env, m_cPlatformView); + (*env)->DeleteWeakGlobalRef(env, m_cPlatformView); m_cPlatformView = NULL; if (fInputMethodLOCKABLE != NULL) @@ -396,7 +397,11 @@ static BOOL shouldUsePressAndHold() { static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); - JNFCallVoidMethod(env, m_cPlatformView, jm_deliverMouseEvent, jEvent); + jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); + if (!(*env)->IsSameObject(env, jlocal, NULL)) { + JNFCallVoidMethod(env, jlocal, jm_deliverMouseEvent, jEvent); + (*env)->DeleteLocalRef(env, jlocal); + } (*env)->DeleteLocalRef(env, jEvent); } @@ -459,8 +464,11 @@ static BOOL shouldUsePressAndHold() { static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView, "deliverKeyEvent", "(Lsun/lwawt/macosx/NSEvent;)V"); - JNFCallVoidMethod(env, m_cPlatformView, jm_deliverKeyEvent, jEvent); - + jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); + if (!(*env)->IsSameObject(env, jlocal, NULL)) { + JNFCallVoidMethod(env, jlocal, jm_deliverKeyEvent, jEvent); + (*env)->DeleteLocalRef(env, jlocal); + } if (characters != NULL) { (*env)->DeleteLocalRef(env, characters); } @@ -475,7 +483,12 @@ static BOOL shouldUsePressAndHold() { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverResize, jc_PlatformView, "deliverResize", "(IIII)V"); - JNFCallVoidMethod(env, m_cPlatformView, jm_deliverResize, x,y,w,h); + + jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); + if (!(*env)->IsSameObject(env, jlocal, NULL)) { + JNFCallVoidMethod(env, jlocal, jm_deliverResize, x,y,w,h); + (*env)->DeleteLocalRef(env, jlocal); + } } @@ -504,7 +517,11 @@ static BOOL shouldUsePressAndHold() { */ static JNF_CLASS_CACHE(jc_CPlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverWindowDidExposeEvent, jc_CPlatformView, "deliverWindowDidExposeEvent", "()V"); - JNFCallVoidMethod(env, m_cPlatformView, jm_deliverWindowDidExposeEvent); + jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); + if (!(*env)->IsSameObject(env, jlocal, NULL)) { + JNFCallVoidMethod(env, jlocal, jm_deliverWindowDidExposeEvent); + (*env)->DeleteLocalRef(env, jlocal); + } /* } */ @@ -541,7 +558,13 @@ static BOOL shouldUsePressAndHold() { } return NULL; } - jobject peer = JNFGetObjectField(env, m_cPlatformView, jf_Peer); + + jobject peer = NULL; + jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView); + if (!(*env)->IsSameObject(env, jlocal, NULL)) { + peer = JNFGetObjectField(env, jlocal, jf_Peer); + (*env)->DeleteLocalRef(env, jlocal); + } static JNF_CLASS_CACHE(jc_LWWindowPeer, "sun/lwawt/LWWindowPeer"); static JNF_MEMBER_CACHE(jf_Target, jc_LWWindowPeer, "target", "Ljava/awt/Component;"); if (peer == NULL) { @@ -549,12 +572,27 @@ static BOOL shouldUsePressAndHold() { JNFDumpJavaStack(env); return NULL; } - return JNFGetObjectField(env, peer, jf_Target); + jobject comp = JNFGetObjectField(env, peer, jf_Target); + (*env)->DeleteLocalRef(env, peer); + return comp; +} + ++ (AWTView *) awtView:(JNIEnv*)env ofAccessible:(jobject)jaccessible +{ + static JNF_STATIC_MEMBER_CACHE(jm_getAWTView, sjc_CAccessibility, "getAWTView", "(Ljavax/accessibility/Accessible;)J"); + + jlong jptr = JNFCallStaticLongMethod(env, jm_getAWTView, jaccessible); + if (jptr == 0) return nil; + + return (AWTView *)jlong_to_ptr(jptr); } - (id)getAxData:(JNIEnv*)env { - return [[[JavaComponentAccessibility alloc] initWithParent:self withEnv:env withAccessible:[self awtComponent:env] withIndex:-1 withView:self withJavaRole:nil] autorelease]; + jobject jcomponent = [self awtComponent:env]; + id ax = [[[JavaComponentAccessibility alloc] initWithParent:self withEnv:env withAccessible:jcomponent withIndex:-1 withView:self withJavaRole:nil] autorelease]; + (*env)->DeleteLocalRef(env, jcomponent); + return ax; } - (NSArray *)accessibilityAttributeNames @@ -1299,7 +1337,7 @@ Java_sun_lwawt_macosx_CPlatformView_nativeCreateView JNF_COCOA_ENTER(env); NSRect rect = NSMakeRect(originX, originY, width, height); - jobject cPlatformView = (*env)->NewGlobalRef(env, obj); + jobject cPlatformView = (*env)->NewWeakGlobalRef(env, obj); [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.m index d0f8b871004..523000c76b4 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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,9 +35,9 @@ { self = [super init]; if (self) { - fAccessibleAction = JNFNewGlobalRef(env, accessibleAction); + fAccessibleAction = JNFNewWeakGlobalRef(env, accessibleAction); fIndex = index; - fComponent = JNFNewGlobalRef(env, component); + fComponent = JNFNewWeakGlobalRef(env, component); } return self; } @@ -46,10 +46,10 @@ { JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; - JNFDeleteGlobalRef(env, fAccessibleAction); + JNFDeleteWeakGlobalRef(env, fAccessibleAction); fAccessibleAction = NULL; - JNFDeleteGlobalRef(env, fComponent); + JNFDeleteWeakGlobalRef(env, fComponent); fComponent = NULL; [super dealloc]; @@ -61,7 +61,18 @@ JNIEnv* env = [ThreadUtilities getJNIEnv]; - return JNFJavaToNSString(env, JNFCallStaticObjectMethod(env, jm_getAccessibleActionDescription, fAccessibleAction, fIndex, fComponent)); // AWT_THREADING Safe (AWTRunLoopMode) + jobject fCompLocal = (*env)->NewLocalRef(env, fComponent); + if ((*env)->IsSameObject(env, fCompLocal, NULL)) { + return @"unknown"; + } + NSString *str = nil; + jobject jstr = JNFCallStaticObjectMethod(env, jm_getAccessibleActionDescription, fAccessibleAction, fIndex, fCompLocal); + if (jstr != NULL) { + NSString *str = JNFJavaToNSString(env, jstr); // AWT_THREADING Safe (AWTRunLoopMode) + (*env)->DeleteLocalRef(env, jstr); + } + (*env)->DeleteLocalRef(env, fCompLocal); + return str == nil ? @"unknown" : str; } - (void)perform @@ -82,9 +93,9 @@ { self = [super init]; if (self) { - fTabGroup = JNFNewGlobalRef(env, tabGroup); + fTabGroup = JNFNewWeakGlobalRef(env, tabGroup); fIndex = index; - fComponent = JNFNewGlobalRef(env, component); + fComponent = JNFNewWeakGlobalRef(env, component); } return self; } @@ -93,10 +104,10 @@ { JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; - JNFDeleteGlobalRef(env, fTabGroup); + JNFDeleteWeakGlobalRef(env, fTabGroup); fTabGroup = NULL; - JNFDeleteGlobalRef(env, fComponent); + JNFDeleteWeakGlobalRef(env, fComponent); fComponent = NULL; [super dealloc]; diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m index 081c7f7b431..2b999368cb1 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -77,7 +77,9 @@ NSString *getJavaRole(JNIEnv *env, jobject axComponent, jobject component) jobject axRole = JNFCallStaticObjectMethod(env, sjm_getAccessibleRole, axComponent, component); // AWT_THREADING Safe (AWTRunLoopMode) if (axRole == NULL) return @"unknown"; - return JNFJavaToNSString(env, axRole); + NSString* str = JNFJavaToNSString(env, axRole); + (*env)->DeleteLocalRef(env, axRole); + return str; } jobject getAxSelection(JNIEnv *env, jobject axContext, jobject component) @@ -126,21 +128,27 @@ BOOL isVertical(JNIEnv *env, jobject axContext, jobject component) { static JNF_STATIC_MEMBER_CACHE(jm_VERTICAL, sjc_AccessibleState, "VERTICAL", "Ljavax/accessibility/AccessibleState;"); jobject axVertState = JNFGetStaticObjectField(env, jm_VERTICAL); - return containsAxState(env, axContext, axVertState, component); + BOOL vertical = containsAxState(env, axContext, axVertState, component); + (*env)->DeleteLocalRef(env, axVertState); + return vertical; } BOOL isHorizontal(JNIEnv *env, jobject axContext, jobject component) { static JNF_STATIC_MEMBER_CACHE(jm_HORIZONTAL, sjc_AccessibleState, "HORIZONTAL", "Ljavax/accessibility/AccessibleState;"); jobject axHorizState = JNFGetStaticObjectField(env, jm_HORIZONTAL); - return containsAxState(env, axContext, axHorizState, component); + BOOL horizontal = containsAxState(env, axContext, axHorizState, component); + (*env)->DeleteLocalRef(env, axHorizState); + return horizontal; } BOOL isShowing(JNIEnv *env, jobject axContext, jobject component) { static JNF_STATIC_MEMBER_CACHE(jm_SHOWING, sjc_AccessibleState, "SHOWING", "Ljavax/accessibility/AccessibleState;"); jobject axVisibleState = JNFGetStaticObjectField(env, jm_SHOWING); - return containsAxState(env, axContext, axVisibleState, component); + BOOL showing = containsAxState(env, axContext, axVisibleState, component); + (*env)->DeleteLocalRef(env, axVisibleState); + return showing; } NSPoint getAxComponentLocationOnScreen(JNIEnv *env, jobject axComponent, jobject component) diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m index 1b3ec43a9fe..b740d05895c 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -75,7 +75,6 @@ static jobject sAccessibilityClass = NULL; static NSMutableDictionary *sAttributeNamesForRoleCache = nil; static NSObject *sAttributeNamesLOCK = nil; - @interface TabGroupAccessibility : JavaComponentAccessibility { NSInteger _numTabs; } @@ -137,8 +136,11 @@ static NSObject *sAttributeNamesLOCK = nil; fView = [view retain]; fJavaRole = [javaRole retain]; - fAccessible = JNFNewGlobalRef(env, accessible); - fComponent = JNFNewGlobalRef(env, [(AWTView *)fView awtComponent:env]); + fAccessible = (*env)->NewWeakGlobalRef(env, accessible); + + jobject jcomponent = [(AWTView *)fView awtComponent:env]; + fComponent = (*env)->NewWeakGlobalRef(env, jcomponent); + (*env)->DeleteLocalRef(env, jcomponent); fIndex = index; @@ -166,10 +168,10 @@ static NSObject *sAttributeNamesLOCK = nil; JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; - JNFDeleteGlobalRef(env, fAccessible); + (*env)->DeleteWeakGlobalRef(env, fAccessible); fAccessible = NULL; - JNFDeleteGlobalRef(env, fComponent); + (*env)->DeleteWeakGlobalRef(env, fComponent); fComponent = NULL; [fParent release]; @@ -279,7 +281,7 @@ static NSObject *sAttributeNamesLOCK = nil; + (NSArray *)childrenOfParent:(JavaComponentAccessibility *)parent withEnv:(JNIEnv *)env withChildrenCode:(NSInteger)whichChildren allowIgnored:(BOOL)allowIgnored { - jobjectArray jchildrenAndRoles = JNFCallStaticObjectMethod(env, jm_getChildrenAndRoles, parent->fAccessible, parent->fComponent, whichChildren, allowIgnored); // AWT_THREADING Safe (AWTRunLoop) + jobjectArray jchildrenAndRoles = (jobjectArray)JNFCallStaticObjectMethod(env, jm_getChildrenAndRoles, parent->fAccessible, parent->fComponent, whichChildren, allowIgnored); // AWT_THREADING Safe (AWTRunLoop) if (jchildrenAndRoles == NULL) return nil; jsize arrayLen = (*env)->GetArrayLength(env, jchildrenAndRoles); @@ -294,14 +296,21 @@ static NSObject *sAttributeNamesLOCK = nil; NSString *childJavaRole = nil; if (jchildJavaRole != NULL) { - childJavaRole = JNFJavaToNSString(env, JNFGetObjectField(env, jchildJavaRole, sjf_key)); + jobject jkey = JNFGetObjectField(env, jchildJavaRole, sjf_key); + childJavaRole = JNFJavaToNSString(env, jkey); + (*env)->DeleteLocalRef(env, jkey); } JavaComponentAccessibility *child = [self createWithParent:parent accessible:jchild role:childJavaRole index:childIndex withEnv:env withView:parent->fView]; + + (*env)->DeleteLocalRef(env, jchild); + (*env)->DeleteLocalRef(env, jchildJavaRole); + [children addObject:child]; childIndex++; } - + (*env)->DeleteLocalRef(env, jchildrenAndRoles); + return children; } @@ -310,7 +319,7 @@ static NSObject *sAttributeNamesLOCK = nil; jobject jcomponent = [(AWTView *)view awtComponent:env]; jint index = JNFCallStaticIntMethod(env, sjm_getAccessibleIndexInParent, jaccessible, jcomponent); NSString *javaRole = getJavaRole(env, jaccessible, jcomponent); - + (*env)->DeleteLocalRef(env, jcomponent); return [self createWithAccessible:jaccessible role:javaRole index:index withEnv:env withView:view]; } @@ -325,7 +334,10 @@ static NSObject *sAttributeNamesLOCK = nil; jobject jCAX = [JavaComponentAccessibility getCAccessible:jaccessible withEnv:env]; if (jCAX == NULL) return nil; JavaComponentAccessibility *value = (JavaComponentAccessibility *) jlong_to_ptr(JNFGetLongField(env, jCAX, jf_ptr)); - if (value != nil) return [[value retain] autorelease]; + if (value != nil) { + (*env)->DeleteLocalRef(env, jCAX); + return [[value retain] autorelease]; + } // otherwise, create a new instance JavaComponentAccessibility *newChild = nil; @@ -348,6 +360,7 @@ static NSObject *sAttributeNamesLOCK = nil; // must hard retain pointer poked into Java object [newChild retain]; JNFSetLongField(env, jCAX, jf_ptr, ptr_to_jlong(newChild)); + (*env)->DeleteLocalRef(env, jCAX); // return autoreleased instance return [newChild autorelease]; @@ -380,7 +393,7 @@ static NSObject *sAttributeNamesLOCK = nil; // Get all the other accessibility attributes states we need in one swell foop. // javaRole isn't pulled in because we need protected access to AccessibleRole.key - jbooleanArray attributeStates = JNFCallStaticObjectMethod(env, jm_getInitialAttributeStates, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) + jbooleanArray attributeStates = (jbooleanArray)JNFCallStaticObjectMethod(env, jm_getInitialAttributeStates, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (attributeStates == NULL) return nil; jboolean *attributeStatesArray = (*env)->GetBooleanArrayElements(env, attributeStates, 0); if (attributeStatesArray == NULL) { @@ -475,6 +488,7 @@ static NSObject *sAttributeNamesLOCK = nil; JavaAxAction *action = [[JavaAxAction alloc] initWithEnv:env withAccessibleAction:axAction withIndex:0 withComponent:fComponent]; [fActions setObject:action forKey:[self isMenu] ? NSAccessibilityPickAction : NSAccessibilityPressAction]; [action release]; + (*env)->DeleteLocalRef(env, axAction); } } @@ -485,7 +499,9 @@ static NSObject *sAttributeNamesLOCK = nil; - (id)parent { + static JNF_CLASS_CACHE(sjc_Window, "java/awt/Window"); static JNF_STATIC_MEMBER_CACHE(sjm_getAccessibleParent, sjc_CAccessibility, "getAccessibleParent", "(Ljavax/accessibility/Accessible;Ljava/awt/Component;)Ljavax/accessibility/Accessible;"); + static JNF_STATIC_MEMBER_CACHE(sjm_getSwingAccessible, sjc_CAccessible, "getSwingAccessible", "(Ljavax/accessibility/Accessible;)Ljavax/accessibility/Accessible;"); if(fParent == nil) { JNIEnv* env = [ThreadUtilities getJNIEnv]; @@ -495,10 +511,21 @@ static NSObject *sAttributeNamesLOCK = nil; if (jparent == NULL) { fParent = fView; } else { - fParent = [JavaComponentAccessibility createWithAccessible:jparent withEnv:env withView:fView]; + AWTView *view = fView; + jobject jax = JNFCallStaticObjectMethod(env, sjm_getSwingAccessible, fAccessible); + + if (JNFIsInstanceOf(env, jax, &sjc_Window)) { + // In this case jparent is an owner toplevel and we should retrieve its own view + view = [AWTView awtView:env ofAccessible:jparent]; + } + if (view != nil) { + fParent = [JavaComponentAccessibility createWithAccessible:jparent withEnv:env withView:view]; + } if (fParent == nil) { fParent = fView; } + (*env)->DeleteLocalRef(env, jparent); + (*env)->DeleteLocalRef(env, jax ); } [fParent retain]; } @@ -546,7 +573,10 @@ static NSObject *sAttributeNamesLOCK = nil; return NO; } - return isShowing(env, [self axContextWithEnv:env], fComponent); + jobject axContext = [self axContextWithEnv:env]; + BOOL showing = isShowing(env, axContext, fComponent); + (*env)->DeleteLocalRef(env, axContext); + return showing; } // the array of names for each role is cached in the sAttributeNamesForRoleCache @@ -723,7 +753,12 @@ static NSObject *sAttributeNamesLOCK = nil; JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject val = JNFCallStaticObjectMethod(env, sjm_getAccessibleDescription, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return JNFJavaToNSString(env, val); + if (val == NULL) { + return @"unknown"; + } + NSString* str = JNFJavaToNSString(env, val); + (*env)->DeleteLocalRef(env, val); + return str; } - (BOOL)accessibilityIsHelpAttributeSettable @@ -739,7 +774,12 @@ static NSObject *sAttributeNamesLOCK = nil; JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject axValue = JNFCallStaticObjectMethod(env, jm_getMaximumAccessibleValue, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return JNFJavaToNSNumber(env, axValue); + if (axValue == NULL) { + return [NSNumber numberWithInt:0]; + } + NSNumber* num = JNFJavaToNSNumber(env, axValue); + (*env)->DeleteLocalRef(env, axValue); + return num; } - (BOOL)accessibilityIsMaxValueAttributeSettable @@ -755,7 +795,12 @@ static NSObject *sAttributeNamesLOCK = nil; JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject axValue = JNFCallStaticObjectMethod(env, jm_getMinimumAccessibleValue, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return JNFJavaToNSNumber(env, axValue); + if (axValue == NULL) { + return [NSNumber numberWithInt:0]; + } + NSNumber* num = JNFJavaToNSNumber(env, axValue); + (*env)->DeleteLocalRef(env, axValue); + return num; } - (BOOL)accessibilityIsMinValueAttributeSettable @@ -770,13 +815,16 @@ static NSObject *sAttributeNamesLOCK = nil; // cmcnote - should batch these two calls into one that returns an array of two bools, one for vertical and one for horiz if (isVertical(env, axContext, fComponent)) { + (*env)->DeleteLocalRef(env, axContext); return NSAccessibilityVerticalOrientationValue; } if (isHorizontal(env, axContext, fComponent)) { + (*env)->DeleteLocalRef(env, axContext); return NSAccessibilityHorizontalOrientationValue; } + (*env)->DeleteLocalRef(env, axContext); return nil; } @@ -808,6 +856,7 @@ static NSObject *sAttributeNamesLOCK = nil; // Get the java screen coords, and make a NSPoint of the bottom left of the AxComponent. NSSize size = getAxComponentSize(env, axComponent, fComponent); NSPoint point = getAxComponentLocationOnScreen(env, axComponent, fComponent); + (*env)->DeleteLocalRef(env, axComponent); point.y += size.height; @@ -857,8 +906,9 @@ static NSObject *sAttributeNamesLOCK = nil; JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject axRole = JNFCallStaticObjectMethod(env, jm_getAccessibleRoleDisplayString, fAccessible, fComponent); - if(axRole != NULL) { + if (axRole != NULL) { value = JNFJavaToNSString(env, axRole); + (*env)->DeleteLocalRef(env, axRole); } else { value = @"unknown"; } @@ -893,7 +943,9 @@ static NSObject *sAttributeNamesLOCK = nil; - (NSValue *)accessibilitySizeAttribute { JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject axComponent = JNFCallStaticObjectMethod(env, sjm_getAccessibleComponent, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return [NSValue valueWithSize:getAxComponentSize(env, axComponent, fComponent)]; + NSValue* size = [NSValue valueWithSize:getAxComponentSize(env, axComponent, fComponent)]; + (*env)->DeleteLocalRef(env, axComponent); + return size; } - (BOOL)accessibilityIsSizeAttributeSettable @@ -952,7 +1004,12 @@ static NSObject *sAttributeNamesLOCK = nil; JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject val = JNFCallStaticObjectMethod(env, sjm_getAccessibleName, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return JNFJavaToNSString(env, val); + if (val == NULL) { + return @"unknown"; + } + NSString* str = JNFJavaToNSString(env, val); + (*env)->DeleteLocalRef(env, val); + return str; } - (BOOL)accessibilityIsTitleAttributeSettable @@ -984,8 +1041,20 @@ static NSObject *sAttributeNamesLOCK = nil; // a text value is taken care of in JavaTextAccessibility // cmcnote should coalesce these calls into one java call + NSNumber *num = nil; jobject axValue = JNFCallStaticObjectMethod(env, sjm_getAccessibleValue, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return JNFJavaToNSNumber(env, JNFCallStaticObjectMethod(env, jm_getCurrentAccessibleValue, axValue, fComponent)); // AWT_THREADING Safe (AWTRunLoop) + if (axValue != NULL) { + jobject str = JNFCallStaticObjectMethod(env, jm_getCurrentAccessibleValue, axValue, fComponent); + if (str != NULL) { + num = JNFJavaToNSNumber(env, str); // AWT_THREADING Safe (AWTRunLoop) + (*env)->DeleteLocalRef(env, str); + } + (*env)->DeleteLocalRef(env, axValue); + } + if (num == nil) { + num = [NSNumber numberWithInt:0]; + } + return num; } - (BOOL)accessibilityIsValueAttributeSettable @@ -1084,7 +1153,10 @@ static NSObject *sAttributeNamesLOCK = nil; id value = nil; if (JNFIsInstanceOf(env, jparent, &jc_Container)) { jobject jaccessible = JNFCallStaticObjectMethod(env, jm_accessibilityHitTest, jparent, (jfloat)point.x, (jfloat)point.y); // AWT_THREADING Safe (AWTRunLoop) - value = [JavaComponentAccessibility createWithAccessible:jaccessible withEnv:env withView:fView]; + if (jaccessible != NULL) { + value = [JavaComponentAccessibility createWithAccessible:jaccessible withEnv:env withView:fView]; + (*env)->DeleteLocalRef(env, jaccessible); + } } if (value == nil) { @@ -1116,6 +1188,7 @@ static NSObject *sAttributeNamesLOCK = nil; if (JNFIsInstanceOf(env, focused, &sjc_Accessible)) { value = [JavaComponentAccessibility createWithAccessible:focused withEnv:env withView:fView]; } + (*env)->DeleteLocalRef(env, focused); } if (value == nil) { @@ -1222,38 +1295,46 @@ JNF_COCOA_EXIT(env); for (i = 0; i < _numTabs; i++) { aTab = (JavaComponentAccessibility *)[tabs objectAtIndex:i]; if ([aTab isAccessibleWithEnv:env forAccessible:selAccessible]) { + (*env)->DeleteLocalRef(env, selAccessible); return aTab; } } - + (*env)->DeleteLocalRef(env, selAccessible); return nil; } - (NSArray *)tabControlsWithEnv:(JNIEnv *)env withTabGroupAxContext:(jobject)axContext withTabCode:(NSInteger)whichTabs allowIgnored:(BOOL)allowIgnored { - jobjectArray jtabsAndRoles = JNFCallStaticObjectMethod(env, jm_getChildrenAndRoles, fAccessible, fComponent, whichTabs, allowIgnored); // AWT_THREADING Safe (AWTRunLoop) + jobjectArray jtabsAndRoles = (jobjectArray)JNFCallStaticObjectMethod(env, jm_getChildrenAndRoles, fAccessible, fComponent, whichTabs, allowIgnored); // AWT_THREADING Safe (AWTRunLoop) if(jtabsAndRoles == NULL) return nil; jsize arrayLen = (*env)->GetArrayLength(env, jtabsAndRoles); - if (arrayLen == 0) return nil; - + if (arrayLen == 0) { + (*env)->DeleteLocalRef(env, jtabsAndRoles); + return nil; + } NSMutableArray *tabs = [NSMutableArray arrayWithCapacity:(arrayLen/2)]; // all of the tabs have the same role, so we can just find out what that is here and use it for all the tabs jobject jtabJavaRole = (*env)->GetObjectArrayElement(env, jtabsAndRoles, 1); // the array entries alternate between tab/role, starting with tab. so the first role is entry 1. - if (jtabJavaRole == NULL) return nil; - - NSString *tabJavaRole = JNFJavaToNSString(env, JNFGetObjectField(env, jtabJavaRole, sjf_key)); + if (jtabJavaRole == NULL) { + (*env)->DeleteLocalRef(env, jtabsAndRoles); + return nil; + } + jobject jkey = JNFGetObjectField(env, jtabJavaRole, sjf_key); + NSString *tabJavaRole = JNFJavaToNSString(env, jkey); + (*env)->DeleteLocalRef(env, jkey); NSInteger i; NSUInteger tabIndex = (whichTabs >= 0) ? whichTabs : 0; // if we're getting one particular child, make sure to set its index correctly for(i = 0; i < arrayLen; i+=2) { jobject jtab = (*env)->GetObjectArrayElement(env, jtabsAndRoles, i); JavaComponentAccessibility *tab = [[[TabGroupControlAccessibility alloc] initWithParent:self withEnv:env withAccessible:jtab withIndex:tabIndex withTabGroup:axContext withView:[self view] withJavaRole:tabJavaRole] autorelease]; + (*env)->DeleteLocalRef(env, jtab); [tabs addObject:tab]; tabIndex++; } - + (*env)->DeleteLocalRef(env, jtabsAndRoles); return tabs; } @@ -1272,7 +1353,9 @@ JNF_COCOA_EXIT(env); { JNIEnv *env = [ThreadUtilities getJNIEnv]; jobject axContext = [self axContextWithEnv:env]; - return [self tabControlsWithEnv:env withTabGroupAxContext:axContext withTabCode:JAVA_AX_ALL_CHILDREN allowIgnored:NO]; + id tabs = [self tabControlsWithEnv:env withTabGroupAxContext:axContext withTabCode:JAVA_AX_ALL_CHILDREN allowIgnored:NO]; + (*env)->DeleteLocalRef(env, axContext); + return tabs; } - (BOOL)accessibilityIsTabsAttributeSettable @@ -1292,7 +1375,9 @@ JNF_COCOA_EXIT(env); { JNIEnv *env = [ThreadUtilities getJNIEnv]; jobject axContext = [self axContextWithEnv:env]; - return [self contentsWithEnv:env withTabGroupAxContext:axContext withTabCode:JAVA_AX_ALL_CHILDREN allowIgnored:NO]; + NSArray* cont = [self contentsWithEnv:env withTabGroupAxContext:axContext withTabCode:JAVA_AX_ALL_CHILDREN allowIgnored:NO]; + (*env)->DeleteLocalRef(env, axContext); + return cont; } - (BOOL)accessibilityIsContentsAttributeSettable @@ -1305,7 +1390,9 @@ JNF_COCOA_EXIT(env); { JNIEnv *env = [ThreadUtilities getJNIEnv]; jobject axContext = [self axContextWithEnv:env]; - return [self currentTabWithEnv:env withAxContext:axContext]; + id val = [self currentTabWithEnv:env withAxContext:axContext]; + (*env)->DeleteLocalRef(env, axContext); + return val; } - (BOOL)accessibilityIsValueAttributeSettable @@ -1322,6 +1409,7 @@ JNF_COCOA_EXIT(env); JNIEnv *env = [ThreadUtilities getJNIEnv]; jobject axContext = [self axContextWithEnv:env]; setAxContextSelection(env, axContext, fIndex, fComponent); + (*env)->DeleteLocalRef(env, axContext); } - (NSArray *)accessibilityChildrenAttribute @@ -1357,6 +1445,7 @@ JNF_COCOA_EXIT(env); result = children; } } + (*env)->DeleteLocalRef(env, axContext); } else { result = [super accessibilityArrayAttributeValues:attribute index:index maxCount:maxCount]; } @@ -1375,7 +1464,7 @@ static BOOL ObjectEquals(JNIEnv *env, jobject a, jobject b, jobject component); self = [super initWithParent:parent withEnv:env withAccessible:accessible withIndex:index withView:view withJavaRole:javaRole]; if (self) { if (tabGroup != NULL) { - fTabGroupAxContext = JNFNewGlobalRef(env, tabGroup); + fTabGroupAxContext = JNFNewWeakGlobalRef(env, tabGroup); } else { fTabGroupAxContext = NULL; } @@ -1388,7 +1477,7 @@ static BOOL ObjectEquals(JNIEnv *env, jobject a, jobject b, jobject component); JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; if (fTabGroupAxContext != NULL) { - JNFDeleteGlobalRef(env, fTabGroupAxContext); + JNFDeleteWeakGlobalRef(env, fTabGroupAxContext); fTabGroupAxContext = NULL; } @@ -1399,9 +1488,14 @@ static BOOL ObjectEquals(JNIEnv *env, jobject a, jobject b, jobject component); { JNIEnv *env = [ThreadUtilities getJNIEnv]; jobject axContext = [self axContextWithEnv:env]; + jobject selAccessible = getAxContextSelection(env, [self tabGroup], fIndex, fComponent); // Returns the current selection of the page tab list - return [NSNumber numberWithBool:ObjectEquals(env, axContext, getAxContextSelection(env, [self tabGroup], fIndex, fComponent), fComponent)]; + id val = [NSNumber numberWithBool:ObjectEquals(env, axContext, selAccessible, fComponent)]; + + (*env)->DeleteLocalRef(env, selAccessible); + (*env)->DeleteLocalRef(env, axContext); + return val; } - (void)getActionsWithEnv:(JNIEnv *)env @@ -1416,7 +1510,8 @@ static BOOL ObjectEquals(JNIEnv *env, jobject a, jobject b, jobject component); if (fTabGroupAxContext == NULL) { JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject tabGroupAxContext = [(JavaComponentAccessibility *)[self parent] axContextWithEnv:env]; - fTabGroupAxContext = JNFNewGlobalRef(env, tabGroupAxContext); + fTabGroupAxContext = JNFNewWeakGlobalRef(env, tabGroupAxContext); + (*env)->DeleteLocalRef(env, tabGroupAxContext); } return fTabGroupAxContext; } @@ -1451,8 +1546,10 @@ static BOOL ObjectEquals(JNIEnv *env, jobject a, jobject b, jobject component); if ([[aElement accessibilityRoleAttribute] isEqualToString:NSAccessibilityScrollBarRole]) { jobject elementAxContext = [aElement axContextWithEnv:env]; if (isHorizontal(env, elementAxContext, fComponent)) { + (*env)->DeleteLocalRef(env, elementAxContext); return aElement; } + (*env)->DeleteLocalRef(env, elementAxContext); } } @@ -1478,8 +1575,10 @@ static BOOL ObjectEquals(JNIEnv *env, jobject a, jobject b, jobject component); if ([[aElement accessibilityRoleAttribute] isEqualToString:NSAccessibilityScrollBarRole]) { jobject elementAxContext = [aElement axContextWithEnv:env]; if (isVertical(env, elementAxContext, fComponent)) { + (*env)->DeleteLocalRef(env, elementAxContext); return aElement; } + (*env)->DeleteLocalRef(env, elementAxContext); } } diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m index 2809d8bcbf5..f7e17b0e96f 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -112,7 +112,9 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { // if it's static text, the AppKit AXValue is the java accessibleName jobject axName = JNFCallStaticObjectMethod(env, sjm_getAccessibleName, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axName != NULL) { - return JNFJavaToNSString(env, axName); + NSString* str = JNFJavaToNSString(env, axName); + (*env)->DeleteLocalRef(env, axName); + return str; } // value is still nil if no accessibleName for static text. Below, try to get the accessibleText. } @@ -120,12 +122,18 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { // cmcnote: inefficient to make three distinct JNI calls. Coalesce. radr://3951923 jobject axText = JNFCallStaticObjectMethod(env, sjm_getAccessibleText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axText == NULL) return nil; - + (*env)->DeleteLocalRef(env, axText); + jobject axEditableText = JNFCallStaticObjectMethod(env, sjm_getAccessibleEditableText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axEditableText == NULL) return nil; static JNF_STATIC_MEMBER_CACHE(jm_getTextRange, sjc_CAccessibleText, "getTextRange", "(Ljavax/accessibility/AccessibleEditableText;IILjava/awt/Component;)Ljava/lang/String;"); - NSString *string = JNFJavaToNSString(env, JNFCallStaticObjectMethod(env, jm_getTextRange, axEditableText, 0, getAxTextCharCount(env, axEditableText, fComponent), fComponent)); // AWT_THREADING Safe (AWTRunLoop) + jobject jrange = JNFCallStaticObjectMethod(env, jm_getTextRange, axEditableText, 0, getAxTextCharCount(env, axEditableText, fComponent), fComponent); + NSString *string = JNFJavaToNSString(env, jrange); // AWT_THREADING Safe (AWTRunLoop) + + (*env)->DeleteLocalRef(env, jrange); + (*env)->DeleteLocalRef(env, axEditableText); + if (string == nil) string = @""; return string; } @@ -139,6 +147,7 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { JNIEnv* env = [ThreadUtilities getJNIEnv]; jobject axEditableText = JNFCallStaticObjectMethod(env, sjm_getAccessibleEditableText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axEditableText == NULL) return NO; + (*env)->DeleteLocalRef(env, axEditableText); return YES; } @@ -157,7 +166,9 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { static JNF_STATIC_MEMBER_CACHE(jm_getSelectedText, sjc_CAccessibleText, "getSelectedText", "(Ljavax/accessibility/Accessible;Ljava/awt/Component;)Ljava/lang/String;"); jobject axText = JNFCallStaticObjectMethod(env, jm_getSelectedText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axText == NULL) return @""; - return JNFJavaToNSString(env, axText); + NSString* str = JNFJavaToNSString(env, axText); + (*env)->DeleteLocalRef(env, axText); + return str; } - (BOOL)accessibilityIsSelectedTextAttributeSettable @@ -220,7 +231,9 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { // also, static text doesn't always have accessibleText. if axText is null, should get the charcount of the accessibleName instead JNIEnv *env = [ThreadUtilities getJNIEnv]; jobject axText = JNFCallStaticObjectMethod(env, sjm_getAccessibleText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) - return [NSNumber numberWithInt:getAxTextCharCount(env, axText, fComponent)]; + NSNumber* num = [NSNumber numberWithInt:getAxTextCharCount(env, axText, fComponent)]; + (*env)->DeleteLocalRef(env, axText); + return num; } - (BOOL)accessibilityIsNumberOfCharactersAttributeSettable @@ -285,7 +298,7 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_STATIC_MEMBER_CACHE(jm_getBoundsForRange, sjc_CAccessibleText, "getBoundsForRange", "(Ljavax/accessibility/Accessible;Ljava/awt/Component;II)[D"); - jdoubleArray axBounds = JNFCallStaticObjectMethod(env, jm_getBoundsForRange, fAccessible, fComponent, range.location, range.length); // AWT_THREADING Safe (AWTRunLoop) + jdoubleArray axBounds = (jdoubleArray)JNFCallStaticObjectMethod(env, jm_getBoundsForRange, fAccessible, fComponent, range.location, range.length); // AWT_THREADING Safe (AWTRunLoop) if (axBounds == NULL) return nil; // We cheat because we know that the array is 4 elements long (x, y, width, height) @@ -324,7 +337,7 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_STATIC_MEMBER_CACHE(jm_getRangeForLine, sjc_CAccessibleText, "getRangeForLine", "(Ljavax/accessibility/Accessible;Ljava/awt/Component;I)[I"); - jintArray axTextRange = JNFCallStaticObjectMethod(env, jm_getRangeForLine, fAccessible, fComponent, [line intValue]); // AWT_THREADING Safe (AWTRunLoop) + jintArray axTextRange = (jintArray)JNFCallStaticObjectMethod(env, jm_getRangeForLine, fAccessible, fComponent, [line intValue]); // AWT_THREADING Safe (AWTRunLoop) if (axTextRange == NULL) return nil; return javaIntArrayToNSRangeValue(env,axTextRange); @@ -350,10 +363,12 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_STATIC_MEMBER_CACHE(jm_getStringForRange, sjc_CAccessibleText, "getStringForRange", "(Ljavax/accessibility/Accessible;Ljava/awt/Component;II)Ljava/lang/String;"); - jstring jstringForRange = JNFCallStaticObjectMethod(env, jm_getStringForRange, fAccessible, fComponent, range.location, range.length); // AWT_THREADING Safe (AWTRunLoop) + jstring jstringForRange = (jstring)JNFCallStaticObjectMethod(env, jm_getStringForRange, fAccessible, fComponent, range.location, range.length); // AWT_THREADING Safe (AWTRunLoop) if (jstringForRange == NULL) return @""; - return JNFJavaToNSString(env, jstringForRange); + NSString* str = JNFJavaToNSString(env, jstringForRange); + (*env)->DeleteLocalRef(env, jstringForRange); + return str; } // @@ -406,7 +421,7 @@ NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_STATIC_MEMBER_CACHE(jm_getRangeForIndex, sjc_CAccessibleText, "getRangeForIndex", "(Ljavax/accessibility/Accessible;Ljava/awt/Component;I)[I"); - jintArray axTextRange = JNFCallStaticObjectMethod(env, jm_getRangeForIndex, fAccessible, fComponent, index); // AWT_THREADING Safe (AWTRunLoop) + jintArray axTextRange = (jintArray)JNFCallStaticObjectMethod(env, jm_getRangeForIndex, fAccessible, fComponent, index); // AWT_THREADING Safe (AWTRunLoop) if (axTextRange == NULL) return nil; return javaIntArrayToNSRangeValue(env, axTextRange); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h index 4a34dda953c..843de484813 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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,7 +31,7 @@ @interface CGLLayer : CAOpenGLLayer { @private - JNFJObjectWrapper *javaLayer; + JNFWeakJObjectWrapper *javaLayer; // intermediate buffer, used the RQ lock to synchronize GLuint textureID; @@ -45,7 +45,7 @@ #endif /* REMOTELAYER */ } -@property (nonatomic, retain) JNFJObjectWrapper *javaLayer; +@property (nonatomic, retain) JNFWeakJObjectWrapper *javaLayer; @property (readwrite, assign) GLuint textureID; @property (readwrite, assign) GLenum target; @property (readwrite, assign) float textureWidth; @@ -57,7 +57,7 @@ @property (nonatomic, retain) NSObject *jrsRemoteLayer; #endif -- (id) initWithJavaLayer:(JNFJObjectWrapper *)javaLayer; +- (id) initWithJavaLayer:(JNFWeakJObjectWrapper *)javaLayer; - (void) blitTexture; @end diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.m index f300ea404c4..87dcf1d351c 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -46,7 +46,7 @@ extern NSOpenGLContext *sharedContext; @synthesize jrsRemoteLayer; #endif -- (id) initWithJavaLayer:(JNFJObjectWrapper *)layer; +- (id) initWithJavaLayer:(JNFWeakJObjectWrapper *)layer; { AWT_ASSERT_APPKIT_THREAD; // Initialize ourselves @@ -133,6 +133,15 @@ AWT_ASSERT_APPKIT_THREAD; { AWT_ASSERT_APPKIT_THREAD; + JNIEnv *env = [ThreadUtilities getJNIEnv]; + static JNF_CLASS_CACHE(jc_JavaLayer, "sun/java2d/opengl/CGLLayer"); + static JNF_MEMBER_CACHE(jm_drawInCGLContext, jc_JavaLayer, "drawInCGLContext", "()V"); + + jobject javaLayerLocalRef = [self.javaLayer jObjectWithEnv:env]; + if ((*env)->IsSameObject(env, javaLayerLocalRef, NULL)) { + return; + } + // Set the current context to the one given to us. CGLSetCurrentContext(glContext); @@ -141,12 +150,7 @@ AWT_ASSERT_APPKIT_THREAD; glClear(GL_COLOR_BUFFER_BIT); glViewport(0, 0, textureWidth, textureHeight); - - JNIEnv *env = [ThreadUtilities getJNIEnv]; - static JNF_CLASS_CACHE(jc_JavaLayer, "sun/java2d/opengl/CGLLayer"); - static JNF_MEMBER_CACHE(jm_drawInCGLContext, jc_JavaLayer, "drawInCGLContext", "()V"); - jobject javaLayerLocalRef = [self.javaLayer jObjectWithEnv:env]; JNFCallVoidMethod(env, javaLayerLocalRef, jm_drawInCGLContext); (*env)->DeleteLocalRef(env, javaLayerLocalRef); @@ -171,7 +175,7 @@ Java_sun_java2d_opengl_CGLLayer_nativeCreateLayer JNF_COCOA_ENTER(env); - JNFJObjectWrapper *javaLayer = [JNFJObjectWrapper wrapperWithJObject:obj withEnv:env]; + JNFWeakJObjectWrapper *javaLayer = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env]; [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ AWT_ASSERT_APPKIT_THREAD; diff --git a/jdk/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c b/jdk/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c index e51f53a8928..4c33baeca36 100644 --- a/jdk/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c +++ b/jdk/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c @@ -231,12 +231,14 @@ static void BufImg_GetRasInfo(JNIEnv *env, pRasInfo->redErrTable = NULL; pRasInfo->grnErrTable = NULL; pRasInfo->bluErrTable = NULL; + pRasInfo->representsPrimaries = 0; } else { pRasInfo->invColorTable = bipriv->cData->img_clr_tbl; pRasInfo->redErrTable = bipriv->cData->img_oda_red; pRasInfo->grnErrTable = bipriv->cData->img_oda_green; pRasInfo->bluErrTable = bipriv->cData->img_oda_blue; pRasInfo->invGrayTable = bipriv->cData->pGrayInverseLutData; + pRasInfo->representsPrimaries = bipriv->cData->representsPrimaries; } } @@ -259,6 +261,59 @@ static void BufImg_Release(JNIEnv *env, } } +static int calculatePrimaryColorsApproximation(int* cmap, unsigned char* cube, int cube_size) { + int i, j, k; + int index, value, color; + // values calculated from cmap + int r, g, b; + // maximum positive/negative variation allowed for r, g, b values for primary colors + int delta = 5; + // get the primary color cmap indices from corner of inverse color table + for (i = 0; i < cube_size; i += (cube_size - 1)) { + for (j = 0; j < cube_size; j += (cube_size - 1)) { + for (k = 0; k < cube_size; k += (cube_size - 1)) { + // calculate inverse color table index + index = i + cube_size * (j + cube_size * k); + // get value present in corners of inverse color table + value = cube[index]; + // use the corner values as index for cmap + color = cmap[value]; + // extract r,g,b values from cmap value + r = ((color) >> 16) & 0xff; + g = ((color) >> 8) & 0xff; + b = color & 0xff; + /* + * If i/j/k value is 0 optimum value of b/g/r should be 0 but we allow + * maximum positive variation of 5. If i/j/k value is 31 optimum value + * of b/g/r should be 255 but we allow maximum negative variation of 5. + */ + if (i == 0) { + if (b > delta) + return 0; + } else { + if (b < (255 - delta)) + return 0; + } + if (j == 0) { + if (g > delta) + return 0; + } else { + if (g < (255 - delta)) + return 0; + } + if (k == 0) { + if (r > delta) + return 0; + } else { + if (r < (255 - delta)) + return 0; + } + } + } + } + return 1; +} + static ColorData *BufImg_SetupICM(JNIEnv *env, BufImgSDOps *bisdo) { @@ -298,6 +353,7 @@ static ColorData *BufImg_SetupICM(JNIEnv *env, } cData->img_clr_tbl = initCubemap(pRgb, bisdo->lutsize, 32); + cData->representsPrimaries = calculatePrimaryColorsApproximation(pRgb, cData->img_clr_tbl, 32); if (allGray == JNI_TRUE) { initInverseGrayLut(pRgb, bisdo->lutsize, cData); } diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/SurfaceData.h b/jdk/src/java.desktop/share/native/libawt/java2d/SurfaceData.h index 349aad1b2e2..c33663d4b34 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/SurfaceData.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/SurfaceData.h @@ -163,6 +163,7 @@ typedef struct { char *grnErrTable; /* Green ordered dither table */ char *bluErrTable; /* Blue ordered dither table */ int *invGrayTable; /* Inverse gray table */ + int representsPrimaries; /* whether cmap represents primary colors */ union { void *align; /* ensures strict alignment */ char data[SD_RASINFO_PRIVATE_SIZE]; diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.h index 76ea5c749c0..9e177d6e31a 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.h @@ -43,7 +43,7 @@ typedef jubyte ByteIndexedDataType; jint *PREFIX ## Lut; #define DeclareByteIndexedStoreVars(PREFIX) \ - int PREFIX ## XDither, PREFIX ## YDither; \ + int PREFIX ## XDither, PREFIX ## YDither, PREFIX ## RepPrims; \ char *PREFIX ## rerr, *PREFIX ## gerr, *PREFIX ## berr; \ unsigned char *PREFIX ## InvLut; @@ -70,6 +70,7 @@ typedef jubyte ByteIndexedDataType; do { \ SetByteIndexedStoreVarsYPos(PREFIX, pRasInfo, (pRasInfo)->bounds.y1); \ PREFIX ## InvLut = (pRasInfo)->invColorTable; \ + PREFIX ## RepPrims = (pRasInfo)->representsPrimaries; \ } while (0) #define InitByteIndexedStoreVarsX(PREFIX, pRasInfo) \ @@ -168,9 +169,14 @@ typedef jubyte ByteIndexedBmDataType; #define StoreByteIndexedFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \ do { \ - r += PREFIX ## rerr[PREFIX ## XDither]; \ - g += PREFIX ## gerr[PREFIX ## XDither]; \ - b += PREFIX ## berr[PREFIX ## XDither]; \ + if (!(((r == 0) || (r == 255)) && \ + ((g == 0) || (g == 255)) && \ + ((b == 0) || (b == 255)) && \ + PREFIX ## RepPrims)) { \ + r += PREFIX ## rerr[PREFIX ## XDither]; \ + g += PREFIX ## gerr[PREFIX ## XDither]; \ + b += PREFIX ## berr[PREFIX ## XDither]; \ + } \ ByteClamp3Components(r, g, b); \ (pRas)[x] = SurfaceData_InvColorMap(PREFIX ## InvLut, r, g, b); \ } while (0) diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgr.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgr.h index 44c69aa29c8..a159a180cbc 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgr.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -191,4 +191,11 @@ typedef jubyte FourByteAbgrDataType; COMP_PREFIX ## A, COMP_PREFIX ## R, \ COMP_PREFIX ## G, COMP_PREFIX ## B) +/* + * SrcOver ## TYPE ## BlendFactor + * Returns appropriate blend value for use in blending calculations. + */ +#define SrcOverFourByteAbgrBlendFactor(dF, dA) \ + (dA) + #endif /* FourByteAbgr_h_Included */ diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgrPre.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgrPre.h index 51a893a2437..cc7bd3a939a 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgrPre.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgrPre.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -217,4 +217,11 @@ typedef jubyte FourByteAbgrPreDataType; (pRas)[4*(x)+3] = (jubyte) COMP_PREFIX ## R; \ } while (0) +/* + * SrcOver ## TYPE ## BlendFactor + * Returns appropriate blend value for use in blending calculations. + */ +#define SrcOverFourByteAbgrPreBlendFactor(dF, dA) \ + (dF) + #endif /* FourByteAbgrPre_h_Included */ diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgb.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgb.h index 1e22bd42c9b..790bf787d7a 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgb.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -208,4 +208,11 @@ typedef jint IntArgbDataType; COMP_PREFIX ## A = (COMP_PREFIX ## A << 8) + COMP_PREFIX ## A; \ } while (0) +/* + * SrcOver ## TYPE ## BlendFactor + * Returns appropriate blend value for use in blending calculations. + */ +#define SrcOverIntArgbBlendFactor(dF, dA) \ + (dA) + #endif /* IntArgb_h_Included */ diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.h index 438eb90ace8..cca4c66b804 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -206,4 +206,11 @@ typedef jint IntArgbBmDataType; COMP_PREFIX ## A = (COMP_PREFIX ## A << 8) + COMP_PREFIX ## A; \ } while (0) +/* + * SrcOver ## TYPE ## BlendFactor + * Returns appropriate blend value for use in blending calculations. + */ +#define SrcOverIntArgbBmBlendFactor(dF, dA) \ + (dA) + #endif /* IntArgbBm_h_Included */ diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbPre.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbPre.h index ab41f8c0727..b1fa7a5c87c 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbPre.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/IntArgbPre.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -216,4 +216,11 @@ typedef jint IntArgbPreDataType; COMP_PREFIX ## G, \ COMP_PREFIX ## B) +/* + * SrcOver ## TYPE ## BlendFactor + * Returns appropriate blend value for use in blending calculations. + */ +#define SrcOverIntArgbPreBlendFactor(dF, dA) \ + (dF) + #endif /* IntArgbPre_h_Included */ diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/LoopMacros.h b/jdk/src/java.desktop/share/native/libawt/java2d/loops/LoopMacros.h index 370d024966f..d9019d83111 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/LoopMacros.h +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/LoopMacros.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -1668,31 +1668,83 @@ void NAME_SOLID_DRAWGLYPHLIST(DST)(SurfaceDataRasInfo *pRasInfo, \ } \ } while (0); +/* + * Antialiased glyph drawing results in artifacts around the character edges + * when text is drawn ontop of translucent background color. The standard + * blending equation for two colors: + * destColor = srcColor * glyphAlpha + destColor * (1 - glyphAlpha) + * works only when srcColor and destColor are opaque. For translucent srcColor + * and destColor, the respective alpha components in each color will influence + * the visibility of the color and the visibility of the color below it. Hence + * the equation for blending is given as: + * resA = srcAlpha + dstAlpha * (1 - srcAlpha) + * resCol = (srcColor * srcAlpha + destColor * destAlpha * (1- srcAlpha))/resA + * In addition, srcAlpha is multiplied with the glyphAlpha- that indicates the + * grayscale mask value of the glyph being drawn. The combined result provides + * smooth antialiased text on the buffer without any artifacts. Since the + * logic is executed for every pixel in a glyph, the implementation is further + * optimized to reduce computation and improve execution time. + */ #define GlyphListAABlend4ByteArgb(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \ FG_PIXEL, PREFIX, SRC_PREFIX) \ - do { \ - DeclareAlphaVarFor4ByteArgb(dstA) \ - DeclareCompVarsFor4ByteArgb(dst) \ + do { \ + DeclareAlphaVarFor4ByteArgb(resA) \ + DeclareCompVarsFor4ByteArgb(res) \ jint mixValSrc = GLYPH_PIXELS[PIXEL_INDEX]; \ if (mixValSrc) { \ - if (mixValSrc < 255) { \ - jint mixValDst = 255 - mixValSrc; \ - Load ## DST ## To4ByteArgb(DST_PTR, pix, PIXEL_INDEX, \ - dstA, dstR, dstG, dstB); \ - dstA = MUL8(dstA, mixValDst) + \ - MUL8(SRC_PREFIX ## A, mixValSrc); \ - MultMultAddAndStore4ByteArgbComps(dst, mixValDst, dst, \ - mixValSrc, SRC_PREFIX); \ - if (!(DST ## IsOpaque) && \ - !(DST ## IsPremultiplied) && dstA && dstA < 255) { \ - DivideAndStore4ByteArgbComps(dst, dst, dstA); \ + if (mixValSrc != 0xff) { \ + PromoteByteAlphaFor4ByteArgb(mixValSrc); \ + resA = MultiplyAlphaFor4ByteArgb(mixValSrc, SRC_PREFIX ## A); \ + } else { \ + resA = SRC_PREFIX ## A; \ + } \ + if (resA != MaxValFor4ByteArgb) { \ + DeclareAndInvertAlphaVarFor4ByteArgb(dstF, resA) \ + DeclareAndClearAlphaVarFor4ByteArgb(dstA) \ + DeclareCompVarsFor4ByteArgb(dst) \ + DeclareCompVarsFor4ByteArgb(tmp) \ + MultiplyAndStore4ByteArgbComps(res, resA, SRC_PREFIX); \ + if (!(DST ## IsPremultiplied)) { \ + Load ## DST ## To4ByteArgb(DST_PTR, pix, PIXEL_INDEX, \ + dstA, dstR, dstG, dstB); \ + Store4ByteArgbCompsUsingOp(tmp, =, dst); \ + } else { \ + Declare ## DST ## AlphaLoadData(DstPix) \ + jint pixelOffset = PIXEL_INDEX * (DST ## PixelStride); \ + DST ## DataType *pixelAddress = PtrAddBytes(DST_PTR, \ + pixelOffset); \ + LoadAlphaFrom ## DST ## For4ByteArgb(pixelAddress, \ + DstPix, \ + dst); \ + Postload4ByteArgbFrom ## DST(pixelAddress, \ + DstPix, \ + tmp); \ + } \ + if (dstA) { \ + DeclareAlphaVarFor4ByteArgb(blendF) \ + dstA = MultiplyAlphaFor4ByteArgb(dstF, dstA); \ + resA += dstA; \ + blendF = SrcOver ## DST ## BlendFactor(dstF, dstA); \ + if (blendF != MaxValFor4ByteArgb) { \ + MultiplyAndStore4ByteArgbComps(tmp, \ + blendF, \ + tmp); \ + } \ + Store4ByteArgbCompsUsingOp(res, +=, tmp); \ } \ - Store ## DST ## From4ByteArgbComps(DST_PTR, pix, \ - PIXEL_INDEX, dst); \ } else { \ Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \ FG_PIXEL, PREFIX); \ + break; \ } \ + if (!(DST ## IsOpaque) && \ + !(DST ## IsPremultiplied) && resA && \ + resA < MaxValFor4ByteArgb) \ + { \ + DivideAndStore4ByteArgbComps(res, res, resA); \ + } \ + Store ## DST ## From4ByteArgbComps(DST_PTR, pix, \ + PIXEL_INDEX, res); \ } \ } while (0); diff --git a/jdk/src/java.desktop/unix/native/common/awt/colordata.h b/jdk/src/java.desktop/unix/native/common/awt/colordata.h index 505e20b8542..cfee07dffdc 100644 --- a/jdk/src/java.desktop/unix/native/common/awt/colordata.h +++ b/jdk/src/java.desktop/unix/native/common/awt/colordata.h @@ -44,6 +44,7 @@ typedef struct _ColorData { char* img_oda_blue; int *pGrayInverseLutData; int screendata; + int representsPrimaries; } ColorData; diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c index 42408da5bbb..ef8caa94382 100644 --- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c +++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c @@ -312,7 +312,7 @@ static void* dl_symbol_gthread(const char* name) return result; } -gboolean gtk2_check(const char* lib_name, int flags) +gboolean gtk2_check(const char* lib_name, gboolean load) { if (gtk2_libhandle != NULL) { /* We've already successfully opened the GTK libs, so return true. */ @@ -320,16 +320,25 @@ gboolean gtk2_check(const char* lib_name, int flags) } else { void *lib = NULL; - lib = dlopen(lib_name, flags); +#ifdef RTLD_NOLOAD + /* Just check if gtk libs are already in the process space */ + lib = dlopen(lib_name, RTLD_LAZY | RTLD_NOLOAD); + if (!load || lib != NULL) { + return lib != NULL; + } +#else +#ifdef _AIX + /* On AIX we could implement this with the help of loadquery(L_GETINFO, ..) */ + /* (see reload_table() in hotspot/src/os/aix/vm/loadlib_aix.cpp) but it is */ + /* probably not worth it because most AIX servers don't have GTK libs anyway */ +#endif +#endif + lib = dlopen(lib_name, RTLD_LAZY | RTLD_LOCAL); if (lib == NULL) { return FALSE; } - if (flags & RTLD_NOLOAD) { - return TRUE; - } - fp_gtk_check_version = dlsym(lib, "gtk_check_version"); /* Check for GTK 2.2+ */ if (!fp_gtk_check_version(2, 2, 0)) { diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c index 060b082e53b..fcb4bb221fb 100644 --- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c +++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c @@ -87,13 +87,25 @@ static void* dl_symbol(const char* name) return result; } -gboolean gtk3_check(const char* lib_name, int flags) +gboolean gtk3_check(const char* lib_name, gboolean load) { if (gtk3_libhandle != NULL) { /* We've already successfully opened the GTK libs, so return true. */ return TRUE; } else { - return dlopen(lib_name, flags) != NULL; +#ifdef RTLD_NOLOAD + void *lib = dlopen(lib_name, RTLD_LAZY | RTLD_NOLOAD); + if (!load || lib != NULL) { + return lib != NULL; + } +#else +#ifdef _AIX + /* On AIX we could implement this with the help of loadquery(L_GETINFO, ..) */ + /* (see reload_table() in hotspot/src/os/aix/vm/loadlib_aix.cpp) but it is */ + /* probably not worth it because most AIX servers don't have GTK libs anyway */ +#endif +#endif + return dlopen(lib_name, RTLD_LAZY | RTLD_LOCAL) != NULL; } } diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c index 0a136b39768..8497908a722 100644 --- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c +++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c @@ -30,8 +30,8 @@ GtkApi* gtk2_load(JNIEnv *env, const char* lib_name); GtkApi* gtk3_load(JNIEnv *env, const char* lib_name); -gboolean gtk2_check(const char* lib_name, int flags); -gboolean gtk3_check(const char* lib_name, int flags); +gboolean gtk2_check(const char* lib_name, gboolean load); +gboolean gtk3_check(const char* lib_name, gboolean load); GtkApi *gtk; @@ -40,7 +40,7 @@ typedef struct { const char* name; const char* vname; GtkApi* (*load)(JNIEnv *env, const char* lib_name); - gboolean (*check)(const char* lib_name, int flags); + gboolean (*check)(const char* lib_name, gboolean load); } GtkLib; static GtkLib libs[] = { @@ -70,10 +70,10 @@ static GtkLib libs[] = { static GtkLib* get_loaded() { GtkLib* lib = libs; while(!gtk && lib->version) { - if (lib->check(lib->vname, RTLD_NOLOAD)) { + if (lib->check(lib->vname, /* load = */FALSE)) { return lib; } - if (lib->check(lib->name, RTLD_NOLOAD)) { + if (lib->check(lib->name, /* load = */FALSE)) { return lib; } lib++; @@ -130,14 +130,14 @@ gboolean gtk_load(JNIEnv *env, GtkVersion version, gboolean verbose) { return gtk != NULL; } -static gboolean check_version(GtkVersion version, int flags) { +static gboolean check_version(GtkVersion version) { GtkLib* lib = libs; while (lib->version) { if (version == GTK_ANY || lib->version == version) { - if (lib->check(lib->vname, flags)) { + if (lib->check(lib->vname, /* load = */TRUE)) { return TRUE; } - if (lib->check(lib->name, flags)) { + if (lib->check(lib->name, /* load = */TRUE)) { return TRUE; } } @@ -150,9 +150,6 @@ gboolean gtk_check_version(GtkVersion version) { if (gtk) { return TRUE; } - if (check_version(version, RTLD_NOLOAD)) { - return TRUE; - } - return check_version(version, RTLD_LAZY | RTLD_LOCAL); + return check_version(version); } diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/colordata.h b/jdk/src/java.desktop/windows/native/libawt/windows/colordata.h index 9401598f429..f25d8979f4d 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/colordata.h +++ b/jdk/src/java.desktop/windows/native/libawt/windows/colordata.h @@ -33,6 +33,7 @@ typedef struct _ColorData { char* img_oda_blue; unsigned char* img_clr_tbl; int *pGrayInverseLutData; + int representsPrimaries; } ColorData; #define CANFREE(pData) (pData) diff --git a/jdk/src/java.httpclient/share/classes/java/net/http/AsyncSSLDelegate.java b/jdk/src/java.httpclient/share/classes/java/net/http/AsyncSSLDelegate.java index 217bd7d16ea..b3ff5c311e4 100644 --- a/jdk/src/java.httpclient/share/classes/java/net/http/AsyncSSLDelegate.java +++ b/jdk/src/java.httpclient/share/classes/java/net/http/AsyncSSLDelegate.java @@ -144,13 +144,9 @@ public class AsyncSSLDelegate implements Closeable, AsyncConnection { sslParameters = Utils.copySSLParameters(sslp); if (alpn != null) { sslParameters.setApplicationProtocols(alpn); - Log.logSSL("Setting application protocols: " + Arrays.toString(alpn)); - } else { - Log.logSSL("No application protocols proposed"); } + logParams(sslParameters); engine.setSSLParameters(sslParameters); - engine.setEnabledCipherSuites(sslp.getCipherSuites()); - engine.setEnabledProtocols(sslp.getProtocols()); this.lowerOutput = lowerOutput; this.client = client; this.channelInputQ = new Queue<>(); @@ -560,24 +556,26 @@ public class AsyncSSLDelegate implements Closeable, AsyncConnection { return sslParameters; } - static void printParams(SSLParameters p) { - System.out.println("SSLParameters:"); + static void logParams(SSLParameters p) { + if (!Log.ssl()) + return; + Log.logSSL("SSLParameters:"); if (p == null) { - System.out.println("Null params"); + Log.logSSL("Null params"); return; } for (String cipher : p.getCipherSuites()) { - System.out.printf("cipher: %s\n", cipher); + Log.logSSL("cipher: {0}\n", cipher); } for (String approto : p.getApplicationProtocols()) { - System.out.printf("application protocol: %s\n", approto); + Log.logSSL("application protocol: {0}\n", approto); } for (String protocol : p.getProtocols()) { - System.out.printf("protocol: %s\n", protocol); + Log.logSSL("protocol: {0}\n", protocol); } if (p.getServerNames() != null) - for (SNIServerName sname : p.getServerNames()) { - System.out.printf("server name: %s\n", sname.toString()); + for (SNIServerName sname : p.getServerNames()) { + Log.logSSL("server name: {0}\n", sname.toString()); } } diff --git a/jdk/src/java.httpclient/share/classes/java/net/http/FilterFactory.java b/jdk/src/java.httpclient/share/classes/java/net/http/FilterFactory.java index cf67771331a..840eacaa64a 100644 --- a/jdk/src/java.httpclient/share/classes/java/net/http/FilterFactory.java +++ b/jdk/src/java.httpclient/share/classes/java/net/http/FilterFactory.java @@ -39,7 +39,9 @@ class FilterFactory { List l = new LinkedList<>(); for (Class clazz : filterClasses) { try { - l.add(clazz.newInstance()); + @SuppressWarnings("deprecation") + HeaderFilter headerFilter = clazz.newInstance(); + l.add(headerFilter); } catch (ReflectiveOperationException e) { throw new InternalError(e); } diff --git a/jdk/src/java.httpclient/share/classes/java/net/http/HttpClientImpl.java b/jdk/src/java.httpclient/share/classes/java/net/http/HttpClientImpl.java index 0d20fa9a8a9..446987d6b5d 100644 --- a/jdk/src/java.httpclient/share/classes/java/net/http/HttpClientImpl.java +++ b/jdk/src/java.httpclient/share/classes/java/net/http/HttpClientImpl.java @@ -110,7 +110,10 @@ class HttpClientImpl extends HttpClient implements BufferHandler { this.proxySelector = builder.proxy; authenticator = builder.authenticator; version = builder.version; - sslParams = builder.sslParams; + if (builder.sslParams == null) + sslParams = getDefaultParams(sslContext); + else + sslParams = builder.sslParams; connections = new ConnectionPool(); connections.start(); timeouts = new LinkedList<>(); @@ -129,6 +132,12 @@ class HttpClientImpl extends HttpClient implements BufferHandler { selmgr.start(); } + private static SSLParameters getDefaultParams(SSLContext ctx) { + SSLParameters params = ctx.getSupportedSSLParameters(); + params.setProtocols(new String[]{"TLSv1.2"}); + return params; + } + /** * Wait for activity on given exchange (assuming blocking = false). * It's a no-op if blocking = true. In particular, the following occurs diff --git a/jdk/src/java.httpclient/share/classes/java/net/http/SSLDelegate.java b/jdk/src/java.httpclient/share/classes/java/net/http/SSLDelegate.java index 27bad6659ad..cf4203bf76d 100644 --- a/jdk/src/java.httpclient/share/classes/java/net/http/SSLDelegate.java +++ b/jdk/src/java.httpclient/share/classes/java/net/http/SSLDelegate.java @@ -66,8 +66,6 @@ class SSLDelegate { Log.logSSL("No application protocols proposed"); } engine.setSSLParameters(sslParameters); - engine.setEnabledCipherSuites(sslp.getCipherSuites()); - engine.setEnabledProtocols(sslp.getProtocols()); wrapper = new EngineWrapper(chan, engine); this.chan = chan; this.client = client; diff --git a/jdk/src/java.httpclient/share/classes/java/net/http/Utils.java b/jdk/src/java.httpclient/share/classes/java/net/http/Utils.java index d16248d4b6b..302b39d9f40 100644 --- a/jdk/src/java.httpclient/share/classes/java/net/http/Utils.java +++ b/jdk/src/java.httpclient/share/classes/java/net/http/Utils.java @@ -146,7 +146,7 @@ final class Utils { } else { sb.append(uri.getScheme()) .append("://") - .append(uri.getHost()) + .append(uri.getAuthority()) .append(uri.getPath()); urlstring = sb.toString(); diff --git a/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java b/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java index e671fec604c..1f992b4065f 100644 --- a/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java +++ b/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java @@ -436,7 +436,8 @@ public class InstrumentationImpl implements Instrumentation { if (classBeingRedefined != null) { module = classBeingRedefined.getModule(); } else { - module = loader.getUnnamedModule(); + module = (loader == null) ? jdk.internal.loader.BootLoader.getUnnamedModule() + : loader.getUnnamedModule(); } } if (mgr == null) { diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java index 6d0cc8de4d6..bc06286e8da 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java @@ -231,13 +231,15 @@ public class LogManager { cname = System.getProperty("java.util.logging.manager"); if (cname != null) { try { - Class clz = ClassLoader.getSystemClassLoader() - .loadClass(cname); - mgr = (LogManager) clz.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = ClassLoader.getSystemClassLoader() + .loadClass(cname).newInstance(); + mgr = (LogManager) tmp; } catch (ClassNotFoundException ex) { - Class clz = Thread.currentThread() - .getContextClassLoader().loadClass(cname); - mgr = (LogManager) clz.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Thread.currentThread() + .getContextClassLoader().loadClass(cname).newInstance(); + mgr = (LogManager) tmp; } } } catch (Exception ex) { @@ -991,8 +993,9 @@ public class LogManager { List handlers = new ArrayList<>(names.length); for (String type : names) { try { - Class clz = ClassLoader.getSystemClassLoader().loadClass(type); - Handler hdl = (Handler) clz.newInstance(); + @SuppressWarnings("deprecation") + Object o = ClassLoader.getSystemClassLoader().loadClass(type).newInstance(); + Handler hdl = (Handler) o; // Check if there is a property defining the // this handler's level. String levs = getProperty(type + ".level"); @@ -1330,11 +1333,13 @@ public class LogManager { // calling readConfiguration(InputStream) with a suitable stream. try { Class clz = ClassLoader.getSystemClassLoader().loadClass(cname); - clz.newInstance(); + @SuppressWarnings("deprecation") + Object witness = clz.newInstance(); return; } catch (ClassNotFoundException ex) { Class clz = Thread.currentThread().getContextClassLoader().loadClass(cname); - clz.newInstance(); + @SuppressWarnings("deprecation") + Object witness = clz.newInstance(); return; } } catch (Exception ex) { @@ -1561,7 +1566,8 @@ public class LogManager { for (String word : names) { try { Class clz = ClassLoader.getSystemClassLoader().loadClass(word); - clz.newInstance(); + @SuppressWarnings("deprecation") + Object witness = clz.newInstance(); } catch (Exception ex) { System.err.println("Can't load config class \"" + word + "\""); System.err.println("" + ex); @@ -2307,8 +2313,9 @@ public class LogManager { String val = getProperty(name); try { if (val != null) { - Class clz = ClassLoader.getSystemClassLoader().loadClass(val); - return (Filter) clz.newInstance(); + @SuppressWarnings("deprecation") + Object o = ClassLoader.getSystemClassLoader().loadClass(val).newInstance(); + return (Filter) o; } } catch (Exception ex) { // We got one of a variety of exceptions in creating the @@ -2328,8 +2335,9 @@ public class LogManager { String val = getProperty(name); try { if (val != null) { - Class clz = ClassLoader.getSystemClassLoader().loadClass(val); - return (Formatter) clz.newInstance(); + @SuppressWarnings("deprecation") + Object o = ClassLoader.getSystemClassLoader().loadClass(val).newInstance(); + return (Formatter) o; } } catch (Exception ex) { // We got one of a variety of exceptions in creating the diff --git a/jdk/src/java.logging/share/classes/java/util/logging/MemoryHandler.java b/jdk/src/java.logging/share/classes/java/util/logging/MemoryHandler.java index 1f9fe727be7..34053937630 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/MemoryHandler.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/MemoryHandler.java @@ -117,7 +117,9 @@ public class MemoryHandler extends Handler { Class clz; try { clz = ClassLoader.getSystemClassLoader().loadClass(targetName); - target = (Handler) clz.newInstance(); + @SuppressWarnings("deprecation") + Object o = clz.newInstance(); + target = (Handler) o; } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { throw new RuntimeException("MemoryHandler can't load handler target \"" + targetName + "\"" , e); } diff --git a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java index c322ed4f028..e2c94815d60 100644 --- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java +++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java @@ -655,7 +655,9 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { final Object[] openArray = (Object[]) openValue; final Collection valueCollection; try { - valueCollection = cast(collectionClass.newInstance()); + @SuppressWarnings("deprecation") + Collection tmp = collectionClass.newInstance(); + valueCollection = cast(tmp); } catch (Exception e) { throw invalidObjectException("Cannot create collection", e); } @@ -1114,7 +1116,9 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { try { final Class targetClass = getTargetClass(); ReflectUtil.checkPackageAccess(targetClass); - o = targetClass.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = targetClass.newInstance(); + o = tmp; for (int i = 0; i < itemNames.length; i++) { if (cd.containsKey(itemNames[i])) { Object openItem = cd.get(itemNames[i]); diff --git a/jdk/src/java.management/share/classes/javax/management/MBeanServerFactory.java b/jdk/src/java.management/share/classes/javax/management/MBeanServerFactory.java index 7eade40ba1d..756811a072f 100644 --- a/jdk/src/java.management/share/classes/javax/management/MBeanServerFactory.java +++ b/jdk/src/java.management/share/classes/javax/management/MBeanServerFactory.java @@ -458,6 +458,7 @@ public class MBeanServerFactory { **/ private static MBeanServerBuilder newBuilder(Class builderClass) { try { + @SuppressWarnings("deprecation") final Object abuilder = builderClass.newInstance(); return (MBeanServerBuilder)abuilder; } catch (RuntimeException x) { diff --git a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java index 1458aca4c3b..4c6479e12b5 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java @@ -531,7 +531,9 @@ public class JMXConnectorFactory { // We have just proved that this cast is correct Class providerClassT = Util.cast(providerClass); try { - return providerClassT.newInstance(); + @SuppressWarnings("deprecation") + T result = providerClassT.newInstance(); + return result; } catch (Exception e) { final String msg = "Exception when instantiating provider [" + className + diff --git a/jdk/src/java.naming/share/classes/com/sun/naming/internal/FactoryEnumeration.java b/jdk/src/java.naming/share/classes/com/sun/naming/internal/FactoryEnumeration.java index 0fe4864d967..8b0e852bad3 100644 --- a/jdk/src/java.naming/share/classes/com/sun/naming/internal/FactoryEnumeration.java +++ b/jdk/src/java.naming/share/classes/com/sun/naming/internal/FactoryEnumeration.java @@ -86,7 +86,9 @@ public final class FactoryEnumeration { answer = cls; } // Instantiate Class to get factory - answer = ((Class) answer).newInstance(); + @SuppressWarnings("deprecation") + Object tmp = ((Class) answer).newInstance(); + answer = tmp; ref = new NamedWeakReference<>(answer, className); factories.set(posn-1, ref); // replace Class object or null return answer; diff --git a/jdk/src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java b/jdk/src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java index 7db51ea5cce..8292846733c 100644 --- a/jdk/src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java +++ b/jdk/src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java @@ -399,7 +399,9 @@ public final class ResourceManager { className = parser.nextToken() + classSuffix; try { // System.out.println("loading " + className); - factory = helper.loadClass(className, loader).newInstance(); + @SuppressWarnings("deprecation") // Class.newInstance + Object tmp = helper.loadClass(className, loader).newInstance(); + factory = tmp; } catch (InstantiationException e) { NamingException ne = new NamingException("Cannot instantiate " + className); diff --git a/jdk/src/java.naming/share/classes/javax/naming/ldap/StartTlsRequest.java b/jdk/src/java.naming/share/classes/javax/naming/ldap/StartTlsRequest.java index 4c81bf6247c..bbe3915dbae 100644 --- a/jdk/src/java.naming/share/classes/javax/naming/ldap/StartTlsRequest.java +++ b/jdk/src/java.naming/share/classes/javax/naming/ldap/StartTlsRequest.java @@ -192,18 +192,12 @@ public class StartTlsRequest implements ExtendedRequest { } try { VersionHelper helper = VersionHelper.getVersionHelper(); - Class clas = helper.loadClass( - "com.sun.jndi.ldap.ext.StartTlsResponseImpl"); + @SuppressWarnings("deprecation") + Object o = helper.loadClass( + "com.sun.jndi.ldap.ext.StartTlsResponseImpl").newInstance(); + resp = (StartTlsResponse) o; - resp = (StartTlsResponse) clas.newInstance(); - - } catch (IllegalAccessException e) { - throw wrapException(e); - - } catch (InstantiationException e) { - throw wrapException(e); - - } catch (ClassNotFoundException e) { + } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw wrapException(e); } diff --git a/jdk/src/java.naming/share/classes/javax/naming/spi/NamingManager.java b/jdk/src/java.naming/share/classes/javax/naming/spi/NamingManager.java index 6a13625cabc..6e60b6bffa9 100644 --- a/jdk/src/java.naming/share/classes/javax/naming/spi/NamingManager.java +++ b/jdk/src/java.naming/share/classes/javax/naming/spi/NamingManager.java @@ -159,7 +159,9 @@ public class NamingManager { } } - return (clas != null) ? (ObjectFactory) clas.newInstance() : null; + @SuppressWarnings("deprecation") // Class.newInstance + ObjectFactory result = (clas != null) ? (ObjectFactory) clas.newInstance() : null; + return result; } @@ -710,8 +712,9 @@ public class NamingManager { if (factory == null) { try { - factory = (InitialContextFactory) - helper.loadClass(className).newInstance(); + @SuppressWarnings("deprecation") + Object o = helper.loadClass(className).newInstance(); + factory = (InitialContextFactory) o; } catch (Exception e) { NoInitialContextException ne = new NoInitialContextException( diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java index 67394641c9d..b6e53c4cb8a 100644 --- a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java +++ b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java @@ -238,10 +238,11 @@ public abstract class Preferences { // dependent on the invoking thread. // Checking AllPermission also seems wrong. try { - return (PreferencesFactory) - Class.forName(factoryName, false, - ClassLoader.getSystemClassLoader()) + @SuppressWarnings("deprecation") + Object result =Class.forName(factoryName, false, + ClassLoader.getSystemClassLoader()) .newInstance(); + return (PreferencesFactory)result; } catch (Exception ex) { try { // workaround for javaws, plugin, @@ -250,11 +251,12 @@ public abstract class Preferences { if (sm != null) { sm.checkPermission(new java.security.AllPermission()); } - return (PreferencesFactory) - Class.forName(factoryName, false, - Thread.currentThread() - .getContextClassLoader()) + @SuppressWarnings("deprecation") + Object result = Class.forName(factoryName, false, + Thread.currentThread() + .getContextClassLoader()) .newInstance(); + return (PreferencesFactory) result; } catch (Exception e) { throw new InternalError( "Can't instantiate Preferences factory " @@ -299,9 +301,10 @@ public abstract class Preferences { platformFactory = "java.util.prefs.FileSystemPreferencesFactory"; } try { - return (PreferencesFactory) - Class.forName(platformFactory, false, - Preferences.class.getClassLoader()).newInstance(); + @SuppressWarnings("deprecation") + Object result = Class.forName(platformFactory, false, + Preferences.class.getClassLoader()).newInstance(); + return (PreferencesFactory) result; } catch (Exception e) { throw new InternalError( "Can't instantiate platform default Preferences factory " diff --git a/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationID.java b/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationID.java index 120a15ade34..13b3a0689c8 100644 --- a/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationID.java +++ b/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationID.java @@ -272,6 +272,7 @@ public class ActivationID implements Serializable { Class refClass = Class.forName(RemoteRef.packagePrefix + "." + in.readUTF()) .asSubclass(RemoteRef.class); + @SuppressWarnings("deprecation") RemoteRef ref = refClass.newInstance(); ref.readExternal(in); activator = (Activator) diff --git a/jdk/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java b/jdk/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java index 59e29d5f597..a47ff2a706e 100644 --- a/jdk/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java +++ b/jdk/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java @@ -681,7 +681,9 @@ public class RMIClassLoader { Class.forName(providerClassName, false, ClassLoader.getSystemClassLoader()) .asSubclass(RMIClassLoaderSpi.class); - return providerClass.newInstance(); + @SuppressWarnings("deprecation") + RMIClassLoaderSpi result = providerClass.newInstance(); + return result; } catch (ClassNotFoundException e) { throw new NoClassDefFoundError(e.getMessage()); diff --git a/jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java b/jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java index 86967ebd8da..db358dad895 100644 --- a/jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java +++ b/jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java @@ -439,18 +439,16 @@ public abstract class RemoteObject implements Remote, java.io.Serializable { RemoteRef.packagePrefix + "." + refClassName; Class refClass = Class.forName(internalRefClassName); try { - ref = (RemoteRef) refClass.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = refClass.newInstance(); + ref = (RemoteRef) tmp; /* * If this step fails, assume we found an internal * class that is not meant to be a serializable ref * type. */ - } catch (InstantiationException e) { - throw new ClassNotFoundException(internalRefClassName, e); - } catch (IllegalAccessException e) { - throw new ClassNotFoundException(internalRefClassName, e); - } catch (ClassCastException e) { + } catch (InstantiationException | IllegalAccessException | ClassCastException e) { throw new ClassNotFoundException(internalRefClassName, e); } ref.readExternal(in); diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/Activation.java b/jdk/src/java.rmi/share/classes/sun/rmi/server/Activation.java index 407601f2f98..d1f73305a2d 100644 --- a/jdk/src/java.rmi/share/classes/sun/rmi/server/Activation.java +++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/Activation.java @@ -2066,7 +2066,9 @@ public class Activation implements Serializable { try { Class execPolicyClass = getRMIClass(execPolicyClassName); - execPolicy = execPolicyClass.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = execPolicyClass.newInstance(); + execPolicy = tmp; execPolicyMethod = execPolicyClass.getMethod("checkExecCommand", ActivationGroupDesc.class, diff --git a/jdk/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java b/jdk/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java index 8ded0720b46..0e810845f24 100644 --- a/jdk/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java +++ b/jdk/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java @@ -111,8 +111,9 @@ public final class TerminalFactory { type = "PC/SC"; Provider sun = Security.getProvider("SunPCSC"); if (sun == null) { - Class clazz = Class.forName("sun.security.smartcardio.SunPCSC"); - sun = (Provider)clazz.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName("sun.security.smartcardio.SunPCSC").newInstance(); + sun = (Provider)o; } factory = TerminalFactory.getInstance(type, null, sun); } catch (Exception e) { diff --git a/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java b/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java index 55179670edb..0326f57639c 100644 --- a/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java +++ b/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java @@ -2962,7 +2962,9 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern SQLData obj = null; try { ReflectUtil.checkPackageAccess(c); - obj = (SQLData) c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + obj = (SQLData) tmp; } catch(Exception ex) { throw new SQLException("Unable to Instantiate: ", ex); } @@ -5710,7 +5712,9 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern SQLData obj = null; try { ReflectUtil.checkPackageAccess(c); - obj = (SQLData) c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + obj = (SQLData) tmp; } catch(Exception ex) { throw new SQLException("Unable to Instantiate: ", ex); } diff --git a/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java b/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java index 07865ac0775..60f6ad0ff9d 100644 --- a/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java +++ b/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java @@ -574,7 +574,9 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable { SQLData obj = null; try { ReflectUtil.checkPackageAccess(c); - obj = (SQLData)c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + obj = (SQLData)tmp; } catch (Exception ex) { throw new SQLException("Unable to Instantiate: ", ex); } diff --git a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java index 02863b233a4..8cbccd4782b 100644 --- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java +++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java @@ -136,8 +136,9 @@ public class RowSetProvider { } // getFactoryClass takes care of adding the read edge if // necessary - Class c = getFactoryClass(factoryClassName, null, false); - factory = (RowSetFactory) c.newInstance(); + @SuppressWarnings("deprecation") + Object o = getFactoryClass(factoryClassName, null, false).newInstance(); + factory = (RowSetFactory) o; } } catch (Exception e) { throw new SQLException( "RowSetFactory: " + factoryClassName + @@ -202,6 +203,7 @@ public class RowSetProvider { // getFactoryClass takes care of adding the read edge if // necessary Class providerClass = getFactoryClass(factoryClassName, cl, false); + @SuppressWarnings("deprecation") RowSetFactory instance = (RowSetFactory) providerClass.newInstance(); if (debug) { trace("Created new instance of " + providerClass + diff --git a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SQLInputImpl.java b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SQLInputImpl.java index 41332f59189..421d4943763 100644 --- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SQLInputImpl.java +++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SQLInputImpl.java @@ -478,7 +478,9 @@ public class SQLInputImpl implements SQLInput { SQLData obj = null; try { ReflectUtil.checkPackageAccess(c); - obj = (SQLData)c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + obj = (SQLData)tmp; } catch (Exception ex) { throw new SQLException("Unable to Instantiate: ", ex); } diff --git a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncFactory.java b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncFactory.java index 8aeccdfe7e3..a38cd2b41c6 100644 --- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncFactory.java +++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncFactory.java @@ -582,14 +582,12 @@ public class SyncFactory { * there. **/ c = Class.forName(providerID, true, cl); - return (SyncProvider) c.newInstance(); + @SuppressWarnings("deprecation") + Object result = c.newInstance(); + return (SyncProvider)result; - } catch (IllegalAccessException e) { + } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw new SyncFactoryException("IllegalAccessException: " + e.getMessage()); - } catch (InstantiationException e) { - throw new SyncFactoryException("InstantiationException: " + e.getMessage()); - } catch (ClassNotFoundException e) { - throw new SyncFactoryException("ClassNotFoundException: " + e.getMessage()); } } diff --git a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java index 253e35ca864..e597f724793 100644 --- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java +++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java @@ -152,7 +152,9 @@ public class SignatureAlgorithm extends Algorithm { log.log(java.util.logging.Level.FINE, "Create URI \"" + algorithmURI + "\" class \"" + implementingClass + "\""); } - return implementingClass.newInstance(); + @SuppressWarnings("deprecation") + SignatureAlgorithmSpi result = implementingClass.newInstance(); + return result; } catch (IllegalAccessException ex) { Object exArgs[] = { algorithmURI, ex.getMessage() }; throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, ex); diff --git a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java index ae33b72c91d..7c04f870c42 100644 --- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java +++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java @@ -115,7 +115,9 @@ public class Canonicalizer { Class implementingClass = canonicalizerHash.get(algorithmURI); - canonicalizerSpi = implementingClass.newInstance(); + @SuppressWarnings("deprecation") + CanonicalizerSpi tmp = implementingClass.newInstance(); + canonicalizerSpi = tmp; canonicalizerSpi.reset = true; } catch (Exception e) { Object exArgs[] = { algorithmURI }; diff --git a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java index e8622d938b6..2263e352944 100644 --- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java +++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java @@ -182,6 +182,7 @@ public class KeyResolver { public static void register(String className, boolean globalResolver) throws ClassNotFoundException, IllegalAccessException, InstantiationException { JavaUtils.checkRegisterPermission(); + @SuppressWarnings("deprecation") KeyResolverSpi keyResolverSpi = (KeyResolverSpi) Class.forName(className).newInstance(); keyResolverSpi.setGlobalResolver(globalResolver); @@ -207,7 +208,9 @@ public class KeyResolver { KeyResolverSpi keyResolverSpi = null; Exception ex = null; try { - keyResolverSpi = (KeyResolverSpi) Class.forName(className).newInstance(); + @SuppressWarnings("deprecation") + Object tmp = Class.forName(className).newInstance(); + keyResolverSpi = (KeyResolverSpi) tmp; } catch (ClassNotFoundException e) { ex = e; } catch (IllegalAccessException e) { @@ -272,6 +275,7 @@ public class KeyResolver { JavaUtils.checkRegisterPermission(); List keyResolverList = new ArrayList(classNames.size()); for (String className : classNames) { + @SuppressWarnings("deprecation") KeyResolverSpi keyResolverSpi = (KeyResolverSpi) Class.forName(className).newInstance(); keyResolverSpi.setGlobalResolver(false); diff --git a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java index 78622d79336..685f0108247 100644 --- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java +++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java @@ -110,7 +110,9 @@ public abstract class KeyResolverSpi { KeyResolverSpi tmp = this; if (globalResolver) { try { - tmp = getClass().newInstance(); + @SuppressWarnings("deprecation") + KeyResolverSpi krs = getClass().newInstance(); + tmp = krs; } catch (InstantiationException e) { throw new KeyResolverException("", e); } catch (IllegalAccessException e) { diff --git a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java index 3fc1d21bb9c..112ba1578af 100644 --- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java +++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java @@ -160,7 +160,9 @@ public final class Transform extends SignatureElementProxy { throw new InvalidTransformException("signature.Transform.UnknownTransform", exArgs); } try { - transformSpi = transformSpiClass.newInstance(); + @SuppressWarnings("deprecation") + TransformSpi tmp = transformSpiClass.newInstance(); + transformSpi = tmp; } catch (InstantiationException ex) { Object exArgs[] = { algorithmURI }; throw new InvalidTransformException( @@ -345,7 +347,9 @@ public final class Transform extends SignatureElementProxy { } TransformSpi newTransformSpi = null; try { - newTransformSpi = transformSpiClass.newInstance(); + @SuppressWarnings("deprecation") + TransformSpi tmp = transformSpiClass.newInstance(); + newTransformSpi = tmp; } catch (InstantiationException ex) { Object exArgs[] = { algorithmURI }; throw new InvalidTransformException( diff --git a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java index 012d2fb8bc4..8617ac090d4 100644 --- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java +++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java @@ -99,8 +99,10 @@ public class ResourceResolver { ResourceResolver resolverTmp = resolver; if (!resolver.resolverSpi.engineIsThreadSafe()) { try { - resolverTmp = - new ResourceResolver(resolver.resolverSpi.getClass().newInstance()); + @SuppressWarnings("deprecation") + ResourceResolver tmp = new ResourceResolver(resolver.resolverSpi.getClass().newInstance()); + resolverTmp = tmp; + ; } catch (InstantiationException e) { throw new ResourceResolverException("", e, context.attr, context.baseUri); } catch (IllegalAccessException e) { @@ -246,6 +248,7 @@ public class ResourceResolver { public static void register(Class className, boolean start) { JavaUtils.checkRegisterPermission(); try { + @SuppressWarnings("deprecation") ResourceResolverSpi resourceResolverSpi = className.newInstance(); register(resourceResolverSpi, start); } catch (IllegalAccessException e) { diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java index bb762ad0b42..0382620b1c0 100644 --- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java +++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java @@ -121,6 +121,7 @@ public class Translator extends AccessibleContext Class translatorClass = getTranslatorClass(o.getClass()); if (translatorClass != null) { try { + @SuppressWarnings("deprecation") Translator t = (Translator)translatorClass.newInstance(); t.setSource(o); a = t; diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/AbstractCharsetProvider.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/AbstractCharsetProvider.java index 1c60443415b..b15b58080a5 100644 --- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/AbstractCharsetProvider.java +++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/AbstractCharsetProvider.java @@ -148,6 +148,7 @@ public class AbstractCharsetProvider true, this.getClass().getClassLoader()); + @SuppressWarnings("deprecation") Charset cs = (Charset)c.newInstance(); cache.put(csn, new SoftReference(cs)); return cs; diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Util.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Util.java index b5787a712f9..c7b1e3850c0 100644 --- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Util.java +++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Util.java @@ -88,8 +88,9 @@ public final class P11Util { p = Security.getProvider(providerName); if (p == null) { try { - Class clazz = Class.forName(className); - p = (Provider)clazz.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName(className).newInstance(); + p = (Provider)o; } catch (Exception e) { throw new ProviderException ("Could not find provider " + providerName, e); diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java index 890587ad790..3aaf88e2e04 100644 --- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -1446,7 +1446,9 @@ public final class SunPKCS11 extends AuthProvider { } return null; } - return (CallbackHandler)c.newInstance(); + @SuppressWarnings("deprecation") + Object result = c.newInstance(); + return (CallbackHandler)result; } }); // save it diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c index 84abb867db1..6ddbdc2bed2 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c +++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c @@ -650,6 +650,7 @@ JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal unsigned char *bufIn; unsigned char *bufOut; int outLen, rv = 0; + jint rc; context = (crypto_ctx_t *) contextID; @@ -668,22 +669,20 @@ JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal } rv = CipherFinal(context, encrypt, bufOut, 0, &outLen); if (rv) { - free(context); - if (outLen != 0) { - free(bufOut); - } - return -rv; + rc = -rv; } else { - if (bufOut != NULL && outLen != 0) { + if (outLen > 0) { (*env)->SetByteArrayRegion(env, out, outOfs, outLen, (jbyte *)bufOut); - free(bufOut); } - free(context); - return outLen; + rc = outLen; } + free(context); + if (bufOut != (unsigned char *)(&outLen)) { + free(bufOut); + } + return rc; } - /* * Class: com_oracle_security_ucrypto_NativeKey * Method: nativeFree diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java index df3efc92e63..f791c5c9646 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java @@ -89,9 +89,10 @@ public abstract class HttpServerProvider { if (cn == null) return false; try { - Class c = Class.forName(cn, true, - ClassLoader.getSystemClassLoader()); - provider = (HttpServerProvider)c.newInstance(); + @SuppressWarnings("deprecation") + Object o = Class.forName(cn, true, + ClassLoader.getSystemClassLoader()).newInstance(); + provider = (HttpServerProvider)o; return true; } catch (ClassNotFoundException | IllegalAccessException | diff --git a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/TerminalFactory.java b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/TerminalFactory.java index ec7b91ead94..9065d2caebe 100644 --- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/TerminalFactory.java +++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/TerminalFactory.java @@ -82,7 +82,9 @@ public class TerminalFactory } else { try { - t = (Terminal) Thread.currentThread().getContextClassLoader().loadClass(type).newInstance(); + @SuppressWarnings("deprecation") + Object o = Thread.currentThread().getContextClassLoader().loadClass(type).newInstance(); + t = (Terminal) o; } catch (Exception e) { throw new IllegalArgumentException(MessageFormat.format("Invalid terminal type: {0}", type), e); diff --git a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/WindowsTerminal.java b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/WindowsTerminal.java index 69691a8554b..09b1f2f95ab 100644 --- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/WindowsTerminal.java +++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/WindowsTerminal.java @@ -370,7 +370,10 @@ public class WindowsTerminal } } else { // virtual keycodes: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx - // just add support for basic editing keys (no control state, no numpad keys) + // xterm escape codes: E. Moy, S. Gildea and T. Dickey, "XTerm Control Sequences": + // http://invisible-island.net/xterm/ctlseqs/ctlseqs.html + // http://xorg.freedesktop.org/releases/X11R6.8.1/PDF/ctlseqs.pdf + // just add support for basic editing keys and function keys String escapeSequence = null; switch (keyEvent.keyCode) { case 0x21: // VK_PRIOR PageUp @@ -403,6 +406,42 @@ public class WindowsTerminal case 0x2E: // VK_DELETE escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[3~", "\u001B[3;%d~"); break; + case 0x70: // VK_F1 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001BOP", "\u001BO%dP"); + break; + case 0x71: // VK_F2 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001BOQ", "\u001BO%dQ"); + break; + case 0x72: // VK_F3 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001BOR", "\u001BO%dR"); + break; + case 0x73: // VK_F4 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001BOS", "\u001BO%dS"); + break; + case 0x74: // VK_F5 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[15~", "\u001B[15;%d~"); + break; + case 0x75: // VK_F6 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[17~", "\u001B[17;%d~"); + break; + case 0x76: // VK_F7 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[18~", "\u001B[18;%d~"); + break; + case 0x77: // VK_F8 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[19~", "\u001B[19;%d~"); + break; + case 0x78: // VK_F9 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[20~", "\u001B[20;%d~"); + break; + case 0x79: // VK_F10 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[21~", "\u001B[21;%d~"); + break; + case 0x7A: // VK_F11 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[23~", "\u001B[23;%d~"); + break; + case 0x7B: // VK_F12 + escapeSequence = escapeSequence(keyEvent.controlKeyState, "\u001B[24~", "\u001B[24;%d~"); + break; default: break; } diff --git a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/internal/ConsoleRunner.java b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/internal/ConsoleRunner.java index 0ac8d4b69b4..0abbc55eb12 100644 --- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/internal/ConsoleRunner.java +++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/internal/ConsoleRunner.java @@ -61,6 +61,7 @@ public class ConsoleRunner List completorList = new ArrayList(); for (StringTokenizer tok = new StringTokenizer(completors, ","); tok.hasMoreTokens();) { + @SuppressWarnings("deprecation") Object obj = Class.forName(tok.nextToken()).newInstance(); completorList.add((Completer) obj); } diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java index 6c97d25b086..49781d7561d 100644 --- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java +++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java @@ -136,10 +136,10 @@ class GNUStyleOptions { jartool.moduleVersion = Version.parse(arg); } }, - new Option(true, OptionType.CREATE_UPDATE, "--hash-dependencies") { + new Option(true, OptionType.CREATE_UPDATE, "--hash-modules") { void process(Main jartool, String opt, String arg) throws BadArgs { try { - jartool.dependenciesToHash = Pattern.compile(arg); + jartool.modulesToHash = Pattern.compile(arg); } catch (PatternSyntaxException e) { throw new BadArgs("err.badpattern", arg).showUsage(true); } diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java index ffe38159603..0559fff5540 100644 --- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java +++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java @@ -26,21 +26,25 @@ package sun.tools.jar; import java.io.*; +import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Exports; import java.lang.module.ModuleDescriptor.Provides; import java.lang.module.ModuleDescriptor.Requires; import java.lang.module.ModuleDescriptor.Version; import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReader; import java.lang.module.ModuleReference; -import java.lang.reflect.Method; +import java.lang.module.ResolutionException; +import java.lang.module.ResolvedModule; import java.net.URI; import java.nio.file.Path; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; import java.util.function.Consumer; -import java.util.regex.Matcher; +import java.util.function.Function; +import java.util.function.Supplier; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.zip.*; @@ -49,9 +53,12 @@ import java.util.jar.Pack200.*; import java.util.jar.Manifest; import java.text.MessageFormat; -import jdk.internal.module.Hasher; +import jdk.internal.misc.JavaLangModuleAccess; +import jdk.internal.misc.SharedSecrets; +import jdk.internal.module.ModuleHashes; import jdk.internal.module.ModuleInfoExtender; import jdk.internal.util.jar.JarIndex; + import static jdk.internal.util.jar.JarIndex.INDEX_NAME; import static java.util.jar.JarFile.MANIFEST_NAME; import static java.util.stream.Collectors.joining; @@ -117,7 +124,7 @@ class Main { /* Modular jar related options */ boolean printModuleDescriptor; Version moduleVersion; - Pattern dependenciesToHash; + Pattern modulesToHash; ModuleFinder moduleFinder = ModuleFinder.empty(); private static final String MODULE_INFO = "module-info.class"; @@ -241,7 +248,7 @@ class Main { if (isModularJar()) { moduleInfoBytes = addExtendedModuleAttributes( readModuleInfo(moduleInfo)); - } else if (moduleVersion != null || dependenciesToHash != null) { + } else if (moduleVersion != null || modulesToHash != null) { error(getMsg("error.module.options.without.info")); return false; } @@ -801,7 +808,7 @@ class Main { } } else if (isModuleInfoEntry && ((newModuleInfoBytes != null) || (ename != null) - || moduleVersion != null || dependenciesToHash != null)) { + || moduleVersion != null || modulesToHash != null)) { if (newModuleInfoBytes == null) { // Update existing module-info.class newModuleInfoBytes = readModuleInfo(zis); @@ -861,7 +868,7 @@ class Main { if (!updateModuleInfo(newModuleInfoBytes, zos)) { updateOk = false; } - } else if (moduleVersion != null || dependenciesToHash != null) { + } else if (moduleVersion != null || modulesToHash != null) { error(getMsg("error.module.options.without.info")); updateOk = false; } @@ -1642,70 +1649,60 @@ class Main { return false; } - @SuppressWarnings("unchecked") + static String toString(Set set) { + if (set.isEmpty()) { return ""; } + return set.stream().map(e -> e.toString().toLowerCase(Locale.ROOT)) + .collect(joining(" ")); + } + + private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); + private void printModuleDescriptor(InputStream entryInputStream) throws IOException { ModuleDescriptor md = ModuleDescriptor.read(entryInputStream); StringBuilder sb = new StringBuilder(); - sb.append("\nName:\n " + md.toNameAndVersion()); + sb.append("\n").append(md.toNameAndVersion()); - Set requires = md.requires(); - if (!requires.isEmpty()) { - sb.append("\nRequires:"); - requires.forEach(r -> - sb.append("\n ").append(r.name()) - .append(toString(r.modifiers(), " [ ", " ]"))); - } + md.requires().stream() + .sorted(Comparator.comparing(Requires::name)) + .forEach(r -> { + sb.append("\n requires "); + if (!r.modifiers().isEmpty()) + sb.append(toString(r.modifiers())).append(" "); + sb.append(r.name()); + }); - Set s = md.uses(); - if (!s.isEmpty()) { - sb.append("\nUses: "); - s.forEach(sv -> sb.append("\n ").append(sv)); - } + md.uses().stream().sorted() + .forEach(p -> sb.append("\n uses ").append(p)); - Set exports = md.exports(); - if (!exports.isEmpty()) { - sb.append("\nExports:"); - exports.forEach(sv -> sb.append("\n ").append(sv)); - } + md.exports().stream() + .sorted(Comparator.comparing(Exports::source)) + .forEach(p -> sb.append("\n exports ").append(p)); - Map provides = md.provides(); - if (!provides.isEmpty()) { - sb.append("\nProvides: "); - provides.values().forEach(p -> - sb.append("\n ").append(p.service()) - .append(" with ") - .append(toString(p.providers(), "", ""))); - } + md.conceals().stream().sorted() + .forEach(p -> sb.append("\n conceals ").append(p)); - Optional mc = md.mainClass(); - if (mc.isPresent()) - sb.append("\nMain class:\n " + mc.get()); + md.provides().values().stream() + .sorted(Comparator.comparing(Provides::service)) + .forEach(p -> sb.append("\n provides ").append(p.service()) + .append(" with ") + .append(toString(p.providers()))); - s = md.conceals(); - if (!s.isEmpty()) { - sb.append("\nConceals:"); - s.forEach(p -> sb.append("\n ").append(p)); - } + md.mainClass().ifPresent(v -> sb.append("\n main-class " + v)); - try { - Method m = ModuleDescriptor.class.getDeclaredMethod("hashes"); - m.setAccessible(true); - Optional optHashes = - (Optional) m.invoke(md); + md.osName().ifPresent(v -> sb.append("\n operating-system-name " + v)); + + md.osArch().ifPresent(v -> sb.append("\n operating-system-architecture " + v)); + + md.osVersion().ifPresent(v -> sb.append("\n operating-system-version " + v)); + + JLMA.hashes(md).ifPresent(hashes -> + hashes.names().stream().sorted().forEach( + mod -> sb.append("\n hashes ").append(mod).append(" ") + .append(hashes.algorithm()).append(" ") + .append(hashes.hashFor(mod)))); - if (optHashes.isPresent()) { - Hasher.DependencyHashes hashes = optHashes.get(); - sb.append("\nHashes:"); - sb.append("\n Algorithm: " + hashes.algorithm()); - hashes.names().stream().forEach(mod -> - sb.append("\n ").append(mod) - .append(": ").append(hashes.hashFor(mod))); - } - } catch (ReflectiveOperationException x) { - throw new InternalError(x); - } output(sb.toString()); } @@ -1751,7 +1748,6 @@ class Main { md = ModuleDescriptor.read(in); } String name = md.name(); - Set dependences = md.requires(); Set exported = md.exports() .stream() .map(ModuleDescriptor.Exports::source) @@ -1778,9 +1774,17 @@ class Main { if (moduleVersion != null) extender.version(moduleVersion); - // --hash-dependencies - if (dependenciesToHash != null) - extender.hashes(hashDependences(name, dependences)); + // --hash-modules + if (modulesToHash != null) { + Hasher hasher = new Hasher(md, fname); + ModuleHashes moduleHashes = hasher.computeHashes(name); + if (moduleHashes != null) { + extender.hashes(moduleHashes); + } else { + // should it issue warning or silent? + System.out.println("warning: no module is recorded in hash in " + name); + } + } extender.write(baos); return baos.toByteArray(); @@ -1788,36 +1792,156 @@ class Main { } /** - * Examines the module dependences of the given module and computes the - * hash of any module that matches the pattern {@code dependenciesToHash}. + * Compute and record hashes */ - private Hasher.DependencyHashes - hashDependences(String name, - Set moduleDependences) - throws IOException - { - Map map = new HashMap<>(); - Matcher matcher = dependenciesToHash.matcher(""); - for (ModuleDescriptor.Requires md: moduleDependences) { - String dn = md.name(); - if (matcher.reset(dn).find()) { - Optional omref = moduleFinder.find(dn); - if (!omref.isPresent()) { - throw new IOException(formatMsg2("error.hash.dep", name , dn)); - } - map.put(dn, modRefToPath(omref.get())); + private class Hasher { + final ModuleFinder finder; + final Map moduleNameToPath; + final Set modules; + final Configuration configuration; + Hasher(ModuleDescriptor descriptor, String fname) throws IOException { + // Create a module finder that finds the modular JAR + // being created/updated + URI uri = Paths.get(fname).toUri(); + ModuleReference mref = new ModuleReference(descriptor, uri, + new Supplier<>() { + @Override + public ModuleReader get() { + throw new UnsupportedOperationException("should not reach here"); + } + }); + + // Compose a module finder with the module path and + // the modular JAR being created or updated + this.finder = ModuleFinder.compose(moduleFinder, + new ModuleFinder() { + @Override + public Optional find(String name) { + if (descriptor.name().equals(name)) + return Optional.of(mref); + else + return Optional.empty(); + } + + @Override + public Set findAll() { + return Collections.singleton(mref); + } + }); + + // Determine the modules that matches the modulesToHash pattern + this.modules = moduleFinder.findAll().stream() + .map(moduleReference -> moduleReference.descriptor().name()) + .filter(mn -> modulesToHash.matcher(mn).find()) + .collect(Collectors.toSet()); + + // a map from a module name to Path of the modular JAR + this.moduleNameToPath = moduleFinder.findAll().stream() + .map(ModuleReference::descriptor) + .map(ModuleDescriptor::name) + .collect(Collectors.toMap(Function.identity(), mn -> moduleToPath(mn))); + + Configuration config = null; + try { + config = Configuration.empty() + .resolveRequires(ModuleFinder.ofSystem(), finder, modules); + } catch (ResolutionException e) { + // should it throw an error? or emit a warning + System.out.println("warning: " + e.getMessage()); } + this.configuration = config; } - if (map.size() == 0) { - return null; - } else { - return Hasher.generate(map, "SHA-256"); - } - } + /** + * Compute hashes of the modules that depend upon the specified + * module directly or indirectly. + */ + ModuleHashes computeHashes(String name) { + // the transposed graph includes all modules in the resolved graph + Map> graph = transpose(); - private static Path modRefToPath(ModuleReference mref) { - URI location = mref.location().get(); - return Paths.get(location); + // find the modules that transitively depend upon the specified name + Deque deque = new ArrayDeque<>(); + deque.add(name); + Set mods = visitNodes(graph, deque); + + // filter modules matching the pattern specified --hash-modules + // as well as itself as the jmod file is being generated + Map modulesForHash = mods.stream() + .filter(mn -> !mn.equals(name) && modules.contains(mn)) + .collect(Collectors.toMap(Function.identity(), moduleNameToPath::get)); + + if (modulesForHash.isEmpty()) + return null; + + return ModuleHashes.generate(modulesForHash, "SHA-256"); + } + + /** + * Returns all nodes traversed from the given roots. + */ + private Set visitNodes(Map> graph, + Deque roots) { + Set visited = new HashSet<>(); + while (!roots.isEmpty()) { + String mn = roots.pop(); + if (!visited.contains(mn)) { + visited.add(mn); + + // the given roots may not be part of the graph + if (graph.containsKey(mn)) { + for (String dm : graph.get(mn)) { + if (!visited.contains(dm)) + roots.push(dm); + } + } + } + } + return visited; + } + + /** + * Returns a transposed graph from the resolved module graph. + */ + private Map> transpose() { + Map> transposedGraph = new HashMap<>(); + Deque deque = new ArrayDeque<>(modules); + + Set visited = new HashSet<>(); + while (!deque.isEmpty()) { + String mn = deque.pop(); + if (!visited.contains(mn)) { + visited.add(mn); + + // add an empty set + transposedGraph.computeIfAbsent(mn, _k -> new HashSet<>()); + + ResolvedModule resolvedModule = configuration.findModule(mn).get(); + for (ResolvedModule dm : resolvedModule.reads()) { + String name = dm.name(); + if (!visited.contains(name)) { + deque.push(name); + } + // reverse edge + transposedGraph.computeIfAbsent(name, _k -> new HashSet<>()) + .add(mn); + } + } + } + return transposedGraph; + } + + private Path moduleToPath(String name) { + ModuleReference mref = moduleFinder.find(name).orElseThrow( + () -> new InternalError(formatMsg2("error.hash.dep",name , name))); + + URI uri = mref.location().get(); + Path path = Paths.get(uri); + String fn = path.getFileName().toString(); + if (!fn.endsWith(".jar")) { + throw new UnsupportedOperationException(path + " is not a modular JAR"); + } + return path; + } } } diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties index a880d9f1592..0b21bca8c06 100644 --- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties +++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties @@ -57,7 +57,7 @@ error.create.tempfile=\ error.hash.dep=\ Hashing module {0} dependences, unable to find module {1} on module path error.module.options.without.info=\ - One of --module-version or --hash-dependencies without module-info.class + One of --module-version or --hash-modules without module-info.class error.unexpected.module-info=\ Unexpected module descriptor {0} error.module.descriptor.not.found=\ @@ -178,11 +178,11 @@ main.help.opt.create.update.no-manifest=\ main.help.opt.create.update.module-version=\ \ --module-version=VERSION The module version, when creating a modular\n\ \ jar, or updating a non-modular jar -main.help.opt.create.update.hash-dependencies=\ -\ --hash-dependencies=PATTERN Compute and record the hashes of module\n\ -\ dependencies matched by the given pattern, when\n\ -\ creating a modular jar, or updating a non-modular\n\ -\ jar +main.help.opt.create.update.hash-modules=\ +\ --hash-modules=PATTERN Compute and record the hashes of modules \n\ +\ matched by the given pattern and that depend upon\n\ +\ directly or indirectly on a modular jar being\n\ +\ created or a non-modular jar being updated main.help.opt.create.update.modulepath=\ \ --modulepath Location of module dependence for generating \ the hash @@ -201,7 +201,7 @@ main.help.postopt=\ \ located in the root of the given directories, or the root of the jar archive\n\ \ itself. The following operations are only valid when creating a modular jar,\n\ \ or updating an existing non-modular jar: '--module-version',\n\ -\ '--hash-dependencies', and '--modulepath'.\n\ +\ '--hash-modules', and '--modulepath'.\n\ \n\ \ Mandatory or optional arguments to long options are also mandatory or optional\n\ \ for any corresponding short options. \ No newline at end of file diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java index 35d209a690f..bd70473ceae 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java @@ -128,7 +128,9 @@ public class ProcessAttachingConnector if (lib.equals("dt_shmem")) { try { Class c = Class.forName("com.sun.tools.jdi.SharedMemoryTransportService"); - ts = (TransportService)c.newInstance(); + @SuppressWarnings("deprecation") + Object tmp = c.newInstance(); + ts = (TransportService)tmp; } catch (Exception x) { } } } diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java index 525a8404fd4..255fa173646 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java @@ -53,17 +53,19 @@ public class RawCommandLineLauncher extends AbstractLauncher implements Launchin super(); try { - Class c = Class.forName("com.sun.tools.jdi.SharedMemoryTransportService"); - transportService = (TransportService)c.newInstance(); + @SuppressWarnings("deprecation") + Object o = + Class.forName("com.sun.tools.jdi.SharedMemoryTransportService").newInstance(); + transportService = (TransportService)o; transport = new Transport() { public String name() { return "dt_shmem"; } }; - } catch (ClassNotFoundException x) { - } catch (UnsatisfiedLinkError x) { - } catch (InstantiationException x) { - } catch (IllegalAccessException x) { + } catch (ClassNotFoundException | + UnsatisfiedLinkError | + InstantiationException | + IllegalAccessException x) { }; if (transportService == null) { diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java index 84a14557b30..9996c07353b 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java @@ -64,18 +64,20 @@ public class SunCommandLineLauncher extends AbstractLauncher implements Launchin * transport or the socket transport */ try { - Class c = Class.forName("com.sun.tools.jdi.SharedMemoryTransportService"); - transportService = (TransportService)c.newInstance(); + @SuppressWarnings("deprecation") + Object o = + Class.forName("com.sun.tools.jdi.SharedMemoryTransportService").newInstance(); + transportService = (TransportService)o; transport = new Transport() { public String name() { return "dt_shmem"; } }; usingSharedMemory = true; - } catch (ClassNotFoundException x) { - } catch (UnsatisfiedLinkError x) { - } catch (InstantiationException x) { - } catch (IllegalAccessException x) { + } catch (ClassNotFoundException | + UnsatisfiedLinkError | + InstantiationException | + IllegalAccessException x) { }; if (transportService == null) { transportService = new SocketTransportService(); diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java index eb1e057d182..a3943145c06 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java @@ -95,27 +95,23 @@ public class DefaultImageBuilder implements ImageBuilder { private final Path root; private final Path mdir; - private final boolean genBom; private final Set modules = new HashSet<>(); /** * Default image builder constructor. * - * @param genBom true, generates a bom file. * @param root The image root directory. * @throws IOException */ - public DefaultImageBuilder(boolean genBom, Path root) throws IOException { + public DefaultImageBuilder(Path root) throws IOException { Objects.requireNonNull(root); - this.genBom = genBom; - this.root = root; this.mdir = root.resolve("lib"); Files.createDirectories(mdir); } - private void storeFiles(Set modules, String bom, Properties release) throws IOException { + private void storeFiles(Set modules, Properties release) throws IOException { if (release != null) { addModules(release, modules); File r = new File(root.toFile(), "release"); @@ -123,11 +119,6 @@ public class DefaultImageBuilder implements ImageBuilder { release.store(fo, null); } } - // Generate bom - if (genBom) { - File bomFile = new File(root.toFile(), "bom"); - createUtf8File(bomFile, bom); - } } private void addModules(Properties release, Set modules) throws IOException { @@ -144,7 +135,7 @@ public class DefaultImageBuilder implements ImageBuilder { } @Override - public void storeFiles(Pool files, String bom, Properties release) { + public void storeFiles(Pool files, Properties release) { try { for (ModuleData f : files.getContent()) { if (!f.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) { @@ -161,7 +152,7 @@ public class DefaultImageBuilder implements ImageBuilder { modules.add(m.getName()); } } - storeFiles(modules, bom, release); + storeFiles(modules, release); if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) { // launchers in the bin directory need execute permission @@ -190,8 +181,8 @@ public class DefaultImageBuilder implements ImageBuilder { } @Override - public void storeFiles(Pool files, String bom) { - storeFiles(files, bom, new Properties()); + public void storeFiles(Pool files) { + storeFiles(files, new Properties()); } /** @@ -213,28 +204,48 @@ public class DefaultImageBuilder implements ImageBuilder { mainClass = ModuleDescriptor.read(stream).mainClass(); if (mainClass.isPresent()) { Path cmd = root.resolve("bin").resolve(module); - if (!Files.exists(cmd)) { - StringBuilder sb = new StringBuilder(); - sb.append("#!/bin/sh") - .append("\n"); - sb.append("JLINK_VM_OPTIONS=") - .append("\n"); - sb.append("DIR=`dirname $0`") - .append("\n"); - sb.append("$DIR/java $JLINK_VM_OPTIONS -m ") + // generate shell script for Unix platforms + StringBuilder sb = new StringBuilder(); + sb.append("#!/bin/sh") + .append("\n"); + sb.append("JLINK_VM_OPTIONS=") + .append("\n"); + sb.append("DIR=`dirname $0`") + .append("\n"); + sb.append("$DIR/java $JLINK_VM_OPTIONS -m ") + .append(module).append('/') + .append(mainClass.get()) + .append(" $@\n"); + + try (BufferedWriter writer = Files.newBufferedWriter(cmd, + StandardCharsets.ISO_8859_1, + StandardOpenOption.CREATE_NEW)) { + writer.write(sb.toString()); + } + if (Files.getFileStore(root.resolve("bin")) + .supportsFileAttributeView(PosixFileAttributeView.class)) { + setExecutable(cmd); + } + // generate .bat file for Windows + if (isWindows()) { + Path bat = root.resolve("bin").resolve(module + ".bat"); + sb = new StringBuilder(); + sb.append("@echo off") + .append("\r\n"); + sb.append("set JLINK_VM_OPTIONS=") + .append("\r\n"); + sb.append("set DIR=%~dp0") + .append("\r\n"); + sb.append("\"%DIR%\\java\" %JLINK_VM_OPTIONS% -m ") .append(module).append('/') .append(mainClass.get()) - .append(" $@\n"); + .append(" %*\r\n"); - try (BufferedWriter writer = Files.newBufferedWriter(cmd, + try (BufferedWriter writer = Files.newBufferedWriter(bat, StandardCharsets.ISO_8859_1, StandardOpenOption.CREATE_NEW)) { writer.write(sb.toString()); } - if (Files.getFileStore(root.resolve("bin")) - .supportsFileAttributeView(PosixFileAttributeView.class)) { - setExecutable(cmd); - } } } } diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java index 5942bd64c85..dc0bf71c535 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java @@ -42,22 +42,20 @@ public interface ImageBuilder { * Store the external files. * * @param content Pool of module content. - * @param bom The options used to build the image file. * @param release the release properties * @throws PluginException */ - public default void storeFiles(Pool content, String bom, Properties release) { - storeFiles(content, bom); + public default void storeFiles(Pool content, Properties release) { + storeFiles(content); } /** * Store the external files. * * @param content Pool of module content. - * @param bom The options used to build the image file. * @throws PluginException */ - public default void storeFiles(Pool content, String bom) { + public default void storeFiles(Pool content) { throw new UnsupportedOperationException("storeFiles"); } diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java index 6246e29afc2..e0347e52a21 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java @@ -88,7 +88,7 @@ public final class ImageFileCreator { ByteOrder byteOrder) throws IOException { return ImageFileCreator.create(archives, byteOrder, - new ImagePluginStack(null)); + new ImagePluginStack()); } public static ExecutableImage create(Set archives, diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java index ac96a796f5b..7bd631a8c72 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java @@ -68,20 +68,13 @@ public final class ImagePluginConfiguration { private ImagePluginConfiguration() { } - public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration plugins) - throws Exception { - return parseConfiguration(plugins, null); - } - /* * Create a stack of plugins from a a configuration. - * */ - public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration pluginsConfiguration, - String bom) + public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration pluginsConfiguration) throws Exception { if (pluginsConfiguration == null) { - return new ImagePluginStack(bom); + return new ImagePluginStack(); } Map> plugins = new LinkedHashMap<>(); for (Plugin.CATEGORY cat : CATEGORIES_ORDER) { @@ -150,7 +143,7 @@ public final class ImagePluginConfiguration { } @Override - public void storeFiles(Pool files, String bom) { + public void storeFiles(Pool files) { throw new PluginException("No directory setup to store files"); } }; @@ -158,6 +151,6 @@ public final class ImagePluginConfiguration { PluginContext ctxt = pluginsConfiguration.getPluginContext(); return new ImagePluginStack(builder, transformerPlugins, - lastSorter, postProcessingPlugins, ctxt, bom); + lastSorter, postProcessingPlugins, ctxt); } } diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java index 646cc5ce558..6a5db82ccdf 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java @@ -167,28 +167,25 @@ public final class ImagePluginStack { private final ImageBuilder imageBuilder; private final Properties release; - private final String bom; - public ImagePluginStack(String bom) { + public ImagePluginStack() { this(null, Collections.emptyList(), null, - Collections.emptyList(), null, bom); + Collections.emptyList(), null); } public ImagePluginStack(ImageBuilder imageBuilder, List contentPlugins, Plugin lastSorter, - List postprocessingPlugins, - String bom) { + List postprocessingPlugins) { this(imageBuilder, contentPlugins, lastSorter, - postprocessingPlugins, null, bom); + postprocessingPlugins, null); } public ImagePluginStack(ImageBuilder imageBuilder, List contentPlugins, Plugin lastSorter, List postprocessingPlugins, - PluginContext ctxt, - String bom) { + PluginContext ctxt) { Objects.requireNonNull(contentPlugins); this.lastSorter = lastSorter; for (TransformerPlugin p : contentPlugins) { @@ -204,7 +201,6 @@ public final class ImagePluginStack { } this.imageBuilder = imageBuilder; this.release = ctxt != null? ctxt.getReleaseProperties() : new Properties(); - this.bom = bom; } public void operate(ImageProvider provider) throws Exception { @@ -479,7 +475,7 @@ public final class ImagePluginStack { } catch (Exception ignored) { } - imageBuilder.storeFiles(new LastPool(transformed), bom, release); + imageBuilder.storeFiles(new LastPool(transformed), release); } public ExecutableImage getExecutableImage() throws IOException { diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java index e3b225ff305..a5b4ba6e4a9 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java @@ -70,6 +70,7 @@ import jdk.tools.jlink.plugin.Plugin; * ## Should use jdk.joptsimple some day. */ public class JlinkTask { + private static final boolean DEBUG = Boolean.getBoolean("jlink.debug"); private static void fail(Class type, String format, @@ -142,9 +143,6 @@ public class JlinkTask { } task.options.packagedModulesPath = path; }, true, "--keep-packaged-modules"), - new Option(false, (task, opt, arg) -> { - task.options.genbom = true; - }, true, "--genbom"), new Option(true, (task, opt, arg) -> { task.options.saveoptsfile = arg; }, "--saveopts"), @@ -175,7 +173,6 @@ public class JlinkTask { static class OptionsValues { boolean help; - boolean genbom; String saveoptsfile; boolean version; boolean fullVersion; @@ -219,18 +216,24 @@ public class JlinkTask { } return EXIT_OK; - } catch (UncheckedIOException | PluginException | IOException | ResolutionException e) { + } catch (UncheckedIOException | PluginException | IllegalArgumentException | + IOException | ResolutionException e) { log.println(taskHelper.getMessage("error.prefix") + " " + e.getMessage()); - log.println(taskHelper.getMessage("main.usage.summary", PROGNAME)); + if (DEBUG) { + e.printStackTrace(log); + } return EXIT_ERROR; } catch (BadArgs e) { taskHelper.reportError(e.key, e.args); if (e.showUsage) { log.println(taskHelper.getMessage("main.usage.summary", PROGNAME)); } + if (DEBUG) { + e.printStackTrace(log); + } return EXIT_CMDERR; } catch (Throwable x) { - log.println(taskHelper.getMessage("main.msg.bug")); + log.println(taskHelper.getMessage("error.prefix") + " " + x.getMessage()); x.printStackTrace(log); return EXIT_ABNORMAL; } finally { @@ -238,16 +241,6 @@ public class JlinkTask { } } - private static Map modulesToPath(Configuration cf) { - Map modPaths = new HashMap<>(); - for (ResolvedModule resolvedModule : cf.modules()) { - ModuleReference mref = resolvedModule.reference(); - URI uri = mref.location().get(); - modPaths.put(mref.descriptor().name(), Paths.get(uri)); - } - return modPaths; - } - /* * Jlink API entry point. */ @@ -275,8 +268,7 @@ public class JlinkTask { null); // Then create the Plugin Stack - ImagePluginStack stack = ImagePluginConfiguration.parseConfiguration(plugins, - genBOMContent(config, plugins)); + ImagePluginStack stack = ImagePluginConfiguration.parseConfiguration(plugins); //Ask the stack to proceed; stack.operate(imageProvider); @@ -297,7 +289,7 @@ public class JlinkTask { } private void postProcessOnly(Path existingImage) throws Exception { - PluginsConfiguration config = taskHelper.getPluginsConfig(null, false); + PluginsConfiguration config = taskHelper.getPluginsConfig(null); ExecutableImage img = DefaultImageBuilder.getExecutableImage(existingImage); if (img == null) { throw taskHelper.newBadArgs("err.existing.image.invalid"); @@ -327,8 +319,7 @@ public class JlinkTask { // Then create the Plugin Stack ImagePluginStack stack = ImagePluginConfiguration. - parseConfiguration(taskHelper.getPluginsConfig(options.output, options.genbom), - genBOMContent()); + parseConfiguration(taskHelper.getPluginsConfig(options.output)); //Ask the stack to proceed stack.operate(imageProvider); @@ -358,6 +349,15 @@ public class JlinkTask { return finder; } + + private static Path toPathLocation(ResolvedModule m) { + Optional ouri = m.reference().location(); + if (!ouri.isPresent()) + throw new InternalError(m + " does not have a location"); + URI uri = ouri.get(); + return Paths.get(uri); + } + private static ImageProvider createImageProvider(ModuleFinder finder, Set addMods, Set limitMods, @@ -374,7 +374,8 @@ public class JlinkTask { ModuleFinder.empty(), addMods); - Map mods = modulesToPath(cf); + Map mods = cf.modules().stream() + .collect(Collectors.toMap(ResolvedModule::name, JlinkTask::toPathLocation)); return new ImageHelper(cf, mods, order, retainModulesPath); } @@ -399,21 +400,15 @@ public class JlinkTask { map.put(mref.descriptor().name(), mref); }); + // add the other modules + otherMods.stream() + .map(finder::find) + .flatMap(Optional::stream) + .forEach(mref -> map.putIfAbsent(mref.descriptor().name(), mref)); + // set of modules that are observable Set mrefs = new HashSet<>(map.values()); - // add the other modules - for (String mod : otherMods) { - Optional omref = finder.find(mod); - if (omref.isPresent()) { - ModuleReference mref = omref.get(); - map.putIfAbsent(mod, mref); - mrefs.add(mref); - } else { - // no need to fail - } - } - return new ModuleFinder() { @Override public Optional find(String name) { diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java index 11df906f292..31064ab79d6 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java @@ -337,8 +337,8 @@ public final class TaskHelper { return null; } - private PluginsConfiguration getPluginsConfig(Path output, - boolean genbom) throws IOException, BadArgs { + private PluginsConfiguration getPluginsConfig(Path output + ) throws IOException, BadArgs { if (output != null) { if (Files.exists(output)) { throw new PluginException(PluginsResourceBundle. @@ -367,7 +367,7 @@ public final class TaskHelper { // recreate or postprocessing don't require an output directory. ImageBuilder builder = null; if (output != null) { - builder = new DefaultImageBuilder(genbom, output); + builder = new DefaultImageBuilder(output); } return new Jlink.PluginsConfiguration(pluginsList, @@ -676,9 +676,9 @@ public final class TaskHelper { + bundleHelper.getMessage(key, args)); } - public PluginsConfiguration getPluginsConfig(Path output, boolean genbom) + public PluginsConfiguration getPluginsConfig(Path output) throws IOException, BadArgs { - return pluginOptions.getPluginsConfig(output, genbom); + return pluginOptions.getPluginsConfig(output); } public Path getExistingImage() { diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java index fb785da54b7..e448acd0b1d 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java @@ -139,7 +139,7 @@ public final class AppRuntimeImageBuilder { // build the image Jlink.PluginsConfiguration pluginConfig = new Jlink.PluginsConfiguration( - plugins, new DefaultImageBuilder(true, outputDir), null); + plugins, new DefaultImageBuilder(outputDir), null); Jlink jlink = new Jlink(); jlink.build(jlinkConfig, pluginConfig); } diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java index e29f42eb6a2..aa068f1136e 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java @@ -125,7 +125,7 @@ public final class DefaultCompressPlugin implements TransformerPlugin, ResourceP zip = new ZipPlugin(resFilter); break; default: - throw new PluginException("Invalid level " + level); + throw new IllegalArgumentException("Invalid compression level " + level); } } else { ss = new StringSharingPlugin(resFilter); diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java index 185906d4c82..4d502904c37 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java @@ -208,7 +208,7 @@ public final class ExcludeVMPlugin implements TransformerPlugin { break; } default: { - throw new PluginException("Unknown option " + value); + throw new IllegalArgumentException("Unknown exclude VM option: " + value); } } predicate = new ResourceFilter(Utils.listParser.apply(exclude), true); diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java index 4630d0992eb..b8b7aa46cc1 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java @@ -164,7 +164,7 @@ public final class IncludeLocalesPlugin implements TransformerPlugin, ResourcePr try { return new Locale.LanguageRange(s); } catch (IllegalArgumentException iae) { - throw new PluginException(String.format( + throw new IllegalArgumentException(String.format( PluginsResourceBundle.getMessage(NAME + ".invalidtag"), s)); } }) @@ -177,24 +177,28 @@ public final class IncludeLocalesPlugin implements TransformerPlugin, ResourcePr Pool.Module module = resources.getModule(MODULENAME); // jdk.localedata module validation - Set packages = module.getAllPackages(); - if (!packages.containsAll(LOCALEDATA_PACKAGES)) { - throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".missingpackages") + - LOCALEDATA_PACKAGES.stream() - .filter(pn -> !packages.contains(pn)) - .collect(Collectors.joining(",\n\t"))); + if (module != null) { + Set packages = module.getAllPackages(); + if (!packages.containsAll(LOCALEDATA_PACKAGES)) { + throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".missingpackages") + + LOCALEDATA_PACKAGES.stream() + .filter(pn -> !packages.contains(pn)) + .collect(Collectors.joining(",\n\t"))); + } + + available = Stream.concat(module.getContent().stream() + .map(md -> p.matcher(md.getPath())) + .filter(m -> m.matches()) + .map(m -> m.group("tag").replaceAll("_", "-")), + Stream.concat(Stream.of(jaJPJPTag), Stream.of(thTHTHTag))) + .distinct() + .sorted() + .map(IncludeLocalesPlugin::tagToLocale) + .collect(Collectors.toList()); + } else { + // jdk.localedata is not added. + throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".localedatanotfound")); } - - available = Stream.concat(module.getContent().stream() - .map(md -> p.matcher(md.getPath())) - .filter(m -> m.matches()) - .map(m -> m.group("tag").replaceAll("_", "-")), - Stream.concat(Stream.of(jaJPJPTag), Stream.of(thTHTHTag))) - .distinct() - .sorted() - .map(IncludeLocalesPlugin::tagToLocale) - .collect(Collectors.toList()); - filtered = filterLocales(available); if (filtered.isEmpty()) { diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java index bd0a9a74f4b..4f8e5eade53 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java @@ -273,7 +273,7 @@ public final class OptimizationPlugin extends AsmPlugin { } else if (s.equals(FORNAME_REMOVAL)) { optimizers.add(new ForNameFolding()); } else { - throw new PluginException("Unknown optimization"); + throw new IllegalArgumentException("Unknown optimization: " + s); } } String f = config.get(LOG); diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java index edf6475cb4b..f4cba7607ea 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java @@ -39,6 +39,8 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; +import jdk.internal.misc.JavaLangModuleAccess; +import jdk.internal.misc.SharedSecrets; import jdk.internal.module.Checks; import jdk.internal.module.ModuleInfoExtender; import jdk.internal.module.SystemModules; @@ -50,6 +52,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; import jdk.tools.jlink.plugin.PluginException; import jdk.tools.jlink.plugin.Pool; import jdk.tools.jlink.plugin.TransformerPlugin; +import jdk.tools.jlink.internal.plugins.SystemModuleDescriptorPlugin.Builder.*; /** * Jlink plugin to reconstitute module descriptors for installed modules. @@ -63,6 +66,8 @@ import jdk.tools.jlink.plugin.TransformerPlugin; * @see SystemModules */ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { + private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); + // TODO: packager has the dependency on the plugin name // Keep it as "--installed-modules" until packager removes such // dependency (should not need to specify this plugin since it @@ -118,7 +123,8 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { Pool.ModuleData data = module.get("module-info.class"); if (data == null) { // automatic module not supported yet - throw new PluginException("module-info.class not found for " + module.getName() + " module"); + throw new PluginException("module-info.class not found for " + + module.getName() + " module"); } assert module.getName().equals(data.getModule()); try { @@ -126,15 +132,20 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { ModuleDescriptor md = ModuleDescriptor.read(bain); validateNames(md); - Builder.ModuleDescriptorBuilder mbuilder = builder.module(md, module.getAllPackages()); + ModuleDescriptorBuilder mbuilder = builder.module(md, module.getAllPackages()); + int packages = md.exports().size() + md.conceals().size(); if (md.conceals().isEmpty() && - (md.exports().size() + md.conceals().size()) != module.getAllPackages().size()) { + packages != module.getAllPackages().size()) { // add ConcealedPackages attribute if not exist bain.reset(); - ModuleInfoRewriter minfoWriter = new ModuleInfoRewriter(bain, mbuilder.conceals()); + ModuleInfoRewriter minfoWriter = + new ModuleInfoRewriter(bain, mbuilder.conceals()); // replace with the overridden version - data = new Pool.ModuleData(data.getModule(), data.getPath(), data.getType(), - minfoWriter.stream(), minfoWriter.size()); + data = new Pool.ModuleData(data.getModule(), + data.getPath(), + data.getType(), + minfoWriter.stream(), + minfoWriter.size()); } out.add(data); } catch (IOException e) { @@ -151,8 +162,12 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { if (builder.isOverriddenClass(data.getPath())) { byte[] bytes = cwriter.toByteArray(); - Pool.ModuleData ndata = new Pool.ModuleData(data.getModule(), data.getPath(), data.getType(), - new ByteArrayInputStream(bytes), bytes.length); + Pool.ModuleData ndata = + new Pool.ModuleData(data.getModule(), + data.getPath(), + data.getType(), + new ByteArrayInputStream(bytes), + bytes.length); out.add(ndata); } else { out.add(data); @@ -230,6 +245,7 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { // static variables in SystemModules class private static final String MODULE_NAMES = "MODULE_NAMES"; + private static final String MODULES_TO_HASH = "MODULES_TO_HASH"; private static final String PACKAGE_COUNT = "PACKAGES_IN_BOOT_LAYER"; private static final int BUILDER_VAR = 0; @@ -246,6 +262,9 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { // list of all ModuleDescriptorBuilders, invoked in turn when building. private final List builders = new ArrayList<>(); + // module name to hash + private final Map modulesToHash = new HashMap<>(); + // map Set to a specialized builder to allow them to be // deduplicated as they are requested private final Map, StringSetBuilder> stringSets = new HashMap<>(); @@ -268,6 +287,11 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { "[Ljava/lang/String;", null, null) .visitEnd(); + // public static String[] MODULES_TO_HASH = new String[] {....}; + cw.visitField(ACC_PUBLIC+ACC_FINAL+ACC_STATIC, MODULES_TO_HASH, + "[Ljava/lang/String;", null, null) + .visitEnd(); + // public static int PACKAGES_IN_BOOT_LAYER; cw.visitField(ACC_PUBLIC+ACC_FINAL+ACC_STATIC, PACKAGE_COUNT, "I", null, numPackages) @@ -283,15 +307,35 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { int index = 0; for (ModuleDescriptorBuilder builder : builders) { - mv.visitInsn(DUP); // arrayref + mv.visitInsn(DUP); // arrayref pushInt(index++); - mv.visitLdcInsn(builder.md.name()); // value + mv.visitLdcInsn(builder.md.name()); // value mv.visitInsn(AASTORE); } mv.visitFieldInsn(PUTSTATIC, CLASSNAME, MODULE_NAMES, "[Ljava/lang/String;"); + // create the MODULES_TO_HASH array + pushInt(numModules); + mv.visitTypeInsn(ANEWARRAY, "java/lang/String"); + + index = 0; + for (ModuleDescriptorBuilder builder : builders) { + String mn = builder.md.name(); + String recordedHash = modulesToHash.get(mn); + if (recordedHash != null) { + mv.visitInsn(DUP); // arrayref + pushInt(index); + mv.visitLdcInsn(recordedHash); // value + mv.visitInsn(AASTORE); + } + index++; + } + + mv.visitFieldInsn(PUTSTATIC, CLASSNAME, MODULES_TO_HASH, + "[Ljava/lang/String;"); + mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); @@ -315,15 +359,19 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { } } - // provides + // provides (preserve iteration order) for (ModuleDescriptor.Provides p : md.provides().values()) { - stringSets.computeIfAbsent(p.providers(), s -> new StringSetBuilder(s)) + stringSets.computeIfAbsent(p.providers(), s -> new StringSetBuilder(s, true)) .increment(); } // uses stringSets.computeIfAbsent(md.uses(), s -> new StringSetBuilder(s)) .increment(); + + // hashes + JLMA.hashes(md).ifPresent(mh -> modulesToHash.putAll(mh.hashes())); + return builder; } @@ -484,13 +532,17 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { conceals(pn); } - if (md.version().isPresent()) { - version(md.version().get()); - } + // version + md.version().ifPresent(this::version); - if (md.mainClass().isPresent()) { - mainClass(md.mainClass().get()); - } + // main class + md.mainClass().ifPresent(this::mainClass); + + // hashes + JLMA.hashes(md).ifPresent(mh -> { + algorithm(mh.algorithm()); + mh.names().forEach(mn -> moduleHash(mn, mh.hashFor(mn))); + }); putModuleDescriptor(); } @@ -603,7 +655,7 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { /* * Invoke Builder.provides(String service, Set providers) * - * Set providers = new HashSet<>(); + * Set providers = new LinkedHashSet<>(); * providers.add(impl); * : * : @@ -652,6 +704,22 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { mv.visitInsn(POP); } + void algorithm(String alg) { + mv.visitVarInsn(ALOAD, BUILDER_VAR); + mv.visitLdcInsn(alg); + mv.visitMethodInsn(INVOKEVIRTUAL, MODULE_DESCRIPTOR_BUILDER, + "algorithm", STRING_SIG, false); + mv.visitInsn(POP); + } + + void moduleHash(String name, String hashString) { + mv.visitVarInsn(ALOAD, BUILDER_VAR); + mv.visitLdcInsn(name); + mv.visitLdcInsn(hashString); + mv.visitMethodInsn(INVOKEVIRTUAL, MODULE_DESCRIPTOR_BUILDER, + "moduleHash", STRING_STRING_SIG, false); + mv.visitInsn(POP); + } } /* @@ -663,10 +731,17 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { */ class StringSetBuilder { final Set names; + final boolean linked; int refCount; int localVarIndex; - StringSetBuilder(Set names) { + + StringSetBuilder(Set names, boolean linked) { this.names = names; + this.linked = linked; + } + + StringSetBuilder(Set names) { + this(names, false); } void increment() { @@ -704,11 +779,11 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin { "singleton", "(Ljava/lang/Object;)Ljava/util/Set;", false); mv.visitVarInsn(ASTORE, index); } else { - mv.visitTypeInsn(NEW, "java/util/HashSet"); + String cn = linked ? "java/util/LinkedHashSet" : "java/util/HashSet"; + mv.visitTypeInsn(NEW, cn); mv.visitInsn(DUP); pushInt(initialCapacity(names.size())); - mv.visitMethodInsn(INVOKESPECIAL, "java/util/HashSet", - "", "(I)V", false); + mv.visitMethodInsn(INVOKESPECIAL, cn, "", "(I)V", false); mv.visitVarInsn(ASTORE, index); for (String t : names) { diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java index 6027866d438..56e51bc9bc5 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java @@ -201,6 +201,8 @@ public interface Plugin { * This method is called prior to invoke the plugin. * * @param config The plugin configuration. + * @throws IllegalArgumentException if a mandatory argument is missing or + * if an argument has invalid value. */ public default void configure(Map config) { } @@ -211,6 +213,9 @@ public interface Plugin { * * @param config The plugin configuration. * @param ctx The plugin context + * @throws IllegalArgumentException if a mandatory argument is missing or + * if an argument has invalid value. + * */ public default void configure(Map config, PluginContext ctx) { configure(config); diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties index c97dc206d11..1aa33439525 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties @@ -33,9 +33,6 @@ main.command.files=\ main.opt.endian=\ \ --endian Byte order of generated jimage (default:native) -main.opt.genbom=\ -\ --genbom Generate a bom file containing jlink info - main.opt.saveopts=\ \ --saveopts Save jlink options in the given file diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties index 73143b8ef79..6edcf645063 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties @@ -89,6 +89,9 @@ No matching locales found for \"%s\". Check the specified pattern. include-locales.invalidtag=\ Invalid language tag: %s +include-locales.localedatanotfound=\ +jdk.localedata module was not specified with --addmods option + main.status.ok=Functional. main.status.not.ok= Not functional. diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java index 2d13cda8747..5cc8a8f649e 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java @@ -26,6 +26,7 @@ package jdk.tools.jmod; import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -34,14 +35,17 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.io.UncheckedIOException; -import java.lang.module.FindException; +import java.lang.module.Configuration; +import java.lang.module.ModuleReader; import java.lang.module.ModuleReference; import java.lang.module.ModuleFinder; -import java.lang.module.ModuleDescriptor.Requires; import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleDescriptor.Exports; +import java.lang.module.ModuleDescriptor.Provides; +import java.lang.module.ModuleDescriptor.Requires; import java.lang.module.ModuleDescriptor.Version; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import java.lang.module.ResolutionException; +import java.lang.module.ResolvedModule; import java.net.URI; import java.nio.file.FileSystems; import java.nio.file.FileVisitResult; @@ -51,13 +55,16 @@ import java.nio.file.Path; import java.nio.file.PathMatcher; import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; import java.nio.file.attribute.BasicFileAttributes; import java.text.MessageFormat; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Formatter; +import java.util.Comparator; +import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -68,6 +75,7 @@ import java.util.Optional; import java.util.ResourceBundle; import java.util.Set; import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.Predicate; import java.util.function.Supplier; import java.util.jar.JarEntry; @@ -89,16 +97,14 @@ import jdk.internal.joptsimple.OptionParser; import jdk.internal.joptsimple.OptionSet; import jdk.internal.joptsimple.OptionSpec; import jdk.internal.joptsimple.ValueConverter; +import jdk.internal.misc.JavaLangModuleAccess; +import jdk.internal.misc.SharedSecrets; import jdk.internal.module.ConfigurableModuleFinder; import jdk.internal.module.ConfigurableModuleFinder.Phase; -import jdk.internal.module.Hasher; -import jdk.internal.module.Hasher.DependencyHashes; +import jdk.internal.module.ModuleHashes; import jdk.internal.module.ModuleInfoExtender; -import static java.util.function.Function.identity; import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; -import static java.util.stream.Collectors.toMap; /** * Implementation for the jmod tool. @@ -127,21 +133,6 @@ public class JmodTask { } } - static void fail(Class type, - String format, - Object... args) throws T { - String msg = new Formatter().format(format, args).toString(); - try { - T t = type.getConstructor(String.class).newInstance(msg); - throw t; - } catch (InstantiationException | - InvocationTargetException | - NoSuchMethodException | - IllegalAccessException e) { - throw new InternalError("Unable to create an instance of " + type, e); - } - } - private static final String PROGNAME = "jmod"; private static final String MODULE_INFO = "module-info.class"; @@ -161,7 +152,8 @@ public class JmodTask { enum Mode { CREATE, LIST, - DESCRIBE + DESCRIBE, + HASH }; static class Options { @@ -179,7 +171,8 @@ public class JmodTask { String osName; String osArch; String osVersion; - Pattern dependenciesToHash; + Pattern modulesToHash; + boolean dryrun; List excludes; } @@ -211,6 +204,9 @@ public class JmodTask { case DESCRIBE: ok = describe(); break; + case HASH: + ok = hashModules(); + break; default: throw new AssertionError("Unknown mode: " + options.mode.name()); } @@ -248,26 +244,8 @@ public class JmodTask { } } - private Map modulesToPath(Set modules) { - ModuleFinder finder = options.moduleFinder; - - Map modPaths = new HashMap<>(); - for (ModuleDescriptor m : modules) { - String name = m.name(); - - Optional omref = finder.find(name); - if (!omref.isPresent()) { - // this should not happen, module path bug? - fail(InternalError.class, - "Selected module %s not on module path", - name); - } - - URI uri = omref.get().location().get(); - modPaths.put(name, Paths.get(uri)); - - } - return modPaths; + private boolean hashModules() { + return new Hasher(options.moduleFinder).run(); } private boolean describe() throws IOException { @@ -297,6 +275,8 @@ public class JmodTask { .collect(joining(" ")); } + private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); + private boolean printModuleDescriptor(InputStream in) throws IOException { @@ -311,74 +291,45 @@ public class JmodTask { StringBuilder sb = new StringBuilder(); sb.append("\n").append(md.toNameAndVersion()); - List requires = md.requires().stream().sorted().collect(toList()); - if (!requires.isEmpty()) { - requires.forEach(r -> { - sb.append("\n requires "); - if (!r.modifiers().isEmpty()) - sb.append(toString(r.modifiers())).append(" "); - sb.append(r.name()); - }); - } + md.requires().stream() + .sorted(Comparator.comparing(Requires::name)) + .forEach(r -> { + sb.append("\n requires "); + if (!r.modifiers().isEmpty()) + sb.append(toString(r.modifiers())).append(" "); + sb.append(r.name()); + }); - List l = md.uses().stream().sorted().collect(toList()); - if (!l.isEmpty()) { - l.forEach(sv -> sb.append("\n uses ").append(sv)); - } + md.uses().stream().sorted() + .forEach(s -> sb.append("\n uses ").append(s)); - List exports = sortExports(md.exports()); - if (!exports.isEmpty()) { - exports.forEach(ex -> sb.append("\n exports ").append(ex)); - } + md.exports().stream() + .sorted(Comparator.comparing(Exports::source)) + .forEach(p -> sb.append("\n exports ").append(p)); - l = md.conceals().stream().sorted().collect(toList()); - if (!l.isEmpty()) { - l.forEach(p -> sb.append("\n conceals ").append(p)); - } + md.conceals().stream().sorted() + .forEach(p -> sb.append("\n conceals ").append(p)); - Map provides = md.provides(); - if (!provides.isEmpty()) { - provides.values().forEach(p -> - sb.append("\n provides ").append(p.service()) - .append(" with ") - .append(toString(p.providers()))); - } + md.provides().values().stream() + .sorted(Comparator.comparing(Provides::service)) + .forEach(p -> sb.append("\n provides ").append(p.service()) + .append(" with ") + .append(toString(p.providers()))); - Optional mc = md.mainClass(); - if (mc.isPresent()) - sb.append("\n main-class " + mc.get()); + md.mainClass().ifPresent(v -> sb.append("\n main-class " + v)); + md.osName().ifPresent(v -> sb.append("\n operating-system-name " + v)); + md.osArch().ifPresent(v -> sb.append("\n operating-system-architecture " + v)); - Optional osname = md.osName(); - if (osname.isPresent()) - sb.append("\n operating-system-name " + osname.get()); + md.osVersion().ifPresent(v -> sb.append("\n operating-system-version " + v)); - Optional osarch = md.osArch(); - if (osarch.isPresent()) - sb.append("\n operating-system-architecture " + osarch.get()); + JLMA.hashes(md).ifPresent( + hashes -> hashes.names().stream().sorted().forEach( + mod -> sb.append("\n hashes ").append(mod).append(" ") + .append(hashes.algorithm()).append(" ") + .append(hashes.hashFor(mod)))); - Optional osversion = md.osVersion(); - if (osversion.isPresent()) - sb.append("\n operating-system-version " + osversion.get()); - - try { - Method m = ModuleDescriptor.class.getDeclaredMethod("hashes"); - m.setAccessible(true); - @SuppressWarnings("unchecked") - Optional optHashes = - (Optional) m.invoke(md); - - if (optHashes.isPresent()) { - Hasher.DependencyHashes hashes = optHashes.get(); - hashes.names().stream().forEach(mod -> - sb.append("\n hashes ").append(mod).append(" ") - .append(hashes.algorithm()).append(" ") - .append(hashes.hashFor(mod))); - } - } catch (ReflectiveOperationException x) { - throw new InternalError(x); - } out.println(sb.toString()); return true; } @@ -387,21 +338,6 @@ public class JmodTask { return false; } - static List sortExports(Set exports) { - Map map = - exports.stream() - .collect(toMap(ModuleDescriptor.Exports::source, - identity())); - List sources = exports.stream() - .map(ModuleDescriptor.Exports::source) - .sorted() - .collect(toList()); - - List l = new ArrayList<>(); - sources.forEach(e -> l.add(map.get(e))); - return l; - } - private boolean create() throws IOException { JmodFileWriter jmod = new JmodFileWriter(); @@ -410,8 +346,9 @@ public class JmodTask { Path target = options.jmodFile; Path tempTarget = target.resolveSibling(target.getFileName() + ".tmp"); try { - try (OutputStream out = Files.newOutputStream(tempTarget)) { - jmod.write(out); + try (OutputStream out = Files.newOutputStream(tempTarget); + BufferedOutputStream bos = new BufferedOutputStream(out)) { + jmod.write(bos); } Files.move(tempTarget, target); } catch (Exception e) { @@ -428,7 +365,6 @@ public class JmodTask { } private class JmodFileWriter { - final ModuleFinder moduleFinder = options.moduleFinder; final List cmds = options.cmds; final List libs = options.libs; final List configs = options.configs; @@ -438,8 +374,8 @@ public class JmodTask { final String osName = options.osName; final String osArch = options.osArch; final String osVersion = options.osVersion; - final Pattern dependenciesToHash = options.dependenciesToHash; final List excludes = options.excludes; + final Hasher hasher = hasher(); JmodFileWriter() { } @@ -545,11 +481,13 @@ public class JmodTask { if (moduleVersion != null) extender.version(moduleVersion); - // --hash-dependencies - if (dependenciesToHash != null) { - String name = descriptor.name(); - Set dependences = descriptor.requires(); - extender.hashes(hashDependences(name, dependences)); + if (hasher != null) { + ModuleHashes moduleHashes = hasher.computeHashes(descriptor.name()); + if (moduleHashes != null) { + extender.hashes(moduleHashes); + } else { + warning("warn.no.module.hashes", descriptor.name()); + } } // write the (possibly extended or modified) module-info.class @@ -561,38 +499,56 @@ public class JmodTask { } } - /** - * Examines the module dependences of the given module - * and computes the hash of any module that matches the - * pattern {@code dependenciesToHash}. + /* + * Hasher resolves a module graph using the --hash-modules PATTERN + * as the roots. + * + * The jmod file is being created and does not exist in the + * given modulepath. */ - DependencyHashes hashDependences(String name, Set moduleDependences) - throws IOException - { - Set descriptors = new HashSet<>(); - for (Requires md: moduleDependences) { - String dn = md.name(); - if (dependenciesToHash.matcher(dn).find()) { - try { - Optional omref = moduleFinder.find(dn); - if (!omref.isPresent()) { - throw new RuntimeException("Hashing module " + name - + " dependencies, unable to find module " + dn - + " on module path"); - } - descriptors.add(omref.get().descriptor()); - } catch (FindException x) { - throw new IOException("error reading module path", x); - } - } - } - - Map map = modulesToPath(descriptors); - if (map.size() == 0) { + private Hasher hasher() { + if (options.modulesToHash == null) return null; - } else { - // use SHA-256 for now, easy to make this configurable if needed - return Hasher.generate(map, "SHA-256"); + + try { + Supplier miSupplier = newModuleInfoSupplier(); + if (miSupplier == null) { + throw new IOException(MODULE_INFO + " not found"); + } + + ModuleDescriptor descriptor; + try (InputStream in = miSupplier.get()) { + descriptor = ModuleDescriptor.read(in); + } + + URI uri = options.jmodFile.toUri(); + ModuleReference mref = new ModuleReference(descriptor, uri, new Supplier<>() { + @Override + public ModuleReader get() { + throw new UnsupportedOperationException(); + } + }); + + // compose a module finder with the module path and also + // a module finder that can find the jmod file being created + ModuleFinder finder = ModuleFinder.compose(options.moduleFinder, + new ModuleFinder() { + @Override + public Optional find(String name) { + if (descriptor.name().equals(name)) + return Optional.of(mref); + else return Optional.empty(); + } + + @Override + public Set findAll() { + return Collections.singleton(mref); + } + }); + + return new Hasher(finder); + } catch (IOException e) { + throw new UncheckedIOException(e); } } @@ -765,6 +721,273 @@ public class JmodTask { } } + /** + * Compute and record hashes + */ + private class Hasher { + final ModuleFinder moduleFinder; + final Map moduleNameToPath; + final Set modules; + final Configuration configuration; + final boolean dryrun = options.dryrun; + Hasher(ModuleFinder finder) { + this.moduleFinder = finder; + // Determine the modules that matches the pattern {@code modulesToHash} + this.modules = moduleFinder.findAll().stream() + .map(mref -> mref.descriptor().name()) + .filter(mn -> options.modulesToHash.matcher(mn).find()) + .collect(Collectors.toSet()); + + // a map from a module name to Path of the packaged module + this.moduleNameToPath = moduleFinder.findAll().stream() + .map(mref -> mref.descriptor().name()) + .collect(Collectors.toMap(Function.identity(), mn -> moduleToPath(mn))); + + // get a resolved module graph + Configuration config = null; + try { + config = Configuration.empty() + .resolveRequires(ModuleFinder.ofSystem(), moduleFinder, modules); + } catch (ResolutionException e) { + warning("warn.module.resolution.fail", e.getMessage()); + } + this.configuration = config; + } + + /** + * This method is for jmod hash command. + * + * Identify the base modules in the module graph, i.e. no outgoing edge + * to any of the modules to be hashed. + * + * For each base module M, compute the hashes of all modules that depend + * upon M directly or indirectly. Then update M's module-info.class + * to record the hashes. + */ + boolean run() { + if (configuration == null) + return false; + + // transposed graph containing the the packaged modules and + // its transitive dependences matching --hash-modules + Map> graph = new HashMap<>(); + for (String root : modules) { + Deque deque = new ArrayDeque<>(); + deque.add(root); + Set visited = new HashSet<>(); + while (!deque.isEmpty()) { + String mn = deque.pop(); + if (!visited.contains(mn)) { + visited.add(mn); + + if (modules.contains(mn)) + graph.computeIfAbsent(mn, _k -> new HashSet<>()); + + ResolvedModule resolvedModule = configuration.findModule(mn).get(); + for (ResolvedModule dm : resolvedModule.reads()) { + String name = dm.name(); + if (!visited.contains(name)) { + deque.push(name); + } + + // reverse edge + if (modules.contains(name) && modules.contains(mn)) { + graph.computeIfAbsent(name, _k -> new HashSet<>()).add(mn); + } + } + } + } + } + + if (dryrun) + out.println("Dry run:"); + + // each node in a transposed graph is a matching packaged module + // in which the hash of the modules that depend upon it is recorded + graph.entrySet().stream() + .filter(e -> !e.getValue().isEmpty()) + .forEach(e -> { + String mn = e.getKey(); + Map modulesForHash = e.getValue().stream() + .collect(Collectors.toMap(Function.identity(), + moduleNameToPath::get)); + ModuleHashes hashes = ModuleHashes.generate(modulesForHash, "SHA-256"); + if (dryrun) { + out.format("%s%n", mn); + hashes.names().stream() + .sorted() + .forEach(name -> out.format(" hashes %s %s %s%n", + name, hashes.algorithm(), hashes.hashFor(name))); + } else { + try { + updateModuleInfo(mn, hashes); + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } + }); + return true; + } + + /** + * Compute hashes of the specified module. + * + * It records the hashing modules that depend upon the specified + * module directly or indirectly. + */ + ModuleHashes computeHashes(String name) { + if (configuration == null) + return null; + + // the transposed graph includes all modules in the resolved graph + Map> graph = transpose(); + + // find the modules that transitively depend upon the specified name + Deque deque = new ArrayDeque<>(); + deque.add(name); + Set mods = visitNodes(graph, deque); + + // filter modules matching the pattern specified --hash-modules + // as well as itself as the jmod file is being generated + Map modulesForHash = mods.stream() + .filter(mn -> !mn.equals(name) && modules.contains(mn)) + .collect(Collectors.toMap(Function.identity(), moduleNameToPath::get)); + + if (modulesForHash.isEmpty()) + return null; + + return ModuleHashes.generate(modulesForHash, "SHA-256"); + } + + /** + * Returns all nodes traversed from the given roots. + */ + private Set visitNodes(Map> graph, + Deque roots) { + Set visited = new HashSet<>(); + while (!roots.isEmpty()) { + String mn = roots.pop(); + if (!visited.contains(mn)) { + visited.add(mn); + // the given roots may not be part of the graph + if (graph.containsKey(mn)) { + for (String dm : graph.get(mn)) { + if (!visited.contains(dm)) { + roots.push(dm); + } + } + } + } + } + return visited; + } + + /** + * Returns a transposed graph from the resolved module graph. + */ + private Map> transpose() { + Map> transposedGraph = new HashMap<>(); + Deque deque = new ArrayDeque<>(modules); + + Set visited = new HashSet<>(); + while (!deque.isEmpty()) { + String mn = deque.pop(); + if (!visited.contains(mn)) { + visited.add(mn); + + transposedGraph.computeIfAbsent(mn, _k -> new HashSet<>()); + + ResolvedModule resolvedModule = configuration.findModule(mn).get(); + for (ResolvedModule dm : resolvedModule.reads()) { + String name = dm.name(); + if (!visited.contains(name)) { + deque.push(name); + } + + // reverse edge + transposedGraph.computeIfAbsent(name, _k -> new HashSet<>()) + .add(mn); + } + } + } + return transposedGraph; + } + + /** + * Reads the given input stream of module-info.class and write + * the extended module-info.class with the given ModuleHashes + * + * @param in InputStream of module-info.class + * @param out OutputStream to write the extended module-info.class + * @param hashes ModuleHashes + */ + private void recordHashes(InputStream in, OutputStream out, ModuleHashes hashes) + throws IOException + { + ModuleInfoExtender extender = ModuleInfoExtender.newExtender(in); + extender.hashes(hashes); + extender.write(out); + } + + private void updateModuleInfo(String name, ModuleHashes moduleHashes) + throws IOException + { + Path target = moduleNameToPath.get(name); + Path tempTarget = target.resolveSibling(target.getFileName() + ".tmp"); + ZipFile zip = new ZipFile(target.toFile()); + try { + try (OutputStream out = Files.newOutputStream(tempTarget); + ZipOutputStream zos = new ZipOutputStream(out)) { + zip.stream().forEach(e -> { + try { + InputStream in = zip.getInputStream(e); + if (e.getName().equals(MODULE_INFO) || + e.getName().equals(Section.CLASSES.jmodDir() + "/" + MODULE_INFO)) { + ZipEntry ze = new ZipEntry(e.getName()); + ze.setTime(System.currentTimeMillis()); + zos.putNextEntry(ze); + recordHashes(in, zos, moduleHashes); + zos.closeEntry(); + } else { + zos.putNextEntry(e); + zos.write(in.readAllBytes()); + zos.closeEntry(); + } + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + } catch (IOException|RuntimeException e) { + if (Files.exists(tempTarget)) { + try { + Files.delete(tempTarget); + } catch (IOException ioe) { + e.addSuppressed(ioe); + } + } + throw e; + } finally { + zip.close(); + } + out.println(getMessage("module.hashes.recorded", name)); + Files.move(tempTarget, target, StandardCopyOption.REPLACE_EXISTING); + } + + private Path moduleToPath(String name) { + ModuleReference mref = moduleFinder.find(name).orElseThrow( + () -> new InternalError("Selected module " + name + " not on module path")); + + URI uri = mref.location().get(); + Path path = Paths.get(uri); + String fn = path.getFileName().toString(); + if (!fn.endsWith(".jar") && !fn.endsWith(".jmod")) { + throw new InternalError(path + " is not a modular JAR or jmod file"); + } + return path; + } + } + enum Section { NATIVE_LIBS("native"), NATIVE_CMDS("bin"), @@ -921,7 +1144,8 @@ public class JmodTask { builder.append("\n").append(" Main operation modes:\n "); builder.append(getMessage("main.opt.mode.create")).append("\n "); builder.append(getMessage("main.opt.mode.list")).append("\n "); - builder.append(getMessage("main.opt.mode.describe")).append("\n\n"); + builder.append(getMessage("main.opt.mode.describe")).append("\n "); + builder.append(getMessage("main.opt.mode.hash")).append("\n\n"); String cmdfile = null; String[] lines = content.split("\n"); @@ -964,13 +1188,16 @@ public class JmodTask { .withValuesSeparatedBy(File.pathSeparatorChar) .withValuesConvertedBy(DirPathConverter.INSTANCE); + OptionSpec dryrun + = parser.accepts("dry-run", getMessage("main.opt.dry-run")); + OptionSpec excludes = parser.accepts("exclude", getMessage("main.opt.exclude")) .withRequiredArg() .withValuesConvertedBy(new GlobConverter()); - OptionSpec hashDependencies - = parser.accepts("hash-dependencies", getMessage("main.opt.hash-dependencies")) + OptionSpec hashModules + = parser.accepts("hash-modules", getMessage("main.opt.hash-modules")) .withRequiredArg() .withValuesConvertedBy(new PatternConverter()); @@ -1049,6 +1276,8 @@ public class JmodTask { options.cmds = opts.valuesOf(cmds); if (opts.has(config)) options.configs = opts.valuesOf(config); + if (opts.has(dryrun)) + options.dryrun = true; if (opts.has(excludes)) options.excludes = opts.valuesOf(excludes); if (opts.has(libs)) @@ -1069,27 +1298,39 @@ public class JmodTask { options.osArch = opts.valueOf(osArch); if (opts.has(osVersion)) options.osVersion = opts.valueOf(osVersion); - if (opts.has(hashDependencies)) { - options.dependenciesToHash = opts.valueOf(hashDependencies); - // if storing hashes of dependencies then the module path is required + if (opts.has(hashModules)) { + options.modulesToHash = opts.valueOf(hashModules); + // if storing hashes then the module path is required if (options.moduleFinder == null) - throw new CommandException("err.modulepath.must.be.specified").showUsage(true); + throw new CommandException("err.modulepath.must.be.specified") + .showUsage(true); } - if (words.size() <= 1) - throw new CommandException("err.jmod.must.be.specified").showUsage(true); - Path path = Paths.get(words.get(1)); - if (options.mode.equals(Mode.CREATE) && Files.exists(path)) - throw new CommandException("err.file.already.exists", path); - else if ((options.mode.equals(Mode.LIST) || - options.mode.equals(Mode.DESCRIBE)) - && Files.notExists(path)) - throw new CommandException("err.jmod.not.found", path); - options.jmodFile = path; + if (options.mode.equals(Mode.HASH)) { + if (options.moduleFinder == null || options.modulesToHash == null) + throw new CommandException("err.modulepath.must.be.specified") + .showUsage(true); + } else { + if (words.size() <= 1) + throw new CommandException("err.jmod.must.be.specified").showUsage(true); + Path path = Paths.get(words.get(1)); - if (words.size() > 2) - throw new CommandException("err.unknown.option", - words.subList(2, words.size())).showUsage(true); + if (options.mode.equals(Mode.CREATE) && Files.exists(path)) + throw new CommandException("err.file.already.exists", path); + else if ((options.mode.equals(Mode.LIST) || + options.mode.equals(Mode.DESCRIBE)) + && Files.notExists(path)) + throw new CommandException("err.jmod.not.found", path); + + if (options.dryrun) { + throw new CommandException("err.invalid.dryrun.option"); + } + options.jmodFile = path; + + if (words.size() > 2) + throw new CommandException("err.unknown.option", + words.subList(2, words.size())).showUsage(true); + } if (options.mode.equals(Mode.CREATE) && options.classpath == null) throw new CommandException("err.classpath.must.be.specified").showUsage(true); diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties index 98e0f6fd7d9..555adb03b8f 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties @@ -1,9 +1,9 @@ main.usage.summary=\ -Usage: {0} (create|list|describe) \n\ +Usage: {0} (create|list|describe|hash) \n\ use --help for a list of possible options main.usage=\ -Usage: {0} (create|list|describe) +Usage: {0} (create|list|describe|hash) error.prefix=Error: warn.prefix=Warning: @@ -14,6 +14,8 @@ main.opt.mode.list=\ \list - Prints the names of all the entries main.opt.mode.describe=\ \describe - Prints the module details +main.opt.mode.hash=\ +\hash - Records hashes of tied modules. main.opt.help=Print this usage message main.opt.version=Version information @@ -21,9 +23,9 @@ main.opt.class-path=Application jar files|dir containing classes main.opt.libs=Location of native libraries main.opt.cmds=Location of native commands main.opt.config=Location of user-editable config files +main.opt.dry-run=Dry run of hash mode main.opt.exclude=Exclude files, given as a PATTERN main.opt.module-version= Module version -main.opt.modulepath=Module path main.opt.main-class=Main class main.opt.main-class.arg=class-name main.opt.os-name=Operating system name @@ -32,18 +34,25 @@ main.opt.os-arch=Operating system architecture main.opt.os-arch.arg=os-arch main.opt.os-version=Operating system version main.opt.os-version.arg=os-version -main.opt.hash-dependencies=Compute and record hashes of dependencies matched by the pattern +main.opt.modulepath=Module path +main.opt.hash-modules=Compute and record hashes to tie a packaged module\ +\ with modules matching the given pattern and depending upon it directly\ +\ or indirectly. The hashes are recorded in the JMOD file being created, or\ +\ a JMOD file or modular JAR on the module path specified the jmod hash command. + main.opt.cmdfile=Read options from the specified file -err.missing.mode=one of create, list, or describe must be specified -err.invalid.mode=mode must be one of create, list, or describe: {0} +module.hashes.recorded=Hashes are recorded in module {0} + +err.missing.mode=one of create, list, describe, or hash must be specified +err.invalid.mode=mode must be one of create, list, describe, or hash: {0} err.classpath.must.be.specified=--class-path must be specified err.jmod.must.be.specified=jmod-file must be specified err.invalid.version=invalid module version {0} -err.output.must.be.specified:--output must be specified -err.mods.must.be.specified:--mods must be specified -err.modulepath.must.be.specified:--module-path must be specified when hashing dependencies -err.invalid.main-class:invalid main-class name: {0} +err.output.must.be.specified=--output must be specified +err.mods.must.be.specified=--mods must be specified +err.modulepath.must.be.specified=--module-path must be specified when hashing modules +err.invalid.main-class=invalid main-class name: {0} err.path.not.found=path not found: {0} err.path.not.valid=invalid path: {0} err.path.not.a.dir=path must be a directory: {0} @@ -54,5 +63,9 @@ err.bad.pattern=bad pattern {0} err.unknown.option=unknown option(s): {0} err.missing.arg=no value given for {0} err.internal.error=internal error: {0} {1} {2} +err.invalid.dryrun.option=--dry-run can only be used with hash mode err.module.descriptor.not.found=Module descriptor not found warn.invalid.arg=Invalid classname or pathname not exist: {0} +warn.no.module.hashes=No hashes recorded: no module specified for hashing depends on {0} +warn.module.resolution.fail=No hashes recorded: {0} + diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/provider/LocaleDataProvider.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/provider/LocaleDataProvider.java index 2513237f7bf..ed9f5b826d9 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/provider/LocaleDataProvider.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/provider/LocaleDataProvider.java @@ -46,7 +46,7 @@ public class LocaleDataProvider extends LocaleData.CommonResourceBundleProvider Class c = Class.forName(LocaleDataProvider.class.getModule(), bundleName); if (c != null && ResourceBundle.class.isAssignableFrom(c)) { try { - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "deprecation"}) ResourceBundle rb = ((Class) c).newInstance(); return rb; } catch (InstantiationException | IllegalAccessException e) { diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java index 36650dcbf94..4ddeaff4c78 100644 --- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java +++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java @@ -52,10 +52,10 @@ class JarFileSystem extends ZipFileSystem { private Function lookup; @Override - Entry getEntry(byte[] path) throws IOException { + IndexNode getInode(byte[] path) { // check for an alias to a versioned entry byte[] versionedPath = lookup.apply(path); - return versionedPath == null ? super.getEntry(path) : super.getEntry(versionedPath); + return versionedPath == null ? super.getInode(path) : super.getInode(versionedPath); } JarFileSystem(ZipFileSystemProvider provider, Path zfpath, Map env) @@ -87,7 +87,7 @@ class JarFileSystem extends ZipFileSystem { } private boolean isMultiReleaseJar() { - try (InputStream is = newInputStream(getBytes("META-INF/MANIFEST.MF"))) { + try (InputStream is = newInputStream(getBytes("/META-INF/MANIFEST.MF"))) { return (new Manifest(is)).getMainAttributes() .containsKey(new Attributes.Name("Multi-Release")); // fixme change line above after JarFile integration to contain Attributes.Name.MULTI_RELEASE @@ -108,7 +108,7 @@ class JarFileSystem extends ZipFileSystem { */ private Function createVersionedLinks(int version) { HashMap aliasMap = new HashMap<>(); - getVersionMap(version, getInode(getBytes("META-INF/versions"))).values() + getVersionMap(version, getInode(getBytes("/META-INF/versions"))).values() .forEach(versionNode -> { // for each META-INF/versions/{n} directory // put all the leaf inodes, i.e. entries, into the alias map // possibly shadowing lower versioned entries @@ -176,7 +176,7 @@ class JarFileSystem extends ZipFileSystem { * returns foo/bar.class */ private byte[] getRootName(IndexNode prefix, IndexNode inode) { - int offset = prefix.name.length; + int offset = prefix.name.length - 1; byte[] fullName = inode.name; return Arrays.copyOfRange(fullName, offset, fullName.length); } diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributes.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributes.java index 12d70ec82ca..5cc6ef3b951 100644 --- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributes.java +++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributes.java @@ -26,122 +26,17 @@ package jdk.nio.zipfs; import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileTime; -import java.util.Arrays; -import java.util.Formatter; -import static jdk.nio.zipfs.ZipUtils.*; /** * * @author Xueming Shen, Rajendra Gutupalli,Jaya Hangal */ -class ZipFileAttributes implements BasicFileAttributes -{ - private final ZipFileSystem.Entry e; - - ZipFileAttributes(ZipFileSystem.Entry e) { - this.e = e; - } - - ///////// basic attributes /////////// - @Override - public FileTime creationTime() { - if (e.ctime != -1) - return FileTime.fromMillis(e.ctime); - return null; - } - - @Override - public boolean isDirectory() { - return e.isDir(); - } - - @Override - public boolean isOther() { - return false; - } - - @Override - public boolean isRegularFile() { - return !e.isDir(); - } - - @Override - public FileTime lastAccessTime() { - if (e.atime != -1) - return FileTime.fromMillis(e.atime); - return null; - } - - @Override - public FileTime lastModifiedTime() { - return FileTime.fromMillis(e.mtime); - } - - @Override - public long size() { - return e.size; - } - - @Override - public boolean isSymbolicLink() { - return false; - } - - @Override - public Object fileKey() { - return null; - } - - ///////// zip entry attributes /////////// - public long compressedSize() { - return e.csize; - } - - public long crc() { - return e.crc; - } - - public int method() { - return e.method; - } - - public byte[] extra() { - if (e.extra != null) - return Arrays.copyOf(e.extra, e.extra.length); - return null; - } - - public byte[] comment() { - if (e.comment != null) - return Arrays.copyOf(e.comment, e.comment.length); - return null; - } - - public String toString() { - StringBuilder sb = new StringBuilder(1024); - Formatter fm = new Formatter(sb); - if (creationTime() != null) - fm.format(" creationTime : %tc%n", creationTime().toMillis()); - else - fm.format(" creationTime : null%n"); - - if (lastAccessTime() != null) - fm.format(" lastAccessTime : %tc%n", lastAccessTime().toMillis()); - else - fm.format(" lastAccessTime : null%n"); - fm.format(" lastModifiedTime: %tc%n", lastModifiedTime().toMillis()); - fm.format(" isRegularFile : %b%n", isRegularFile()); - fm.format(" isDirectory : %b%n", isDirectory()); - fm.format(" isSymbolicLink : %b%n", isSymbolicLink()); - fm.format(" isOther : %b%n", isOther()); - fm.format(" fileKey : %s%n", fileKey()); - fm.format(" size : %d%n", size()); - fm.format(" compressedSize : %d%n", compressedSize()); - fm.format(" crc : %x%n", crc()); - fm.format(" method : %d%n", method()); - fm.close(); - return sb.toString(); - } +interface ZipFileAttributes extends BasicFileAttributes { + public long compressedSize(); + public long crc(); + public int method(); + public byte[] extra(); + public byte[] comment(); + public String toString(); } diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java index ae01cb38460..d8becaaa23d 100644 --- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -68,36 +68,29 @@ import static java.nio.file.StandardCopyOption.*; class ZipFileSystem extends FileSystem { private final ZipFileSystemProvider provider; - private final ZipPath defaultdir; - private boolean readOnly = false; private final Path zfpath; private final ZipCoder zc; - + private final boolean noExtt; // see readExtra() + private final ZipPath rootdir; // configurable by env map - private final String defaultDir; // default dir for the file system - private final String nameEncoding; // default encoding for name/comment private final boolean useTempFile; // use a temp file for newOS, default // is to use BAOS for better performance - private final boolean createNew; // create a new zip if not exists + private boolean readOnly = false; // readonly file system private static final boolean isWindows = AccessController.doPrivileged( (PrivilegedAction) () -> System.getProperty("os.name") .startsWith("Windows")); ZipFileSystem(ZipFileSystemProvider provider, Path zfpath, - Map env) - throws IOException + Map env) throws IOException { - // configurable env setup - this.createNew = "true".equals(env.get("create")); - this.nameEncoding = env.containsKey("encoding") ? - (String)env.get("encoding") : "UTF-8"; + // create a new zip if not exists + boolean createNew = "true".equals(env.get("create")); + // default encoding for name/comment + String nameEncoding = env.containsKey("encoding") ? + (String)env.get("encoding") : "UTF-8"; + this.noExtt = "false".equals(env.get("zipinfo-time")); this.useTempFile = TRUE.equals(env.get("useTempFile")); - this.defaultDir = env.containsKey("default.dir") ? - (String)env.get("default.dir") : "/"; - if (this.defaultDir.charAt(0) != '/') - throw new IllegalArgumentException("default dir should be absolute"); - this.provider = provider; this.zfpath = zfpath; if (Files.notExists(zfpath)) { @@ -113,10 +106,9 @@ class ZipFileSystem extends FileSystem { zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ); boolean writeable = AccessController.doPrivileged( (PrivilegedAction) () -> Files.isWritable(zfpath)); - if (!writeable) - this.readOnly = true; + this.readOnly = !writeable; this.zc = ZipCoder.get(nameEncoding); - this.defaultdir = new ZipPath(this, getBytes(defaultDir)); + this.rootdir = new ZipPath(this, new byte[]{'/'}); this.ch = Files.newByteChannel(zfpath, READ); try { this.cen = initCEN(); @@ -161,33 +153,29 @@ class ZipFileSystem extends FileSystem { @Override public Iterable getRootDirectories() { - ArrayList pathArr = new ArrayList<>(); - pathArr.add(new ZipPath(this, new byte[]{'/'})); - return pathArr; + return List.of(rootdir); } - ZipPath getDefaultDir() { // package private - return defaultdir; + ZipPath getRootDir() { + return rootdir; } @Override public ZipPath getPath(String first, String... more) { - String path; if (more.length == 0) { - path = first; - } else { - StringBuilder sb = new StringBuilder(); - sb.append(first); - for (String segment: more) { - if (segment.length() > 0) { - if (sb.length() > 0) - sb.append('/'); - sb.append(segment); - } - } - path = sb.toString(); + return new ZipPath(this, getBytes(first)); } - return new ZipPath(this, getBytes(path)); + StringBuilder sb = new StringBuilder(); + sb.append(first); + for (String path : more) { + if (path.length() > 0) { + if (sb.length() > 0) { + sb.append('/'); + } + sb.append(path); + } + } + return new ZipPath(this, getBytes(sb.toString())); } @Override @@ -206,14 +194,11 @@ class ZipFileSystem extends FileSystem { @Override public Iterable getFileStores() { - ArrayList list = new ArrayList<>(1); - list.add(new ZipFileStore(new ZipPath(this, new byte[]{'/'}))); - return list; + return List.of(new ZipFileStore(rootdir)); } private static final Set supportedFileAttributeViews = - Collections.unmodifiableSet( - new HashSet(Arrays.asList("basic", "zip"))); + Set.of("basic", "zip"); @Override public Set supportedFileAttributeViews() { @@ -331,12 +316,26 @@ class ZipFileSystem extends FileSystem { return null; e = new Entry(inode.name); // pseudo directory e.method = METHOD_STORED; // STORED for dir - e.mtime = e.atime = e.ctime = -1;// -1 for all times + e.mtime = e.atime = e.ctime = zfsDefaultTimeStamp; } } finally { endRead(); } - return new ZipFileAttributes(e); + return e; + } + + void checkAccess(byte[] path) throws IOException { + beginRead(); + try { + ensureOpen(); + // is it necessary to readCEN as a sanity check? + if (getInode(path) == null) { + throw new NoSuchFileException(toString()); + } + + } finally { + endRead(); + } } void setTimes(byte[] path, FileTime mtime, FileTime atime, FileTime ctime) @@ -387,14 +386,6 @@ class ZipFileSystem extends FileSystem { } } - private ZipPath toZipPath(byte[] path) { - // make it absolute - byte[] p = new byte[path.length + 1]; - p[0] = '/'; - System.arraycopy(path, 0, p, 1, path.length); - return new ZipPath(this, p); - } - // returns the list of child paths of "path" Iterator iteratorOf(byte[] path, DirectoryStream.Filter filter) @@ -409,7 +400,7 @@ class ZipFileSystem extends FileSystem { List list = new ArrayList<>(); IndexNode child = inode.child; while (child != null) { - ZipPath zp = toZipPath(child.name); + ZipPath zp = new ZipPath(this, child.name); if (filter == null || filter.accept(zp)) list.add(zp); child = child.sibling; @@ -450,6 +441,7 @@ class ZipFileSystem extends FileSystem { try { ensureOpen(); Entry eSrc = getEntry(src); // ensureOpen checked + if (eSrc == null) throw new NoSuchFileException(getString(src)); if (eSrc.isDir()) { // spec says to create dst dir @@ -679,7 +671,7 @@ class ZipFileSystem extends FileSystem { } public SeekableByteChannel truncate(long size) - throws IOException + throws IOException { throw new NonWritableChannelException(); } @@ -879,7 +871,8 @@ class ZipFileSystem extends FileSystem { private void checkParents(byte[] path) throws IOException { beginRead(); try { - while ((path = getParent(path)) != null && path.length != 0) { + while ((path = getParent(path)) != null && + path != ROOTPATH) { if (!inodes.containsKey(IndexNode.keyOf(path))) { throw new NoSuchFileException(getString(path)); } @@ -889,15 +882,20 @@ class ZipFileSystem extends FileSystem { } } - private static byte[] ROOTPATH = new byte[0]; + private static byte[] ROOTPATH = new byte[] { '/' }; private static byte[] getParent(byte[] path) { + int off = getParentOff(path); + if (off <= 1) + return ROOTPATH; + return Arrays.copyOf(path, off + 1); + } + + private static int getParentOff(byte[] path) { int off = path.length - 1; if (off > 0 && path[off] == '/') // isDirectory off--; while (off > 0 && path[off] != '/') { off--; } - if (off <= 0) - return ROOTPATH; - return Arrays.copyOf(path, off + 1); + return off; } private final void beginWrite() { @@ -941,19 +939,6 @@ class ZipFileSystem extends FileSystem { close(); } - private long getDataPos(Entry e) throws IOException { - if (e.locoff == -1) { - Entry e2 = getEntry(e.name); - if (e2 == null) - throw new ZipException("invalid loc for entry <" + e.name + ">"); - e.locoff = e2.locoff; - } - byte[] buf = new byte[LOCHDR]; - if (readFullyAt(buf, 0, buf.length, e.locoff) != buf.length) - throw new ZipException("invalid loc for entry <" + e.name + ">"); - return locpos + e.locoff + LOCHDR + LOCNAM(buf) + LOCEXT(buf); - } - // Reads len bytes of data from the specified offset into buf. // Returns the total number of bytes read. // Each/every byte read from here (except the cen, which is mapped). @@ -1090,7 +1075,9 @@ class ZipFileSystem extends FileSystem { if (pos + CENHDR + nlen > limit) { zerror("invalid CEN header (bad header size)"); } - byte[] name = Arrays.copyOfRange(cen, pos + CENHDR, pos + CENHDR + nlen); + byte[] name = new byte[nlen + 1]; + System.arraycopy(cen, pos + CENHDR, name, 1, nlen); + name[0] = '/'; IndexNode inode = new IndexNode(name, pos); inodes.put(inode, inode); // skip ext and comment @@ -1278,7 +1265,7 @@ class ZipFileSystem extends FileSystem { if (inode.pos == -1) { continue; // pseudo directory node } - e = Entry.readCEN(this, inode.pos); + e = Entry.readCEN(this, inode); try { written += copyLOCEntry(e, false, os, written, buf); elist.add(e); @@ -1320,13 +1307,6 @@ class ZipFileSystem extends FileSystem { Files.move(tmpFile, zfpath, REPLACE_EXISTING); hasUpdate = false; // clear - /* - if (isOpen) { - ch = zfpath.newByteChannel(READ); // re-fresh "ch" and "cen" - cen = initCEN(); - } - */ - //System.out.printf("->sync(%s) done!%n", toString()); } IndexNode getInode(byte[] path) { @@ -1350,7 +1330,7 @@ class ZipFileSystem extends FileSystem { return (Entry)inode; if (inode == null || inode.pos == -1) return null; - return Entry.readCEN(this, inode.pos); + return Entry.readCEN(this, inode); } public void deleteFile(byte[] path, boolean failIfNotExists) @@ -1432,7 +1412,6 @@ class ZipFileSystem extends FileSystem { bufSize = 8192; final long size = e.size; eis = new InflaterInputStream(eis, getInflater(), (int)bufSize) { - private boolean isClosed = false; public void close() throws IOException { if (!isClosed) { @@ -1493,10 +1472,20 @@ class ZipFileSystem extends FileSystem { this.zfch = zfch; rem = e.csize; size = e.size; - pos = getDataPos(e); + pos = e.locoff; + if (pos == -1) { + Entry e2 = getEntry(e.name); + if (e2 == null) { + throw new ZipException("invalid loc for entry <" + e.name + ">"); + } + pos = e2.locoff; + } + pos = -pos; // lazy initialize the real data offset } + public int read(byte b[], int off, int len) throws IOException { ensureOpen(); + initDataPos(); if (rem == 0) { return -1; } @@ -1523,6 +1512,7 @@ class ZipFileSystem extends FileSystem { } return (int)n; } + public int read() throws IOException { byte[] b = new byte[1]; if (read(b, 0, 1) == 1) { @@ -1531,6 +1521,7 @@ class ZipFileSystem extends FileSystem { return -1; } } + public long skip(long n) throws IOException { ensureOpen(); if (n > rem) @@ -1542,16 +1533,30 @@ class ZipFileSystem extends FileSystem { } return n; } + public int available() { return rem > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) rem; } + public long size() { return size; } + public void close() { rem = 0; streams.remove(this); } + + private void initDataPos() throws IOException { + if (pos <= 0) { + pos = -pos + locpos; + byte[] buf = new byte[LOCHDR]; + if (readFullyAt(buf, 0, buf.length, pos) != LOCHDR) { + throw new ZipException("invalid loc " + pos + " for entry reading"); + } + pos += LOCHDR + LOCNAM(buf) + LOCEXT(buf); + } + } } class EntryOutputStream extends DeflaterOutputStream @@ -1701,8 +1706,9 @@ class ZipFileSystem extends FileSystem { // End of central directory record static class END { - int disknum; - int sdisknum; + // these 2 fields are not used by anyone and write() uses "0" + // int disknum; + // int sdisknum; int endsub; // endsub int centot; // 4 bytes long cenlen; // 4 bytes @@ -1711,9 +1717,9 @@ class ZipFileSystem extends FileSystem { byte[] comment; /* members of Zip64 end of central directory locator */ - int diskNum; + // int diskNum; long endpos; - int disktot; + // int disktot; void write(OutputStream os, long offset) throws IOException { boolean hasZip64 = false; @@ -1776,6 +1782,11 @@ class ZipFileSystem extends FileSystem { int hashcode; // node is hashable/hashed by its name int pos = -1; // position in cen table, -1 menas the // entry does not exists in zip file + IndexNode(byte[] name) { + name(name); + this.pos = -1; + } + IndexNode(byte[] name, int pos) { name(name); this.pos = pos; @@ -1804,6 +1815,9 @@ class ZipFileSystem extends FileSystem { if (!(other instanceof IndexNode)) { return false; } + if (other instanceof ParentLookup) { + return ((ParentLookup)other).equals(this); + } return Arrays.equals(name, ((IndexNode)other).name); } @@ -1816,17 +1830,16 @@ class ZipFileSystem extends FileSystem { IndexNode child; // 1st child } - static class Entry extends IndexNode { + static class Entry extends IndexNode implements ZipFileAttributes { - static final int CEN = 1; // entry read from cen - static final int NEW = 2; // updated contents in bytes or file - static final int FILECH = 3; // fch update in "file" - static final int COPY = 4; // copy of a CEN entry + static final int CEN = 1; // entry read from cen + static final int NEW = 2; // updated contents in bytes or file + static final int FILECH = 3; // fch update in "file" + static final int COPY = 4; // copy of a CEN entry - - byte[] bytes; // updated content bytes - Path file; // use tmp file to store bytes; - int type = CEN; // default is the entry read from cen + byte[] bytes; // updated content bytes + Path file; // use tmp file to store bytes; + int type = CEN; // default is the entry read from cen // entry attributes int version; @@ -1841,10 +1854,12 @@ class ZipFileSystem extends FileSystem { byte[] extra; // cen - int versionMade; - int disk; - int attrs; - long attrsEx; + + // these fields are not used by anyone and writeCEN uses "0" + // int versionMade; + // int disk; + // int attrs; + // long attrsEx; long locoff; byte[] comment; @@ -1875,10 +1890,12 @@ class ZipFileSystem extends FileSystem { this.csize = e.csize; this.method = e.method; this.extra = e.extra; + /* this.versionMade = e.versionMade; this.disk = e.disk; this.attrs = e.attrs; this.attrsEx = e.attrsEx; + */ this.locoff = e.locoff; this.comment = e.comment; this.type = type; @@ -1899,19 +1916,19 @@ class ZipFileSystem extends FileSystem { } ///////////////////// CEN ////////////////////// - static Entry readCEN(ZipFileSystem zipfs, int pos) + static Entry readCEN(ZipFileSystem zipfs, IndexNode inode) throws IOException { - return new Entry().cen(zipfs, pos); + return new Entry().cen(zipfs, inode); } - private Entry cen(ZipFileSystem zipfs, int pos) + private Entry cen(ZipFileSystem zipfs, IndexNode inode) throws IOException { byte[] cen = zipfs.cen; + int pos = inode.pos; if (!cenSigAt(cen, pos)) zerror("invalid CEN header (bad signature)"); - versionMade = CENVEM(cen, pos); version = CENVER(cen, pos); flag = CENFLG(cen, pos); method = CENHOW(cen, pos); @@ -1922,13 +1939,16 @@ class ZipFileSystem extends FileSystem { int nlen = CENNAM(cen, pos); int elen = CENEXT(cen, pos); int clen = CENCOM(cen, pos); + /* + versionMade = CENVEM(cen, pos); disk = CENDSK(cen, pos); attrs = CENATT(cen, pos); attrsEx = CENATX(cen, pos); + */ locoff = CENOFF(cen, pos); - pos += CENHDR; - name(Arrays.copyOfRange(cen, pos, pos + nlen)); + this.name = inode.name; + this.hashcode = inode.hashcode; pos += nlen; if (elen > 0) { @@ -1955,7 +1975,8 @@ class ZipFileSystem extends FileSystem { boolean foundExtraTime = false; // if time stamp NTFS, EXTT present // confirm size/length - int nlen = (name != null) ? name.length : 0; + + int nlen = (name != null) ? name.length - 1 : 0; // name has [0] as "slash" int elen = (extra != null) ? extra.length : 0; int eoff = 0; int clen = (comment != null) ? comment.length : 0; @@ -2004,7 +2025,7 @@ class ZipFileSystem extends FileSystem { writeInt(os, crc); // crc-32 writeInt(os, csize0); // compressed size writeInt(os, size0); // uncompressed size - writeShort(os, name.length); + writeShort(os, nlen); writeShort(os, elen + elen64 + elenNTFS + elenEXTT); if (comment != null) { @@ -2016,7 +2037,7 @@ class ZipFileSystem extends FileSystem { writeShort(os, 0); // internal file attributes (unused) writeInt(os, 0); // external file attributes (unused) writeInt(os, locoff0); // relative offset of local header - writeBytes(os, name); + writeBytes(os, name, 1, nlen); if (elen64 != 0) { writeShort(os, EXTID_ZIP64);// Zip64 extra writeShort(os, elen64 - 4); // size of "this" extra block @@ -2086,8 +2107,9 @@ class ZipFileSystem extends FileSystem { int nlen = LOCNAM(buf); int elen = LOCEXT(buf); - name = new byte[nlen]; - if (zipfs.readFullyAt(name, 0, nlen, pos + LOCHDR) != nlen) { + name = new byte[nlen + 1]; + name[0] = '/'; + if (zipfs.readFullyAt(name, 1, nlen, pos + LOCHDR) != nlen) { throw new ZipException("loc: name reading failed"); } if (elen > 0) { @@ -2130,12 +2152,10 @@ class ZipFileSystem extends FileSystem { return this; } - int writeLOC(OutputStream os) - throws IOException - { + int writeLOC(OutputStream os) throws IOException { writeInt(os, LOCSIG); // LOC header signature int version = version(); - int nlen = (name != null) ? name.length : 0; + int nlen = (name != null) ? name.length - 1 : 0; // [0] is slash int elen = (extra != null) ? extra.length : 0; boolean foundExtraTime = false; // if extra timestamp present int eoff = 0; @@ -2192,9 +2212,9 @@ class ZipFileSystem extends FileSystem { elenEXTT += 4; } } - writeShort(os, name.length); + writeShort(os, nlen); writeShort(os, elen + elen64 + elenNTFS + elenEXTT); - writeBytes(os, name); + writeBytes(os, name, 1, nlen); if (elen64 != 0) { writeShort(os, EXTID_ZIP64); writeShort(os, 16); @@ -2229,13 +2249,11 @@ class ZipFileSystem extends FileSystem { if (extra != null) { writeBytes(os, extra); } - return LOCHDR + name.length + elen + elen64 + elenNTFS + elenEXTT; + return LOCHDR + nlen + elen + elen64 + elenNTFS + elenEXTT; } // Data Descriptior - int writeEXT(OutputStream os) - throws IOException - { + int writeEXT(OutputStream os) throws IOException { writeInt(os, EXTSIG); // EXT header signature writeInt(os, crc); // crc-32 if (csize >= ZIP64_MINVAL || size >= ZIP64_MINVAL) { @@ -2301,7 +2319,15 @@ class ZipFileSystem extends FileSystem { break; case EXTID_EXTT: // spec says the Extened timestamp in cen only has mtime - // need to read the loc to get the extra a/ctime + // need to read the loc to get the extra a/ctime, if flag + // "zipinfo-time" is not specified to false; + // there is performance cost (move up to loc and read) to + // access the loc table foreach entry; + if (zipfs.noExtt) { + if (sz == 5) + mtime = unixToJavaTime(LG(extra, pos + 1)); + break; + } byte[] buf = new byte[LOCHDR]; if (zipfs.readFullyAt(buf, 0, buf.length , locoff) != buf.length) @@ -2309,7 +2335,6 @@ class ZipFileSystem extends FileSystem { if (!locSigAt(buf, 0)) throw new ZipException("loc: wrong sig ->" + Long.toString(getSig(buf, 0), 16)); - int locElen = LOCEXT(buf); if (locElen < 9) // EXTT is at lease 9 bytes break; @@ -2354,6 +2379,96 @@ class ZipFileSystem extends FileSystem { else extra = null; } + + ///////// basic file attributes /////////// + @Override + public FileTime creationTime() { + return FileTime.fromMillis(ctime == -1 ? mtime : ctime); + } + + @Override + public boolean isDirectory() { + return isDir(); + } + + @Override + public boolean isOther() { + return false; + } + + @Override + public boolean isRegularFile() { + return !isDir(); + } + + @Override + public FileTime lastAccessTime() { + return FileTime.fromMillis(atime == -1 ? mtime : atime); + } + + @Override + public FileTime lastModifiedTime() { + return FileTime.fromMillis(mtime); + } + + @Override + public long size() { + return size; + } + + @Override + public boolean isSymbolicLink() { + return false; + } + + @Override + public Object fileKey() { + return null; + } + + ///////// zip entry attributes /////////// + public long compressedSize() { + return csize; + } + + public long crc() { + return crc; + } + + public int method() { + return method; + } + + public byte[] extra() { + if (extra != null) + return Arrays.copyOf(extra, extra.length); + return null; + } + + public byte[] comment() { + if (comment != null) + return Arrays.copyOf(comment, comment.length); + return null; + } + + public String toString() { + StringBuilder sb = new StringBuilder(1024); + Formatter fm = new Formatter(sb); + fm.format(" creationTime : %tc%n", creationTime().toMillis()); + fm.format(" lastAccessTime : %tc%n", lastAccessTime().toMillis()); + fm.format(" lastModifiedTime: %tc%n", lastModifiedTime().toMillis()); + fm.format(" isRegularFile : %b%n", isRegularFile()); + fm.format(" isDirectory : %b%n", isDirectory()); + fm.format(" isSymbolicLink : %b%n", isSymbolicLink()); + fm.format(" isOther : %b%n", isOther()); + fm.format(" fileKey : %s%n", fileKey()); + fm.format(" size : %d%n", size()); + fm.format(" compressedSize : %d%n", compressedSize()); + fm.format(" crc : %x%n", crc()); + fm.format(" method : %d%n", method()); + fm.close(); + return sb.toString(); + } } private static class ExChannelCloser { @@ -2379,25 +2494,8 @@ class ZipFileSystem extends FileSystem { // implemented below. private IndexNode root; - private void addToTree(IndexNode inode, HashSet dirs) { - if (dirs.contains(inode)) { - return; - } - IndexNode parent; - byte[] name = inode.name; - byte[] pname = getParent(name); - if (inodes.containsKey(LOOKUPKEY.as(pname))) { - parent = inodes.get(LOOKUPKEY); - } else { // pseudo directory entry - parent = new IndexNode(pname, -1); - inodes.put(parent, parent); - } - addToTree(parent, dirs); - inode.sibling = parent.child; - parent.child = inode; - if (name[name.length -1] == '/') - dirs.add(inode); - } + // default time stamp for pseudo entries + private long zfsDefaultTimeStamp = System.currentTimeMillis(); private void removeFromTree(IndexNode inode) { IndexNode parent = inodes.get(LOOKUPKEY.as(getParent(inode.name))); @@ -2417,15 +2515,69 @@ class ZipFileSystem extends FileSystem { } } + // purely for parent lookup, so we don't have to copy the parent + // name every time + static class ParentLookup extends IndexNode { + int len; + ParentLookup() {} + + final ParentLookup as(byte[] name, int len) { // as a lookup "key" + name(name, len); + return this; + } + + void name(byte[] name, int len) { + this.name = name; + this.len = len; + // calculate the hashcode the same way as Arrays.hashCode() does + int result = 1; + for (int i = 0; i < len; i++) + result = 31 * result + name[i]; + this.hashcode = result; + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof IndexNode)) { + return false; + } + byte[] oname = ((IndexNode)other).name; + return Arrays.equals(name, 0, len, + oname, 0, oname.length); + } + + } + private void buildNodeTree() throws IOException { beginWrite(); try { - HashSet dirs = new HashSet<>(); - IndexNode root = new IndexNode(ROOTPATH, -1); + IndexNode root = new IndexNode(ROOTPATH); + IndexNode[] nodes = inodes.keySet().toArray(new IndexNode[0]); inodes.put(root, root); - dirs.add(root); - for (IndexNode node : inodes.keySet().toArray(new IndexNode[0])) { - addToTree(node, dirs); + ParentLookup lookup = new ParentLookup(); + for (IndexNode node : nodes) { + IndexNode parent; + while (true) { + int off = getParentOff(node.name); + if (off <= 1) { // parent is root + node.sibling = root.child; + root.child = node; + break; + } + lookup = lookup.as(node.name, off + 1); + if (inodes.containsKey(lookup)) { + parent = inodes.get(lookup); + node.sibling = parent.child; + parent.child = node; + break; + } + // add new pseudo directory entry + parent = new IndexNode(Arrays.copyOf(node.name, off + 1)); + inodes.put(parent, parent); + node.sibling = parent.child; + parent.child = node; + node = parent; + } } } finally { endWrite(); diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java index edc6d3c2f00..e4ec117cf08 100644 --- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java +++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java @@ -41,7 +41,7 @@ import static java.nio.file.StandardCopyOption.*; * @author Xueming Shen, Rajendra Gutupalli,Jaya Hangal */ -class ZipPath implements Path { +final class ZipPath implements Path { private final ZipFileSystem zfs; private final byte[] path; @@ -64,7 +64,7 @@ class ZipPath implements Path { @Override public ZipPath getRoot() { if (this.isAbsolute()) - return new ZipPath(zfs, new byte[]{path[0]}); + return zfs.getRootDir(); else return null; } @@ -145,7 +145,15 @@ class ZipPath implements Path { @Override public ZipPath toRealPath(LinkOption... options) throws IOException { - ZipPath realPath = new ZipPath(zfs, getResolvedPath()).toAbsolutePath(); + ZipPath realPath; + byte[] resolved = getResolvedPath(); + // resolved is always absolute and normalized + if (resolved == path) { + realPath = this; + } else { + realPath = new ZipPath(zfs, resolved, true); + realPath.resolved = resolved; + } realPath.checkAccess(); return realPath; } @@ -159,20 +167,11 @@ class ZipPath implements Path { if (isAbsolute()) { return this; } else { - //add / bofore the existing path - byte[] defaultdir = zfs.getDefaultDir().path; - int defaultlen = defaultdir.length; - boolean endsWith = (defaultdir[defaultlen - 1] == '/'); - byte[] t = null; - if (endsWith) - t = new byte[defaultlen + path.length]; - else - t = new byte[defaultlen + 1 + path.length]; - System.arraycopy(defaultdir, 0, t, 0, defaultlen); - if (!endsWith) - t[defaultlen++] = '/'; - System.arraycopy(path, 0, t, defaultlen, path.length); - return new ZipPath(zfs, t, true); // normalized + // add '/' before the existing path + byte[] tmp = new byte[path.length + 1]; + System.arraycopy(path, 0, tmp, 1, path.length); + tmp[0] = '/'; + return new ZipPath(zfs, tmp, true); // normalized } } @@ -217,11 +216,15 @@ class ZipPath implements Path { public Path relativize(Path other) { final ZipPath o = checkPath(other); if (o.equals(this)) - return new ZipPath(getFileSystem(), new byte[0], true); - if (/* this.getFileSystem() != o.getFileSystem() || */ - this.isAbsolute() != o.isAbsolute()) { + return new ZipPath(zfs, new byte[0], true); + if (this.path.length == 0) + return o; + if (this.zfs != o.zfs || this.isAbsolute() != o.isAbsolute()) throw new IllegalArgumentException(); - } + if (this.path.length == 1 && this.path[0] == '/') + return new ZipPath(zfs, + Arrays.copyOfRange(o.path, 1, o.path.length), + true); int mc = this.getNameCount(); int oc = o.getNameCount(); int n = Math.min(mc, oc); @@ -249,7 +252,7 @@ class ZipPath implements Path { System.arraycopy(o.path, o.offsets[i], result, pos, o.path.length - o.offsets[i]); - return new ZipPath(getFileSystem(), result); + return new ZipPath(zfs, result); } @Override @@ -265,26 +268,29 @@ class ZipPath implements Path { @Override public ZipPath resolve(Path other) { final ZipPath o = checkPath(other); - if (o.isAbsolute()) + int tlen = this.path.length; + if (tlen == 0 || o.isAbsolute()) return o; + int olen = o.path.length; + if (olen == 0) + return this; byte[] resolved = null; - if (this.path[path.length - 1] == '/') { - resolved = new byte[path.length + o.path.length]; - System.arraycopy(path, 0, resolved, 0, path.length); - System.arraycopy(o.path, 0, resolved, path.length, o.path.length); + if (this.path[tlen - 1] == '/') { + resolved = new byte[tlen + olen]; + System.arraycopy(path, 0, resolved, 0, tlen); + System.arraycopy(o.path, 0, resolved, tlen, olen); } else { - resolved = new byte[path.length + 1 + o.path.length]; - System.arraycopy(path, 0, resolved, 0, path.length); - resolved[path.length] = '/'; - System.arraycopy(o.path, 0, resolved, path.length + 1, o.path.length); + resolved = new byte[tlen + 1 + olen]; + System.arraycopy(path, 0, resolved, 0, tlen); + resolved[tlen] = '/'; + System.arraycopy(o.path, 0, resolved, tlen + 1, olen); } return new ZipPath(zfs, resolved); } @Override public Path resolveSibling(Path other) { - if (other == null) - throw new NullPointerException(); + Objects.requireNonNull(other, "other"); Path parent = getParent(); return (parent == null) ? other : parent.resolve(other); } @@ -330,22 +336,22 @@ class ZipPath implements Path { @Override public ZipPath resolve(String other) { - return resolve(getFileSystem().getPath(other)); + return resolve(zfs.getPath(other)); } @Override public final Path resolveSibling(String other) { - return resolveSibling(getFileSystem().getPath(other)); + return resolveSibling(zfs.getPath(other)); } @Override public final boolean startsWith(String other) { - return startsWith(getFileSystem().getPath(other)); + return startsWith(zfs.getPath(other)); } @Override public final boolean endsWith(String other) { - return endsWith(getFileSystem().getPath(other)); + return endsWith(zfs.getPath(other)); } @Override @@ -357,8 +363,7 @@ class ZipPath implements Path { } private ZipPath checkPath(Path path) { - if (path == null) - throw new NullPointerException(); + Objects.requireNonNull(path, "path"); if (!(path instanceof ZipPath)) throw new ProviderMismatchException(); return (ZipPath) path; @@ -410,8 +415,6 @@ class ZipPath implements Path { r = getResolved(); else r = toAbsolutePath().getResolvedPath(); - if (r[0] == '/') - r = Arrays.copyOfRange(r, 1, r.length); resolved = r; } return resolved; @@ -425,13 +428,10 @@ class ZipPath implements Path { byte prevC = 0; for (int i = 0; i < path.length; i++) { byte c = path[i]; - if (c == '\\') + if (c == '\\' || c == '\u0000') return normalize(path, i); if (c == (byte)'/' && prevC == '/') return normalize(path, i - 1); - if (c == '\u0000') - throw new InvalidPathException(zfs.getString(path), - "Path: nul character not allowed"); prevC = c; } return path; @@ -465,12 +465,10 @@ class ZipPath implements Path { // Remove DotSlash(./) and resolve DotDot (..) components private byte[] getResolved() { - if (path.length == 0) - return path; for (int i = 0; i < path.length; i++) { - byte c = path[i]; - if (c == (byte)'.') + if (path[i] == (byte)'.') { return resolve0(); + } } return path; } @@ -612,7 +610,6 @@ class ZipPath implements Path { ///////////////////////////////////////////////////////////////////// - void createDirectory(FileAttribute... attrs) throws IOException { @@ -749,20 +746,13 @@ class ZipPath implements Path { throw new UnsupportedOperationException(); } } - ZipFileAttributes attrs = zfs.getFileAttributes(getResolvedPath()); - if (attrs == null && (path.length != 1 || path[0] != '/')) - throw new NoSuchFileException(toString()); - if (w) { - if (zfs.isReadOnly()) - throw new AccessDeniedException(toString()); - } - if (x) + zfs.checkAccess(getResolvedPath()); + if ((w && zfs.isReadOnly()) || x) { throw new AccessDeniedException(toString()); + } } boolean exists() { - if (path.length == 1 && path[0] == '/') - return true; try { return zfs.exists(getResolvedPath()); } catch (IOException x) {} diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index f3434f35be4..de8331e3622 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -181,6 +181,8 @@ java/nio/file/WatchService/LotsOfEvents.java 7158947 solaris- java/nio/charset/coders/BashStreams.java 8149712 generic-all +java/nio/file/WatchService/DeleteInterference.java 8156511 linux-all + ############################################################################ # jdk_rmi diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 78c24d3b053..4b9b756fd75 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -26,9 +26,12 @@ groups=TEST.groups [closed/TEST.groups] # Allow querying of sun.arch.data.model in @requires clauses requires.properties=sun.arch.data.model -# Tests using jtreg 4.2 b01 features -requiredVersion=4.2 b01 +# Tests using jtreg 4.2 b02 features +requiredVersion=4.2 b02 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them external.lib.roots = ../../ + +# Use new form of -Xpatch +useNewXpatch=true diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index 673b0862d5c..3f5461582e5 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -29,7 +29,6 @@ tier1 = \ :jdk_lang \ -java/lang/ProcessHandle/TreeTest.java \ :jdk_util \ - -java/util/WeakHashMap/GCDuringIteration.java \ -java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \ -java/util/concurrent/forkjoin/FJExceptionTableLeak.java \ sun/nio/cs/ISO8859x.java \ @@ -39,7 +38,6 @@ tier1 = \ tier2 = \ java/lang/ProcessHandle/TreeTest.java \ - java/util/WeakHashMap/GCDuringIteration.java \ java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \ java/util/concurrent/forkjoin/FJExceptionTableLeak.java \ :jdk_io \ diff --git a/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh b/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh index e8b4365b68f..0ecd30a4de5 100644 --- a/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh +++ b/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh @@ -81,9 +81,9 @@ cp ${TESTSRC}${FS}JavaBug.java bug chmod -fR 777 bug -${COMPILEJAVA}${FS}bin${FS}javac -d . bug${FS}*.java +${COMPILEJAVA}${FS}bin${FS}javac -addmods java.corba -d . bug${FS}*.java -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . bug/JavaBug > test.out 2>&1 +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -addmods java.corba -cp . bug/JavaBug > test.out 2>&1 grep "NullPointerException" test.out diff --git a/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java b/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java index 6130a83420d..ccc84df74bc 100644 --- a/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java +++ b/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java @@ -27,7 +27,8 @@ * @summary Four helper classes missing in Sun JDK * @library /lib/testlibrary * @build jdk.testlibrary.* - * @run main CorbaExceptionsCompileTest + * @compile -addmods java.corba CorbaExceptionsCompileTest.java + * @run main/othervm -addmods java.corba CorbaExceptionsCompileTest */ import java.io.*; diff --git a/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java b/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java index cd7c50bdd37..4791c63f2ef 100644 --- a/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java +++ b/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java @@ -25,6 +25,8 @@ * @test * @bug 7095856 * @summary OutputStreamHook doesn't handle null values + * @compile -addmods java.corba HookPutFieldsTest.java + * @run main/othervm -addmods java.corba HookPutFieldsTest */ import java.net.InetAddress; diff --git a/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java b/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java index d5fa81cb2f5..49b0a5d9f6f 100644 --- a/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java +++ b/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java @@ -25,7 +25,8 @@ * @test * @bug 8028215 * @summary SetDefaultORBTest setting ORB impl via properties test - * @run main/othervm SetDefaultORBTest + * @compile -addmods java.corba SetDefaultORBTest.java + * @run main/othervm -addmods java.corba SetDefaultORBTest * */ diff --git a/jdk/test/com/sun/crypto/provider/Mac/HmacSHA512.java b/jdk/test/com/sun/crypto/provider/Mac/HmacSHA512.java new file mode 100644 index 00000000000..40d84ea1f38 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Mac/HmacSHA512.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2016, 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 jdk.testlibrary.Asserts; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.util.Arrays; + +/** + * @test + * @bug 8051408 + * @library /lib/testlibrary + * @summary testing HmacSHA512/224 and HmacSHA512/256. + */ +public class HmacSHA512 { + public static void main(String[] args) throws Exception { + + Mac mac; + + // Test vectors obtained from + // https://groups.google.com/d/msg/sci.crypt/OolWgsgQD-8/IUR2KhCcfEkJ + mac = Mac.getInstance("HmacSHA512/224"); + mac.init(new SecretKeySpec(xeh("4a656665"), "HmacSHA512/224")); + mac.update("what do ya want for nothing?".getBytes()); + Asserts.assertTrue(Arrays.equals(mac.doFinal(), + xeh("4a530b31a79ebcce36916546317c45f247d83241dfb818fd37254bde"))); + + mac = Mac.getInstance("HmacSHA512/256"); + mac.init(new SecretKeySpec(xeh("4a656665"), "HmacSHA512/256")); + mac.update("what do ya want for nothing?".getBytes()); + Asserts.assertTrue(Arrays.equals(mac.doFinal(), + xeh("6df7b24630d5ccb2ee335407081a87188c221489768fa2020513b2d593359456"))); + + mac = Mac.getInstance("HmacSHA512/224"); + mac.init(new SecretKeySpec(xeh("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"), + "HmacSHA512/224")); + mac.update("Hi There".getBytes()); + Asserts.assertTrue(Arrays.equals(mac.doFinal(), + xeh("b244ba01307c0e7a8ccaad13b1067a4cf6b961fe0c6a20bda3d92039"))); + + mac = Mac.getInstance("HmacSHA512/256"); + mac.init(new SecretKeySpec(xeh("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"), + "HmacSHA512/256")); + mac.update("Hi There".getBytes()); + Asserts.assertTrue(Arrays.equals(mac.doFinal(), + xeh("9f9126c3d9c3c330d760425ca8a217e31feae31bfe70196ff81642b868402eab"))); + } + + static byte[] xeh(String in) { + in = in.replaceAll(" ", ""); + int len = in.length() / 2; + byte[] out = new byte[len]; + for (int i = 0; i < len; i++) { + out[i] = (byte)Integer.parseInt(in.substring(i * 2, i * 2 + 2), 16); + } + return out; + } +} diff --git a/jdk/test/com/sun/net/httpserver/bugs/B6373555.java b/jdk/test/com/sun/net/httpserver/bugs/B6373555.java index cef94781975..4fa703234e1 100644 --- a/jdk/test/com/sun/net/httpserver/bugs/B6373555.java +++ b/jdk/test/com/sun/net/httpserver/bugs/B6373555.java @@ -29,7 +29,6 @@ import java.net.*; import java.io.*; -import javax.xml.soap.*; import java.util.*; import com.sun.net.httpserver.*; import java.util.concurrent.*; diff --git a/jdk/test/java/awt/Graphics2D/DrawString/AntialiasedTextArtifact.java b/jdk/test/java/awt/Graphics2D/DrawString/AntialiasedTextArtifact.java new file mode 100644 index 00000000000..36e9bf976bf --- /dev/null +++ b/jdk/test/java/awt/Graphics2D/DrawString/AntialiasedTextArtifact.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2016, 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 8015070 + * @summary Tests for artifacts around the edges of anti-aliased text + * drawn over translucent background color. + */ +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.io.IOException; + +public class AntialiasedTextArtifact { + /* Image dimensions */ + private static final int TEST_IMAGE_WIDTH = 2800; + private static final int TEST_IMAGE_HEIGHT = 100; + private static final String TEST_STRING = + "The quick brown fox jumps over the lazy dog. 0123456789."; + + /* + * The artifacts appear when text is drawn ontop of translucent + * background. In other words, a background with alpha channel. + * Hence we test the algorithm for image types that contain either + * straight alpha channel or pre-multiplied alpha channel. In + * addition we test the images with other common pixel formats. + */ + private static final int[] TYPES = {BufferedImage.TYPE_INT_ARGB, + BufferedImage.TYPE_INT_ARGB_PRE, + BufferedImage.TYPE_4BYTE_ABGR, + BufferedImage.TYPE_4BYTE_ABGR_PRE, + BufferedImage.TYPE_INT_RGB, + BufferedImage.TYPE_INT_BGR, + BufferedImage.TYPE_3BYTE_BGR}; + + public static void main(String[] args) throws IOException { + /* Iterate over different image types */ + for (int type : TYPES) { + BufferedImage testImg = getBufferedImage(type); + + /* Draw anti-aliased string and check for artifacts */ + drawAntialiasedString(testImg); + checkArtifact(testImg); + } + } + + private static BufferedImage getBufferedImage(int imageType) { + /* Create a Graphics2D object from the given image type */ + BufferedImage image = new BufferedImage(TEST_IMAGE_WIDTH, + TEST_IMAGE_HEIGHT, + imageType); + return image; + } + + private static void drawAntialiasedString(BufferedImage image) { + /* Create Graphics2D object */ + Graphics2D graphics = (Graphics2D) image.getGraphics(); + + /* Fill the image with translucent color */ + graphics.setColor(new Color(127, 127, 127, 127)); + graphics.fillRect(0, 0, TEST_IMAGE_WIDTH, TEST_IMAGE_HEIGHT); + + /* Drawstring with Antialiasing hint */ + graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + Font font = new Font("Verdana" , Font.PLAIN, 60); + graphics.setFont(font); + graphics.setColor(new Color(255, 0, 0)); + graphics.drawString(TEST_STRING, 10, 75); + graphics.dispose(); + } + + private static void checkArtifact(BufferedImage image) throws IOException { + int componentMask = 0xff; + int colorThreshold = 200; + int rowIndex = 0; + int colIndex = 0; + + /* Loop through every pixel to check for possible artifact */ + for (rowIndex = 0; rowIndex < image.getHeight(); rowIndex++) { + for (colIndex = 0; colIndex < image.getWidth(); colIndex++) { + /* + * API: getRGB(x,y) returns color in INT_ARGB color space. + * Extract individual color components with a simple mask. + */ + int colorValue = image.getRGB(colIndex, rowIndex); + int colorComponent1 = colorValue & componentMask; + int colorComponent2 = (colorValue>>8) & componentMask; + int colorComponent3 = (colorValue>>16) & componentMask; + + /* + * Artifacts are predominantly a subjective decision based on + * the quality of the rendered image content. However, in the + * current use-case, the artifacts around the edges of the anti + * aliased text appear like spots of white pixels without any + * relation to the color of foreground text or the background + * translucent shape. + * + * To identify the artifact pixels, each color component from + * the testImage is compared with a constant threshold. The + * component threshold has been set based on observation from + * different experiments on mulitple Java versions. + */ + if (colorComponent1 >= colorThreshold + && colorComponent2 >= colorThreshold + && colorComponent3 >= colorThreshold) { + /* Artifact has been noticed. Report error. */ + throw new RuntimeException("Test Failed."); + } + } + } + } +} diff --git a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java index 393f9c7c4c6..a162debb3f8 100644 --- a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java +++ b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -23,11 +23,13 @@ import java.io.FilePermission; import java.io.IOException; +import java.io.UncheckedIOException; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import java.lang.reflect.Module; import java.lang.reflect.Modifier; import java.lang.reflect.InaccessibleObjectException; +import java.lang.reflect.Layer; import java.lang.reflect.ReflectPermission; import java.net.URI; import java.nio.file.FileSystem; @@ -68,7 +70,6 @@ import jdk.internal.module.Modules; */ public class FieldSetAccessibleTest { - static final List skipped = new ArrayList<>(); static final List cantread = new ArrayList<>(); static final List failed = new ArrayList<>(); static final AtomicLong classCount = new AtomicLong(); @@ -210,7 +211,6 @@ public class FieldSetAccessibleTest { long millis = (elapsed % 1000_000_000) / 1000_000; long nanos = elapsed % 1000_000; System.out.println("Unreadable path elements: " + cantread); - System.out.println("Skipped path elements: " + skipped); System.out.println("Failed path elements: " + failed); printSummary(secs, millis, nanos); @@ -247,37 +247,26 @@ public class FieldSetAccessibleTest { static class ClassNameJrtStreamBuilder implements Iterable{ final FileSystem jrt; - final List roots = new ArrayList<>(); + final Path root; ClassNameJrtStreamBuilder() { jrt = FileSystems.getFileSystem(URI.create("jrt:/")); - for (Path root : jrt.getRootDirectories()) { - roots.add(root); - } - } - - Stream build() { - return roots.stream().flatMap(this::toStream) - .filter(x -> x.getNameCount() > 2) - .map( x-> x.subpath(2, x.getNameCount())) - .map( x -> x.toString()) - .filter(s -> s.endsWith(".class") && !s.endsWith("module-info.class")); + root = jrt.getPath("/modules"); } @Override public Iterator iterator() { - return build().iterator(); - } - - private Stream toStream(Path root) { try { - return Files.walk(root); + return Files.walk(root) + .filter(p -> p.getNameCount() > 2) + .filter(p -> Layer.boot().findModule(p.getName(1).toString()).isPresent()) + .map(p -> p.subpath(2, p.getNameCount())) + .map(p -> p.toString()) + .filter(s -> s.endsWith(".class") && !s.endsWith("module-info.class")) + .iterator(); } catch(IOException x) { - x.printStackTrace(System.err); - skipped.add(root.toString()); + throw new UncheckedIOException("Unable to walk \"/modules\"", x); } - return Collections.emptyList().stream(); } - } // Test with or without a security manager diff --git a/jdk/test/java/lang/StackWalker/EmbeddedStackWalkTest.java b/jdk/test/java/lang/StackWalker/EmbeddedStackWalkTest.java index 00bcb213596..8833aed4434 100644 --- a/jdk/test/java/lang/StackWalker/EmbeddedStackWalkTest.java +++ b/jdk/test/java/lang/StackWalker/EmbeddedStackWalkTest.java @@ -140,8 +140,8 @@ public class EmbeddedStackWalkTest { s.limit(BIG_LOOP) .filter(f -> c.getName().equals(f.getClassName()) && mn.equals(f.getMethodName())) .forEach(f -> { - assertEquals(f.getFileName().get(), fileName); - int line = f.getLineNumber().getAsInt(); + assertEquals(f.getFileName(), fileName); + int line = f.getLineNumber(); assertTrue(line >= BEGIN_LINE && line <= END_LINE); StackTraceElement st = f.toStackTraceElement(); diff --git a/jdk/test/java/lang/StackWalker/StackRecorderUtil.java b/jdk/test/java/lang/StackWalker/StackRecorderUtil.java index e20ce5a9f5a..6f6d04c4844 100644 --- a/jdk/test/java/lang/StackWalker/StackRecorderUtil.java +++ b/jdk/test/java/lang/StackWalker/StackRecorderUtil.java @@ -100,8 +100,8 @@ public class StackRecorderUtil implements Iterable } if (!Objects.equals(ste.getClassName(), sf.getClassName()) || !Objects.equals(ste.getMethodName(), sf.getMethodName()) - || !Objects.equals(ste.getFileName(), sf.getFileName().orElse(null)) - || !Objects.equals(ste.getLineNumber(), sf.getLineNumber().orElse(-1)) + || !Objects.equals(ste.getFileName(), sf.getFileName()) + || !Objects.equals(ste.getLineNumber(), sf.getLineNumber()) || !Objects.equals(ste.isNativeMethod(), sf.isNativeMethod())) { throw new RuntimeException("StackFrame and StackTraceElement differ: " + "sf=" + sf + ", ste=" + ste); diff --git a/jdk/test/java/lang/StackWalker/TestBCI.java b/jdk/test/java/lang/StackWalker/TestBCI.java new file mode 100644 index 00000000000..c7d3a332ce1 --- /dev/null +++ b/jdk/test/java/lang/StackWalker/TestBCI.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2016, 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 8140450 + * @summary Basic test for the StackWalker::getByteCodeIndex method + * @modules jdk.jdeps/com.sun.tools.classfile + * @run main TestBCI + */ + +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.Code_attribute; +import com.sun.tools.classfile.ConstantPoolException; +import com.sun.tools.classfile.Descriptor; +import com.sun.tools.classfile.LineNumberTable_attribute; +import com.sun.tools.classfile.Method; + +import java.lang.StackWalker.StackFrame; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static java.lang.StackWalker.Option.RETAIN_CLASS_REFERENCE; + +public class TestBCI { + public static void main(String... args) throws Exception { + TestBCI test = new TestBCI(Walker.class); + System.out.println("Line number table:"); + test.methods.values().stream() + .sorted(Comparator.comparing(MethodInfo::name).reversed()) + .forEach(System.out::println); + + // walk the stack + test.walk(); + } + + private final Map methods; + private final Class clazz; + TestBCI(Class c) throws ConstantPoolException, IOException { + Map methods; + String filename = c.getName().replace('.', '/') + ".class"; + try (InputStream in = c.getResourceAsStream(filename)) { + ClassFile cf = ClassFile.read(in); + methods = Arrays.stream(cf.methods) + .map(m -> new MethodInfo(cf, m)) + .collect(Collectors.toMap(MethodInfo::name, Function.identity())); + } + this.clazz = c; + this.methods = methods; + } + + void walk() { + Walker walker = new Walker(); + walker.m1(); + } + + void verify(StackFrame frame) { + if (frame.getDeclaringClass() != clazz) + return; + + int bci = frame.getByteCodeIndex(); + int lineNumber = frame.getLineNumber(); + System.out.format("%s.%s bci %d (%s:%d)%n", + frame.getClassName(), frame.getMethodName(), bci, + frame.getFileName(), lineNumber); + + MethodInfo method = methods.get(frame.getMethodName()); + SortedSet values = method.findLineNumbers(bci).get(); + if (!values.contains(lineNumber)) { + throw new RuntimeException("line number for bci: " + bci + " " + + lineNumber + " not matched line number table: " + values); + } + } + + /* + * BCIs in the execution stack when StackWalker::forEach is invoked + * will cover BCI range in the line number table. + */ + class Walker { + final StackWalker walker = StackWalker.getInstance(RETAIN_CLASS_REFERENCE); + void m1() { + int i = (int)Math.random()+2; + m2(i*2); + } + + void m2(int i) { + i++; + m3(i); + } + + void m3(int i) { + i++; m4(i++); + } + + int m4(int i) { + walker.forEach(TestBCI.this::verify); + return i; + } + } + + static class MethodInfo { + final Method method; + final String name; + final String paramTypes; + final String returnType; + final Map> bciToLineNumbers = new HashMap<>(); + MethodInfo(ClassFile cf, Method m) { + this.method = m; + + String name; + String paramTypes; + String returnType; + LineNumberTable_attribute.Entry[] lineNumberTable; + try { + // method name + name = m.getName(cf.constant_pool); + // signature + paramTypes = m.descriptor.getParameterTypes(cf.constant_pool); + returnType = m.descriptor.getReturnType(cf.constant_pool); + Code_attribute codeAttr = (Code_attribute) + m.attributes.get(Attribute.Code); + lineNumberTable = ((LineNumberTable_attribute) + codeAttr.attributes.get(Attribute.LineNumberTable)).line_number_table; + } catch (ConstantPoolException|Descriptor.InvalidDescriptor e) { + throw new RuntimeException(e); + } + this.name = name; + this.paramTypes = paramTypes; + this.returnType = returnType; + Arrays.stream(lineNumberTable).forEach(entry -> + bciToLineNumbers.computeIfAbsent(entry.start_pc, _n -> new TreeSet<>()) + .add(entry.line_number)); + } + + String name() { + return name; + } + + Optional> findLineNumbers(int value) { + return bciToLineNumbers.entrySet().stream() + .sorted(Map.Entry.comparingByKey(Comparator.reverseOrder())) + .filter(e -> e.getKey().intValue() <= value) + .map(Map.Entry::getValue) + .findFirst(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(name); + sb.append(paramTypes).append(returnType).append(" "); + bciToLineNumbers.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .forEach(entry -> sb.append("bci:").append(entry.getKey()).append(" ") + .append(entry.getValue()).append(" ")); + return sb.toString(); + } + } + +} diff --git a/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java b/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java new file mode 100644 index 00000000000..96d02bfa066 --- /dev/null +++ b/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2016, 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. + */ + +package p; + +import java.io.*; +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.Instrumentation; +import java.lang.reflect.Module; +import java.security.ProtectionDomain; + +public class BootstrapClassPathAgent { + + public static void premain(String args, Instrumentation inst) { + System.out.println("agent loader=" + BootstrapClassPathAgent.class.getClassLoader()); + inst.addTransformer(new MyTransformer()); + } + + static class MyTransformer implements ClassFileTransformer { + + public byte[] transform(Module module, + String className, + Class classBeingRedefined, + ProtectionDomain protectionDomain, + byte[] classfileBuffer) { + System.out.println(className + ", module=" + module); + return null; + } + } +} diff --git a/jdk/test/java/lang/instrument/BootstrapClassPathSetUp.sh b/jdk/test/java/lang/instrument/BootstrapClassPathSetUp.sh new file mode 100644 index 00000000000..dea6f05f1ff --- /dev/null +++ b/jdk/test/java/lang/instrument/BootstrapClassPathSetUp.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# +# Copyright (c) 2016, 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. +# + +if [ "${TESTSRC}" = "" ] +then + echo "TESTSRC not set. Test cannot execute. Failed." + exit 1 +fi +echo "TESTSRC=${TESTSRC}" + +if [ "${TESTJAVA}" = "" ] +then + echo "TESTJAVA not set. Test cannot execute. Failed." + exit 1 +fi +echo "TESTJAVA=${TESTJAVA}" + +if [ "${COMPILEJAVA}" = "" ] +then + COMPILEJAVA="${TESTJAVA}" +fi +echo "COMPILEJAVA=${COMPILEJAVA}" + +if [ "${TESTCLASSES}" = "" ] +then + echo "TESTCLASSES not set. Test cannot execute. Failed." + exit 1 +fi + +echo "TESTCLASSES=${TESTCLASSES}" +echo "CLASSPATH=${CLASSPATH}" + +JAVAC="${COMPILEJAVA}/bin/javac -g" +JAR="${COMPILEJAVA}/bin/jar" + +mkdir agentclasses +touch agent.mf +echo "Manifest-Version: 1.0" >> agent.mf +echo "Boot-Class-Path: agent.jar" >> agent.mf +echo "Premain-Class: p.BootstrapClassPathAgent" >> agent.mf + +cp ${TESTSRC}/BootstrapClassPathAgent.java BootstrapClassPathAgent.java +${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d agentclasses BootstrapClassPathAgent.java +echo "JAR=${JAR}" +${JAR} ${TESTTOOLVMOPTS} cvfm agent.jar agent.mf -C agentclasses . +rm -f BootstrapClassPathAgent.class BootstrapClassPathAgent.java diff --git a/jdk/test/tools/jlink/hashes/newsrc/m2/org/m2/Util.java b/jdk/test/java/lang/instrument/BootstrapClassPathTest.java similarity index 65% rename from jdk/test/tools/jlink/hashes/newsrc/m2/org/m2/Util.java rename to jdk/test/java/lang/instrument/BootstrapClassPathTest.java index b7e0b62fc77..bee8602308e 100644 --- a/jdk/test/tools/jlink/hashes/newsrc/m2/org/m2/Util.java +++ b/jdk/test/java/lang/instrument/BootstrapClassPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,12 +21,23 @@ * questions. */ -package org.m2; +/** + * @test + * @bug 8156147 + * @summary simple test for the Boot-Class-Path agent + * + * @run build BootstrapClassPathTest + * @run shell BootstrapClassPathSetUp.sh + * @run main/othervm -javaagent:agent.jar BootstrapClassPathTest BootstrapClassPathTest + */ -public class Util { - private Util() { } +import java.io.*; +import java.lang.instrument.*; +import java.lang.reflect.Module; +import java.security.ProtectionDomain; - public static String timeOfDay() { - return "Time for a beer"; +public class BootstrapClassPathTest { + + public static void main (String[] args) { } } diff --git a/jdk/test/java/lang/invoke/VarargsArrayTest.java b/jdk/test/java/lang/invoke/VarargsArrayTest.java index 98e069835a7..dad164dcccc 100644 --- a/jdk/test/java/lang/invoke/VarargsArrayTest.java +++ b/jdk/test/java/lang/invoke/VarargsArrayTest.java @@ -37,7 +37,7 @@ import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor; * @library /lib/testlibrary /lib/testlibrary/jsr292 * @compile/module=java.base java/lang/invoke/MethodHandleHelper.java * @run main/bootclasspath VarargsArrayTest - * @run main/bootclasspath -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.START_ARITY=250 + * @run main/bootclasspath/othervm -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.START_ARITY=250 * VarargsArrayTest */ diff --git a/jdk/test/java/lang/module/ModuleFinderTest.java b/jdk/test/java/lang/module/ModuleFinderTest.java index 2306ba3a2f9..3270dfd4085 100644 --- a/jdk/test/java/lang/module/ModuleFinderTest.java +++ b/jdk/test/java/lang/module/ModuleFinderTest.java @@ -340,7 +340,7 @@ public class ModuleFinderTest { */ public void testOfWithUnrecognizedEntry() throws Exception { Path dir = Files.createTempDirectory(USER_DIR, "mods"); - Path mod = Files.createTempFile(dir, "m", "mod"); + Path mod = Files.createTempFile(dir, "m", ".junk"); ModuleFinder finder = ModuleFinder.of(mod); try { @@ -360,6 +360,48 @@ public class ModuleFinderTest { } + /** + * Test ModuleFinder.of with a file path to a directory containing a file + * that will not be recognized as a module. + */ + public void testOfWithUnrecognizedEntryInDirectory() throws Exception { + Path dir = Files.createTempDirectory(USER_DIR, "mods"); + Files.createTempFile(dir, "m", ".junk"); + + ModuleFinder finder = ModuleFinder.of(dir); + try { + finder.find("java.rhubarb"); + assertTrue(false); + } catch (FindException e) { + // expected + } + + finder = ModuleFinder.of(dir); + try { + finder.findAll(); + assertTrue(false); + } catch (FindException e) { + // expected + } + } + + + /** + * Test ModuleFinder.of with a file path to a directory containing a file + * starting with ".", the file should be ignored. + */ + public void testOfWithHiddenEntryInDirectory() throws Exception { + Path dir = Files.createTempDirectory(USER_DIR, "mods"); + Files.createTempFile(dir, ".marker", ""); + + ModuleFinder finder = ModuleFinder.of(dir); + assertFalse(finder.find("java.rhubarb").isPresent()); + + finder = ModuleFinder.of(dir); + assertTrue(finder.findAll().isEmpty()); + } + + /** * Test ModuleFinder.of with a directory that contains two * versions of the same module diff --git a/jdk/test/tools/launcher/modules/addmods/src/app/Main.java b/jdk/test/java/lang/reflect/WeakPairMap/Driver.java similarity index 78% rename from jdk/test/tools/launcher/modules/addmods/src/app/Main.java rename to jdk/test/java/lang/reflect/WeakPairMap/Driver.java index be903e510ac..f84956d687e 100644 --- a/jdk/test/tools/launcher/modules/addmods/src/app/Main.java +++ b/jdk/test/java/lang/reflect/WeakPairMap/Driver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,12 +21,15 @@ * questions. */ -package app; - -import jdk.lib.Util; - -public class Main { +/** + * @test + * @bug 8888888 + * @summary Functional test for WeakPairMap + * @build java.base/java.lang.reflect.WeakPairMapTest + * @run main Driver + */ +public class Driver { public static void main(String[] args) { - Object obj = Util.makeObject(); + java.lang.reflect.WeakPairMapTest.main(args); } } diff --git a/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java b/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java new file mode 100644 index 00000000000..3247bb317ac --- /dev/null +++ b/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2016, 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. + */ + +package java.lang.reflect; + +import java.lang.ref.Reference; +import java.util.Objects; + +/** + * Functional test for WeakPairMap + * + * @author Peter Levart + */ +public class WeakPairMapTest { + public static void main(String[] args) { + WeakPairMap pm = new WeakPairMap<>(); + Object key1 = new Object(); + Object key2 = new Object(); + + // check for emptiness + assertEquals(pm.containsKeyPair(key1, key2), false); + assertEquals(pm.get(key1, key2), null); + + // check for NPE(s) + for (Object k1 : new Object[]{null, key1}) { + for (Object k2 : new Object[]{null, key2}) { + for (String v : new String[]{null, "abc"}) { + + if (k1 != null && k2 != null && v != null) { + // skip non-null args + continue; + } + + try { + pm.put(k1, k2, v); + throw new AssertionError("Unexpected code path, k1=" + + k1 + ", k2=" + k2 + ", v=" + v); + } catch (NullPointerException e) { + // expected + } + + try { + pm.putIfAbsent(k1, k2, v); + throw new AssertionError("Unexpected code path, k1=" + + k1 + ", k2=" + k2 + ", v=" + v); + } catch (NullPointerException e) { + // expected + } + + if (k1 != null && k2 != null) { + // skip non-null args + continue; + } + + try { + pm.computeIfAbsent(k1, k2, (_k1, _k2) -> v); + throw new AssertionError("Unexpected code path, k1=" + + k1 + ", k2=" + k2 + ", v=" + v); + } catch (NullPointerException e) { + // expected + } + + try { + pm.containsKeyPair(k1, k2); + throw new AssertionError("Unexpected code path, k1=" + + k1 + ", k2=" + k2); + } catch (NullPointerException e) { + // expected + } + + try { + pm.get(k1, k2); + throw new AssertionError("Unexpected code path, k1=" + + k1 + ", k2=" + k2); + } catch (NullPointerException e) { + // expected + } + } + } + } + + // how much to wait when it is expected for entry to be retained + final long retentionTimeout = 500L; + // how much to wait when it is expected for entry to be removed + final long cleanupTimeout = 30_000L; + + // check insertion + assertEquals(pm.putIfAbsent(key1, key2, "abc"), null); + assertEquals(pm.get(key1, key2), "abc"); + + // check retention while both keys are still reachable + assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false); + assertEquals(pm.get(key1, key2), "abc"); + + // check cleanup when both keys are unreachable + key1 = null; + key2 = null; + assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true); + + // new insertion + key1 = new Object(); + key2 = new Object(); + assertEquals(pm.putIfAbsent(key1, key2, "abc"), null); + assertEquals(pm.get(key1, key2), "abc"); + + // check retention while both keys are still reachable + assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false); + assertEquals(pm.get(key1, key2), "abc"); + + // check cleanup when 1st key is unreachable + key1 = null; + assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true); + Reference.reachabilityFence(key2); + + // new insertion + key1 = new Object(); + key2 = new Object(); + assertEquals(pm.putIfAbsent(key1, key2, "abc"), null); + assertEquals(pm.get(key1, key2), "abc"); + + // check retention while both keys are still reachable + assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false); + assertEquals(pm.get(key1, key2), "abc"); + + // check cleanup when 2nd key is unreachable + key2 = null; + assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true); + Reference.reachabilityFence(key1); + } + + /** + * Trigger GC and wait for at most {@code millis} ms for given value to + * be removed from given WeakPairMap. + * + * @return true if element has been removed or false if not + */ + static boolean gcAndWaitRemoved(WeakPairMap pm, V value, + long millis) { + System.gc(); + for (int i = 0; i < (millis + 99) / 100 && pm.values().contains(value); i++) { + try { + Thread.sleep(100L); + } catch (InterruptedException e) { + throw new AssertionError("Interrupted"); + } + } + return !pm.values().contains(value); + } + + static void assertEquals(Object actual, Object expected) { + if (!Objects.equals(actual, expected)) { + throw new AssertionError("Expected: " + expected + ", actual: " + actual); + } + } +} diff --git a/jdk/test/java/net/httpclient/QuickResponses.java b/jdk/test/java/net/httpclient/QuickResponses.java index 5de1f687552..50d32b8dfbb 100644 --- a/jdk/test/java/net/httpclient/QuickResponses.java +++ b/jdk/test/java/net/httpclient/QuickResponses.java @@ -71,6 +71,7 @@ public class QuickResponses { public static void main(String[] args) throws Exception { server = new Server(0); URI uri = new URI(server.getURL()); + server.start(); HttpRequest request = HttpRequest.create(uri) .GET(); @@ -79,7 +80,6 @@ public class QuickResponses { Server.Connection s1 = server.activity(); s1.send(entireResponse()); - HttpResponse r = cf1.join(); if (r.statusCode()!= 200 || !r.body(HttpResponse.asString()).equals(responses[0])) throw new RuntimeException("Failed on first response"); diff --git a/jdk/test/java/net/httpclient/Server.java b/jdk/test/java/net/httpclient/Server.java index d103e12d54c..ffc98956a2d 100644 --- a/jdk/test/java/net/httpclient/Server.java +++ b/jdk/test/java/net/httpclient/Server.java @@ -21,8 +21,6 @@ * questions. */ -//package javaapplication16; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -32,6 +30,7 @@ import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.LinkedList; import java.util.List; +import java.util.Iterator; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -44,13 +43,16 @@ import java.util.concurrent.atomic.AtomicInteger; public class Server extends Thread { ServerSocket ss; - List sockets; + private final List sockets; + private final List removals; + private final List additions; AtomicInteger counter = new AtomicInteger(0); // waits up to 20 seconds for something to happen // dont use this unless certain activity coming. public Connection activity() { for (int i = 0; i < 80 * 100; i++) { + doRemovalsAndAdditions(); for (Connection c : sockets) { if (c.poll()) { return c; @@ -59,11 +61,26 @@ public class Server extends Thread { try { Thread.sleep(250); } catch (InterruptedException e) { + e.printStackTrace(); } } return null; } + private void doRemovalsAndAdditions() { + if (removals.isEmpty() && additions.isEmpty()) + return; + Iterator i = removals.iterator(); + while (i.hasNext()) + sockets.remove(i.next()); + removals.clear(); + + i = additions.iterator(); + while (i.hasNext()) + sockets.add(i.next()); + additions.clear(); + } + // clears all current connections on Server. public void reset() { for (Connection c : sockets) { @@ -84,7 +101,6 @@ public class Server extends Thread { incoming = new ArrayBlockingQueue<>(100); setName("Server-Connection"); setDaemon(true); - start(); } final Socket socket; final int id; @@ -210,16 +226,17 @@ public class Server extends Thread { try { socket.close(); } catch (IOException e) {} - sockets.remove(this); + removals.add(this); } } Server(int port) throws IOException { ss = new ServerSocket(port); sockets = Collections.synchronizedList(new LinkedList<>()); + removals = Collections.synchronizedList(new LinkedList<>()); + additions = Collections.synchronizedList(new LinkedList<>()); setName("Test-Server"); setDaemon(true); - start(); } Server() throws IOException { @@ -238,6 +255,7 @@ public class Server extends Thread { try { ss.close(); } catch (IOException e) { + e.printStackTrace(); } for (Connection c : sockets) { c.close(); @@ -250,8 +268,10 @@ public class Server extends Thread { try { Socket s = ss.accept(); Connection c = new Connection(s); - sockets.add(c); + c.start(); + additions.add(c); } catch (IOException e) { + e.printStackTrace(); } } } diff --git a/jdk/test/java/net/httpclient/SplitResponse.java b/jdk/test/java/net/httpclient/SplitResponse.java index cf887c19a0f..a26ee01e159 100644 --- a/jdk/test/java/net/httpclient/SplitResponse.java +++ b/jdk/test/java/net/httpclient/SplitResponse.java @@ -68,6 +68,7 @@ public class SplitResponse { public static void main(String[] args) throws Exception { server = new Server(0); URI uri = new URI(server.getURL()); + server.start(); HttpRequest request; HttpResponse r; diff --git a/jdk/test/java/net/httpclient/http2/BasicTest.java b/jdk/test/java/net/httpclient/http2/BasicTest.java index 0d53bbf1b04..3a07e652730 100644 --- a/jdk/test/java/net/httpclient/http2/BasicTest.java +++ b/jdk/test/java/net/httpclient/http2/BasicTest.java @@ -98,6 +98,7 @@ public class BasicTest { simpleTest(true); streamTest(false); streamTest(true); + paramsTest(); Thread.sleep(1000 * 4); } finally { httpServer.stop(); @@ -180,6 +181,30 @@ public class BasicTest { System.err.println("DONE"); } + static void paramsTest() throws Exception { + Http2TestServer server = new Http2TestServer(true, 0, (t -> { + SSLSession s = t.getSSLSession(); + String prot = s.getProtocol(); + if (prot.equals("TLSv1.2")) { + t.sendResponseHeaders(200, -1); + } else { + System.err.printf("Protocols =%s\n", prot); + t.sendResponseHeaders(500, -1); + } + }), exec, sslContext); + server.start(); + int port = server.getAddress().getPort(); + URI u = new URI("https://127.0.0.1:"+port+"/foo"); + HttpClient client = getClient(); + HttpRequest req = client.request(u) + .GET(); + HttpResponse resp = req.response(); + int stat = resp.statusCode(); + if (stat != 200) { + throw new RuntimeException("paramsTest failed " + + Integer.toString(stat)); + } + } static void simpleTest(boolean secure) throws Exception { URI uri = getURI(secure); diff --git a/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestExchange.java b/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestExchange.java index 4b9ce043001..0203eaa0656 100644 --- a/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestExchange.java +++ b/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestExchange.java @@ -5,6 +5,7 @@ import java.io.OutputStream; import java.io.IOException; import java.net.URI; import java.net.InetSocketAddress; +import javax.net.ssl.SSLSession; public class Http2TestExchange { @@ -14,6 +15,7 @@ public class Http2TestExchange { final String method; final InputStream is; final BodyOutputStream os; + final SSLSession sslSession; final int streamid; final boolean pushAllowed; final Http2TestServerConnection conn; @@ -24,6 +26,7 @@ public class Http2TestExchange { Http2TestExchange(int streamid, String method, HttpHeadersImpl reqheaders, HttpHeadersImpl rspheaders, URI uri, InputStream is, + SSLSession sslSession, BodyOutputStream os, Http2TestServerConnection conn, boolean pushAllowed) { this.reqheaders = reqheaders; this.rspheaders = rspheaders; @@ -32,6 +35,7 @@ public class Http2TestExchange { this.is = is; this.streamid = streamid; this.os = os; + this.sslSession = sslSession; this.pushAllowed = pushAllowed; this.conn = conn; this.server = conn.server; @@ -53,6 +57,10 @@ public class Http2TestExchange { return method; } + public SSLSession getSSLSession() { + return sslSession; + } + public void close() { try { is.close(); diff --git a/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestServerConnection.java b/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestServerConnection.java index 2f56f8a3dfb..645dc6a6677 100644 --- a/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestServerConnection.java +++ b/jdk/test/java/net/httpclient/http2/java.httpclient/java/net/http/Http2TestServerConnection.java @@ -31,6 +31,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.net.URI; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; import java.net.URISyntaxException; import static java.net.http.SettingsFrame.HEADER_TABLE_SIZE; import java.nio.ByteBuffer; @@ -355,7 +357,8 @@ public class Http2TestServerConnection { URI uri = new URI(us); boolean pushAllowed = clientSettings.getParameter(SettingsFrame.ENABLE_PUSH) == 1; Http2TestExchange exchange = new Http2TestExchange(streamid, method, - headers, rspheaders, uri, bis, bos, this, pushAllowed); + headers, rspheaders, uri, bis, getSSLSession(), + bos, this, pushAllowed); // give to user handler.handle(exchange); @@ -368,6 +371,12 @@ public class Http2TestServerConnection { } } + private SSLSession getSSLSession() { + if (! (socket instanceof SSLSocket)) + return null; + SSLSocket ssl = (SSLSocket)socket; + return ssl.getSession(); + } // Runs in own thread @SuppressWarnings({"rawtypes","unchecked"}) diff --git a/jdk/test/java/net/httpclient/security/0.policy b/jdk/test/java/net/httpclient/security/0.policy index 918766e425d..16276a7e5f9 100644 --- a/jdk/test/java/net/httpclient/security/0.policy +++ b/jdk/test/java/net/httpclient/security/0.policy @@ -2,8 +2,7 @@ grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/1.policy b/jdk/test/java/net/httpclient/security/1.policy index b9be27e884c..8e44d212d69 100644 --- a/jdk/test/java/net/httpclient/security/1.policy +++ b/jdk/test/java/net/httpclient/security/1.policy @@ -1,8 +1,7 @@ // Policy 1 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; @@ -13,7 +12,7 @@ grant { // permissions specific to this test - permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET"; + permission java.net.URLPermission "http://127.0.0.1:${port.number}/files/foo.txt", "GET"; }; // For proxy only. Not being tested diff --git a/jdk/test/java/net/httpclient/security/10.policy b/jdk/test/java/net/httpclient/security/10.policy index e6341878348..2be99f876b7 100644 --- a/jdk/test/java/net/httpclient/security/10.policy +++ b/jdk/test/java/net/httpclient/security/10.policy @@ -1,8 +1,7 @@ // Policy 10 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; @@ -12,7 +11,7 @@ grant { permission java.lang.RuntimePermission "createClassLoader"; // permissions specific to this test - permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET:*"; + permission java.net.URLPermission "http://127.0.0.1:${port.number}/files/foo.txt", "GET:*"; }; // For proxy only. Not being tested diff --git a/jdk/test/java/net/httpclient/security/11.policy b/jdk/test/java/net/httpclient/security/11.policy index 016d090bc65..16d9b48791d 100644 --- a/jdk/test/java/net/httpclient/security/11.policy +++ b/jdk/test/java/net/httpclient/security/11.policy @@ -1,8 +1,7 @@ // Policy 11 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; @@ -12,8 +11,8 @@ grant { permission java.lang.RuntimePermission "createClassLoader"; // permissions specific to this test - permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET:*"; - permission java.net.URLPermission "socket://127.0.0.1:27301", "CONNECT"; + permission java.net.URLPermission "http://127.0.0.1:${port.number}/files/foo.txt", "GET:*"; + permission java.net.URLPermission "socket://127.0.0.1:${port.number1}", "CONNECT"; }; diff --git a/jdk/test/java/net/httpclient/security/12.policy b/jdk/test/java/net/httpclient/security/12.policy index 016d090bc65..16d9b48791d 100644 --- a/jdk/test/java/net/httpclient/security/12.policy +++ b/jdk/test/java/net/httpclient/security/12.policy @@ -1,8 +1,7 @@ // Policy 11 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; @@ -12,8 +11,8 @@ grant { permission java.lang.RuntimePermission "createClassLoader"; // permissions specific to this test - permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET:*"; - permission java.net.URLPermission "socket://127.0.0.1:27301", "CONNECT"; + permission java.net.URLPermission "http://127.0.0.1:${port.number}/files/foo.txt", "GET:*"; + permission java.net.URLPermission "socket://127.0.0.1:${port.number1}", "CONNECT"; }; diff --git a/jdk/test/java/net/httpclient/security/14.policy b/jdk/test/java/net/httpclient/security/14.policy new file mode 100644 index 00000000000..85b0d4943e4 --- /dev/null +++ b/jdk/test/java/net/httpclient/security/14.policy @@ -0,0 +1,23 @@ +// Policy 14 +grant { + // permissions common to all tests + permission java.util.PropertyPermission "*", "read"; + permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; + permission java.net.NetPermission "getDefaultHttpClient"; + permission java.lang.RuntimePermission "modifyThread"; + permission java.util.logging.LoggingPermission "control", ""; + permission java.net.SocketPermission "localhost:1024-", "accept,listen"; + permission java.io.FilePermission "${test.src}${/}docs${/}-", "read"; + permission java.lang.RuntimePermission "createClassLoader"; + + + // permissions specific to this test + permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET"; +}; + +// For proxy only. Not being tested +grant codebase "file:${test.classes}/proxydir/-" { + permission java.net.SocketPermission "localhost:1024-", "accept,listen,connect"; + permission java.net.SocketPermission "127.0.0.1:1024-", "connect,resolve"; +}; + diff --git a/jdk/test/java/net/httpclient/security/15.policy b/jdk/test/java/net/httpclient/security/15.policy index f2f02c90b9e..923b2deed35 100644 --- a/jdk/test/java/net/httpclient/security/15.policy +++ b/jdk/test/java/net/httpclient/security/15.policy @@ -1,8 +1,7 @@ // Policy 11 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; @@ -13,7 +12,6 @@ grant { // permissions specific to this test permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET:*"; - permission java.net.URLPermission "socket://127.0.0.1:27301", "CONNECT"; // Test checks for this explicitly permission java.net.RuntimePermission "foobar"; diff --git a/jdk/test/java/net/httpclient/security/2.policy b/jdk/test/java/net/httpclient/security/2.policy index 8a19314f3d0..7c7e50013a1 100644 --- a/jdk/test/java/net/httpclient/security/2.policy +++ b/jdk/test/java/net/httpclient/security/2.policy @@ -1,8 +1,7 @@ // Policy 2 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/3.policy b/jdk/test/java/net/httpclient/security/3.policy index 075a5be3e80..85f3e59a216 100644 --- a/jdk/test/java/net/httpclient/security/3.policy +++ b/jdk/test/java/net/httpclient/security/3.policy @@ -1,8 +1,7 @@ // Policy 3 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/4.policy b/jdk/test/java/net/httpclient/security/4.policy index 8248caf46da..6d67b89cdd7 100644 --- a/jdk/test/java/net/httpclient/security/4.policy +++ b/jdk/test/java/net/httpclient/security/4.policy @@ -1,8 +1,7 @@ // Policy 4 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/5.policy b/jdk/test/java/net/httpclient/security/5.policy index ba63e335919..5eb739a6e81 100644 --- a/jdk/test/java/net/httpclient/security/5.policy +++ b/jdk/test/java/net/httpclient/security/5.policy @@ -1,8 +1,7 @@ // Policy 5 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/6.policy b/jdk/test/java/net/httpclient/security/6.policy index 4b29da739c3..55bbd1ac30c 100644 --- a/jdk/test/java/net/httpclient/security/6.policy +++ b/jdk/test/java/net/httpclient/security/6.policy @@ -1,8 +1,7 @@ // Policy 6 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/7.policy b/jdk/test/java/net/httpclient/security/7.policy index 80345ba1610..7859e8df5e6 100644 --- a/jdk/test/java/net/httpclient/security/7.policy +++ b/jdk/test/java/net/httpclient/security/7.policy @@ -1,8 +1,7 @@ // Policy 7 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/8.policy b/jdk/test/java/net/httpclient/security/8.policy index bc298b19fd6..774b0ae47ed 100644 --- a/jdk/test/java/net/httpclient/security/8.policy +++ b/jdk/test/java/net/httpclient/security/8.policy @@ -1,8 +1,7 @@ // Policy 8 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/9.policy b/jdk/test/java/net/httpclient/security/9.policy index d11c412f274..e4ff37dd01f 100644 --- a/jdk/test/java/net/httpclient/security/9.policy +++ b/jdk/test/java/net/httpclient/security/9.policy @@ -1,8 +1,7 @@ // Policy 9 grant { // permissions common to all tests - permission java.util.PropertyPermission "test.src", "read"; - permission java.util.PropertyPermission "test.classes", "read"; + permission java.util.PropertyPermission "*", "read"; permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete"; permission java.net.NetPermission "getDefaultHttpClient"; permission java.lang.RuntimePermission "modifyThread"; diff --git a/jdk/test/java/net/httpclient/security/Driver.java b/jdk/test/java/net/httpclient/security/Driver.java new file mode 100644 index 00000000000..078be5f5e51 --- /dev/null +++ b/jdk/test/java/net/httpclient/security/Driver.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2015, 2016, 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 + */ + +/** + * @test + * @bug 8087112 + * @library /lib/testlibrary/ + * @build jdk.testlibrary.SimpleSSLContext jdk.testlibrary.Utils + * @compile ../../../../com/sun/net/httpserver/LogFilter.java + * @compile ../../../../com/sun/net/httpserver/FileServerHandler.java + * @compile ../ProxyServer.java + * @build Security + * + * @run driver/timeout=60 Driver + */ + +/** + * driver required for allocating free portnumbers and putting this number + * into security policy file used in some tests. + * + * The tests are in Security.java and port number supplied in -Dport.number + * and -Dport.number1 for tests that require a second free port + */ +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.io.*; +import java.net.*; + +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.Utils; + +/** + * Driver for tests + */ +public class Driver { + + public static void main(String[] args) throws Throwable { + System.out.println("Starting Driver"); + runtest("1.policy", "1"); + runtest("10.policy", "10"); + runtest("11.policy", "11"); + runtest("12.policy", "12"); + System.out.println("DONE"); + } + + static class Logger extends Thread { + private final OutputStream ps; + private final InputStream stdout; + + Logger(String cmdLine, Process p, String dir) throws IOException { + super(); + setDaemon(true); + cmdLine = "Command line = [" + cmdLine + "]"; + stdout = p.getInputStream(); + File f = File.createTempFile("debug", ".txt", new File(dir)); + ps = new FileOutputStream(f); + ps.write(cmdLine.getBytes()); + ps.flush(); + } + + public void run() { + try { + byte[] buf = new byte[128]; + int c; + while ((c = stdout.read(buf)) != -1) { + ps.write(buf, 0, c); + ps.flush(); + } + ps.close(); + } catch (Throwable e) { + e.printStackTrace(); + } + } + } + + public static void runtest(String policy, String testnum) throws Throwable { + + String testJdk = System.getProperty("test.jdk", "?"); + String testSrc = System.getProperty("test.src", "?"); + String testClassPath = System.getProperty("test.class.path", "?"); + String testClasses = System.getProperty("test.classes", "?"); + String sep = System.getProperty("file.separator", "?"); + String javaCmd = testJdk + sep + "bin" + sep + "java"; + int retval = 10; // 10 is special exit code denoting a bind error + // in which case, we retry + while (retval == 10) { + List cmd = new ArrayList<>(); + cmd.add(javaCmd); + cmd.add("-Dtest.jdk=" + testJdk); + cmd.add("-Dtest.src=" + testSrc); + cmd.add("-Dtest.classes=" + testClasses); + cmd.add("-Djava.security.manager"); + cmd.add("-Djava.security.policy=" + testSrc + sep + policy); + cmd.add("-Dport.number=" + Integer.toString(Utils.getFreePort())); + cmd.add("-Dport.number1=" + Integer.toString(Utils.getFreePort())); + cmd.add("-cp"); + cmd.add(testClassPath); + cmd.add("Security"); + cmd.add(testnum); + + ProcessBuilder processBuilder = new ProcessBuilder(cmd) + .redirectOutput(ProcessBuilder.Redirect.PIPE) + .redirectErrorStream(true); + + String cmdLine = cmd.stream().collect(Collectors.joining(" ")); + Process child = processBuilder.start(); + Logger log = new Logger(cmdLine, child, testClasses); + log.start(); + retval = child.waitFor(); + System.out.println("retval = " + retval); + } + if (retval != 0) { + Thread.sleep(2000); + throw new RuntimeException("Non zero return value"); + } + } +} diff --git a/jdk/test/java/net/httpclient/security/Security.java b/jdk/test/java/net/httpclient/security/Security.java index adfa8f71f65..185b8a7be26 100644 --- a/jdk/test/java/net/httpclient/security/Security.java +++ b/jdk/test/java/net/httpclient/security/Security.java @@ -32,7 +32,6 @@ * @compile ../ProxyServer.java * * @run main/othervm/secure=java.lang.SecurityManager/policy=0.policy Security 0 - * @run main/othervm/secure=java.lang.SecurityManager/policy=1.policy Security 1 * @run main/othervm/secure=java.lang.SecurityManager/policy=2.policy Security 2 * @run main/othervm/secure=java.lang.SecurityManager/policy=3.policy Security 3 * @run main/othervm/secure=java.lang.SecurityManager/policy=4.policy Security 4 @@ -41,14 +40,13 @@ * @run main/othervm/secure=java.lang.SecurityManager/policy=7.policy Security 7 * @run main/othervm/secure=java.lang.SecurityManager/policy=8.policy Security 8 * @run main/othervm/secure=java.lang.SecurityManager/policy=9.policy Security 9 - * @run main/othervm/secure=java.lang.SecurityManager/policy=10.policy Security 10 - * @run main/othervm/secure=java.lang.SecurityManager/policy=11.policy Security 11 - * @run main/othervm/secure=java.lang.SecurityManager/policy=12.policy Security 12 * @run main/othervm/secure=java.lang.SecurityManager/policy=0.policy Security 13 - * @run main/othervm/secure=java.lang.SecurityManager/policy=1.policy Security 14 + * @run main/othervm/secure=java.lang.SecurityManager/policy=14.policy Security 14 * @run main/othervm/secure=java.lang.SecurityManager/policy=15.policy Security 15 */ +// Tests 1, 10, 11 and 12 executed from Driver + import com.sun.net.httpserver.*; import java.io.IOException; import java.io.InputStream; @@ -78,7 +76,7 @@ public class Security { static HttpServer s1 = null; static ExecutorService executor=null; - static int port; + static int port, proxyPort; static HttpClient client; static String httproot, fileuri, fileroot, redirectroot; static List clients = new LinkedList<>(); @@ -136,6 +134,9 @@ public class Security { if (!dest.toFile().exists()) { System.out.printf("moving %s to %s\n", src.toString(), dest.toString()); Files.move(src, dest, StandardCopyOption.REPLACE_EXISTING); + } else if (src.toFile().exists()) { + System.out.printf("%s exists, deleting %s\n", dest.toString(), src.toString()); + Files.delete(src); } else { System.out.printf("NOT moving %s to %s\n", src.toString(), dest.toString()); } @@ -225,15 +226,15 @@ public class Security { }), // (10) policy has permission for destination URL but not for proxy test(false, () -> { //Policy 10 - directProxyTest(27208, true); + directProxyTest(proxyPort, true); }), // (11) policy has permission for both destination URL and proxy test(true, () -> { //Policy 11 - directProxyTest(27301, true); + directProxyTest(proxyPort, true); }), // (12) policy has permission for both destination URL and proxy test(false, () -> { //Policy 11 - directProxyTest(28301, false); + directProxyTest(proxyPort, false); }), // (13) async version of test 0 test(false, () -> { // Policy 0 @@ -350,6 +351,8 @@ public class Security { throw new RuntimeException("Failed"); } System.out.println (policy + " succeeded as expected"); + } catch (BindException e) { + System.exit(10); } catch (SecurityException e) { if (succeeds) { System.out.println("FAILED"); @@ -362,8 +365,12 @@ public class Security { } public static void main(String[] args) throws Exception { - initServer(); - setupProxy(); + try { + initServer(); + setupProxy(); + } catch (BindException e) { + System.exit(10); + } fileroot = System.getProperty ("test.src")+ "/docs"; int testnum = Integer.parseInt(args[0]); String policy = args[0]; @@ -382,33 +389,25 @@ public class Security { runtest(tr.test, policy, tr.result); } finally { s1.stop(0); - //executor.shutdownNow(); + executor.shutdownNow(); for (HttpClient client : clients) client.executorService().shutdownNow(); } } - // create Http Server on port range below. So, we can - HttpServer createServer() { - HttpServer server; - for (int i=25800; i<26800; i++) { - InetSocketAddress a = new InetSocketAddress(i); - try { - server = HttpServer.create(a, 0); - return server; - } catch (IOException e) {} - } - return null; - } - public static void initServer() throws Exception { + String portstring = System.getProperty("port.number"); + port = portstring != null ? Integer.parseInt(portstring) : 0; + portstring = System.getProperty("port.number1"); + proxyPort = portstring != null ? Integer.parseInt(portstring) : 0; + Logger logger = Logger.getLogger("com.sun.net.httpserver"); ConsoleHandler ch = new ConsoleHandler(); logger.setLevel(Level.ALL); ch.setLevel(Level.ALL); logger.addHandler(ch); String root = System.getProperty ("test.src")+ "/docs"; - InetSocketAddress addr = new InetSocketAddress (0); + InetSocketAddress addr = new InetSocketAddress (port); s1 = HttpServer.create (addr, 0); if (s1 instanceof HttpsServer) { throw new RuntimeException ("should not be httpsserver"); @@ -423,7 +422,13 @@ public class Security { s1.setExecutor (executor); s1.start(); - port = s1.getAddress().getPort(); + if (port == 0) + port = s1.getAddress().getPort(); + else { + if (s1.getAddress().getPort() != port) + throw new RuntimeException("Error wrong port"); + System.out.println("Port was assigned by Driver"); + } System.out.println("HTTP server port = " + port); httproot = "http://127.0.0.1:" + port + "/files/"; redirectroot = "http://127.0.0.1:" + port + "/redirect/"; diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java index c833735eb0f..e12ab09c32b 100644 --- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java +++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java @@ -25,7 +25,7 @@ * @bug 4607272 6842687 6878369 6944810 7023403 * @summary Unit test for AsynchronousSocketChannel * @run main Basic -skipSlowConnectTest - * @key randomness + * @key randomness intermittent */ import java.nio.ByteBuffer; diff --git a/jdk/test/java/nio/channels/FileChannel/InterruptMapDeadlock.java b/jdk/test/java/nio/channels/FileChannel/InterruptMapDeadlock.java index 43d0e36508e..3a173b9479c 100644 --- a/jdk/test/java/nio/channels/FileChannel/InterruptMapDeadlock.java +++ b/jdk/test/java/nio/channels/FileChannel/InterruptMapDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -23,6 +23,7 @@ /* @test * @bug 8024833 + * @key intermittent * @summary Tests interruption of threads mapping sections of a file channel in * an attempt to deadlock due to nesting of begin calls. */ diff --git a/jdk/test/java/nio/charset/spi/basic.sh b/jdk/test/java/nio/charset/spi/basic.sh index a53b51ea7e0..4e1c6df891b 100644 --- a/jdk/test/java/nio/charset/spi/basic.sh +++ b/jdk/test/java/nio/charset/spi/basic.sh @@ -113,7 +113,7 @@ for where in app; do av="$av -Djava.security.manager -Djava.security.policy==$TESTSRC/default-pol";; cp-policy) css="$CSS FOO"; av="$av -Djava.security.manager - -Djava.security.policy==$TESTSRC/charsetProvider.sp";; + -Djava.security.policy=$TESTSRC/charsetProvider.sp";; esac if (set -x; $JAVA ${TESTVMOPTS} $av Test $css) 2>&1; then continue; diff --git a/jdk/test/java/nio/charset/spi/default-pol b/jdk/test/java/nio/charset/spi/default-pol index 1f5acba9cc0..b380d5e82d8 100644 --- a/jdk/test/java/nio/charset/spi/default-pol +++ b/jdk/test/java/nio/charset/spi/default-pol @@ -1,3 +1,11 @@ +grant codeBase "jrt:/jdk.charsets" { + permission java.io.FilePermission "${java.home}/-", "read"; + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "sun.nio.cs.map", "read"; + permission java.lang.RuntimePermission "charsetProvider"; + permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc"; + permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.cs"; +}; // default permissions granted to all domains diff --git a/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java b/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java new file mode 100644 index 00000000000..bba242c4779 --- /dev/null +++ b/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2016, 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 8051408 + * @summary Make sure DrbgParameters coded as specified + * @library /test/lib/share/classes + */ + +import jdk.test.lib.Asserts; + +import java.security.DrbgParameters; +import java.util.Arrays; + +import static java.security.DrbgParameters.Capability.*; + +public class DrbgParametersSpec { + + public static void main(String args[]) throws Exception { + + byte[] p, np1, np2; + + // Capability + Asserts.assertTrue(PR_AND_RESEED.supportsPredictionResistance()); + Asserts.assertTrue(PR_AND_RESEED.supportsReseeding()); + Asserts.assertFalse(RESEED_ONLY.supportsPredictionResistance()); + Asserts.assertTrue(RESEED_ONLY.supportsReseeding()); + Asserts.assertFalse(NONE.supportsPredictionResistance()); + Asserts.assertFalse(NONE.supportsReseeding()); + + // Instantiation + p = "Instantiation".getBytes(); + DrbgParameters.Instantiation ins = DrbgParameters + .instantiation(192, RESEED_ONLY, p); + Asserts.assertTrue(ins.getStrength() == 192); + Asserts.assertTrue(ins.getCapability() == RESEED_ONLY); + np1 = ins.getPersonalizationString(); + np2 = ins.getPersonalizationString(); + // Getter outputs have same content but not the same object + Asserts.assertTrue(Arrays.equals(np1, p)); + Asserts.assertTrue(Arrays.equals(np2, p)); + Asserts.assertNE(np1, np2); + // Changes to original input has no affect on object + p[0] = 'X'; + np2 = ins.getPersonalizationString(); + Asserts.assertTrue(Arrays.equals(np1, np2)); + + ins = DrbgParameters.instantiation(-1, NONE, null); + Asserts.assertNull(ins.getPersonalizationString()); + + // NextBytes + p = "NextBytes".getBytes(); + DrbgParameters.NextBytes nb = DrbgParameters + .nextBytes(192, true, p); + Asserts.assertTrue(nb.getStrength() == 192); + Asserts.assertTrue(nb.getPredictionResistance()); + np1 = nb.getAdditionalInput(); + np2 = nb.getAdditionalInput(); + // Getter outputs have same content but not the same object + Asserts.assertTrue(Arrays.equals(np1, p)); + Asserts.assertTrue(Arrays.equals(np2, p)); + Asserts.assertNE(np1, np2); + // Changes to original input has no affect on object + p[0] = 'X'; + np2 = nb.getAdditionalInput(); + Asserts.assertTrue(Arrays.equals(np1, np2)); + + // Reseed + p = "Reseed".getBytes(); + DrbgParameters.Reseed rs = DrbgParameters + .reseed(true, p); + Asserts.assertTrue(rs.getPredictionResistance()); + np1 = rs.getAdditionalInput(); + np2 = rs.getAdditionalInput(); + // Getter outputs have same content but not the same object + Asserts.assertTrue(Arrays.equals(np1, p)); + Asserts.assertTrue(Arrays.equals(np2, p)); + Asserts.assertNE(np1, np2); + // Changes to original input has no affect on object + p[0] = 'X'; + np2 = rs.getAdditionalInput(); + Asserts.assertTrue(Arrays.equals(np1, np2)); + } +} diff --git a/jdk/test/java/security/SecureRandom/Serialize.java b/jdk/test/java/security/SecureRandom/Serialize.java index 3ba6d63e0f9..799f1bfa428 100644 --- a/jdk/test/java/security/SecureRandom/Serialize.java +++ b/jdk/test/java/security/SecureRandom/Serialize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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,16 +31,73 @@ import java.io.*; public class Serialize { - public static void main(String args[]) throws IOException { + public static void main(String args[]) throws Exception { + for (String alg: new String[]{ + "SHA1PRNG", "DRBG", "Hash_DRBG", "HMAC_DRBG", "CTR_DRBG", + "Hash_DRBG,SHA-512,192,pr_and_reseed"}) { - FileOutputStream fos = new FileOutputStream("t.tmp"); - ObjectOutputStream oos = new ObjectOutputStream(fos); + System.out.println("Testing " + alg); + SecureRandom s1; - SecureRandom secRandom = new SecureRandom(); + // A SecureRandom can be s11ned and des11ned at any time. - // serialize and write out - oos.writeObject(secRandom); - oos.flush(); - oos.close(); + // Brand new. + s1 = getInstance(alg); + revive(s1).nextInt(); + if (alg.contains("DRBG")) { + revive(s1).reseed(); + } + + // Used + s1 = getInstance(alg); + s1.nextInt(); // state set + revive(s1).nextInt(); + if (alg.contains("DRBG")) { + revive(s1).reseed(); + } + + // Automatically reseeded + s1 = getInstance(alg); + if (alg.contains("DRBG")) { + s1.reseed(); + } + revive(s1).nextInt(); + if (alg.contains("DRBG")) { + revive(s1).reseed(); + } + + // Manually seeded + s1 = getInstance(alg); + s1.setSeed(1L); + revive(s1).nextInt(); + if (alg.contains("DRBG")) { + revive(s1).reseed(); + } + } + } + + private static SecureRandom getInstance(String alg) throws Exception { + if (alg.equals("SHA1PRNG") || alg.equals("DRBG")) { + return SecureRandom.getInstance(alg); + } else { + String old = Security.getProperty("securerandom.drbg.config"); + try { + Security.setProperty("securerandom.drbg.config", alg); + return SecureRandom.getInstance("DRBG"); + } finally { + Security.setProperty("securerandom.drbg.config", old); + } + } + } + + private static SecureRandom revive(SecureRandom oldOne) throws Exception { + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + new ObjectOutputStream(bout).writeObject(oldOne); + SecureRandom newOne = (SecureRandom) new ObjectInputStream( + new ByteArrayInputStream(bout.toByteArray())).readObject(); + if (!oldOne.toString().equals(newOne.toString())) { + throw new Exception(newOne + " is not " + oldOne); + } + return newOne; } } diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java index 14d7e0359d4..db19675f97b 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java @@ -72,6 +72,7 @@ import static org.testng.Assert.assertEquals; import java.text.ParsePosition; import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.LocalTime; import java.time.YearMonth; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; @@ -793,7 +794,101 @@ public class TCKDateTimeFormatterBuilder { DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern("g").toFormatter(); assertEquals(LocalDate.of(y, m, d).format(df), expected); } + //---------------------------------------------------------------------- + @DataProvider(name="dayOfYearFieldValues") + Object[][] data_dayOfYearFieldValues() { + return new Object[][] { + {2016, 1, 1, "D", "1"}, + {2016, 1, 31, "D", "31"}, + {2016, 1, 1, "DD", "01"}, + {2016, 1, 31, "DD", "31"}, + {2016, 4, 9, "DD", "100"}, + {2016, 1, 1, "DDD", "001"}, + {2016, 1, 31, "DDD", "031"}, + {2016, 4, 9, "DDD", "100"}, + }; + } + @Test(dataProvider="dayOfYearFieldValues") + public void test_dayOfYearFieldValues(int y, int m, int d, String pattern, String expected) throws Exception { + DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter(); + assertEquals(LocalDate.of(y, m, d).format(df), expected); + } + + @DataProvider(name="dayOfYearFieldAdjacentParsingValues") + Object[][] data_dayOfYearFieldAdjacentParsingValues() { + return new Object[][] { + {"20160281015", LocalDateTime.of(2016, 1, 28, 10, 15)}, + {"20161001015", LocalDateTime.of(2016, 4, 9, 10, 15)}, + }; + } + + @Test(dataProvider="dayOfYearFieldAdjacentParsingValues") + public void test_dayOfYearFieldAdjacentValueParsing(String input, LocalDateTime expected) { + DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern("yyyyDDDHHmm").toFormatter(); + LocalDateTime actual = LocalDateTime.parse(input, df); + assertEquals(actual, expected); + } + + @Test(expectedExceptions = DateTimeParseException.class) + public void test_dayOfYearFieldInvalidValue() { + DateTimeFormatter.ofPattern("DDD").parse("1234"); + } + + @Test(expectedExceptions = DateTimeParseException.class) + public void test_dayOfYearFieldInvalidAdacentValueParsingPattern() { + // patterns D and DD will not take part in adjacent value parsing + DateTimeFormatter.ofPattern("yyyyDDHHmmss").parse("201610123456"); + } + + //----------------------------------------------------------------------- + @DataProvider(name="secondsPattern") + Object[][] data_secondsPattern() { + return new Object[][] { + {"A", "1", LocalTime.ofNanoOfDay(1_000_000)}, + {"A", "100000", LocalTime.ofSecondOfDay(100)}, + {"AA", "01", LocalTime.ofNanoOfDay(1_000_000)}, + {"AA", "100000", LocalTime.ofSecondOfDay(100)}, + {"AAAAAA", "100000", LocalTime.ofSecondOfDay(100)}, + {"HHmmssn", "0000001", LocalTime.ofNanoOfDay(1)}, + {"HHmmssn", "000000111", LocalTime.ofNanoOfDay(111)}, + {"HHmmssnn", "00000001", LocalTime.ofNanoOfDay(1)}, + {"HHmmssnn", "0000001111", LocalTime.ofNanoOfDay(1111)}, + {"HHmmssnnnnnn", "000000111111", LocalTime.ofNanoOfDay(111_111)}, + {"N", "1", LocalTime.ofNanoOfDay(1)}, + {"N", "100000", LocalTime.ofNanoOfDay(100_000)}, + {"NN", "01", LocalTime.ofNanoOfDay(1)}, + {"NN", "100000", LocalTime.ofNanoOfDay(100_000)}, + {"NNNNNN", "100000", LocalTime.ofNanoOfDay(100_000)}, + }; + } + + @Test(dataProvider="secondsPattern") + public void test_secondsPattern(String pattern, String input, LocalTime expected) throws Exception { + DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter(); + assertEquals(LocalTime.parse(input, df), expected); + } + + @DataProvider(name="secondsValues") + Object[][] data_secondsValues() { + return new Object[][] { + {"A", 1, "1000"}, + {"n", 1, "0"}, + {"N", 1, "1000000000"}, + }; + } + + @Test(dataProvider="secondsValues") + public void test_secondsValues(String pattern, int seconds , String expected) throws Exception { + DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter(); + assertEquals(LocalTime.ofSecondOfDay(seconds).format(df), expected); + } + + @Test(expectedExceptions = DateTimeParseException.class) + public void test_secondsPatternInvalidAdacentValueParsingPattern() { + // patterns A*, N*, n* will not take part in adjacent value parsing + DateTimeFormatter.ofPattern("yyyyAA").parse("201610"); + } //----------------------------------------------------------------------- @Test diff --git a/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java b/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java index 316fa3f9227..c4c88bc3b1b 100644 --- a/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java +++ b/jdk/test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -684,7 +684,7 @@ public class TestDateTimeFormatterBuilder { {"LLLLL", "Text(MonthOfYear,NARROW_STANDALONE)"}, {"D", "Value(DayOfYear)"}, - {"DD", "Value(DayOfYear,2)"}, + {"DD", "Value(DayOfYear,2,3,NOT_NEGATIVE)"}, {"DDD", "Value(DayOfYear,3)"}, {"d", "Value(DayOfMonth)"}, @@ -746,17 +746,17 @@ public class TestDateTimeFormatterBuilder { {"SSS", "Fraction(NanoOfSecond,3,3)"}, {"SSSSSSSSS", "Fraction(NanoOfSecond,9,9)"}, - {"A", "Value(MilliOfDay)"}, - {"AA", "Value(MilliOfDay,2)"}, - {"AAA", "Value(MilliOfDay,3)"}, + {"A", "Value(MilliOfDay,1,19,NOT_NEGATIVE)"}, + {"AA", "Value(MilliOfDay,2,19,NOT_NEGATIVE)"}, + {"AAA", "Value(MilliOfDay,3,19,NOT_NEGATIVE)"}, - {"n", "Value(NanoOfSecond)"}, - {"nn", "Value(NanoOfSecond,2)"}, - {"nnn", "Value(NanoOfSecond,3)"}, + {"n", "Value(NanoOfSecond,1,19,NOT_NEGATIVE)"}, + {"nn", "Value(NanoOfSecond,2,19,NOT_NEGATIVE)"}, + {"nnn", "Value(NanoOfSecond,3,19,NOT_NEGATIVE)"}, - {"N", "Value(NanoOfDay)"}, - {"NN", "Value(NanoOfDay,2)"}, - {"NNN", "Value(NanoOfDay,3)"}, + {"N", "Value(NanoOfDay,1,19,NOT_NEGATIVE)"}, + {"NN", "Value(NanoOfDay,2,19,NOT_NEGATIVE)"}, + {"NNN", "Value(NanoOfDay,3,19,NOT_NEGATIVE)"}, {"z", "ZoneText(SHORT)"}, {"zz", "ZoneText(SHORT)"}, @@ -782,7 +782,7 @@ public class TestDateTimeFormatterBuilder { {"xxxxx", "Offset(+HH:MM:ss,'+00:00')"}, // LDML {"ppH", "Pad(Value(HourOfDay),2)"}, - {"pppDD", "Pad(Value(DayOfYear,2),3)"}, + {"pppDD", "Pad(Value(DayOfYear,2,3,NOT_NEGATIVE),3)"}, {"yyyy[-MM[-dd", "Value(YearOfEra,4,19,EXCEEDS_PAD)['-'Value(MonthOfYear,2)['-'Value(DayOfMonth,2)]]"}, {"yyyy[-MM[-dd]]", "Value(YearOfEra,4,19,EXCEEDS_PAD)['-'Value(MonthOfYear,2)['-'Value(DayOfMonth,2)]]"}, diff --git a/jdk/test/java/util/Currency/Bug8154295.java b/jdk/test/java/util/Currency/Bug8154295.java new file mode 100644 index 00000000000..356d00ba36b --- /dev/null +++ b/jdk/test/java/util/Currency/Bug8154295.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, 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 8154295 + * @summary Check getNumericCodeAsString() method which returns numeric code as a 3 digit String. + */ + +import java.util.Currency; + +public class Bug8154295 { + + public static void main(String[] args) { + + String numericCode = Currency.getInstance("AFA").getNumericCodeAsString(); + if (!numericCode.equals("004")) { //should return "004" (a 3 digit string) + throw new RuntimeException("[Expected 004, " + + "found "+numericCode+" for AFA]"); + } + + numericCode = Currency.getInstance("AUD").getNumericCodeAsString(); + if (!numericCode.equals("036")) { //should return "036" (a 3 digit string) + throw new RuntimeException("[Expected 036, " + + "found "+numericCode+" for AUD]"); + } + + numericCode = Currency.getInstance("USD").getNumericCodeAsString(); + if (!numericCode.equals("840")) {// should return "840" (a 3 digit string) + throw new RuntimeException("[Expected 840, " + + "found "+numericCode+" for USD]"); + } + + } + +} diff --git a/jdk/test/java/util/Map/EntrySetIterator.java b/jdk/test/java/util/Map/EntrySetIterator.java new file mode 100644 index 00000000000..db90280097e --- /dev/null +++ b/jdk/test/java/util/Map/EntrySetIterator.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2016, 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 8139233 + * @summary ensure entry set's iterator doesn't have side effects on the entry set + * @run testng EntrySetIterator + */ + +import java.util.*; +import org.testng.annotations.Test; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertEquals; + +public class EntrySetIterator { + @Test + public void main() { + Map map = Map.of("a", "1", "b", "2", "c", "3"); + Set> entrySet = map.entrySet(); + Iterator> iterator = entrySet.iterator(); + + assertTrue(iterator.hasNext()); + + // copying implicitly iterates an iterator + Set> copy1 = new HashSet<>(entrySet); + Set> copy2 = new HashSet<>(entrySet); + + assertEquals(copy2, copy1); + assertTrue(iterator.hasNext()); + } +} diff --git a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh index 62bc96cdba9..c2ce46ec3c3 100644 --- a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh +++ b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh @@ -68,7 +68,7 @@ cd ${PATCHDIR}/java.desktop ${TESTJAVA}/bin/jar xf ${TESTSRC}/awtres.jar echo -${TESTJAVA}/bin/java ${TESTVMOPTS} -Xpatch:${PATCHDIR} \ +${TESTJAVA}/bin/java ${TESTVMOPTS} -Xpatch:java.desktop=${PATCHDIR}/java.desktop \ -cp ${TESTCLASSES} Bug6299235Test if [ $? -ne 0 ] diff --git a/jdk/test/java/util/jar/JarFile/MultiReleaseJarHttpProperties.java b/jdk/test/java/util/jar/JarFile/MultiReleaseJarHttpProperties.java index f80991d09d5..50cec677ee6 100644 --- a/jdk/test/java/util/jar/JarFile/MultiReleaseJarHttpProperties.java +++ b/jdk/test/java/util/jar/JarFile/MultiReleaseJarHttpProperties.java @@ -26,7 +26,7 @@ * @bug 8132734 * @summary Test the System properties for JarFile that support multi-release jar files * @library /lib/testlibrary/java/util/jar - * @build Compiler JarBuilder CreateMultiReleaseTestJars + * @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer * @run testng MultiReleaseJarHttpProperties * @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarHttpProperties * @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarHttpProperties @@ -43,8 +43,6 @@ * @run testng/othervm -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties */ -import com.sun.net.httpserver.*; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -73,7 +71,7 @@ public class MultiReleaseJarHttpProperties extends MultiReleaseJarProperties { @Override protected void initializeClassLoader() throws Exception { URL[] urls = new URL[]{ - new URL("http://localhost:" + server.getPort() + "/multi-release-jar") + new URL("http://localhost:" + server.getPort() + "/multi-release.jar") }; cldr = new URLClassLoader(urls); // load any class, Main is convenient and in the root entries @@ -112,45 +110,3 @@ public class MultiReleaseJarHttpProperties extends MultiReleaseJarProperties { getResource(rootClass, resource); } } - -/** - * Extremely simple server that only performs one task. The server listens for - * requests on the ephemeral port. If it sees a request that begins with - * "/multi-release-jar", it consumes the request and returns a stream of bytes - * representing the jar file multi-release.jar found in "userdir". - */ -class SimpleHttpServer { - private static final String userdir = System.getProperty("user.dir", "."); - private static final Path multirelease = Paths.get(userdir, "multi-release.jar"); - - private final HttpServer server; - - public SimpleHttpServer() throws IOException { - server = HttpServer.create(); - } - - public void start() throws IOException { - server.bind(new InetSocketAddress(0), 0); - server.createContext("/multi-release-jar", t -> { - try (InputStream is = t.getRequestBody()) { - is.readAllBytes(); // probably not necessary to consume request - byte[] bytes = Files.readAllBytes(multirelease); - t.sendResponseHeaders(200, bytes.length); - try (OutputStream os = t.getResponseBody()) { - os.write(bytes); - } - } - }); - server.setExecutor(null); // creates a default executor - server.start(); - } - - public void stop() { - server.stop(0); - } - - int getPort() { - return server.getAddress().getPort(); - } -} - diff --git a/jdk/test/javax/crypto/Cipher/CipherStreamClose.java b/jdk/test/javax/crypto/Cipher/CipherStreamClose.java index 1e8ff16331d..304c887dea1 100644 --- a/jdk/test/javax/crypto/Cipher/CipherStreamClose.java +++ b/jdk/test/javax/crypto/Cipher/CipherStreamClose.java @@ -27,6 +27,8 @@ * @summary Make sure Cipher IO streams doesn't call extra doFinal if close() * is called multiple times. Additionally, verify the input and output streams * match with encryption and decryption with non-stream crypto. + * @compile -addmods java.xml.bind CipherStreamClose.java + * @run main/othervm -addmods java.xml.bind CipherStreamClose */ import java.io.*; diff --git a/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java b/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java index d69cbe42f9c..52079aa359b 100644 --- a/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java +++ b/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java @@ -27,8 +27,10 @@ * @summary test RMI-IIOP call with ConcurrentHashMap as an argument * @library /lib/testlibrary * @build jdk.testlibrary.* - * @build Test HelloInterface HelloServer HelloClient HelloImpl _HelloImpl_Tie _HelloInterface_Stub ConcurrentHashMapTest - * @run main/othervm -Djava.naming.provider.url=iiop://localhost:1050 -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest + * @compile -addmods java.corba Test.java HelloInterface.java HelloServer.java HelloClient.java + * HelloImpl.java _HelloImpl_Tie.java _HelloInterface_Stub.java ConcurrentHashMapTest.java + * @run main/othervm -addmods java.corba -Djava.naming.provider.url=iiop://localhost:1050 + * -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest * @key intermittent */ @@ -101,6 +103,8 @@ public class ConcurrentHashMapTest { // -Djava.naming.provider.url=iiop://localhost:1050 HelloServer List commands = new ArrayList<>(); commands.add(ConcurrentHashMapTest.JAVA); + commands.add("-addmods"); + commands.add("java.corba"); commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory"); commands.add("-Djava.naming.provider.url=iiop://localhost:1050"); commands.add("-cp"); diff --git a/jdk/test/javax/smartcardio/CommandAPDUTest.java b/jdk/test/javax/smartcardio/CommandAPDUTest.java index a6ce5c69d41..72c5a474590 100644 --- a/jdk/test/javax/smartcardio/CommandAPDUTest.java +++ b/jdk/test/javax/smartcardio/CommandAPDUTest.java @@ -26,7 +26,8 @@ * @bug 8049021 * @summary Test different constructors for CommandAPDU and check CLA,INS,NC,NE, * P1,and P2 - * @run testng CommandAPDUTest + * @compile -addmods java.smartcardio CommandAPDUTest.java + * @run testng/othervm -addmods java.smartcardio CommandAPDUTest */ import java.nio.ByteBuffer; import javax.smartcardio.CommandAPDU; diff --git a/jdk/test/javax/smartcardio/HistoricalBytes.java b/jdk/test/javax/smartcardio/HistoricalBytes.java index 35af338cd09..eebaf8dd671 100644 --- a/jdk/test/javax/smartcardio/HistoricalBytes.java +++ b/jdk/test/javax/smartcardio/HistoricalBytes.java @@ -26,7 +26,9 @@ * @bug 6445367 * @summary Verify that ATR.getHistoricalBytes() works * @author Andreas Sterbenz -**/ + * @compile -addmods java.smartcardio HistoricalBytes.java + * @run main/othervm -addmods java.smartcardio HistoricalBytes + */ import java.util.Arrays; diff --git a/jdk/test/javax/smartcardio/ResponseAPDUTest.java b/jdk/test/javax/smartcardio/ResponseAPDUTest.java index 995cd1241cf..c885c2b827c 100644 --- a/jdk/test/javax/smartcardio/ResponseAPDUTest.java +++ b/jdk/test/javax/smartcardio/ResponseAPDUTest.java @@ -25,7 +25,8 @@ * @test * @bug 8049021 * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2 - * @run testng ResponseAPDUTest + * @compile -addmods java.smartcardio ResponseAPDUTest.java + * @run testng/othervm -addmods java.smartcardio ResponseAPDUTest */ import javax.smartcardio.ResponseAPDU; import static org.testng.Assert.*; diff --git a/jdk/test/javax/smartcardio/Serialize.java b/jdk/test/javax/smartcardio/Serialize.java index ac572369276..a7eac0e242c 100644 --- a/jdk/test/javax/smartcardio/Serialize.java +++ b/jdk/test/javax/smartcardio/Serialize.java @@ -26,6 +26,8 @@ * @bug 6445367 * @summary make sure serialization works * @author Andreas Sterbenz + * @compile -addmods java.smartcardio Serialize.java + * @run main/othervm -addmods java.smartcardio Serialize */ import java.io.*; diff --git a/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java b/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java index cec4c4443e4..881cc7250b8 100644 --- a/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java +++ b/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java @@ -25,7 +25,8 @@ * @test * @bug 8049021 * @summary Test if we can write new provider for smart card - * @run main/othervm/policy=policy TerminalFactorySpiTest + * @compile -addmods java.smartcardio TerminalFactorySpiTest.java + * @run main/othervm/policy=policy -addmods java.smartcardio TerminalFactorySpiTest */ import java.security.Provider; import java.security.Security; diff --git a/jdk/test/javax/smartcardio/TestCardPermission.java b/jdk/test/javax/smartcardio/TestCardPermission.java index 24db1fb4b0c..7c31da6a9d7 100644 --- a/jdk/test/javax/smartcardio/TestCardPermission.java +++ b/jdk/test/javax/smartcardio/TestCardPermission.java @@ -26,6 +26,8 @@ * @bug 6293767 * @summary Test for the CardPermission class * @author Andreas Sterbenz + * @compile -addmods java.smartcardio TestCardPermission.java + * @run main/othervm -addmods java.smartcardio TestCardPermission */ import javax.smartcardio.*; diff --git a/jdk/test/javax/smartcardio/TestCommandAPDU.java b/jdk/test/javax/smartcardio/TestCommandAPDU.java index 543fcea2487..34421590dcb 100644 --- a/jdk/test/javax/smartcardio/TestCommandAPDU.java +++ b/jdk/test/javax/smartcardio/TestCommandAPDU.java @@ -27,6 +27,8 @@ * @summary Test for the CommandAPDU class * @author Andreas Sterbenz * @key randomness + * @compile -addmods java.smartcardio TestCommandAPDU.java + * @run main/othervm -addmods java.smartcardio TestCommandAPDU */ import java.util.*; diff --git a/jdk/test/javax/transaction/testng/Driver.java b/jdk/test/javax/transaction/testng/Driver.java new file mode 100644 index 00000000000..3f5e9ec1bc7 --- /dev/null +++ b/jdk/test/javax/transaction/testng/Driver.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016, 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 + * @compile -addmods java.transaction + * test/transaction/InvalidTransactionExceptionTests.java + * test/transaction/TransactionRequiredExceptionTests.java + * test/transaction/TransactionRolledbackExceptionTests.java + * test/transaction/XAExceptionTests.java + * util/SerializedTransactionExceptions.java + * @run testng/othervm -addmods java.transaction test.transaction.InvalidTransactionExceptionTests + * @run testng/othervm -addmods java.transaction test.transaction.TransactionRequiredExceptionTests + * @run testng/othervm -addmods java.transaction test.transaction.TransactionRolledbackExceptionTests + * @run testng/othervm -addmods java.transaction util.SerializedTransactionExceptions + */ diff --git a/jdk/test/javax/transaction/testng/TEST.properties b/jdk/test/javax/transaction/testng/TEST.properties deleted file mode 100644 index f9e4addcabe..00000000000 --- a/jdk/test/javax/transaction/testng/TEST.properties +++ /dev/null @@ -1,4 +0,0 @@ -# JDBC unit tests uses TestNG -TestNG.dirs= . -othervm.dirs= . - diff --git a/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java b/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java index 1fb8e868634..4a556efce13 100644 --- a/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java +++ b/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java @@ -26,6 +26,7 @@ * @bug 8032884 * @summary Globalbindings optionalProperty="primitive" does not work when minOccurs=0 * @run shell compile-schema.sh + * @compile -addmods java.xml.bind XjcOptionalPropertyTest.java * @run main/othervm XjcOptionalPropertyTest */ diff --git a/jdk/test/javax/xml/jaxp/common/8035437/run.sh b/jdk/test/javax/xml/jaxp/common/8035437/run.sh index 2ebe7ce4296..5dbcff7f18a 100644 --- a/jdk/test/javax/xml/jaxp/common/8035437/run.sh +++ b/jdk/test/javax/xml/jaxp/common/8035437/run.sh @@ -34,12 +34,12 @@ $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ -d compile/java.xml -Xmodule:java.xml $TESTSRC/Document.java $TESTSRC/Node.java || exit 1 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ - -d exec/java.xml -Xpatch:compile -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2 + -d exec/java.xml -Xpatch:java.xml=compile/java.xml -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ $TESTSRC/AbstractMethodErrorTest.java -d exec || exit 3 -$TESTJAVA/bin/java ${TESTVMOPTS} -Xpatch:exec -cp exec AbstractMethodErrorTest || exit 4 +$TESTJAVA/bin/java ${TESTVMOPTS} -Xpatch:java.xml=exec -cp exec AbstractMethodErrorTest || exit 4 exit 0 diff --git a/jdk/test/javax/xml/soap/XmlTest.java b/jdk/test/javax/xml/soap/XmlTest.java index fedd52d59da..37aed906037 100644 --- a/jdk/test/javax/xml/soap/XmlTest.java +++ b/jdk/test/javax/xml/soap/XmlTest.java @@ -38,6 +38,8 @@ import java.util.Iterator; /* * @test + * @compile -addmods java.xml.ws XmlTest.java + * @run main/othervm -addmods java.xml.ws XmlTest * @summary tests JAF DataHandler can be instantiated; test serialize and * deserialize SOAP message containing xml attachment */ diff --git a/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java b/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java index 1cf8e8e6b0a..b36c356f25d 100644 --- a/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java +++ b/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java @@ -49,29 +49,29 @@ import java.nio.file.StandardOpenOption; * run main/othervm SAAJFactoryTest saaj.factory.Valid - * scenario14 javax.xml.soap.MessageFactory=saaj.factory.Valid saaj.factory.Valid2 - * - * @build saaj.factory.* + * @compile -addmods java.xml.ws saaj/factory/Invalid.java saaj/factory/Valid.java + * saaj/factory/Valid2.java saaj/factory/Valid3.java SAAJFactoryTest.java * - * @run main/othervm SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - - * scenario2 - - - * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.Valid SAAJFactoryTest saaj.factory.Valid - - * scenario5 - - - * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.NonExisting SAAJFactoryTest - * - javax.xml.soap.SOAPException - * scenario6 - - - * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.Invalid SAAJFactoryTest - javax.xml.soap.SOAPException - * scenario7 - - - * @run main/othervm SAAJFactoryTest saaj.factory.Valid - - * scenario8 - saaj.factory.Valid - * @run main/othervm SAAJFactoryTest saaj.factory.Valid - - * scenario9 - saaj.factory.Valid - * @run main/othervm SAAJFactoryTest - javax.xml.soap.SOAPException - * scenario10 - saaj.factory.NonExisting - * @run main/othervm SAAJFactoryTest - javax.xml.soap.SOAPException - * scenario11 - saaj.factory.Invalid - * @run main/othervm SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - - * scenario12 - - - * @run main/othervm SAAJFactoryTest saaj.factory.Valid - - * scenario15 - saaj.factory.Valid + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - scenario2 - - + * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.Valid + * SAAJFactoryTest saaj.factory.Valid - scenario5 - - + * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.NonExisting + * SAAJFactoryTest - javax.xml.soap.SOAPException scenario6 - - + * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.Invalid + * SAAJFactoryTest - javax.xml.soap.SOAPException scenario7 - - + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest saaj.factory.Valid - scenario8 - saaj.factory.Valid + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest saaj.factory.Valid - scenario9 - saaj.factory.Valid + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest - javax.xml.soap.SOAPException scenario10 - saaj.factory.NonExisting + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest - javax.xml.soap.SOAPException scenario11 - saaj.factory.Invalid scenario11 - saaj.factory.Invalid + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - scenario12 - - + * @run main/othervm -addmods java.xml.ws + * SAAJFactoryTest saaj.factory.Valid - scenario15 - saaj.factory.Valid */ public class SAAJFactoryTest { diff --git a/jdk/test/javax/xml/ws/8043129/MailTest.java b/jdk/test/javax/xml/ws/8043129/MailTest.java index 3d32a7d4dd8..73b0959a379 100644 --- a/jdk/test/javax/xml/ws/8043129/MailTest.java +++ b/jdk/test/javax/xml/ws/8043129/MailTest.java @@ -27,8 +27,8 @@ * @summary JAF initialisation in SAAJ clashing with the one in javax.mail * @author mkos * @library javax.mail.jar - * @build MailTest - * @run main MailTest + * @compile -addmods java.xml.ws MailTest.java + * @run main/othervm -addmods java.xml.ws MailTest */ import javax.activation.CommandMap; diff --git a/jdk/test/javax/xml/ws/clientjar/TestWsImport.java b/jdk/test/javax/xml/ws/clientjar/TestWsImport.java index dadceb34295..bc048e84b08 100644 --- a/jdk/test/javax/xml/ws/clientjar/TestWsImport.java +++ b/jdk/test/javax/xml/ws/clientjar/TestWsImport.java @@ -25,7 +25,8 @@ * @test * @bug 8016271 8026405 * @summary wsimport -clientjar does not create portable jar on windows due to hardcoded '\' - * @run main/othervm TestWsImport + * @compile -addmods java.xml.ws TestWsImport.java + * @run main/othervm -addmods java.xml.ws TestWsImport */ import javax.xml.namespace.QName; diff --git a/jdk/test/javax/xml/ws/publish/WSTest.java b/jdk/test/javax/xml/ws/publish/WSTest.java index 539f2d4b53b..651d2fbdaff 100644 --- a/jdk/test/javax/xml/ws/publish/WSTest.java +++ b/jdk/test/javax/xml/ws/publish/WSTest.java @@ -25,7 +25,8 @@ * @test * @bug 8146086 * @summary Publishing two webservices on same port fails with "java.net.BindException: Address already in use" - * @run main/othervm WSTest + * @compile -addmods java.xml.ws WSTest.java + * @run main/othervm -addmods java.xml.ws WSTest */ import javax.jws.WebMethod; import javax.jws.WebService; diff --git a/jdk/test/javax/xml/ws/xsanymixed/Test.java b/jdk/test/javax/xml/ws/xsanymixed/Test.java index 4287d8c08c5..a4f5476220d 100644 --- a/jdk/test/javax/xml/ws/xsanymixed/Test.java +++ b/jdk/test/javax/xml/ws/xsanymixed/Test.java @@ -27,7 +27,8 @@ * @summary the content of xs:any content:mixed should remain as is, * no white space changes and no changes to namespace prefixes * @run shell compile-wsdl.sh - * @run main/othervm Test + * @compile -addmods java.xml.ws Test.java + * @run main/othervm -addmods java.xml.ws Test */ import com.sun.net.httpserver.HttpServer; diff --git a/jdk/test/jdk/nio/zipfs/Basic.java b/jdk/test/jdk/nio/zipfs/Basic.java index a32a0980386..f29e4bd123e 100644 --- a/jdk/test/jdk/nio/zipfs/Basic.java +++ b/jdk/test/jdk/nio/zipfs/Basic.java @@ -42,7 +42,7 @@ import java.util.Map; /** * @test - * @bug 8038500 8040059 + * @bug 8038500 8040059 8150366 8150496 * @summary Basic test for zip provider * * @run main Basic @@ -155,7 +155,8 @@ public class Basic { indent(); System.out.print(file.getFileName()); if (attrs.isRegularFile()) - System.out.format(" (%d)", attrs.size()); + System.out.format("%n%s%n", attrs); + System.out.println(); return FileVisitResult.CONTINUE; } diff --git a/jdk/test/jdk/nio/zipfs/PathOps.java b/jdk/test/jdk/nio/zipfs/PathOps.java index eaf118bba7f..8f428515cbc 100644 --- a/jdk/test/jdk/nio/zipfs/PathOps.java +++ b/jdk/test/jdk/nio/zipfs/PathOps.java @@ -47,15 +47,15 @@ public class PathOps { private Path path; private Exception exc; - private PathOps(String s) { + private PathOps(String first, String... more) { out.println(); - input = s; + input = first; try { - path = fs.getPath(s); - out.format("%s -> %s", s, path); + path = fs.getPath(first, more); + out.format("%s -> %s", first, path); } catch (Exception x) { exc = x; - out.format("%s -> %s", s, x); + out.format("%s -> %s", first, x); } out.println(); } @@ -179,6 +179,13 @@ public class PathOps { return this; } + PathOps resolveSibling(String other, String expected) { + out.format("test resolveSibling %s\n", other); + checkPath(); + check(path.resolveSibling(other), expected); + return this; + } + PathOps relativize(String other, String expected) { out.format("test relativize %s\n", other); checkPath(); @@ -224,6 +231,10 @@ public class PathOps { return new PathOps(s); } + static PathOps test(String first, String... more) { + return new PathOps(first, more); + } + // -- PathOpss -- static void header(String s) { @@ -235,6 +246,26 @@ public class PathOps { static void doPathOpTests() { header("Path operations"); + // construction + test("/") + .string("/"); + test("/", "") + .string("/"); + test("/", "foo") + .string("/foo"); + test("/", "/foo") + .string("/foo"); + test("/", "foo/") + .string("/foo"); + test("foo", "bar", "gus") + .string("foo/bar/gus"); + test("") + .string(""); + test("", "/") + .string("/"); + test("", "foo", "", "bar", "", "/gus") + .string("foo/bar/gus"); + // all components test("/a/b/c") .root("/") @@ -323,7 +354,6 @@ public class PathOps { .ends("foo/bar/") .ends("foo/bar"); - // elements test("a/b/c") .element(0,"a") @@ -343,16 +373,57 @@ public class PathOps { // resolve test("/tmp") .resolve("foo", "/tmp/foo") - .resolve("/foo", "/foo"); + .resolve("/foo", "/foo") + .resolve("", "/tmp"); test("tmp") .resolve("foo", "tmp/foo") + .resolve("/foo", "/foo") + .resolve("", "tmp"); + test("") + .resolve("", "") + .resolve("foo", "foo") .resolve("/foo", "/foo"); + // resolveSibling + test("foo") + .resolveSibling("bar", "bar") + .resolveSibling("/bar", "/bar") + .resolveSibling("", ""); + test("foo/bar") + .resolveSibling("gus", "foo/gus") + .resolveSibling("/gus", "/gus") + .resolveSibling("", "foo"); + test("/foo") + .resolveSibling("gus", "/gus") + .resolveSibling("/gus", "/gus") + .resolveSibling("", "/"); + test("/foo/bar") + .resolveSibling("gus", "/foo/gus") + .resolveSibling("/gus", "/gus") + .resolveSibling("", "/foo"); + test("") + .resolveSibling("foo", "foo") + .resolveSibling("/foo", "/foo") + .resolve("", ""); + // relativize test("/a/b/c") .relativize("/a/b/c", "") .relativize("/a/b/c/d/e", "d/e") - .relativize("/a/x", "../../x"); + .relativize("/a/x", "../../x") + .relativize("/x", "../../../x"); + test("a/b/c") + .relativize("a/b/c/d", "d") + .relativize("a/x", "../../x") + .relativize("x", "../../../x") + .relativize("", "../../.."); + test("") + .relativize("a", "a") + .relativize("a/b/c", "a/b/c") + .relativize("", ""); + test("/") + .relativize("/a", "a") + .relativize("/a/c", "a/c"); // normalize test("/") diff --git a/jdk/test/lib/testlibrary/java/util/jar/SimpleHttpServer.java b/jdk/test/lib/testlibrary/java/util/jar/SimpleHttpServer.java new file mode 100644 index 00000000000..b79423ab051 --- /dev/null +++ b/jdk/test/lib/testlibrary/java/util/jar/SimpleHttpServer.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2015, 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 com.sun.net.httpserver.*; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * Extremely simple server that only performs one task. The server listens for + * requests on the ephemeral port. If it sees a request that begins with + * "/multi-release.jar", it consumes the request and returns a stream of bytes + * representing the jar file multi-release.jar found in "userdir". + */ +class SimpleHttpServer { + private static final String userdir = System.getProperty("user.dir", "."); + private static final Path multirelease = Paths.get(userdir, "multi-release.jar"); + + private final HttpServer server; + + public SimpleHttpServer() throws IOException { + server = HttpServer.create(); + } + + public void start() throws IOException { + server.bind(new InetSocketAddress(0), 0); + server.createContext("/multi-release.jar", t -> { + try (InputStream is = t.getRequestBody()) { + is.readAllBytes(); // probably not necessary to consume request + byte[] bytes = Files.readAllBytes(multirelease); + t.sendResponseHeaders(200, bytes.length); + try (OutputStream os = t.getResponseBody()) { + os.write(bytes); + } + } + }); + server.setExecutor(null); // creates a default executor + server.start(); + } + + public void stop() { + server.stop(0); + } + + int getPort() { + return server.getAddress().getPort(); + } +} + diff --git a/jdk/test/sun/java2d/loops/ConvertToByteIndexedTest.java b/jdk/test/sun/java2d/loops/ConvertToByteIndexedTest.java new file mode 100644 index 00000000000..5632edbaac9 --- /dev/null +++ b/jdk/test/sun/java2d/loops/ConvertToByteIndexedTest.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2016, 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 7116979 + * @summary Test verifies whether BufferedImage with primary colors are + * stored properly when we draw into ByteIndexed BufferedImage. + * @run main ConvertToByteIndexedTest + */ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.util.HashMap; + +public class ConvertToByteIndexedTest { + static final int[] SRC_TYPES = new int[] { + BufferedImage.TYPE_INT_RGB, + BufferedImage.TYPE_INT_ARGB, + BufferedImage.TYPE_INT_ARGB_PRE, + BufferedImage.TYPE_INT_BGR, + BufferedImage.TYPE_3BYTE_BGR, + BufferedImage.TYPE_4BYTE_ABGR, + BufferedImage.TYPE_4BYTE_ABGR_PRE, + BufferedImage.TYPE_USHORT_565_RGB, + BufferedImage.TYPE_USHORT_555_RGB, + BufferedImage.TYPE_BYTE_INDEXED}; + + static final String[] TYPE_NAME = new String[] { + "INT_RGB", + "INT_ARGB", + "INT_ARGB_PRE", + "INT_BGR", + "3BYTE_BGR", + "4BYTE_ABGR", + "4BYTE_ABGR_PRE", + "USHORT_565_RGB", + "USHORT_555_RGB", + "BYTE_INDEXED"}; + + static final Color[] COLORS = new Color[] { + //Color.WHITE, + Color.BLACK, + Color.RED, + Color.YELLOW, + Color.GREEN, + Color.MAGENTA, + Color.CYAN, + Color.BLUE}; + + static final HashMap TYPE_TABLE = + new HashMap(); + + static { + for (int i = 0; i < SRC_TYPES.length; i++) { + TYPE_TABLE.put(new Integer(SRC_TYPES[i]), TYPE_NAME[i]); + } + } + + static int width = 50; + static int height = 50; + + public static void ConvertToByteIndexed(Color color, int srcType) { + // setup source image and graphics for conversion. + BufferedImage srcImage = new BufferedImage(width, height, srcType); + Graphics2D srcG2D = srcImage.createGraphics(); + srcG2D.setColor(color); + srcG2D.fillRect(0, 0, width, height); + + // setup destination image and graphics for conversion. + int dstType = BufferedImage.TYPE_BYTE_INDEXED; + BufferedImage dstImage = new BufferedImage(width, height, dstType); + Graphics2D dstG2D = (Graphics2D)dstImage.getGraphics(); + // draw source image into Byte Indexed destination + dstG2D.drawImage(srcImage, 0, 0, null); + + // draw into ARGB image to verify individual pixel value. + BufferedImage argbImage = new BufferedImage(width, height, + BufferedImage.TYPE_INT_ARGB); + Graphics2D argbG2D = (Graphics2D)argbImage.getGraphics(); + argbG2D.drawImage(dstImage, 0, 0, null); + + for (int i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + if (color.getRGB() != argbImage.getRGB(i, j)) { + throw new RuntimeException("Conversion from " + + TYPE_TABLE.get(srcType) + " to BYTE_INDEXED is not" + + " done properly for " + color); + } + } + } + } + + public static void main(String args[]) { + for (int srcType : SRC_TYPES) { + for (Color color : COLORS) { + ConvertToByteIndexed(color, srcType); + } + } + } +} diff --git a/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java b/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java index aeca6c6b50d..0f5545707a4 100644 --- a/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java +++ b/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java @@ -26,19 +26,25 @@ * @bug 8132734 * @summary Test that URL connections to multi-release jars can be runtime versioned * @library /lib/testlibrary/java/util/jar - * @build Compiler JarBuilder CreateMultiReleaseTestJars + * @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer * @run testng MultiReleaseJarURLConnection */ import java.io.IOException; import java.io.InputStream; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; import java.net.JarURLConnection; import java.net.URL; +import java.net.URLClassLoader; import java.net.URLConnection; import java.nio.file.Files; import java.nio.file.Paths; import java.util.jar.JarFile; +import jdk.Version; + import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -47,46 +53,78 @@ import org.testng.annotations.Test; public class MultiReleaseJarURLConnection { String userdir = System.getProperty("user.dir","."); - String file = userdir + "/signed-multi-release.jar"; + String unversioned = userdir + "/unversioned.jar"; + String unsigned = userdir + "/multi-release.jar"; + String signed = userdir + "/signed-multi-release.jar"; + SimpleHttpServer server; @BeforeClass public void initialize() throws Exception { CreateMultiReleaseTestJars creator = new CreateMultiReleaseTestJars(); creator.compileEntries(); + creator.buildUnversionedJar(); creator.buildMultiReleaseJar(); creator.buildSignedMultiReleaseJar(); + + server = new SimpleHttpServer(); + server.start(); + } @AfterClass public void close() throws IOException { - Files.delete(Paths.get(userdir, "multi-release.jar")); - Files.delete(Paths.get(userdir, "signed-multi-release.jar")); + // Windows requires server to stop before file is deleted + if (server != null) + server.stop(); + Files.delete(Paths.get(unversioned)); + Files.delete(Paths.get(unsigned)); + Files.delete(Paths.get(signed)); } @DataProvider(name = "data") public Object[][] createData() { return new Object[][]{ - {"unsigned file", userdir + "/multi-release.jar"}, - {"signed file", userdir + "/signed-multi-release.jar"}, + {"unversioned", unversioned}, + {"unsigned", unsigned}, + {"signed", signed} }; } @Test(dataProvider = "data") - public void testRuntimeVersioning(String ignore, String file) throws Exception { + public void testRuntimeVersioning(String style, String file) throws Exception { String urlFile = "jar:file:" + file + "!/"; - String urlEntry = urlFile + "version/Version.java"; + String baseUrlEntry = urlFile + "version/Version.java"; + String rtreturn = "return " + Version.current().major(); - Assert.assertTrue(readAndCompare(new URL(urlEntry), "return 8")); - // #runtime is "magic" - Assert.assertTrue(readAndCompare(new URL(urlEntry + "#runtime"), "return 9")); + Assert.assertTrue(readAndCompare(new URL(baseUrlEntry), "return 8")); + // #runtime is "magic" for a multi-release jar, but not for unversioned jar + Assert.assertTrue(readAndCompare(new URL(baseUrlEntry + "#runtime"), + style.equals("unversioned") ? "return 8" : rtreturn)); // #fragment or any other fragment is not magic - Assert.assertTrue(readAndCompare(new URL(urlEntry + "#fragment"), "return 8")); + Assert.assertTrue(readAndCompare(new URL(baseUrlEntry + "#fragment"), "return 8")); // cached entities not affected - Assert.assertTrue(readAndCompare(new URL(urlEntry), "return 8")); + Assert.assertTrue(readAndCompare(new URL(baseUrlEntry), "return 8")); + + // the following tests will not work with unversioned jars + if (style.equals("unversioned")) return; + + // direct access to versioned entry + String versUrlEntry = urlFile + "META-INF/versions/" + Version.current().major() + + "/version/Version.java"; + Assert.assertTrue(readAndCompare(new URL(versUrlEntry), rtreturn)); + // adding any fragment does not change things + Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#runtime"), rtreturn)); + Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#fragment"), rtreturn)); + + // it really doesn't change things + versUrlEntry = urlFile + "META-INF/versions/10/version/Version.java"; + Assert.assertTrue(readAndCompare(new URL(versUrlEntry), "return 10")); + Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#runtime"), "return 10")); + Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#fragment"), "return 10")); } @Test(dataProvider = "data") - public void testCachedJars(String ignore, String file) throws Exception { + public void testCachedJars(String style, String file) throws Exception { String urlFile = "jar:file:" + file + "!/"; URL rootUrl = new URL(urlFile); @@ -98,7 +136,11 @@ public class MultiReleaseJarURLConnection { juc = (JarURLConnection)runtimeUrl.openConnection(); JarFile runtimeJar = juc.getJarFile(); JarFile.Release runtime = runtimeJar.getVersion(); - Assert.assertNotEquals(root, runtime); + if (style.equals("unversioned")) { + Assert.assertEquals(root, runtime); + } else { + Assert.assertNotEquals(root, runtime); + } juc = (JarURLConnection)rootUrl.openConnection(); JarFile jar = juc.getJarFile(); @@ -115,6 +157,63 @@ public class MultiReleaseJarURLConnection { jar.close(); // probably not needed } + @DataProvider(name = "resourcedata") + public Object[][] createResourceData() throws Exception { + return new Object[][]{ + {"unversioned", Paths.get(unversioned).toUri().toURL()}, + {"unsigned", Paths.get(unsigned).toUri().toURL()}, + {"signed", Paths.get(signed).toUri().toURL()}, + {"unversioned", new URL("file:" + unversioned)}, + {"unsigned", new URL("file:" + unsigned)}, + {"signed", new URL("file:" + signed)}, + {"unversioned", new URL("jar:file:" + unversioned + "!/")}, + {"unsigned", new URL("jar:file:" + unsigned + "!/")}, + {"signed", new URL("jar:file:" + signed + "!/")}, + // external jar received via http protocol + {"http", new URL("jar:http://localhost:" + server.getPort() + "/multi-release.jar!/")}, + {"http", new URL("http://localhost:" + server.getPort() + "/multi-release.jar")}, + + }; + } + + @Test(dataProvider = "resourcedata") + public void testResources(String style, URL url) throws Throwable { + //System.out.println(" testing " + style + " url: " + url); + URL[] urls = {url}; + URLClassLoader cldr = new URLClassLoader(urls); + Class vcls = cldr.loadClass("version.Version"); + + // verify we are loading a runtime versioned class + MethodType mt = MethodType.methodType(int.class); + MethodHandle mh = MethodHandles.lookup().findVirtual(vcls, "getVersion", mt); + Assert.assertEquals((int)mh.invoke(vcls.newInstance()), + style.equals("unversioned") ? 8 : Version.current().major()); + + // now get a resource and verify that we don't have a fragment attached + URL vclsUrl = vcls.getResource("/version/Version.class"); + String fragment = vclsUrl.getRef(); + Assert.assertNull(fragment); + + // and verify that the the url is a reified pointer to the runtime entry + String rep = vclsUrl.toString(); + //System.out.println(" getResource(\"/version/Version.class\") returned: " + rep); + if (style.equals("http")) { + Assert.assertTrue(rep.startsWith("jar:http:")); + } else { + Assert.assertTrue(rep.startsWith("jar:file:")); + } + String suffix; + if (style.equals("unversioned")) { + suffix = ".jar!/version/Version.class"; + } else { + suffix = ".jar!/META-INF/versions/" + Version.current().major() + + "/version/Version.class"; + } + Assert.assertTrue(rep.endsWith(suffix)); + cldr.close(); + } + + private boolean readAndCompare(URL url, String match) throws Exception { boolean result; // necessary to do it this way, instead of openStream(), so we can diff --git a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java index 4f80a59d290..4b2b2093ed2 100644 --- a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java +++ b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java @@ -26,7 +26,6 @@ import java.util.*; import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; -import javax.xml.bind.DatatypeConverter; public class SecretKeysBasic extends PKCS11Test { @@ -131,8 +130,11 @@ public class SecretKeysBasic extends PKCS11Test { System.out.println(info + "> " + key); System.out.println("\tALGO=" + key.getAlgorithm()); if (key.getFormat() != null) { - System.out.println("\t[" + key.getFormat() + "] VALUE=" + - DatatypeConverter.printHexBinary(key.getEncoded())); + StringBuilder sb = new StringBuilder(); + for (byte b : key.getEncoded()) { + sb.append(String.format("%02x", b & 0xff)); + } + System.out.println("\t[" + key.getFormat() + "] VALUE=" + sb); } else { System.out.println("\tVALUE=n/a"); } diff --git a/jdk/test/sun/security/provider/MessageDigest/SHA512.java b/jdk/test/sun/security/provider/MessageDigest/SHA512.java new file mode 100644 index 00000000000..7de757545b0 --- /dev/null +++ b/jdk/test/sun/security/provider/MessageDigest/SHA512.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2016, 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 jdk.testlibrary.Asserts; + +import java.security.MessageDigest; +import java.util.Arrays; + +/** + * @test + * @bug 8051408 + * @library /lib/testlibrary + * @summary testing SHA-512/224 and SHA-512/256. + */ +public class SHA512 { + public static void main(String[] args) throws Exception { + + MessageDigest md; + + // Test vectors obtained from + // http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA512_224.pdf + md = MessageDigest.getInstance("SHA-512/224"); + Asserts.assertTrue(Arrays.equals(md.digest("abc".getBytes()), + xeh("4634270F 707B6A54 DAAE7530 460842E2 0E37ED26 5CEEE9A4 3E8924AA"))); + Asserts.assertTrue(Arrays.equals(md.digest(( + "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" + + "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu").getBytes()), + xeh("23FEC5BB 94D60B23 30819264 0B0C4533 35D66473 4FE40E72 68674AF9"))); + + // Test vectors obtained from + // http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA512_256.pdf + md = MessageDigest.getInstance("SHA-512/256"); + Asserts.assertTrue(Arrays.equals(md.digest("abc".getBytes()), + xeh("53048E26 81941EF9 9B2E29B7 6B4C7DAB E4C2D0C6 34FC6D46 E0E2F131 07E7AF23"))); + Asserts.assertTrue(Arrays.equals(md.digest(( + "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" + + "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu").getBytes()), + xeh("3928E184 FB8690F8 40DA3988 121D31BE 65CB9D3E F83EE614 6FEAC861 E19B563A"))); + } + + static byte[] xeh(String in) { + in = in.replaceAll(" ", ""); + int len = in.length() / 2; + byte[] out = new byte[len]; + for (int i = 0; i < len; i++) { + out[i] = (byte)Integer.parseInt(in.substring(i * 2, i * 2 + 2), 16); + } + return out; + } +} diff --git a/jdk/test/sun/security/provider/PolicyFile/Modules.java b/jdk/test/sun/security/provider/PolicyFile/Modules.java index 5cd7f3dca58..855441e036a 100644 --- a/jdk/test/sun/security/provider/PolicyFile/Modules.java +++ b/jdk/test/sun/security/provider/PolicyFile/Modules.java @@ -25,7 +25,9 @@ * @test * @bug 8047771 * @summary check permissions and principals from various modules - * @run main/othervm/java.security.policy==modules.policy Modules + * @compile -addmods java.xml.ws,java.smartcardio Modules.java + * @run main/othervm/java.security.policy==modules.policy + * -addmods java.xml.ws,java.smartcardio Modules */ import java.security.AccessController; diff --git a/jdk/test/sun/security/provider/SecureRandom/AbstractDrbgSpec.java b/jdk/test/sun/security/provider/SecureRandom/AbstractDrbgSpec.java new file mode 100644 index 00000000000..a0caa26091e --- /dev/null +++ b/jdk/test/sun/security/provider/SecureRandom/AbstractDrbgSpec.java @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2016, 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 8051408 + * @modules java.base/sun.security.provider + * @summary check the AbstractDrbg API etc + */ + +import java.security.*; +import sun.security.provider.AbstractDrbg; +import static java.security.DrbgParameters.Capability.*; + +/** + * This test makes sure the AbstractDrbg API works as specified. It also + * checks the SecureRandom API. + */ +public class AbstractDrbgSpec { + + public static void main(String args[]) throws Exception { + + // getInstance from a provider. + + Provider p = new All("A", 0, ""); + byte[] bytes = new byte[100]; + + // A non-DRBG + iae(() -> SecureRandom.getInstance("S1", null, p)); + nsae(() -> SecureRandom.getInstance("S1", + new SecureRandomParameters() {}, p)); + + SecureRandom s1 = SecureRandom.getInstance("S1", p); + if (s1.getParameters() != null) { + throw new Exception(); + } + + iae(() -> s1.nextBytes(bytes, null)); + uoe(() -> s1.nextBytes(bytes, new SecureRandomParameters() {})); + uoe(() -> s1.reseed()); + iae(() -> s1.reseed(null)); + uoe(() -> s1.reseed(new SecureRandomParameters() {})); + + // A weak DRBG + iae(() -> SecureRandom.getInstance("S2", null, p)); + nsae(() -> SecureRandom.getInstance("S2", + new SecureRandomParameters() {}, p)); + nsae(() -> SecureRandom.getInstance("S2", + DrbgParameters.instantiation(256, NONE, null), p)); + nsae(() -> SecureRandom.getInstance("S2", + DrbgParameters.instantiation(-1, PR_AND_RESEED, null), p)); + nsae(() -> SecureRandom.getInstance("S2", + DrbgParameters.instantiation(-1, RESEED_ONLY, null), p)); + + SecureRandom s2 = SecureRandom.getInstance("S2", + DrbgParameters.instantiation(-1, NONE, null), p); + equals(s2, "S2,SQUEEZE,128,none"); + equals(s2.getParameters(), "128,none,null"); + + npe(() -> s2.nextBytes(null)); + iae(() -> s2.nextBytes(bytes, null)); + iae(() -> s2.nextBytes(bytes, new SecureRandomParameters() {})); + uoe(() -> s2.reseed()); + iae(() -> s2.reseed(null)); + + iae(() -> s2.nextBytes(bytes, + DrbgParameters.nextBytes(-1, false, new byte[101]))); + s2.nextBytes(new byte[101], + DrbgParameters.nextBytes(-1, false, new byte[100])); + s2.nextBytes(bytes, + DrbgParameters.nextBytes(-1, false, new byte[100])); + + // A strong DRBG + iae(() -> SecureRandom.getInstance("S3", null, p)); + nsae(() -> SecureRandom.getInstance("S3", + new SecureRandomParameters() {}, p)); + SecureRandom.getInstance("S3", + DrbgParameters.instantiation(192, PR_AND_RESEED, null), p); + + SecureRandom s3 = SecureRandom.getInstance("S3", p); + equals(s3, "S3,SQUEEZE,128,reseed_only"); + equals(s3.getParameters(), "128,reseed_only,null"); + + iae(() -> s3.nextBytes(bytes, + DrbgParameters.nextBytes(192, false, null))); + iae(() -> s3.nextBytes(bytes, + DrbgParameters.nextBytes(112, true, null))); + iae(() -> s3.reseed(new SecureRandomParameters() {})); + + SecureRandom s32 = SecureRandom.getInstance( + "S3", DrbgParameters.instantiation(192, PR_AND_RESEED, null), p); + equals(s32, "S3,SQUEEZE,192,pr_and_reseed"); + equals(s32.getParameters(), "192,pr_and_reseed,null"); + + s32.nextBytes(bytes, DrbgParameters.nextBytes(192, false, null)); + s32.nextBytes(bytes, DrbgParameters.nextBytes(112, true, null)); + s32.reseed(); + s32.reseed(DrbgParameters.reseed(true, new byte[100])); + + // getInstance from competitive providers. + + Provider l = new Legacy("L", 0, ""); + Provider w = new Weak("W", 0, ""); + Provider s = new Strong("S", 0, ""); + + Security.addProvider(l); + Security.addProvider(w); + Security.addProvider(s); + + SecureRandom s4; + + try { + s4 = SecureRandom.getInstance("S"); + if (s4.getProvider() != l) { + throw new Exception(); + } + + nsae(() -> SecureRandom.getInstance( + "S", DrbgParameters.instantiation(256, NONE, null))); + + s4 = SecureRandom.getInstance( + "S", DrbgParameters.instantiation(192, NONE, null)); + if (s4.getProvider() != s) { + throw new Exception(); + } + + s4 = SecureRandom.getInstance( + "S", DrbgParameters.instantiation(128, PR_AND_RESEED, null)); + if (s4.getProvider() != s) { + throw new Exception(); + } + + s4 = SecureRandom.getInstance( + "S", DrbgParameters.instantiation(128, RESEED_ONLY, null)); + if (s4.getProvider() != s) { + throw new Exception(); + } + + s4 = SecureRandom.getInstance( + "S", DrbgParameters.instantiation(128, NONE, null)); + if (s4.getProvider() != w) { + throw new Exception(); + } + } finally { + Security.removeProvider("L"); + Security.removeProvider("W"); + Security.removeProvider("S"); + } + } + + public static class All extends Provider { + protected All(String name, double version, String info) { + super(name, version, info); + put("SecureRandom.S1", S1.class.getName()); + put("SecureRandom.S2", S2.class.getName()); + put("SecureRandom.S3", S3.class.getName()); + } + } + + // Providing S with no params support + public static class Legacy extends Provider { + protected Legacy(String name, double version, String info) { + super(name, version, info); + put("SecureRandom.S", S1.class.getName()); + } + } + + public static class Weak extends Provider { + protected Weak(String name, double version, String info) { + super(name, version, info); + put("SecureRandom.S", S2.class.getName()); + } + } + + public static class Strong extends Provider { + protected Strong(String name, double version, String info) { + super(name, version, info); + put("SecureRandom.S", S3.class.getName()); + } + } + + // This is not a DRBG. + public static class S1 extends SecureRandomSpi { + @Override + protected void engineSetSeed(byte[] seed) { + } + + @Override + protected void engineNextBytes(byte[] bytes) { + } + + @Override + protected byte[] engineGenerateSeed(int numBytes) { + return new byte[numBytes]; + } + } + + // This is a strong DRBG. + public static class S3 extends AbstractDrbg { + + public S3(SecureRandomParameters params) { + supportPredictionResistance = true; + supportReseeding = true; + highestSupportedSecurityStrength = 192; + mechName = "S3"; + algorithm = "SQUEEZE"; + configure(params); + } + protected void chooseAlgorithmAndStrength() { + if (requestedInstantiationSecurityStrength < 0) { + securityStrength = DEFAULT_STRENGTH; + } else { + securityStrength = requestedInstantiationSecurityStrength; + } + minLength = securityStrength / 8; + maxAdditionalInputLength = maxPersonalizationStringLength = 100; + } + + @Override + protected void initEngine() { + + } + + @Override + protected void instantiateAlgorithm(byte[] ei) { + + } + + @Override + protected void generateAlgorithm(byte[] result, byte[] additionalInput) { + + } + + @Override + protected void reseedAlgorithm(byte[] ei, byte[] additionalInput) { + + } + } + + // This is a weak DRBG. maximum strength is 128 and does + // not support prediction resistance or reseed. + public static class S2 extends S3 { + public S2(SecureRandomParameters params) { + super(null); + mechName = "S2"; + highestSupportedSecurityStrength = 128; + supportPredictionResistance = false; + supportReseeding = false; + configure(params); + } + } + + static void nsae(RunnableWithException r) throws Exception { + checkException(r, NoSuchAlgorithmException.class); + } + + static void iae(RunnableWithException r) throws Exception { + checkException(r, IllegalArgumentException.class); + } + + static void uoe(RunnableWithException r) throws Exception { + checkException(r, UnsupportedOperationException.class); + } + + static void npe(RunnableWithException r) throws Exception { + checkException(r, NullPointerException.class); + } + + interface RunnableWithException { + void run() throws Exception; + } + + static void checkException(RunnableWithException r, Class ex) + throws Exception { + try { + r.run(); + } catch (Exception e) { + if (ex.isAssignableFrom(e.getClass())) { + return; + } + throw e; + } + throw new Exception("No exception thrown"); + } + + static void equals(Object o, String s) throws Exception { + if (!o.toString().equals(s)) { + throw new Exception(o.toString() + " is not " + s); + } + } +} diff --git a/jdk/test/sun/security/provider/SecureRandom/AutoReseed.java b/jdk/test/sun/security/provider/SecureRandom/AutoReseed.java new file mode 100644 index 00000000000..48361f225d5 --- /dev/null +++ b/jdk/test/sun/security/provider/SecureRandom/AutoReseed.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, 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.security.SecureRandom; +import java.security.Security; + +/** + * @test + * @bug 8051408 + * @summary make sure nextBytes etc can be called before setSeed + */ +public class AutoReseed { + + public static void main(String[] args) throws Exception { + SecureRandom sr; + String old = Security.getProperty("securerandom.drbg.config"); + try { + for (String mech : + new String[]{"Hash_DRBG", "HMAC_DRBG", "CTR_DRBG"}) { + System.out.println("Testing " + mech + "..."); + Security.setProperty("securerandom.drbg.config", mech); + + // Check auto reseed works + sr = SecureRandom.getInstance("DRBG"); + sr.nextInt(); + sr = SecureRandom.getInstance("DRBG"); + sr.reseed(); + sr = SecureRandom.getInstance("DRBG"); + sr.generateSeed(10); + } + } finally { + Security.setProperty("securerandom.drbg.config", old); + } + } +} diff --git a/jdk/test/sun/security/provider/SecureRandom/CommonSeeder.java b/jdk/test/sun/security/provider/SecureRandom/CommonSeeder.java new file mode 100644 index 00000000000..22f1f0c66b9 --- /dev/null +++ b/jdk/test/sun/security/provider/SecureRandom/CommonSeeder.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2016, 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 sun.security.provider.AbstractDrbg; +import sun.security.provider.EntropySource; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.security.DrbgParameters; +import java.security.SecureRandom; +import java.security.Security; + +/** + * @test + * @bug 8051408 + * @modules java.base/sun.security.provider + * @run main/othervm CommonSeeder + * @summary check entropy reading of DRBGs + */ +public class CommonSeeder { + + static class MyES implements EntropySource { + int count = 100; + int lastCount = 100; + + @Override + public byte[] getEntropy(int minEntropy, int minLength, + int maxLength, boolean pr) { + count--; + return new byte[minLength]; + } + + /** + * Confirms genEntropy() has been called {@code less} times + * since last check. + */ + public void checkUsage(int less) throws Exception { + if (lastCount != count + less) { + throw new Exception(String.format( + "lastCount = %d, count = %d, less = %d", + lastCount, count, less)); + } + lastCount = count; + } + } + + public static void main(String[] args) throws Exception { + + byte[] result = new byte[10]; + MyES es = new MyES(); + + // Set es as the default entropy source, overriding SeedGenerator. + setDefaultSeeder(es); + + // Nothing happened yet + es.checkUsage(0); + + SecureRandom sr; + sr = SecureRandom.getInstance("DRBG"); + + // No entropy reading if only getInstance + es.checkUsage(0); + + // Entropy is read at 1st nextBytes of the 1st DRBG + sr.nextInt(); + es.checkUsage(1); + + for (String mech : new String[]{"Hash_DRBG", "HMAC_DRBG", "CTR_DRBG"}) { + System.out.println("Testing " + mech + "..."); + + // DRBG with pr_false will never read entropy again no matter + // if nextBytes or reseed is called. + + Security.setProperty("securerandom.drbg.config", mech); + sr = SecureRandom.getInstance("DRBG"); + sr.nextInt(); + sr.reseed(); + es.checkUsage(0); + + // DRBG with pr_true always read from default entropy, and + // its nextBytes always reseed itself + + Security.setProperty("securerandom.drbg.config", + mech + ",pr_and_reseed"); + sr = SecureRandom.getInstance("DRBG"); + + sr.nextInt(); + es.checkUsage(2); // one instantiate, one reseed + sr.nextInt(); + es.checkUsage(1); // one reseed in nextBytes + sr.reseed(); + es.checkUsage(1); // one reseed + sr.nextBytes(result, DrbgParameters.nextBytes(-1, false, null)); + es.checkUsage(0); // pr_false for this call + sr.nextBytes(result, DrbgParameters.nextBytes(-1, true, null)); + es.checkUsage(1); // pr_true for this call + sr.reseed(DrbgParameters.reseed(true, null)); + es.checkUsage(1); // reseed from es + sr.reseed(DrbgParameters.reseed(false, null)); + es.checkUsage(0); // reseed from AbstractDrbg.SeederHolder.seeder + } + } + + static void setDefaultSeeder(EntropySource es) throws Exception { + Field f = AbstractDrbg.class.getDeclaredField("defaultES"); + f.setAccessible(true); // no more private + Field f2 = Field.class.getDeclaredField("modifiers"); + f2.setAccessible(true); + f2.setInt(f, f2.getInt(f) - Modifier.FINAL); // no more final + f.set(null, es); + } +} diff --git a/jdk/test/sun/security/provider/SecureRandom/DRBGAlg.java b/jdk/test/sun/security/provider/SecureRandom/DRBGAlg.java new file mode 100644 index 00000000000..31a308a0f5e --- /dev/null +++ b/jdk/test/sun/security/provider/SecureRandom/DRBGAlg.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2016, 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 sun.security.provider.MoreDrbgParameters; + +import java.security.DrbgParameters; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.SecureRandomParameters; +import java.security.Security; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import static java.security.DrbgParameters.Capability.*; + +/** + * @test + * @bug 8051408 + * @modules java.base/sun.security.provider + * @summary make sure DRBG alg can be defined and instantiated freely + */ +public class DRBGAlg { + + public static void main(String[] args) throws Exception { + + check(null, "Hash_DRBG", "SHA-256", "reseed_only", ",128"); + check("", "Hash_DRBG", "SHA-256", "reseed_only", ",128"); + check("sha-1", "Hash_DRBG", "SHA-1", "reseed_only", ",128"); + check("sha-256", "Hash_DRBG", "SHA-256", "reseed_only", ",128"); + check("SHA-3"); + check("hash_drbg", "Hash_DRBG", "SHA-256", "reseed_only", ",128"); + check("hmac_drbg", "HMAC_DRBG", "SHA-256", "reseed_only", ",128"); + check("ctr_drbg", "CTR_DRBG", "AES-", "reseed_only", ",128", "use_df"); + + // trying all permutations + checkPermutations( + Collections.emptyList(), + Arrays.asList("hash_drbg","sha-512","Pr_and_Reseed","192"), + "Hash_DRBG", "SHA-512", "pr_and_reseed", ",192"); + + check("Hash_DRBG,Hmac_DRBG"); + check("SHA-1,SHA-256"); + check("128,256"); + check("none,reseed_only"); + check("use_df,no_df"); + check("Hash_DRBG,,SHA-1"); + + check(null, DrbgParameters.instantiation(112, PR_AND_RESEED, null), + "Hash_DRBG", "SHA-256", "pr_and_reseed", ",112"); + check(null, DrbgParameters.instantiation(256, PR_AND_RESEED, null), + "Hash_DRBG", "SHA-256", "pr_and_reseed", ",256"); + check(null, DrbgParameters.instantiation(384, PR_AND_RESEED, null)); + check("sha-1", DrbgParameters.instantiation(112, PR_AND_RESEED, null), + "Hash_DRBG", "SHA-1", "pr_and_reseed", ",112"); + check("sha-1", DrbgParameters.instantiation(192, PR_AND_RESEED, null)); + check("hash_drbg,sha-512,Pr_and_Reseed,192", + DrbgParameters.instantiation(112, NONE, null), + "Hash_DRBG", "SHA-512", "reseed_only", ",112"); + check("hash_drbg,sha-512,Pr_and_Reseed,192", + DrbgParameters.instantiation(-1, NONE, null), + "Hash_DRBG", "SHA-512", "reseed_only", ",192"); + // getInstance params can be stronger than definition + check("hash_drbg,sha-256,None,112", + DrbgParameters.instantiation(192, PR_AND_RESEED, null), + "Hash_DRBG", "SHA-256", "pr_and_reseed", ",192"); + + check("hash_drbg,sha-1", new MoreDrbgParameters( + null, null, "sha-512", null, false, + DrbgParameters.instantiation(-1, NONE, null)), + "Hash_DRBG", "SHA-512"); + check("hash_drbg,sha-1", new MoreDrbgParameters( + null, null, null, null, false, + DrbgParameters.instantiation(-1, NONE, null)), + "Hash_DRBG", "SHA-1"); + check("hash_drbg", new MoreDrbgParameters( + null, "hmac_drbg", null, null, false, + DrbgParameters.instantiation(-1, NONE, null)), + "HMAC_DRBG", "SHA-256"); + + check("hash_drbg,sha-1", new MoreDrbgParameters( + null, null, "sha-3", null, false, + DrbgParameters.instantiation(-1, NONE, null))); + check("hash_drbg,sha-1", new MoreDrbgParameters( + null, "Unknown_DRBG", null, null, false, + DrbgParameters.instantiation(-1, NONE, null))); + } + + /** + * Checks all permutatins of a config. This is a recursive method and + * should be called with checkPermutations(empty,config,expected). + * + * @param current the current chosen aspects + * @param remains the remaining + * @param expected the expected effective config + * @throws Exception when check fails + */ + private static void checkPermutations(List current, + List remains, String... expected) throws Exception { + if (remains.isEmpty()) { + check(current.stream().collect(Collectors.joining(",")), expected); + } else { + for (String r : remains) { + List newCurrent = new ArrayList<>(current); + newCurrent.add(r); + List newRemains = new ArrayList<>(remains); + newRemains.remove(r); + checkPermutations(newCurrent, newRemains, expected); + } + } + } + + /** + * Checks DRBG definition for getInstance(alg, params). + * + * @param define DRBG + * @param params getInstance request (null if none) + * @param expected expected actual instantiate params, empty if should fail + */ + static void check(String define, SecureRandomParameters params, + String... expected) throws Exception { + System.out.println("Testing " + define + " with " + params + "..."); + String old = Security.getProperty("securerandom.drbg.config"); + if (define != null) { + Security.setProperty("securerandom.drbg.config", define); + } + try { + String result = params != null ? + SecureRandom.getInstance("DRBG", params).toString() : + SecureRandom.getInstance("DRBG").toString(); + System.out.println("Result " + result); + if (expected.length == 0) { + throw new Exception("should fail"); + } + for (String s : expected) { + if (!result.contains(s)) { + throw new Exception(result); + } + } + } catch (NoSuchAlgorithmException e) { + System.out.println("Result NSAE"); + if (expected.length > 0) { + throw e; + } + } finally { + Security.setProperty("securerandom.drbg.config", old); + } + } + + /** + * Checks DRBG definition for getInstance(alg). + * + * @param define DRBG + * @param expected expected actual instantiate params, empty if should fail + */ + static void check(String define, String... expected) throws Exception { + check(define, null, expected); + } +} diff --git a/jdk/test/sun/security/provider/SecureRandom/DrbgCavp.java b/jdk/test/sun/security/provider/SecureRandom/DrbgCavp.java new file mode 100644 index 00000000000..51dba4b23d9 --- /dev/null +++ b/jdk/test/sun/security/provider/SecureRandom/DrbgCavp.java @@ -0,0 +1,422 @@ +/* + * Copyright (c) 2016, 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 sun.security.provider.EntropySource; +import sun.security.provider.MoreDrbgParameters; + +import javax.crypto.Cipher; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.lang.*; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.DrbgParameters; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Queue; +import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; + +import static java.security.DrbgParameters.Capability.*; + +/** + * The Known-output DRBG test. The test vector can be obtained from + * http://csrc.nist.gov/groups/STM/cavp/documents/drbg/drbgtestvectors.zip. + * + * Manually run this test with + * + * java DrbgCavp drbgtestvectors.zip + * + */ +public class DrbgCavp { + + // the current nonce + private static byte[] nonce; + + // A buffer to store test materials for the current call and + // can be printed out of an error occurs. + private static ByteArrayOutputStream bout = new ByteArrayOutputStream(); + + // Save err for restoring + private static PrintStream err = System.err; + + private static final int AES_LIMIT; + + static { + try { + AES_LIMIT = Cipher.getMaxAllowedKeyLength("AES"); + } catch (Exception e) { + // should not happen + throw new AssertionError("Cannot detect AES"); + } + } + + public static void main(String[] args) throws Exception { + + if (args.length != 1) { + System.out.println("Usage: java DrbgCavp drbgtestvectors.zip"); + return; + } + File tv = new File(args[0]); + + EntropySource es = new TestEntropySource(); + System.setErr(new PrintStream(bout)); + + // The testsuite is a zip file containing more zip files for different + // working modes. Each internal zip file contains test materials for + // different mechanisms. + + try (ZipFile zf = new ZipFile(tv)) { + String[] modes = {"no_reseed", "pr_false", "pr_true"}; + for (String mode : modes) { + try (ZipInputStream zis = new ZipInputStream(zf.getInputStream( + zf.getEntry("drbgvectors_" + mode + ".zip")))) { + while (true) { + ZipEntry ze = zis.getNextEntry(); + if (ze == null) { + break; + } + String fname = ze.getName(); + if (fname.equals("Hash_DRBG.txt") + || fname.equals("HMAC_DRBG.txt") + || fname.equals("CTR_DRBG.txt")) { + String algorithm + = fname.substring(0, fname.length() - 4); + test(mode, algorithm, es, zis); + } + } + } + } + } finally { + System.setErr(err); + } + } + + /** + * A special entropy source you can set entropy input at will. + */ + private static class TestEntropySource implements EntropySource { + + private static Queue data = new ArrayDeque<>(); + + @Override + public byte[] getEntropy(int minEntropy, int minLength, + int maxLength, boolean pr) { + byte[] result = data.poll(); + if (result == null + || result.length < minLength + || result.length > maxLength) { + throw new RuntimeException("Invalid entropy: " + + "need [" + minLength + ", " + maxLength + "], " + + (result == null ? "none" : "has " + result.length)); + } + return result; + } + + private static void setEntropy(byte[] input) { + data.offer(input); + } + + private static void clearEntropy() { + data.clear(); + } + } + + /** + * The test. + * + * // Algorithm line, might contain usedf flag + * [AES-128 use df] + * // Ignored, use mode argument + * [PredictionResistance = True] + * // Ignored, just read EntropyInput + * [EntropyInputLen = 128] + * // Ignored, just read Nonce + * [NonceLen = 64] + * // Ignored, just read PersonalizationString + * [PersonalizationStringLen = 128] + * // Ignored, just read AdditionalInput + * [AdditionalInputLen = 128] + * // Used to allocate buffer for nextBytes() call + * [ReturnedBitsLen = 512] + * + * // A sign we can ignore old unused entropy input + * COUNT = 0 + * + * // Instantiate + * EntropyInput = 92898f... + * Nonce = c2a4d9... + * PersonalizationString = ea65ee... // Enough to call getInstance() + * + * // Reseed + * EntropyInputReseed = bfd503... + * AdditionalInputReseed = 009e0b... // Enough to call reseed() + * + * // Generation + * AdditionalInput = 1a40fa.... // Enough to call nextBytes() for PR off + * EntropyInputPR = 20728a... // Enough to call nextBytes() for PR on + * ReturnedBits = 5a3539... // Compare this to last nextBytes() output + * + * @param mode one of "no_reseed", "pr_false", "pr_true" + * @param mech one of "Hash_DRBG", "HMAC_DRBG", "CTR_DRBG" + * @param es our own entropy source + * @param is test material + */ + private static void test(String mode, String mech, EntropySource es, + InputStream is) throws Exception { + + SecureRandom hd = null; + + // Expected output length in bits as in [ReturnedBitsLen] + int outLen = 0; + + // DRBG algorithm as in the algorithm line + String algorithm = null; + + // When CTR_DRBG uses a derivation function as in the algorithm line + boolean usedf = false; + + // Additional input as in "AdditionalInput" + byte[] additional = null; + + // Random bits generated + byte[] output = null; + + // Prediction resistance flag, determined by mode + boolean isPr = false; + + StringBuilder sb = new StringBuilder(); + + int lineno = 0; + + System.out.println(mode + "/" + mech); + + try (Stream lines = + new BufferedReader(new InputStreamReader(is)).lines()) { + for (String s: (Iterable) lines::iterator) { + lineno++; + err.print(hd == null ? '-' : '*'); + Line l = new Line(s); + if (l.key.contains("no df") || l.key.contains("use df") || + l.key.startsWith("SHA-")) { + sb = new StringBuilder(); + bout.reset(); + } + sb.append(String.format( + "%9s %4s %5d %s\n", mode, mech, lineno, s)); + switch (l.key) { + case "3KeyTDEA no df": + case "AES-128 no df": + case "AES-192 no df": + case "AES-256 no df": + case "3KeyTDEA use df": + case "AES-128 use df": + case "AES-192 use df": + case "AES-256 use df": + algorithm = l.key.split(" ")[0]; + usedf = l.key.contains("use df"); + break; + case "ReturnedBitsLen": + outLen = l.vint(); + output = new byte[outLen / 8]; + break; + case "EntropyInput": + TestEntropySource.setEntropy(l.vdata()); + break; + case "Nonce": + nonce = l.vdata(); + break; + case "COUNT": + // Remove unused entropy (say, when AES-256 is skipped) + TestEntropySource.clearEntropy(); + break; + case "PersonalizationString": + try { + isPr = mode.equals("pr_true"); + byte[] ps = null; + if (l.vdata().length != 0) { + ps = l.vdata(); + } + + // MoreDrbgParameters must be used because we + // want to set entropy input and nonce. Since + // it can also set mechanism, algorithm and usedf, + // we don't need to touch securerandom.drbg.config. + hd = SecureRandom.getInstance("DRBG", + new MoreDrbgParameters(es, mech, algorithm, + nonce, usedf, + DrbgParameters.instantiation( + -1, + isPr ? PR_AND_RESEED + : RESEED_ONLY, + ps)), + "SUN"); + } catch (NoSuchAlgorithmException iae) { + // AES-256 might not be available. This is OK. + if ((algorithm.equals("AES-192") + || algorithm.equals("AES-256")) + && AES_LIMIT == 128) { + hd = null; + } else { + throw iae; + } + } + break; + case "EntropyInputReseed": + TestEntropySource.setEntropy(l.vdata()); + break; + case "AdditionalInputReseed": + if (l.vdata().length == 0) { + additional = null; + } else { + additional = l.vdata(); + } + if (hd != null) { + if (additional == null) { + hd.reseed(); + } else { + hd.reseed(DrbgParameters.reseed( + isPr, additional)); + } + } + break; + case "EntropyInputPR": + if (l.vdata().length != 0) { + TestEntropySource.setEntropy(l.vdata()); + } + if (mode.equals("pr_true")) { + if (hd != null) { + if (additional == null) { + hd.nextBytes(output); + } else { + hd.nextBytes(output, + DrbgParameters.nextBytes( + -1, isPr, additional)); + } + } + } + break; + case "AdditionalInput": + if (l.vdata().length == 0) { + additional = null; + } else { + additional = l.vdata(); + } + if (!mode.equals("pr_true")) { + if (hd != null) { + if (additional == null) { + hd.nextBytes(output); + } else { + hd.nextBytes(output, + DrbgParameters.nextBytes( + -1, isPr, additional)); + } + } + } + break; + case "ReturnedBits": + if (hd != null) { + if (!Arrays.equals(output, l.vdata())) { + throw new Exception("\nExpected: " + + l.value + "\n Actual: " + hex(output)); + } + } + break; + default: + // Algorithm line for Hash_DRBG and HMAC_DRBG + if (l.key.startsWith("SHA-")) { + algorithm = l.key; + } + } + } + err.println(); + } catch (Exception e) { + err.println(); + err.println(sb.toString()); + err.println(bout.toString()); + throw e; + } + } + + /** + * Parse a line from test material. + * + * Brackets are removed. Key and value separated. + */ + static class Line { + + final String key; + final String value; + + Line(String s) { + s = s.trim(); + if (s.length() >= 2) { + if (s.charAt(0) == '[') { + s = s.substring(1, s.length() - 1); + } + } + if (s.indexOf('=') < 0) { + key = s; + value = null; + } else { + key = s.substring(0, s.indexOf('=')).trim(); + value = s.substring(s.indexOf('=') + 1).trim(); + } + } + + int vint() { + return Integer.parseInt(value); + } + + byte[] vdata() { + return xeh(value); + } + } + + // Bytes to HEX + private static String hex(byte[] in) { + StringBuilder sb = new StringBuilder(); + for (byte b: in) { + sb.append(String.format("%02x", b&0xff)); + } + return sb.toString(); + } + + // HEX to bytes + private static byte[] xeh(String in) { + in = in.replaceAll(" ", ""); + int len = in.length() / 2; + byte[] out = new byte[len]; + for (int i = 0; i < len; i++) { + out[i] = (byte) Integer.parseInt( + in.substring(i * 2, i * 2 + 2), 16); + } + return out; + } +} diff --git a/jdk/test/sun/security/provider/SecureRandom/SelfSeed.java b/jdk/test/sun/security/provider/SecureRandom/SelfSeed.java deleted file mode 100644 index 93d6a302ac6..00000000000 --- a/jdk/test/sun/security/provider/SecureRandom/SelfSeed.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1998, 2003, 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 4168409 - * @summary SecureRandom forces all instances to self-seed, even if a seed is - * provided - */ - -import java.security.SecureRandom; - -public class SelfSeed { - - private static final int NUM_BYTES = 5; - private static byte seed[] = { (byte)0xaa, (byte)0x11, (byte)0xa1 }; - - public static void main(String[] args) { - - try { - SecureRandom sr1 = SecureRandom.getInstance("SHA1PRNG"); - sr1.setSeed(seed); - byte randomBytes[] = new byte[NUM_BYTES]; - sr1.nextBytes(randomBytes); - - SecureRandom sr2 = new SecureRandom(seed); - if (sr2.getAlgorithm().equals("SHA1PRNG") == false) { - System.out.println("Default PRNG is not SHA1PRNG, skipping test"); - return; - } - byte otherRandomBytes[] = new byte[NUM_BYTES]; - sr2.nextBytes(otherRandomBytes); - - // make sure the random bytes generated are the same - for (int i = 0; i < NUM_BYTES; i++) { - if (randomBytes[i] != otherRandomBytes[i]) - throw new SecurityException("FAILURE: " + - "Returned bytes not equal"); - } - - // success - } catch (Exception e) { - throw new SecurityException("FAILURE: " + e.toString()); - } - } -} diff --git a/jdk/test/sun/security/provider/SecureRandom/StrongSeedReader.java b/jdk/test/sun/security/provider/SecureRandom/StrongSeedReader.java index 7057f9b2bb4..44511a9b803 100644 --- a/jdk/test/sun/security/provider/SecureRandom/StrongSeedReader.java +++ b/jdk/test/sun/security/provider/SecureRandom/StrongSeedReader.java @@ -59,6 +59,7 @@ public class StrongSeedReader { System.setProperty("java.security.egd", file.toURI().toString()); testSeed("NativePRNG"); testSeed("SHA1PRNG"); + testSeed("DRBG"); } finally { if (file != null) { file.delete(); diff --git a/jdk/test/tools/jar/modularJar/Basic.java b/jdk/test/tools/jar/modularJar/Basic.java index 40829ec9280..417f71a2f5e 100644 --- a/jdk/test/tools/jar/modularJar/Basic.java +++ b/jdk/test/tools/jar/modularJar/Basic.java @@ -340,43 +340,43 @@ public class Basic { "--file=" + modularJar.toString()) .assertSuccess() .resultChecker(r -> { - // Expect similar output: "Name:bar, Requires: foo,... - // Conceals: jdk.test.foo, jdk.test.foo.internal" - Pattern p = Pattern.compile("\\s+Name:\\s+bar\\s+Requires:\\s+foo"); + // Expect similar output: "bar, requires mandated foo, ... + // conceals jdk.test.foo, conceals jdk.test.foo.internal" + Pattern p = Pattern.compile("\\s+bar\\s+requires\\s++foo"); assertTrue(p.matcher(r.output).find(), - "Expecting to find \"Name: bar, Requires: foo,...\"", + "Expecting to find \"bar, requires foo,...\"", "in output, but did not: [" + r.output + "]"); p = Pattern.compile( - "Conceals:\\s+jdk.test.foo\\s+jdk.test.foo.internal"); + "conceals\\s+jdk.test.foo\\s+conceals\\s+jdk.test.foo.internal"); assertTrue(p.matcher(r.output).find(), - "Expecting to find \"Conceals: jdk.test.foo,...\"", + "Expecting to find \"conceals jdk.test.foo,...\"", "in output, but did not: [" + r.output + "]"); }); } @Test - public void dependencesFooBar() throws IOException { + public void hashBarInFooModule() throws IOException { Path mp = Paths.get("dependencesFooBar"); createTestDir(mp); - Path modClasses = MODULE_CLASSES.resolve(FOO.moduleName); - Path modularJar = mp.resolve(FOO.moduleName + ".jar"); - jar("--create", - "--file=" + modularJar.toString(), - "--main-class=" + FOO.mainClass, - "--module-version=" + FOO.version, - "--no-manifest", - "-C", modClasses.toString(), ".") - .assertSuccess(); - - modClasses = MODULE_CLASSES.resolve(BAR.moduleName); - modularJar = mp.resolve(BAR.moduleName + ".jar"); + Path modClasses = MODULE_CLASSES.resolve(BAR.moduleName); + Path modularJar = mp.resolve(BAR.moduleName + ".jar"); jar("--create", "--file=" + modularJar.toString(), "--main-class=" + BAR.mainClass, "--module-version=" + BAR.version, + "--no-manifest", + "-C", modClasses.toString(), ".") + .assertSuccess(); + + modClasses = MODULE_CLASSES.resolve(FOO.moduleName); + modularJar = mp.resolve(FOO.moduleName + ".jar"); + jar("--create", + "--file=" + modularJar.toString(), + "--main-class=" + FOO.mainClass, + "--module-version=" + FOO.version, "--modulepath=" + mp.toString(), - "--hash-dependencies=" + "foo", // dependency on foo + "--hash-modules=" + "bar", "--no-manifest", "-C", modClasses.toString(), ".") .assertSuccess(); @@ -392,49 +392,49 @@ public class Basic { } @Test - public void badDependencyFooBar() throws IOException { + public void invalidHashInFooModule() throws IOException { Path mp = Paths.get("badDependencyFooBar"); createTestDir(mp); - Path fooClasses = MODULE_CLASSES.resolve(FOO.moduleName); - Path fooJar = mp.resolve(FOO.moduleName + ".jar"); - jar("--create", - "--file=" + fooJar.toString(), - "--main-class=" + FOO.mainClass, - "--module-version=" + FOO.version, - "--no-manifest", - "-C", fooClasses.toString(), ".").assertSuccess(); - Path barClasses = MODULE_CLASSES.resolve(BAR.moduleName); Path barJar = mp.resolve(BAR.moduleName + ".jar"); jar("--create", "--file=" + barJar.toString(), "--main-class=" + BAR.mainClass, "--module-version=" + BAR.version, - "--modulepath=" + mp.toString(), - "--hash-dependencies=" + "foo", // dependency on foo "--no-manifest", "-C", barClasses.toString(), ".").assertSuccess(); - // Rebuild foo.jar with a change that will cause its hash to be different - FileUtils.deleteFileWithRetry(fooJar); + Path fooClasses = MODULE_CLASSES.resolve(FOO.moduleName); + Path fooJar = mp.resolve(FOO.moduleName + ".jar"); jar("--create", "--file=" + fooJar.toString(), "--main-class=" + FOO.mainClass, - "--module-version=" + FOO.version + ".1", // a newer version + "--module-version=" + FOO.version, + "--modulepath=" + mp.toString(), + "--hash-modules=" + "bar", "--no-manifest", "-C", fooClasses.toString(), ".").assertSuccess(); + // Rebuild bar.jar with a change that will cause its hash to be different + FileUtils.deleteFileWithRetry(barJar); + jar("--create", + "--file=" + barJar.toString(), + "--main-class=" + BAR.mainClass, + "--module-version=" + BAR.version + ".1", // a newer version + "--no-manifest", + "-C", barClasses.toString(), ".").assertSuccess(); + java(mp, BAR.moduleName + "/" + BAR.mainClass, "-XaddExports:java.base/jdk.internal.module=bar") .assertFailure() .resultChecker(r -> { // Expect similar output: "java.lang.module.ResolutionException: Hash - // of foo (WdktSIQSkd4+CEacpOZoeDrCosMATNrIuNub9b5yBeo=) differs to + // of bar (WdktSIQSkd4+CEacpOZoeDrCosMATNrIuNub9b5yBeo=) differs to // expected hash (iepvdv8xTeVrFgMtUhcFnmetSub6qQHCHc92lSaSEg0=)" - Pattern p = Pattern.compile(".*Hash of foo.*differs to expected hash.*"); + Pattern p = Pattern.compile(".*Hash of bar.*differs to expected hash.*"); assertTrue(p.matcher(r.output).find(), - "Expecting error message containing \"Hash of foo ... differs to" + "Expecting error message containing \"Hash of bar ... differs to" + " expected hash...\" but got: [", r.output + "]"); }); } @@ -454,7 +454,7 @@ public class Basic { jar("--create", "--file=" + modularJar.toString(), - "--hash-dependencies=" + ".*", // no module-info.class + "--hash-modules=" + ".*", // no module-info.class "-C", modClasses.toString(), "jdk") .assertFailure(); // TODO: expected failure message } diff --git a/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java b/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java index 7d768fc15d2..181491ab601 100644 --- a/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java +++ b/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java @@ -30,7 +30,7 @@ import java.lang.reflect.Method; import java.util.Optional; import java.util.StringJoiner; -import jdk.internal.module.Hasher; +import jdk.internal.module.ModuleHashes; import jdk.test.bar.internal.Message; public class Bar { @@ -43,10 +43,11 @@ public class Bar { Method m = ModuleDescriptor.class.getDeclaredMethod("hashes"); m.setAccessible(true); - Optional optHashes = - (Optional) m.invoke(md); + ModuleDescriptor foo = jdk.test.foo.Foo.class.getModule().getDescriptor(); + Optional oHashes = + (Optional) m.invoke(foo); - System.out.println("hashes:" + optHashes.get().hashFor("foo")); + System.out.println("hashes:" + oHashes.get().hashFor("bar")); StringJoiner sj = new StringJoiner(","); md.conceals().forEach(sj::add); diff --git a/jdk/test/tools/jlink/ImageFileCreatorTest.java b/jdk/test/tools/jlink/ImageFileCreatorTest.java index a674925b223..449d950d04d 100644 --- a/jdk/test/tools/jlink/ImageFileCreatorTest.java +++ b/jdk/test/tools/jlink/ImageFileCreatorTest.java @@ -214,14 +214,12 @@ public class ImageFileCreatorTest { } @Override - public void storeFiles(Pool content, String bom) { - + public void storeFiles(Pool content) { } - }; ImagePluginStack stack = new ImagePluginStack(noopBuilder, Collections.emptyList(), - null, Collections.emptyList(), ""); + null, Collections.emptyList()); ImageFileCreator.create(archives, ByteOrder.nativeOrder(), stack); } diff --git a/jdk/test/tools/jlink/IntegrationTest.java b/jdk/test/tools/jlink/IntegrationTest.java index 05c61207b7d..951c16cff74 100644 --- a/jdk/test/tools/jlink/IntegrationTest.java +++ b/jdk/test/tools/jlink/IntegrationTest.java @@ -241,7 +241,7 @@ public class IntegrationTest { lst.add(new MyPostProcessor()); } // Image builder - DefaultImageBuilder builder = new DefaultImageBuilder(true, output); + DefaultImageBuilder builder = new DefaultImageBuilder(output); PluginsConfiguration plugins = new Jlink.PluginsConfiguration(lst, builder, null); @@ -254,10 +254,6 @@ public class IntegrationTest { if (!jimage.exists()) { throw new AssertionError("jimage not generated"); } - File bom = new File(output.toString(), "bom"); - if (!bom.exists()) { - throw new AssertionError("bom not generated"); - } File release = new File(output.toString(), "release"); if (!release.exists()) { throw new AssertionError("release not generated"); @@ -311,7 +307,7 @@ public class IntegrationTest { } // Image builder - DefaultImageBuilder builder = new DefaultImageBuilder(false, output); + DefaultImageBuilder builder = new DefaultImageBuilder(output); PluginsConfiguration plugins = new Jlink.PluginsConfiguration(lst, builder, null); @@ -359,7 +355,7 @@ public class IntegrationTest { } // Image builder - DefaultImageBuilder builder = new DefaultImageBuilder(false, output); + DefaultImageBuilder builder = new DefaultImageBuilder(output); PluginsConfiguration plugins = new Jlink.PluginsConfiguration(lst, builder, null); boolean failed = false; diff --git a/jdk/test/tools/jlink/JLink2Test.java b/jdk/test/tools/jlink/JLink2Test.java index d68242590ce..8106fadee32 100644 --- a/jdk/test/tools/jlink/JLink2Test.java +++ b/jdk/test/tools/jlink/JLink2Test.java @@ -66,8 +66,6 @@ public class JLink2Test { // This test case must be first one, the JlinkTask is clean // and reveals possible bug related to plugin options in defaults - // e. g.: --genbom - testBomFile(helper); testSameNames(helper); testModulePath(helper); testOptions(); @@ -136,35 +134,6 @@ public class JLink2Test { validator.validate(); } - private static void testBomFile(Helper helper) throws Exception { - String[] userOptions = { - "--compress", - "2", - "--addmods", - "bomzip", - "--strip-debug", - "--genbom", - "--exclude-resources", - "*.jcov,*/META-INF/*"}; - String moduleName = "bomzip"; - helper.generateDefaultJModule(moduleName, "composite2"); - Path imgDir = helper.generateDefaultImage(userOptions, moduleName).assertSuccess(); - helper.checkImage(imgDir, moduleName, userOptions, null, null); - File bom = new File(imgDir.toFile(), "bom"); - if (!bom.exists()) { - throw new RuntimeException(bom.getAbsolutePath() + " not generated"); - } - String bomcontent = new String(Files.readAllBytes(bom.toPath())); - if (!bomcontent.contains("--strip-debug") - || !bomcontent.contains("--compress") - || !bomcontent.contains("--genbom") - || !bomcontent.contains("--exclude-resources *.jcov," - + "*/META-INF/*") - || !bomcontent.contains("--addmods bomzip")) { - throw new Exception("Not expected content in " + bom); - } - } - private static void testOptions() throws Exception { List builtInPlugins = new ArrayList<>(); builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot())); diff --git a/jdk/test/tools/jlink/JLinkTest.java b/jdk/test/tools/jlink/JLinkTest.java index e37b9023f41..9f7749df72d 100644 --- a/jdk/test/tools/jlink/JLinkTest.java +++ b/jdk/test/tools/jlink/JLinkTest.java @@ -204,7 +204,7 @@ public class JLinkTest { String[] userOptions = {"--compress", "invalid"}; String moduleName = "invalidCompressLevel"; helper.generateDefaultJModule(moduleName, "composite2"); - helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: Invalid level invalid"); + helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: Invalid compression level invalid"); } // @file diff --git a/jdk/test/tools/jlink/hashes/HashesTest.java b/jdk/test/tools/jlink/hashes/HashesTest.java deleted file mode 100644 index 8060bd9d466..00000000000 --- a/jdk/test/tools/jlink/hashes/HashesTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Copyright (c) 2015, 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 - * @summary Test the recording and checking of dependency hashes - * @author Andrei Eremeev - * @library /lib/testlibrary - * @modules java.base/jdk.internal.module - * jdk.jlink/jdk.tools.jlink - * jdk.jlink/jdk.tools.jmod - * jdk.compiler - * @ignore - * @build jdk.testlibrary.ProcessTools jdk.testlibrary.OutputAnalyzer CompilerUtils - * @run main HashesTest - */ - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import jdk.testlibrary.OutputAnalyzer; -import jdk.testlibrary.ProcessTools; - -public class HashesTest { - - private final Path jdkHome = Paths.get(System.getProperty("test.jdk")); - private final Path stdJmods = jdkHome.resolve("jmods"); - private final Path testSrc = Paths.get(System.getProperty("test.src")); - private final Path modSrc = testSrc.resolve("src"); - private final Path newModSrc = testSrc.resolve("newsrc"); - private final Path classes = Paths.get("classes"); - private final Path jmods = Paths.get("jmods"); - - public static void main(String[] args) throws Exception { - new HashesTest().run(); - } - - private void run() throws Exception { - if (!Files.exists(stdJmods)) { - return; - } - Files.createDirectories(jmods); - Path m1Classes = classes.resolve("m1"); - Path m2Classes = classes.resolve("m2"); - Path m3Classes = classes.resolve("not_matched"); - // build the second module - compileClasses(modSrc, m2Classes); - runJmod(m2Classes.toString(), m2Classes.getFileName().toString()); - - // build the third module - compileClasses(modSrc, m3Classes); - runJmod(m3Classes.toString(), m3Classes.getFileName().toString()); - - compileClasses(modSrc, m1Classes, "-mp", jmods.toString()); - runJmod(m1Classes.toString(), m1Classes.getFileName().toString(), - "--modulepath", jmods.toString(), "--hash-dependencies", "m2"); - runJava(0, "-mp", jmods.toString(), "-m", "m1/org.m1.Main"); - - deleteDirectory(m3Classes); - Files.delete(jmods.resolve("not_matched.jmod")); - - // build the new third module - compileClasses(newModSrc, m3Classes); - runJmod(m3Classes.toString(), m3Classes.getFileName().toString()); - runJava(0, "-mp", jmods.toString(), "-m", "m1/org.m1.Main"); - - deleteDirectory(m2Classes); - Files.delete(jmods.resolve("m2.jmod")); - - compileClasses(newModSrc, m2Classes); - runJmod(m2Classes.toString(), m2Classes.getFileName().toString()); - - runJava(1, "-mp", jmods.toString(), "-m", "m1/org.m1.Main"); - - if (jdk.tools.jlink.internal.Main.run(new String[]{ - "--modulepath", stdJmods.toString() + File.pathSeparator + jmods.toString(), - "--addmods", "m1", "--output", "myimage"}, new PrintWriter(System.out)) == 0) { - throw new AssertionError("Expected failure. rc = 0"); - } - } - - private void deleteDirectory(Path dir) throws IOException { - Files.walkFileTree(dir, new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - Files.delete(file); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - Files.delete(dir); - return FileVisitResult.CONTINUE; - } - }); - } - - private void runJava(int expectedExitCode, String... args) throws Exception { - OutputAnalyzer analyzer = ProcessTools.executeTestJava(args); - if (analyzer.getExitValue() != expectedExitCode) { - throw new AssertionError("Expected exit code: " + expectedExitCode + - ", got: " + analyzer.getExitValue()); - } - } - - private void compileClasses(Path src, Path output, String... options) throws IOException { - List args = new ArrayList<>(); - Collections.addAll(args, options); - Collections.addAll(args, "-d", output.toString()); - args.add(src.toString()); - System.out.println("javac options: " + args.stream().collect(Collectors.joining(" "))); - if (!CompilerUtils.compile(src.resolve(output.getFileName()), output, options)) { - throw new AssertionError("Compilation failure. See log."); - } - } - - private void runJmod(String cp, String modName, String... options) { - List args = new ArrayList<>(); - args.add("create"); - Collections.addAll(args, options); - Collections.addAll(args, "--class-path", cp, - jmods + File.separator + modName + ".jmod"); - int rc = jdk.tools.jmod.Main.run(args.toArray(new String[args.size()]), System.out); - System.out.println("jmod options: " + args.stream().collect(Collectors.joining(" "))); - if (rc != 0) { - throw new AssertionError("Jmod failed: rc = " + rc); - } - } -} diff --git a/jdk/test/tools/jlink/plugins/FileCopierPluginTest.java b/jdk/test/tools/jlink/plugins/FileCopierPluginTest.java index 69388e7f6e9..5fecfec388b 100644 --- a/jdk/test/tools/jlink/plugins/FileCopierPluginTest.java +++ b/jdk/test/tools/jlink/plugins/FileCopierPluginTest.java @@ -101,9 +101,8 @@ public class FileCopierPluginTest { } Path root = new File(".").toPath(); - DefaultImageBuilder imgbuilder = new DefaultImageBuilder(false, - root); - imgbuilder.storeFiles(pool, ""); + DefaultImageBuilder imgbuilder = new DefaultImageBuilder(root); + imgbuilder.storeFiles(pool); if (lic.exists()) { File license = new File(root.toFile(), "LICENSE"); diff --git a/jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java b/jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java index e109e6c496f..357541a3144 100644 --- a/jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java +++ b/jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java @@ -36,6 +36,7 @@ import tests.Result; /* * @test + * @bug 8152143 8152704 8155649 * @summary IncludeLocalesPlugin tests * @author Naoto Sato * @library ../../lib @@ -55,15 +56,17 @@ public class IncludeLocalesPluginTest { private final static String moduleName = "IncludeLocalesTest"; private static Helper helper; private final static int INCLUDE_LOCALES_OPTION = 0; - private final static int EXPECTED_LOCATIONS = 1; - private final static int UNEXPECTED_PATHS = 2; - private final static int AVAILABLE_LOCALES = 3; - private final static int ERROR_MESSAGE = 4; + private final static int ADDMODS_OPTION = 1; + private final static int EXPECTED_LOCATIONS = 2; + private final static int UNEXPECTED_PATHS = 3; + private final static int AVAILABLE_LOCALES = 4; + private final static int ERROR_MESSAGE = 5; private final static Object[][] testData = { // without --include-locales option: should include all locales { "", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class", "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class", @@ -144,6 +147,7 @@ public class IncludeLocalesPluginTest { // All English/Japanese locales { "--include-locales=en,ja", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class", "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class", @@ -174,6 +178,7 @@ public class IncludeLocalesPluginTest { // All locales in India { "--include-locales=*-IN", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_en_IN.class", "/jdk.localedata/sun/text/resources/ext/FormatData_hi_IN.class", @@ -201,7 +206,9 @@ public class IncludeLocalesPluginTest { }, // Thai - {"--include-locales=th", + { + "--include-locales=th", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th", "/jdk.localedata/sun/text/resources/thai_dict", @@ -221,7 +228,9 @@ public class IncludeLocalesPluginTest { }, // Hong Kong - {"--include-locales=zh-HK", + { + "--include-locales=zh-HK", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class", "/jdk.localedata/sun/text/resources/ext/FormatData_zh_HK.class", @@ -244,7 +253,9 @@ public class IncludeLocalesPluginTest { }, // Norwegian - {"--include-locales=nb,nn,no", + { + "--include-locales=nb,nn,no", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_no.class", "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO.class", @@ -268,7 +279,9 @@ public class IncludeLocalesPluginTest { }, // Hebrew/Indonesian/Yiddish - {"--include-locales=he,id,yi", + { + "--include-locales=he,id,yi", + "jdk.localedata", List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_in.class", "/jdk.localedata/sun/text/resources/ext/FormatData_in_ID.class", @@ -294,7 +307,9 @@ public class IncludeLocalesPluginTest { }, // Error case: No matching locales - {"--include-locales=xyz", + { + "--include-locales=xyz", + "jdk.localedata", null, null, null, @@ -304,7 +319,9 @@ public class IncludeLocalesPluginTest { }, // Error case: Invalid argument - {"--include-locales=en,zh_HK", + { + "--include-locales=en,zh_HK", + "jdk.localedata", null, null, null, @@ -312,6 +329,18 @@ public class IncludeLocalesPluginTest { PluginsResourceBundle.getMessage("include-locales.invalidtag"), "zh_HK")) .getMessage(), }, + + // Error case: jdk.localedata is not added + { + "--include-locales=en-US", + "java.base", + null, + null, + null, + new PluginException( + PluginsResourceBundle.getMessage("include-locales.localedatanotfound")) + .getMessage(), + }, }; public static void main(String[] args) throws Exception { @@ -328,7 +357,7 @@ public class IncludeLocalesPluginTest { Result result = JImageGenerator.getJLinkTask() .modulePath(helper.defaultModulePath()) .output(helper.createNewImageDir(moduleName)) - .addMods("jdk.localedata") + .addMods((String)data[ADDMODS_OPTION]) .option((String)data[INCLUDE_LOCALES_OPTION]) .call(); diff --git a/jdk/test/tools/jmod/JmodNegativeTest.java b/jdk/test/tools/jmod/JmodNegativeTest.java index 5469726a318..9149dc001d9 100644 --- a/jdk/test/tools/jmod/JmodNegativeTest.java +++ b/jdk/test/tools/jmod/JmodNegativeTest.java @@ -76,7 +76,7 @@ public class JmodNegativeTest { jmod() .assertFailure() .resultChecker(r -> - assertContains(r.output, "Error: one of create, list, or describe must be specified") + assertContains(r.output, "Error: one of create, list, describe, or hash must be specified") ); } @@ -85,7 +85,7 @@ public class JmodNegativeTest { jmod("badAction") .assertFailure() .resultChecker(r -> - assertContains(r.output, "Error: mode must be one of create, list, or describe") + assertContains(r.output, "Error: mode must be one of create, list, describe, or hash") ); jmod("--badOption") @@ -170,14 +170,14 @@ public class JmodNegativeTest { } @Test - public void testHashDependenciesModulePathNotSpecified() { + public void testHashModulesModulePathNotSpecified() { jmod("create", - "--hash-dependencies", "anyPattern.*", + "--hash-modules", "anyPattern.*", "output.jmod") .assertFailure() .resultChecker(r -> assertContains(r.output, "Error: --module-path must be " - +"specified when hashing dependencies") + +"specified when hashing modules") ); } @@ -317,7 +317,7 @@ public class JmodNegativeTest { } @Test - public void testDependencyNotFound() throws IOException { + public void testNoModuleHash() throws IOException { Path jmod = MODS_DIR.resolve("output.jmod"); FileUtils.deleteFileIfExistsWithRetry(jmod); Path emptyDir = Paths.get("empty"); @@ -328,13 +328,12 @@ public class JmodNegativeTest { jmod("create", "--class-path", cp, - "--hash-dependencies", ".*", + "--hash-modules", ".*", "--modulepath", emptyDir.toString(), jmod.toString()) - .assertFailure() .resultChecker(r -> - assertContains(r.output, "Hashing module foo dependencies, " - + "unable to find module java.base on module path") + assertContains(r.output, "No hashes recorded: " + + "no module specified for hashing depends on foo") ); } @@ -350,13 +349,10 @@ public class JmodNegativeTest { jmod("create", "--class-path", cp, - "--hash-dependencies", ".*", + "--hash-modules", ".*", "--modulepath", MODS_DIR.toString(), jmod.toString()) - .assertFailure() - .resultChecker(r -> - assertContains(r.output, "Error: error reading module path") - ); + .assertFailure(); } finally { FileUtils.deleteFileWithRetry(empty); } @@ -371,7 +367,7 @@ public class JmodNegativeTest { Files.createFile(file); jmod("create", - "--hash-dependencies", ".*", + "--hash-modules", ".*", "--modulepath", file.toString(), jmod.toString()) .assertFailure() @@ -388,7 +384,7 @@ public class JmodNegativeTest { List> tasks = Arrays.asList( () -> jmod("create", - "--hash-dependencies", "anyPattern", + "--hash-modules", "anyPattern", "--modulepath", "doesNotExist", "output.jmod"), () -> jmod("create", @@ -436,7 +432,7 @@ public class JmodNegativeTest { List> tasks = Arrays.asList( () -> jmod("create", - "--hash-dependencies", "anyPattern", + "--hash-modules", "anyPattern", "--modulepath","empty" + pathSeparator + "doesNotExist", "output.jmod"), () -> jmod("create", diff --git a/jdk/test/tools/jmod/hashes/HashesTest.java b/jdk/test/tools/jmod/hashes/HashesTest.java new file mode 100644 index 00000000000..243ecbd8190 --- /dev/null +++ b/jdk/test/tools/jmod/hashes/HashesTest.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) 2015, 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 + * @summary Test the recording and checking of module hashes + * @author Andrei Eremeev + * @library /lib/testlibrary + * @modules java.base/jdk.internal.module + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jmod + * jdk.compiler + * @build CompilerUtils + * @run testng HashesTest + */ + +import java.io.IOException; +import java.io.InputStream; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReader; +import java.lang.module.ModuleReference; +import java.lang.reflect.Method; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import jdk.internal.module.ConfigurableModuleFinder; +import jdk.internal.module.ModuleHashes; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import static org.testng.Assert.*; + +public class HashesTest { + + private final Path testSrc = Paths.get(System.getProperty("test.src")); + private final Path modSrc = testSrc.resolve("src"); + private final Path mods = Paths.get("mods"); + private final Path jmods = Paths.get("jmods"); + private final String[] modules = new String[] { "m1", "m2", "m3"}; + + private static Method hashesMethod; + @BeforeTest + private void setup() throws Exception { + if (Files.exists(jmods)) { + deleteDirectory(jmods); + } + Files.createDirectories(jmods); + + // build m2, m3 required by m1 + compileModule("m2", modSrc); + jmod("m2"); + + compileModule("m3", modSrc); + jmod("m3"); + + // build m1 + compileModule("m1", modSrc); + // no hash is recorded since m1 has outgoing edges + jmod("m1", "--modulepath", jmods.toString(), "--hash-modules", ".*"); + + // compile org.bar and org.foo + compileModule("org.bar", modSrc); + compileModule("org.foo", modSrc); + + try { + hashesMethod = ModuleDescriptor.class.getDeclaredMethod("hashes"); + hashesMethod.setAccessible(true); + } catch (ReflectiveOperationException x) { + throw new InternalError(x); + } + } + + @Test + public void test() throws Exception { + for (String mn : modules) { + assertFalse(hashes(mn).isPresent()); + } + + // hash m1 in m2 + jmod("m2", "--modulepath", jmods.toString(), "--hash-modules", "m1"); + checkHashes(hashes("m2").get(), "m1"); + + // hash m1 in m2 + jmod("m2", "--modulepath", jmods.toString(), "--hash-modules", ".*"); + checkHashes(hashes("m2").get(), "m1"); + + // create m2.jmod with no hash + jmod("m2"); + // run jmod hash command to hash m1 in m2 and m3 + runJmod(Arrays.asList("hash", "--modulepath", jmods.toString(), + "--hash-modules", ".*")); + checkHashes(hashes("m2").get(), "m1"); + checkHashes(hashes("m3").get(), "m1"); + + jmod("org.bar"); + jmod("org.foo"); + + jmod("org.bar", "--modulepath", jmods.toString(), "--hash-modules", "org.*"); + checkHashes(hashes("org.bar").get(), "org.foo"); + + jmod("m3", "--modulepath", jmods.toString(), "--hash-modules", ".*"); + checkHashes(hashes("m3").get(), "org.foo", "org.bar", "m1"); + } + + private void checkHashes(ModuleHashes hashes, String... hashModules) { + assertTrue(hashes.names().equals(Set.of(hashModules))); + } + + private Optional hashes(String name) throws Exception { + ModuleFinder finder = ModuleFinder.of(jmods.resolve(name + ".jmod")); + if (finder instanceof ConfigurableModuleFinder) { + ((ConfigurableModuleFinder) finder) + .configurePhase(ConfigurableModuleFinder.Phase.LINK_TIME); + } + ModuleReference mref = finder.find(name).orElseThrow(RuntimeException::new); + ModuleReader reader = mref.open(); + try (InputStream in = reader.open("module-info.class").get()) { + ModuleDescriptor md = ModuleDescriptor.read(in); + Optional hashes = + (Optional) hashesMethod.invoke(md); + System.out.format("hashes in module %s %s%n", name, + hashes.isPresent() ? "present" : "absent"); + if (hashes.isPresent()) { + hashes.get().names().stream() + .sorted() + .forEach(n -> System.out.format(" %s %s%n", n, hashes.get().hashFor(n))); + } + return hashes; + } finally { + reader.close(); + } + } + + private void deleteDirectory(Path dir) throws IOException { + Files.walkFileTree(dir, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException + { + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) + throws IOException + { + Files.delete(dir); + return FileVisitResult.CONTINUE; + } + }); + } + + private void compileModule(String moduleName, Path src) throws IOException { + Path msrc = src.resolve(moduleName); + assertTrue(CompilerUtils.compile(msrc, mods, "-modulesourcepath", src.toString())); + } + + private void jmod(String moduleName, String... options) throws IOException { + Path mclasses = mods.resolve(moduleName); + Path outfile = jmods.resolve(moduleName + ".jmod"); + List args = new ArrayList<>(); + args.add("create"); + Collections.addAll(args, options); + Collections.addAll(args, "--class-path", mclasses.toString(), + outfile.toString()); + + if (Files.exists(outfile)) + Files.delete(outfile); + + runJmod(args); + } + + private void runJmod(List args) { + int rc = jdk.tools.jmod.Main.run(args.toArray(new String[args.size()]), System.out); + System.out.println("jmod options: " + args.stream().collect(Collectors.joining(" "))); + if (rc != 0) { + throw new AssertionError("Jmod failed: rc = " + rc); + } + } +} diff --git a/jdk/test/tools/jlink/hashes/src/m1/module-info.java b/jdk/test/tools/jmod/hashes/src/m1/module-info.java similarity index 97% rename from jdk/test/tools/jlink/hashes/src/m1/module-info.java rename to jdk/test/tools/jmod/hashes/src/m1/module-info.java index 8268cd84662..be3af51bf37 100644 --- a/jdk/test/tools/jlink/hashes/src/m1/module-info.java +++ b/jdk/test/tools/jmod/hashes/src/m1/module-info.java @@ -23,5 +23,5 @@ module m1 { requires m2; - requires not_matched; + requires m3; } diff --git a/jdk/test/tools/jlink/hashes/src/m1/org/m1/Main.java b/jdk/test/tools/jmod/hashes/src/m1/org/m1/Main.java similarity index 97% rename from jdk/test/tools/jlink/hashes/src/m1/org/m1/Main.java rename to jdk/test/tools/jmod/hashes/src/m1/org/m1/Main.java index 5b1d2f0c8e3..4108327b1fe 100644 --- a/jdk/test/tools/jlink/hashes/src/m1/org/m1/Main.java +++ b/jdk/test/tools/jmod/hashes/src/m1/org/m1/Main.java @@ -24,7 +24,7 @@ package org.m1; import org.m2.Util; -import org.not_matched.Name; +import org.m3.Name; public class Main { public static void main(String[] args) { diff --git a/jdk/test/tools/jlink/hashes/newsrc/m2/module-info.java b/jdk/test/tools/jmod/hashes/src/m2/module-info.java similarity index 100% rename from jdk/test/tools/jlink/hashes/newsrc/m2/module-info.java rename to jdk/test/tools/jmod/hashes/src/m2/module-info.java diff --git a/jdk/test/tools/jlink/hashes/src/m2/org/m2/Util.java b/jdk/test/tools/jmod/hashes/src/m2/org/m2/Util.java similarity index 100% rename from jdk/test/tools/jlink/hashes/src/m2/org/m2/Util.java rename to jdk/test/tools/jmod/hashes/src/m2/org/m2/Util.java diff --git a/jdk/test/tools/jlink/hashes/src/m2/module-info.java b/jdk/test/tools/jmod/hashes/src/m3/module-info.java similarity index 97% rename from jdk/test/tools/jlink/hashes/src/m2/module-info.java rename to jdk/test/tools/jmod/hashes/src/m3/module-info.java index 4489049b402..a39d7ba860e 100644 --- a/jdk/test/tools/jlink/hashes/src/m2/module-info.java +++ b/jdk/test/tools/jmod/hashes/src/m3/module-info.java @@ -21,6 +21,6 @@ * questions. */ -module m2 { - exports org.m2; +module m3 { + exports org.m3; } diff --git a/jdk/test/tools/jlink/hashes/src/not_matched/org/not_matched/Name.java b/jdk/test/tools/jmod/hashes/src/m3/org/m3/Name.java similarity index 95% rename from jdk/test/tools/jlink/hashes/src/not_matched/org/not_matched/Name.java rename to jdk/test/tools/jmod/hashes/src/m3/org/m3/Name.java index d17333408cb..62040eb55b2 100644 --- a/jdk/test/tools/jlink/hashes/src/not_matched/org/not_matched/Name.java +++ b/jdk/test/tools/jmod/hashes/src/m3/org/m3/Name.java @@ -21,12 +21,12 @@ * questions. */ -package org.not_matched; +package org.m3; public class Name { private Name() { } public static String name() { - return "old_module"; + return "m3"; } } diff --git a/jdk/test/tools/jlink/hashes/newsrc/not_matched/module-info.java b/jdk/test/tools/jmod/hashes/src/org.bar/module-info.java similarity index 89% rename from jdk/test/tools/jlink/hashes/newsrc/not_matched/module-info.java rename to jdk/test/tools/jmod/hashes/src/org.bar/module-info.java index a72988ae6ae..a269fd5ea8c 100644 --- a/jdk/test/tools/jlink/hashes/newsrc/not_matched/module-info.java +++ b/jdk/test/tools/jmod/hashes/src/org.bar/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,6 +21,6 @@ * questions. */ -module not_matched { - exports org.not_matched; +module org.bar { + requires public m1; } diff --git a/jdk/test/tools/jlink/hashes/src/not_matched/module-info.java b/jdk/test/tools/jmod/hashes/src/org.foo/module-info.java similarity index 89% rename from jdk/test/tools/jlink/hashes/src/not_matched/module-info.java rename to jdk/test/tools/jmod/hashes/src/org.foo/module-info.java index a72988ae6ae..b143d5b0ece 100644 --- a/jdk/test/tools/jlink/hashes/src/not_matched/module-info.java +++ b/jdk/test/tools/jmod/hashes/src/org.foo/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,6 +21,6 @@ * questions. */ -module not_matched { - exports org.not_matched; +module org.foo { + requires public org.bar; } diff --git a/jdk/test/tools/launcher/ToolsOpts.java b/jdk/test/tools/launcher/ToolsOpts.java index a0f67d24203..4b4a32bde2b 100644 --- a/jdk/test/tools/launcher/ToolsOpts.java +++ b/jdk/test/tools/launcher/ToolsOpts.java @@ -151,29 +151,26 @@ public class ToolsOpts extends TestHelper { init(); TestResult tr; int jpos = -1; + String xPatch = "-J-Xpatch:jdk.compiler=jdk.compiler"; for (String arg[] : optionPatterns) { jpos = indexOfJoption(arg); //Build a cmd string for output in results reporting. - String cmdString = javacCmd + " -J-Xpatch:."; + String cmdString = javacCmd + " " + xPatch; for (String opt : arg) { cmdString = cmdString.concat(" " + opt); } switch (arg.length) { case 1: - tr = doExec(javacCmd, "-J-Xpatch:.", - arg[0]); + tr = doExec(javacCmd, xPatch, arg[0]); break; case 2: - tr = doExec(javacCmd, "-J-Xpatch:.", - arg[0], arg[1]); + tr = doExec(javacCmd, xPatch, arg[0], arg[1]); break; case 3: - tr = doExec(javacCmd, "-J-Xpatch:.", - arg[0], arg[1], arg[2]); + tr = doExec(javacCmd, xPatch, arg[0], arg[1], arg[2]); break; case 4: - tr = doExec(javacCmd, "-J-Xpatch:.", - arg[0], arg[1], arg[2], arg[3]); + tr = doExec(javacCmd, xPatch, arg[0], arg[1], arg[2], arg[3]); break; default: tr = null; diff --git a/jdk/test/tools/launcher/modules/addmods/AddModsTest.java b/jdk/test/tools/launcher/modules/addmods/AddModsTest.java index a65c3d4eb81..b1fe43c9a29 100644 --- a/jdk/test/tools/launcher/modules/addmods/AddModsTest.java +++ b/jdk/test/tools/launcher/modules/addmods/AddModsTest.java @@ -47,120 +47,179 @@ public class AddModsTest { private static final String TEST_SRC = System.getProperty("test.src"); private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); - private static final Path MODS_DIR = Paths.get("mods"); + private static final Path MODS1_DIR = Paths.get("mods1"); + private static final Path MODS2_DIR = Paths.get("mods2"); - // the module name of the library module - private static final String LIB_MODULE = "lib"; + // test module / main class + private static final String TEST_MODULE = "test"; + private static final String TEST_MAIN_CLASS = "test.Main"; + private static final String TEST_MID = TEST_MODULE + "/" + TEST_MAIN_CLASS; - // application source directory - private static final String APP_SRC = "app"; - - // application is compiled to classes - private static final Path CLASSES_DIR = Paths.get("classes"); - - // application main class - private static final String MAIN_CLASS = "app.Main"; + // logger module + private static final String LOGGER_MODULE = "logger"; @BeforeTest public void compile() throws Exception { - - // javac -d mods/$LIB_MODULE src/$LIB_MODULE/** + // javac -d mods1/test src/test/** boolean compiled = CompilerUtils.compile( - SRC_DIR.resolve(LIB_MODULE), - MODS_DIR.resolve(LIB_MODULE) + SRC_DIR.resolve(TEST_MODULE), + MODS1_DIR.resolve(TEST_MODULE) ); - assertTrue(compiled, "library module did not compile"); + assertTrue(compiled, "test did not compile"); - // javac -d classes -mp mods src/$APP_DIR/** - compiled = CompilerUtils.compile( - SRC_DIR.resolve(APP_SRC), - CLASSES_DIR, - "-mp", MODS_DIR.toString(), - "-addmods", LIB_MODULE + // javac -d mods1/logger src/logger/** + compiled= CompilerUtils.compile( + SRC_DIR.resolve(LOGGER_MODULE), + MODS2_DIR.resolve(LOGGER_MODULE) ); - assertTrue(compiled, "app did not compile"); + assertTrue(compiled, "test did not compile"); } /** - * Basic test of -addmods ALL-SYSTEM, using the output of -listmods to - * check that the a sample of the system modules are resolved. + * Basic test of -addmods ALL-DEFAULT. Module java.sql should be + * resolved and the types in that module should be visible. + */ + public void testAddDefaultModules1() throws Exception { + + // java -addmods ALL-DEFAULT -mp mods1 -m test ... + int exitValue + = executeTestJava("-mp", MODS1_DIR.toString(), + "-addmods", "ALL-DEFAULT", + "-m", TEST_MID, + "java.sql.Connection") + .outputTo(System.out) + .errorTo(System.out) + .getExitValue(); + + assertTrue(exitValue == 0); + } + + /** + * Basic test of -addmods ALL-DEFAULT. Module java.annotations.common + * should not resolved and so the types in that module should not be + * visible. + */ + public void testAddDefaultModules2() throws Exception { + + // java -addmods ALL-DEFAULT -mp mods1 -m test ... + int exitValue + = executeTestJava("-mp", MODS1_DIR.toString(), + "-addmods", "ALL-DEFAULT", + "-m", TEST_MID, + "javax.annotation.Generated") + .outputTo(System.out) + .errorTo(System.out) + .shouldContain("ClassNotFoundException") + .getExitValue(); + + assertTrue(exitValue != 0); + } + + /** + * Basic test of -addmods ALL-SYSTEM. All system modules should be resolved + * and thus all types in those modules should be visible. */ public void testAddSystemModules() throws Exception { - executeTestJava("-addmods", "ALL-SYSTEM", - "-listmods", - "-m", "java.base") - .outputTo(System.out) - .errorTo(System.out) - .shouldContain("java.sql") - .shouldContain("java.corba"); + // java -addmods ALL-SYSTEM -mp mods1 -m test ... + int exitValue + = executeTestJava("-mp", MODS1_DIR.toString(), + "-addmods", "ALL-SYSTEM", + "-m", TEST_MID, + "java.sql.Connection", + "javax.annotation.Generated") + .outputTo(System.out) + .errorTo(System.out) + .getExitValue(); - // no exit value to check as -m java.base will likely fail + assertTrue(exitValue == 0); } /** - * Run application on class path that makes use of module on the - * application module path. Uses {@code -addmods lib} + * Run test on class path to load a type in a module on the application + * module path, uses {@code -addmods logger}. */ public void testRunWithAddMods() throws Exception { - // java -mp mods -addmods lib -cp classes app.Main + // java -mp mods -addmods logger -cp classes test.Main + String classpath = MODS1_DIR.resolve(TEST_MODULE).toString(); + String modulepath = MODS2_DIR.toString(); int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", LIB_MODULE, - "-cp", CLASSES_DIR.toString(), - MAIN_CLASS) + = executeTestJava("-mp", modulepath, + "-addmods", LOGGER_MODULE, + "-cp", classpath, + TEST_MAIN_CLASS, + "logger.Logger") .outputTo(System.out) .errorTo(System.out) .getExitValue(); assertTrue(exitValue == 0); - } + /** + * Run application on class path that makes use of module on the + * application module path. Does not use -addmods and so should + * fail at run-time. + */ + public void testRunMissingAddMods() throws Exception { + + // java -mp mods -cp classes test.Main + String classpath = MODS1_DIR.resolve(TEST_MODULE).toString(); + String modulepath = MODS1_DIR.toString(); + int exitValue + = executeTestJava("-mp", modulepath, + "-cp", classpath, + TEST_MAIN_CLASS, + "logger.Logger") + .outputTo(System.out) + .errorTo(System.out) + .shouldContain("ClassNotFoundException") + .getExitValue(); + + assertTrue(exitValue != 0); + } + + /** - * Run application on class path that makes use of module on the - * application module path. Uses {@code -addmods ALL-MODULE-PATH}. + * Run test on class path to load a type in a module on the application + * module path, uses {@code -addmods ALL-MODULE-PATH}. */ public void testAddAllModulePath() throws Exception { - // java -mp mods -addmods lib -cp classes app.Main + // java -mp mods -addmods ALL-MODULE-PATH -cp classes test.Main + String classpath = MODS1_DIR.resolve(TEST_MODULE).toString(); + String modulepath = MODS1_DIR.toString(); int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), + = executeTestJava("-mp", modulepath, "-addmods", "ALL-MODULE-PATH", - "-cp", CLASSES_DIR.toString(), - MAIN_CLASS) + "-cp", classpath, + TEST_MAIN_CLASS) .outputTo(System.out) .errorTo(System.out) .getExitValue(); assertTrue(exitValue == 0); - } /** - * Run application on class path that makes use of module on the - * application module path. Does not use -addmods and so will - * fail at run-time. + * Test {@code -addmods ALL-MODULE-PATH} without {@code -modulepath}. */ - public void testRunMissingAddMods() throws Exception { + public void testAddAllModulePathWithNoModulePath() throws Exception { - // java -mp mods -cp classes app.Main + // java -addmods ALL-MODULE-PATH -version int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-cp", CLASSES_DIR.toString(), - MAIN_CLASS) + = executeTestJava("-addmods", "ALL-MODULE-PATH", + "-version") .outputTo(System.out) .errorTo(System.out) .getExitValue(); - // CNFE or other error/exception - assertTrue(exitValue != 0); - + assertTrue(exitValue == 0); } @@ -169,18 +228,17 @@ public class AddModsTest { */ public void testRunWithBadAddMods() throws Exception { - // java -mp mods -addmods,DoesNotExist lib -cp classes app.Main + // java -mp mods -addmods DoesNotExist -m test ... int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", LIB_MODULE + ",DoesNotExist", - "-cp", CLASSES_DIR.toString(), - MAIN_CLASS) + = executeTestJava("-mp", MODS1_DIR.toString(), + "-addmods", "DoesNotExist", + "-m", TEST_MID) .outputTo(System.out) .errorTo(System.out) + .shouldContain("DoesNotExist") .getExitValue(); assertTrue(exitValue != 0); - } } diff --git a/jdk/test/tools/launcher/modules/addmods/src/lib/jdk/lib/Util.java b/jdk/test/tools/launcher/modules/addmods/src/lib/jdk/lib/Util.java deleted file mode 100644 index 682a22921f3..00000000000 --- a/jdk/test/tools/launcher/modules/addmods/src/lib/jdk/lib/Util.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014, 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. - */ - -package jdk.lib; - -public class Util { - private Util() { } - - public static Object makeObject() { - return new Object(); - } -} diff --git a/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java b/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java new file mode 100644 index 00000000000..0cb0c293263 --- /dev/null +++ b/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016, 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. + */ + +package logger; + +/** + * No-op user module for use by the {@code java -addmods} tests. + */ +public class Logger { +} diff --git a/jdk/test/tools/launcher/modules/addmods/src/lib/module-info.java b/jdk/test/tools/launcher/modules/addmods/src/logger/module-info.java similarity index 90% rename from jdk/test/tools/launcher/modules/addmods/src/lib/module-info.java rename to jdk/test/tools/launcher/modules/addmods/src/logger/module-info.java index 16dae96e170..fc5a8257db4 100644 --- a/jdk/test/tools/launcher/modules/addmods/src/lib/module-info.java +++ b/jdk/test/tools/launcher/modules/addmods/src/logger/module-info.java @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +/** + * Copyright (c) 2016, 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 @@ -21,6 +21,4 @@ * questions. */ -module lib { - exports jdk.lib; -} +module logger { } diff --git a/jdk/test/tools/launcher/modules/addmods/src/test/module-info.java b/jdk/test/tools/launcher/modules/addmods/src/test/module-info.java new file mode 100644 index 00000000000..335d0bc1a12 --- /dev/null +++ b/jdk/test/tools/launcher/modules/addmods/src/test/module-info.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2016, 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. + */ + +module test { } diff --git a/jdk/test/tools/jlink/hashes/newsrc/not_matched/org/not_matched/Name.java b/jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java similarity index 71% rename from jdk/test/tools/jlink/hashes/newsrc/not_matched/org/not_matched/Name.java rename to jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java index eb71f80b451..c6ca7a1be1b 100644 --- a/jdk/test/tools/jlink/hashes/newsrc/not_matched/org/not_matched/Name.java +++ b/jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,12 +21,17 @@ * questions. */ -package org.not_matched; +package test; -public class Name { - private Name() { } - - public static String name() { - return "new_module"; +/** + * Invoked by tests for the {@code java -addmods} option to check that types + * are visible. + */ +public class Main { + public static void main(String[] args) throws Exception { + for (String cn : args) { + Class c = Class.forName(cn); + System.out.println("Loaded: " + c); + } } } diff --git a/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java b/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java index 3bcf4bfa50c..82d0c383f7a 100644 --- a/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java +++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java @@ -25,7 +25,7 @@ * @test * @library /lib/testlibrary * @modules jdk.compiler - * @build AddReadsTest CompilerUtils jdk.testlibrary.* + * @build AddReadsTest CompilerUtils JarUtils jdk.testlibrary.* * @run testng AddReadsTest * @summary Basic tests for java -XaddReads */ diff --git a/jdk/test/tools/launcher/modules/patch/PatchTest.java b/jdk/test/tools/launcher/modules/patch/PatchTest.java index ba0ce877145..971362061ab 100644 --- a/jdk/test/tools/launcher/modules/patch/PatchTest.java +++ b/jdk/test/tools/launcher/modules/patch/PatchTest.java @@ -25,7 +25,7 @@ * @test * @library /lib/testlibrary * @modules jdk.compiler - * @build PatchTest CompilerUtils jdk.testlibrary.* + * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.* * @run testng PatchTest * @summary Basic test for -Xpatch */ @@ -72,6 +72,9 @@ public class PatchTest { private static final Path SRC2_DIR = Paths.get(TEST_SRC, "src2"); private static final Path PATCHES2_DIR = Paths.get("patches2"); + // destination directory for patches packaged as JAR files + private static final Path PATCHES_DIR = Paths.get("patches"); + // the classes overridden or added with -Xpatch private static final String[] CLASSES = { @@ -95,7 +98,7 @@ public class PatchTest { @BeforeTest - public void compile() throws Exception { + public void setup() throws Exception { // javac -d mods/test src/test/** boolean compiled= CompilerUtils.compile(SRC_DIR.resolve("test"), @@ -103,36 +106,40 @@ public class PatchTest { assertTrue(compiled, "classes did not compile"); // javac -Xmodule:$MODULE -d patches1/$MODULE patches1/$MODULE/** + // jar cf patches/$MODULE-1.jar -C patches1/$MODULE . for (Path src : Files.newDirectoryStream(SRC1_DIR)) { Path output = PATCHES1_DIR.resolve(src.getFileName()); String mn = src.getFileName().toString(); compiled = CompilerUtils.compile(src, output, "-Xmodule:" + mn); assertTrue(compiled, "classes did not compile"); + JarUtils.createJarFile(PATCHES_DIR.resolve(mn + "-1.jar"), output); } // javac -Xmodule:$MODULE -d patches2/$MODULE patches2/$MODULE/** + // jar cf patches/$MODULE-2.jar -C patches2/$MODULE . for (Path src : Files.newDirectoryStream(SRC2_DIR)) { Path output = PATCHES2_DIR.resolve(src.getFileName()); String mn = src.getFileName().toString(); compiled = CompilerUtils.compile(src, output, "-Xmodule:" + mn); assertTrue(compiled, "classes did not compile"); + JarUtils.createJarFile(PATCHES_DIR.resolve(mn + "-2.jar"), output); } } /** - * Run the test with -Xpatch + * Run test with patches to java.base, jdk.naming.dns and jdk.compiler */ - public void testRunWithXPatch() throws Exception { - - // value for -Xpatch - String patchPath = PATCHES1_DIR + File.pathSeparator + PATCHES2_DIR; - + void runTest(String basePatches, String dnsPatches, String compilerPatches) + throws Exception + { // the argument to the test is the list of classes overridden or added String arg = Stream.of(CLASSES).collect(Collectors.joining(",")); int exitValue - = executeTestJava("-Xpatch:" + patchPath, + = executeTestJava("-Xpatch:java.base=" + basePatches, + "-Xpatch:jdk.naming.dns=" + dnsPatches, + "-Xpatch:jdk.compiler=" + compilerPatches, "-XaddExports:java.base/java.lang2=test", "-XaddExports:jdk.naming.dns/com.sun.jndi.dns=test", "-XaddExports:jdk.naming.dns/com.sun.jndi.dns2=test", @@ -145,6 +152,44 @@ public class PatchTest { .getExitValue(); assertTrue(exitValue == 0); + } + + + /** + * Run test with -Xpatch and exploded patches + */ + public void testWithExplodedPatches() throws Exception { + + // patches1/java.base:patches2/java.base + String basePatches = PATCHES1_DIR.resolve("java.base") + + File.pathSeparator + PATCHES2_DIR.resolve("java.base"); + + String dnsPatches = PATCHES1_DIR.resolve("jdk.naming.dns") + + File.pathSeparator + PATCHES2_DIR.resolve("jdk.naming.dns"); + + String compilerPatches = PATCHES1_DIR.resolve("jdk.compiler") + + File.pathSeparator + PATCHES2_DIR.resolve("jdk.compiler"); + + runTest(basePatches, dnsPatches, compilerPatches); + } + + + /** + * Run test with -Xpatch and patches in JAR files + */ + public void testWitJarPatches() throws Exception { + + // patches/java.base-1.jar:patches/java-base-2.jar + String basePatches = PATCHES_DIR.resolve("java.base-1.jar") + + File.pathSeparator + PATCHES_DIR.resolve("java.base-2.jar"); + + String dnsPatches = PATCHES_DIR.resolve("jdk.naming.dns-1.jar") + + File.pathSeparator + PATCHES_DIR.resolve("jdk.naming.dns-2.jar"); + + String compilerPatches = PATCHES_DIR.resolve("jdk.compiler-1.jar") + + File.pathSeparator + PATCHES_DIR.resolve("jdk.compiler-2.jar"); + + runTest(basePatches, dnsPatches, compilerPatches); } diff --git a/jdk/test/tools/lib/tests/JImageGenerator.java b/jdk/test/tools/lib/tests/JImageGenerator.java index c75164b69cc..a836e818243 100644 --- a/jdk/test/tools/lib/tests/JImageGenerator.java +++ b/jdk/test/tools/lib/tests/JImageGenerator.java @@ -113,7 +113,7 @@ public class JImageGenerator { private static final String CMDS_OPTION = "--cmds"; private static final String CONFIG_OPTION = "--config"; - private static final String HASH_DEPENDENCIES_OPTION = "--hash-dependencies"; + private static final String HASH_MODULES_OPTION = "--hash-modules"; private static final String LIBS_OPTION = "--libs"; private static final String MODULE_VERSION_OPTION = "--module-version"; @@ -347,7 +347,7 @@ public class JImageGenerator { private final List jmods = new ArrayList<>(); private final List options = new ArrayList<>(); private Path output; - private String hashDependencies; + private String hashModules; private String mainClass; private String moduleVersion; @@ -356,8 +356,8 @@ public class JImageGenerator { return this; } - public JModTask hashDependencies(String hash) { - this.hashDependencies = hash; + public JModTask hashModules(String hash) { + this.hashModules = hash; return this; } @@ -430,9 +430,9 @@ public class JImageGenerator { options.add(CONFIG_OPTION); options.add(toPath(config)); } - if (hashDependencies != null) { - options.add(HASH_DEPENDENCIES_OPTION); - options.add(hashDependencies); + if (hashModules != null) { + options.add(HASH_MODULES_OPTION); + options.add(hashModules); } if (mainClass != null) { options.add(MAIN_CLASS_OPTION); diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index d2404007848..602ccb1932c 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -99,7 +99,7 @@ java.datatransfer_COPY := flavormap.properties ################################################################################ java.desktop_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference \ - '-Xdoclint/package:java.*,javax.*' + '-Xdoclint/package:java.*,javax.*' -Xlint:-deprecation java.desktop_COPY := .gif .png .wav .txt .xml .css .pf java.desktop_CLEAN := iio-plugin.properties cursors.properties diff --git a/make/CreateBuildJdkCopy.gmk b/make/CreateBuildJdkCopy.gmk index ca8b3e10491..0a9ba2c4789 100644 --- a/make/CreateBuildJdkCopy.gmk +++ b/make/CreateBuildJdkCopy.gmk @@ -29,13 +29,15 @@ include $(SPEC) include MakeBase.gmk include Modules.gmk -MODULES_TO_COPY := $(call FindTransitiveDepsForModule, jdk.jlink) jdk.jlink +MODULES_TO_COPY := $(sort \ + $(foreach m, jdk.jlink $(INTERIM_IMAGE_MODULES), \ + $(call FindTransitiveDepsForModule, $m) $m)) ################################################################################ # Copy the modules needed to run jlink and jmod. Use bulk copy instead of # SetupCopyFiles since there are so many files. -COPY_CLASSES_TARGET := $(BUILDJDK_OUTPUTDIR)/jdk/modules/_buildjdk-copy-maker +COPY_CLASSES_TARGET := $(BUILDJDK_OUTPUTDIR)/jdk/modules/java.base/_the.buildjdk-copy-marker $(COPY_CLASSES_TARGET): $(call CacheFind, $(wildcard \ $(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY)))) @@ -49,15 +51,6 @@ $(COPY_CLASSES_TARGET): $(call CacheFind, $(wildcard \ TARGETS += $(COPY_CLASSES_TARGET) -#$(eval $(call SetupCopyFiles, COPY_JDK_MODULES, \ - SRC := $(BUILD_OUTPUT), \ - DEST := $(BUILDJDK_OUTPUTDIR), \ - FILES := $(call DoubleDollar, $(call DoubleDollar, $(call CacheFind, $(wildcard \ - $(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY)))))), \ -)) - -#TARGETS += $(COPY_JDK_MODULES) - ################################################################################ $(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \ diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index 212132779b1..394888c4970 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -1,4 +1,4 @@ -# + # Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # @@ -35,6 +35,8 @@ endif ################################################################################ +JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods + LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ $(SUPPORT_OUTPUTDIR)/modules_libs-stripped $(IMPORT_MODULES_LIBS)))) CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ @@ -64,15 +66,35 @@ ifneq ($(CLASSES_DIR), ) DEPS += $(call CacheFind, $(CLASSES_DIR)) endif -# Add dependencies on other jmod files -DEPS += $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, \ - $(call FindDepsForModule, $(MODULE))) +# Add dependencies on other jmod files. Only java.base needs access to other +# jmods. +ifeq ($(MODULE), java.base) + # When creating a BUILDJDK, we don't need to add hashes to java.base + ifneq ($(CREATING_BUILDJDK), true) + DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \ + $(filter-out java.base, $(call FindAllModules))) + + # TODO: find modules that directly and indirectly depend on upgradeable + # modules + EXCLUDE_HASH_MODULES := $(UPGRADEABLE_MODULES) \ + java.se.ee \ + jdk.rmic \ + jdk.xml.bind \ + jdk.xml.ws \ + # + + EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(EXCLUDE_HASH_MODULES)))) + + JMOD_FLAGS += --modulepath $(JMODS_DIR) \ + --hash-modules '^(?!$(EXCLUDE_PATTERN))' + endif +endif # TODO: What about headers? # Create jmods in a temp dir and then move them into place to keep the # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. -$(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod: $(DEPS) - $(call LogWarn, Creating $(notdir $@)) +$(JMODS_DIR)/$(MODULE).jmod: $(DEPS) + $(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@)) $(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods) $(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $(JMOD) create \ @@ -80,8 +102,7 @@ $(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod: $(DEPS) --os-name $(REQUIRED_OS_NAME) \ --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \ --os-version $(REQUIRED_OS_VERSION) \ - --modulepath $(IMAGES_OUTPUTDIR)/jmods\ - --hash-dependencies '.*' \ + --modulepath $(JMODS_DIR) \ --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.pdb,*.map}' \ $(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@ diff --git a/make/Images.gmk b/make/Images.gmk index a50cd7ca4d4..302bc2b3e42 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -56,19 +56,11 @@ JRE_COMPACT1_MODULES := java.compact1 $(COMPACT1_EXTRA_MODULES) JRE_COMPACT2_MODULES := $(JRE_COMPACT1_MODULES) java.compact2 $(COMPACT2_EXTRA_MODULES) JRE_COMPACT3_MODULES := $(JRE_COMPACT2_MODULES) java.compact3 $(COMPACT3_EXTRA_MODULES) -# Replacing double-comma with a single comma is to workaround the issue -# with some version of make on windows that doesn't substitute spaces -# with one comma properly as with make 4.0 -SubstComma = \ - $(strip \ - $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \ - ) - -JRE_MODULES_LIST := $(call SubstComma, $(JRE_MODULES)) -JDK_MODULES_LIST := $(call SubstComma, $(JDK_MODULES)) -JRE_COMPACT1_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT1_MODULES)) -JRE_COMPACT2_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT2_MODULES)) -JRE_COMPACT3_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT3_MODULES)) +JRE_MODULES_LIST := $(call CommaList, $(JRE_MODULES)) +JDK_MODULES_LIST := $(call CommaList, $(JDK_MODULES)) +JRE_COMPACT1_MODULES_LIST := $(call CommaList, $(JRE_COMPACT1_MODULES)) +JRE_COMPACT2_MODULES_LIST := $(call CommaList, $(JRE_COMPACT2_MODULES)) +JRE_COMPACT3_MODULES_LIST := $(call CommaList, $(JRE_COMPACT3_MODULES)) ################################################################################ # Release file @@ -363,6 +355,23 @@ $(JDK_IMAGE_DIR)/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip +################################################################################ +# classlist + +$(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \ + FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \ + DEST := $(JDK_IMAGE_DIR)/lib, \ +)) + +JDK_TARGETS += $(JDK_COPY_CLASSLIST) + +$(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \ + FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \ + DEST := $(JRE_IMAGE_DIR)/lib, \ +)) + +JRE_TARGETS += $(JRE_COPY_CLASSLIST) + ################################################################################ # /demo dir ifneq ($(findstring images, $(MAKECMDGOALS)), ) diff --git a/make/InterimImage.gmk b/make/InterimImage.gmk new file mode 100644 index 00000000000..6f05abe0b83 --- /dev/null +++ b/make/InterimImage.gmk @@ -0,0 +1,60 @@ +# +# Copyright (c) 2016, 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. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include Modules.gmk + +################################################################################ + +# Use this file inside the image as target for make rule +JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX) + +INTERIM_MODULES_LIST := $(call CommaList, $(INTERIM_IMAGE_MODULES)) + +JMODS := $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, $(INTERIM_IMAGE_MODULES)) + +JLINK_TOOL := $(JLINK) \ + --modulepath $(IMAGES_OUTPUTDIR)/jmods \ + --endian $(OPENJDK_BUILD_CPU_ENDIAN) + +$(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ + $(call DependOnVariable, INTERIM_MODULES_LIST) + $(ECHO) Creating interim jimage + $(RM) -r $(INTERIM_IMAGE_DIR) + $(JLINK_TOOL) \ + --output $(INTERIM_IMAGE_DIR) \ + --addmods $(INTERIM_MODULES_LIST) + $(TOUCH) $@ + +TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE) + +################################################################################ + +all: $(TARGETS) + +.PHONY: all diff --git a/make/Main.gmk b/make/Main.gmk index 43a6f755ec0..b1700f367ea 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -348,25 +348,35 @@ ALL_TARGETS += docs-javadoc docs-jvmtidoc zip-docs ################################################################################ # Cross compilation support -ifeq ($(CREATE_BUILDJDK), true) +ifeq ($(CREATING_BUILDJDK), true) # This target is only called by the recursive call below. - create-buildjdk-compile-hotspot-helper: hotspot - create-buildjdk-compile-modules-helper: jdk.jlink-launchers java.base-copy \ - jdk.jdeps-launchers + create-buildjdk-interim-image-helper: interim-image jdk.jlink-launchers \ + java.base-copy jdk.jdeps-launchers endif create-buildjdk-copy: +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateBuildJdkCopy.gmk) -create-buildjdk-compile-hotspot create-buildjdk-compile-modules: +create-buildjdk-interim-image: +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk \ $@-helper \ SPEC=$(dir $(SPEC))buildjdk-spec.gmk \ HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \ CREATING_BUILDJDK=true) -ALL_TARGETS += create-buildjdk-copy create-buildjdk-compile-hotspot \ - create-buildjdk-compile-modules +ALL_TARGETS += create-buildjdk-copy create-buildjdk-interim-image + +################################################################################ +# The interim-image is a small jlinked image that is used to generate artifacts +# at build time for use when linking the real images. + +interim-image: + +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk) + +generate-classlist: + +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateClasslist.gmk) + +ALL_TARGETS += interim-image generate-classlist ################################################################################ # Build tests @@ -522,10 +532,11 @@ else $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java)) # Declare dependencies from -lib to -java - # Skip modules that do not have java source. When creating a BUILD_JDK, the - # java compilation has already been done by the normal build and copied in. + # Skip modules that do not have java source. + # When creating a BUILDJDK, the java compilation has already been done by the + # normal build and copied in. ifneq ($(CREATING_BUILDJDK), true) - $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java)) + $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java)) endif # Declare dependencies from all other -lib to java.base-lib @@ -562,13 +573,21 @@ else $(foreach m, $(GENDATA_MODULES), $(eval $m-strip: $m-gendata)) $(foreach m, $(COPY_MODULES), $(eval $m-strip: $m-copy)) - # Declare dependencies between jmod targets - $(foreach m, $(JMOD_MODULES), \ - $(eval $m-jmod: $(addsuffix -jmod, $(call FindDepsForModule,$m)))) + # Declare dependencies between jmod targets. Only java.base jmod needs access + # to the other jmods to be built. + # When creating a BUILDJDK, we don't need to add hashes to java.base, thus + # we don't need to depend on all other jmods + ifneq ($(CREATING_BUILDJDK), true) + java.base-jmod: $(filter-out java.base-jmod, $(JMOD_TARGETS)) + endif # Declare dependencies from -jmod to all other module targets $(foreach m, $(STRIP_MODULES), $(eval $m-jmod: $m-strip)) - $(foreach m, $(JAVA_MODULES), $(eval $m-jmod: $m-java)) + # When creating a BUILDJDK, the java compilation has already been done by the + # normal build and copied in. + ifneq ($(CREATING_BUILDJDK), true) + $(foreach m, $(JAVA_MODULES), $(eval $m-jmod: $m-java)) + endif $(foreach m, $(GENDATA_MODULES), $(eval $m-jmod: $m-gendata)) $(foreach m, $(RMIC_MODULES), $(eval $m-jmod: $m-rmic)) $(foreach m, $(LIBS_MODULES), $(eval $m-jmod: $m-libs)) @@ -577,10 +596,18 @@ else # Jmods cannot be created until we have the jlink tool ready to run, which requires # all java modules to be compiled and jdk.jlink-launchers. - $(JMOD_TARGETS): java java.base-libs jdk.jlink-launchers + $(JMOD_TARGETS): java.base-libs jdk.jlink-launchers + # When creating a BUILDJDK, the java compilation has already been done by the + # normal build and copied in. + ifneq ($(CREATING_BUILDJDK), true) + $(JMOD_TARGETS): java + endif ifeq ($(CREATE_BUILDJDK), true) - $(JMOD_TARGETS): create-buildjdk + # Avoid calling create-buildjdk from within a create-buildjdk call + ifneq ($(CREATING_BUILDJDK), true) + $(JMOD_TARGETS): create-buildjdk + endif endif zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \ @@ -590,7 +617,18 @@ else jrtfs-jar: interim-langtools - jimages: jmods zip-source source-tips demos samples jrtfs-jar + ifeq ($(CREATE_BUILDJDK), true) + # If creating a buildjdk, the interim image needs to be based on that. + generate-classlist: create-buildjdk + else ifeq ($(EXTERNAL_BUILDJDK), false) + # If an external buildjdk has been provided, we skip generating an + # interim-image and just use the external buildjdk for generating + # classlist. + generate-classlist: interim-image + endif + generate-classlist: buildtools-jdk + + jimages: jmods zip-source source-tips demos samples jrtfs-jar generate-classlist profiles: jmods zip-source source-tips jrtfs-jar @@ -606,9 +644,12 @@ else test: jimages test-image - create-buildjdk-copy: jdk.jlink-java java.base-gendata + create-buildjdk-copy: jdk.jlink-java java.base-gendata \ + $(addsuffix -java, $(INTERIM_IMAGE_MODULES)) - create-buildjdk-compile-modules: create-buildjdk-copy create-buildjdk-compile-hotspot + create-buildjdk-interim-image: create-buildjdk-copy + + interim-image: $(addsuffix -jmod, $(INTERIM_IMAGE_MODULES)) test-make: clean-test-make @@ -682,8 +723,7 @@ samples: samples-jdk # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk. exploded-image: $(ALL_MODULES) -create-buildjdk: create-buildjdk-compile-modules create-buildjdk-copy \ - create-buildjdk-compile-hotspot +create-buildjdk: create-buildjdk-copy create-buildjdk-interim-image mac-bundles: mac-bundles-jdk @@ -694,10 +734,14 @@ mac-bundles: mac-bundles-jdk # (and possibly other, more specific versions) product-images: jimages demos samples zip-security exploded-image -# When cross compiling and building a partial BUILDJDK for the build host, -# the summary generation cannot be run. +# The module summary cannot be run when: +# * Cross compiling and building a partial BUILDJDK for the build host +# * An external buildjdk has been supplied since it may not match the +# module selection of the target jdk ifneq ($(CREATE_BUILDJDK), true) - product-images: generate-summary + ifeq ($(EXTERNAL_BUILDJDK), false) + product-images: generate-summary + endif endif ifeq ($(OPENJDK_TARGET_OS), macosx) diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index 22e9d908bfc..29940176b04 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -181,7 +181,7 @@ define SetupJavaCompilationBody # Extract the info from the java compiler setup. $1_JVM := $$($$($1_SETUP)_JVM) $1_JAVAC := $$($$($1_SETUP)_JAVAC) - $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS) + $1_FLAGS := $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS) ifneq ($$($1_CLASSPATH), ) $1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH)) endif diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index f159b8fca63..1a33d69f3bb 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -741,6 +741,17 @@ check-jvm-variant = \ $(error Internal error: Invalid variant tested: $1)) \ $(if $(filter $1, $(JVM_VARIANTS)), true, false)) +################################################################################ +# Converts a space separated list to a comma separated list. +# +# Replacing double-comma with a single comma is to workaround the issue with +# some version of make on windows that doesn't substitute spaces with one comma +# properly. +CommaList = \ + $(strip \ + $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \ + ) + ################################################################################ # Hook to include the corresponding custom file, if present. diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 681c58ad07a..ba1f82e5d5b 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -38,13 +38,12 @@ _MODULES_GMK := 1 BOOT_MODULES := PLATFORM_MODULES := JRE_TOOL_MODULES := +UPGRADEABLE_MODULES := +AGGREGATOR_MODULES := # Hook to include the corresponding custom file, if present. $(eval $(call IncludeCustomExtension, , common/Modules.gmk)) -UPGRADEABLE_MDOULES := -AGGREGATOR_MDOULES := - BOOT_MODULES += \ java.base \ java.datatransfer \ @@ -73,11 +72,9 @@ BOOT_MODULES += \ # to be deprivileged BOOT_MODULES += \ - java.compiler \ java.scripting \ java.sql.rowset \ java.smartcardio \ - jdk.charsets \ jdk.naming.rmi \ # @@ -104,7 +101,9 @@ PLATFORM_MODULES += \ # PLATFORM_MODULES += \ + java.compiler \ jdk.accessibility \ + jdk.charsets \ jdk.crypto.ec \ jdk.crypto.pkcs11 \ jdk.dynalink \ @@ -129,6 +128,10 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) PLATFORM_MODULES += jdk.crypto.ucrypto endif +# These modules are included in the interim image which is used to run profiling +# before building the real images. +INTERIM_IMAGE_MODULES := java.base java.logging + ################################################################################ # Some platforms don't have the serviceability agent