OpenJDK / valhalla / valhalla
changeset 59566:aa67336b5f17 nestmates
Merge
author | dholmes |
---|---|
date | Wed, 25 Mar 2020 21:31:09 -0400 |
parents | 315478f0a527 b65352cf6754 |
children | 1e14b42ab69b |
files | make/CompileInterimRmic.gmk make/common/RMICompilation.gmk make/rmic/Rmic-java.management.rmi.gmk make/rmic/Rmic-java.rmi.gmk make/rmic/Rmic-jdk.naming.rmi.gmk make/rmic/RmicCommon.gmk src/demo/share/jfc/Font2DTest/Font2DTestApplet.java src/demo/share/jfc/SwingSet2/SwingSet2Applet.java src/hotspot/cpu/ppc/templateTable_ppc_64.cpp src/hotspot/cpu/sparc/templateTable_sparc.cpp src/hotspot/cpu/x86/templateTable_x86.cpp src/hotspot/share/classfile/classFileParser.cpp src/hotspot/share/classfile/classLoader.cpp src/hotspot/share/classfile/javaClasses.cpp src/hotspot/share/classfile/klassFactory.cpp src/hotspot/share/classfile/systemDictionary.cpp src/hotspot/share/classfile/systemDictionary.hpp src/hotspot/share/classfile/systemDictionaryShared.cpp src/hotspot/share/classfile/vmSymbols.hpp src/hotspot/share/gc/shared/concurrentGCPhaseManager.cpp src/hotspot/share/gc/shared/concurrentGCPhaseManager.hpp src/hotspot/share/gc/shenandoah/shenandoahAllocTracker.cpp src/hotspot/share/gc/shenandoah/shenandoahAllocTracker.hpp src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.cpp src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.hpp src/hotspot/share/jvmci/vmStructs_jvmci.cpp src/hotspot/share/memory/metaspaceShared.cpp src/hotspot/share/oops/instanceKlass.cpp src/hotspot/share/oops/instanceKlass.hpp src/hotspot/share/opto/c2compiler.cpp src/hotspot/share/prims/jni.cpp src/hotspot/share/prims/jvm.cpp src/hotspot/share/runtime/vmStructs.cpp src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java src/java.base/share/classes/com/sun/security/cert/internal/x509/X509V1CertImpl.java src/java.base/share/classes/java/lang/ClassLoader.java src/java.base/share/classes/java/lang/System.java src/java.base/share/classes/java/lang/invoke/MethodHandles.java src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java src/java.base/share/native/libjava/ClassLoader.c src/java.base/unix/classes/java/lang/ClassLoaderHelper.java src/java.base/windows/classes/java/lang/ClassLoaderHelper.java src/java.rmi/share/doc/stub/java/rmi/activation/ActivationGroup_Stub.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java src/jdk.jartool/share/classes/sun/tools/jar/Manifest.java src/jdk.jartool/share/classes/sun/tools/jar/SignatureFile.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTag.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java test/hotspot/jtreg/ProblemList.txt test/hotspot/jtreg/gc/concurrent_phase_control/CheckControl.java test/hotspot/jtreg/gc/concurrent_phase_control/CheckSupported.java test/hotspot/jtreg/gc/concurrent_phase_control/CheckUnsupported.java test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlG1.java test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlG1Basics.java test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlParallel.java test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlSerial.java test/hotspot/jtreg/gc/g1/TestJNIWeakG1/TestJNIWeakG1.java test/hotspot/jtreg/gc/g1/TestJNIWeakG1/libTestJNIWeakG1.c test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java test/jdk/ProblemList.txt test/jdk/java/awt/TrayIcon/AddPopupAfterShowTest/AddPopupAfterShowTest.html test/jdk/sun/management/jmxremote/bootstrap/Makefile test/jdk/sun/management/jmxremote/bootstrap/launcher.c test/jdk/sun/management/jmxremote/bootstrap/linux-amd64/launcher test/jdk/sun/management/jmxremote/bootstrap/linux-i586/launcher test/jdk/sun/management/jmxremote/bootstrap/solaris-amd64/launcher test/jdk/sun/management/jmxremote/bootstrap/solaris-sparcv9/launcher test/langtools/tools/javac/file/MultiReleaseJar/MutliReleaseModuleInfoTest.java |
diffstat | 1228 files changed, 779355 insertions(+), 21744 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Tue Mar 24 14:50:32 2020 -0700 +++ b/.hgtags Wed Mar 25 21:31:09 2020 -0400 @@ -623,3 +623,6 @@ b2dd4028a6de4e40dda8b76109e4b5c6b294f980 jdk-15+11 2ec0ff3042630ddbd3587e340fe0dd40391cb6c4 jdk-15+12 1c06a8ee8acad4d93c782626a233693a73de0add jdk-15+13 +1d6ceb13e142665ea833fca01c8c8598e0ddd211 jdk-15+14 +bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14-ga +82b7c62cf4cc56828a8fb724f57087967232a2a7 jdk-15+15
--- a/make/CompileDemos.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/CompileDemos.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, 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 @@ # EXTRA_MANIFEST_ATTR Extra manifest attribute # SKIP_COMPILATION Skip Java compilation iff true # DISABLE_SJAVAC Passed to SetupJavaCompilation +# DISABLED_WARNINGS Additional disabled warnings SetupBuildDemo = $(NamedParamsMacroTemplate) define SetupBuildDemoBody ifeq ($$($1_SRC_DIR), ) @@ -135,6 +136,7 @@ EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \ SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \ EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \ + DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \ DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \ )) @@ -173,35 +175,42 @@ $(eval $(call SetupBuildDemo, FileChooserDemo, \ DEMO_SUBDIR := jfc, \ + DISABLED_WARNINGS := rawtypes deprecation unchecked, \ )) $(eval $(call SetupBuildDemo, SwingSet2, \ DEMO_SUBDIR := jfc, \ EXTRA_COPY_TO_JAR := .java, \ EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \ + DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast, \ DISABLE_SJAVAC := true, \ )) $(eval $(call SetupBuildDemo, Font2DTest, \ + DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast, \ DEMO_SUBDIR := jfc, \ )) $(eval $(call SetupBuildDemo, J2Ddemo, \ DEMO_SUBDIR := jfc, \ MAIN_CLASS := java2d.J2Ddemo, \ + DISABLED_WARNINGS := rawtypes deprecation unchecked cast, \ JAR_NAME := J2Ddemo, \ )) $(eval $(call SetupBuildDemo, Metalworks, \ + DISABLED_WARNINGS := rawtypes unchecked, \ DEMO_SUBDIR := jfc, \ )) $(eval $(call SetupBuildDemo, Notepad, \ + DISABLED_WARNINGS := rawtypes, \ DEMO_SUBDIR := jfc, \ )) $(eval $(call SetupBuildDemo, Stylepad, \ DEMO_SUBDIR := jfc, \ + DISABLED_WARNINGS := rawtypes unchecked, \ EXTRA_SRC_DIR := $(DEMO_SHARE_SRC)/jfc/Notepad, \ EXCLUDE_FILES := $(DEMO_SHARE_SRC)/jfc/Notepad/README.txt, \ )) @@ -211,6 +220,7 @@ )) $(eval $(call SetupBuildDemo, TableExample, \ + DISABLED_WARNINGS := rawtypes unchecked deprecation, \ DEMO_SUBDIR := jfc, \ ))
--- a/make/CompileInterimLangtools.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/CompileInterimLangtools.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, 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,12 +77,12 @@ EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \ COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \ + DISABLED_WARNINGS := module, \ ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \ $$(INTERIM_LANGTOOLS_ADD_EXPORTS) \ --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \ --add-exports java.base/jdk.internal=java.compiler.interim \ - --add-exports java.base/jdk.internal=jdk.compiler.interim \ - -Xlint:-module, \ + --add-exports java.base/jdk.internal=jdk.compiler.interim, \ )) $1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
--- a/make/CompileInterimRmic.gmk Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -# -# Copyright (c) 2011, 2018, 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 JavaCompilation.gmk -include SetupJavaCompilers.gmk - -################################################################################ -# Generate interim versions of the module-info.java files for the interim -# langtools modules. Each interim module has ".interim" added as suffix to the -# original module name. - -INTERIM_MODULEINFO_PATTERN := \ - $(foreach m, $(INTERIM_RMIC_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g') \ - -e '/ToolProvider[,; ]/d' - -$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \ - $(TOPDIR)/src/%/share/classes/module-info.java - $(call LogInfo, Generating module-info.java for $*.interim) - $(call MakeDir, $(@D)) - $(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@ - -TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \ - $(INTERIM_RMIC_MODULES)) - -################################################################################ - -RMIC_PKGS := \ - sun/rmi/rmic \ - sun/tools/asm \ - sun/tools/java \ - sun/tools/javac \ - sun/tools/tree \ - sun/tools/util \ - # - -$(eval $(call SetupJavaCompilation, BUILD_jdk.rmic.interim, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(TOPDIR)/src/jdk.rmic/share/classes, \ - EXCLUDE_FILES := $(TOPDIR)/src/jdk.rmic/share/classes/module-info.java, \ - EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/jdk.rmic.interim/module-info.java, \ - INCLUDES := $(RMIC_PKGS), \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules/jdk.rmic.interim, \ - COPY := .properties, \ - ADD_JAVAC_FLAGS := \ - --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules \ - $(INTERIM_RMIC_ADD_EXPORTS), \ -)) - -TARGETS += $(BUILD_jdk.rmic.interim) - -########################################################################################## - -all: $(TARGETS)
--- a/make/CompileJavaModules.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/CompileJavaModules.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -80,7 +80,7 @@ ################################################################################ java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \ - '-Xdoclint/package:java.*,javax.*' -Xlint:exports \ + '-Xdoclint/package:java.*,javax.*' \ --doclint-format html4 java.desktop_COPY += .gif .png .wav .txt .xml .css .pf java.desktop_CLEAN += iio-plugin.properties cursors.properties @@ -245,7 +245,6 @@ ################################################################################ java.sql_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS ################################################################################ @@ -270,7 +269,7 @@ ################################################################################ -java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' -Xlint:-exports +java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' java.naming_CLEAN += jndiprovider.properties ################################################################################ @@ -304,7 +303,8 @@ ################################################################################ -jdk.hotspot.agent_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides +jdk.hotspot.agent_DISABLED_WARNINGS += deprecation rawtypes serial unchecked \ + cast static overrides fallthrough jdk.hotspot.agent_COPY += .gif .png sa.js .properties ################################################################################ @@ -341,17 +341,17 @@ ################################################################################ -jdk.scripting.nashorn_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides +jdk.scripting.nashorn_DISABLED_WARNINGS += removal jdk.scripting.nashorn_COPY := .properties .js ################################################################################ -jdk.scripting.nashorn.shell_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides +jdk.scripting.nashorn.shell_DISABLED_WARNINGS += removal jdk.scripting.nashorn.shell_COPY += .js .properties ################################################################################ -jdk.rmic_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS +jdk.rmic_DISABLED_WARNINGS += deprecation jdk.rmic_CLEAN += .properties ################################################################################ @@ -431,7 +431,7 @@ # The exports are needed since JVMCI is dynamically exported (see # jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo). -jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -Xlint:-exports -XDstringConcat=inline +jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline ################################################################################ @@ -536,13 +536,9 @@ jdk.localedata_KEEP_ALL_TRANSLATIONS := true ################################################################################ -# There is an issue in sjavac that triggers a warning in jdk.jfr that isn't -# triggered without sjavac. -ifeq ($(ENABLE_SJAVAC), yes) - jdk.jfr_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS -endif +jdk.jfr_DISABLED_WARNINGS += exports jdk.jfr_COPY := .xsd .xml .dtd -jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline -Xlint:-exports +jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline ################################################################################ # If this is an imported module that has prebuilt classes, only compile
--- a/make/CompileModuleTools.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/CompileModuleTools.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2020, 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 @@ -42,6 +42,7 @@ build/tools/jigsaw, \ COPY := .properties .html, \ BIN := $(TOOLS_CLASSES_DIR), \ + DISABLED_WARNINGS := fallthrough, \ ADD_JAVAC_FLAGS := \ --add-modules jdk.jdeps \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
--- a/make/CompileToolsJdk.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/CompileToolsJdk.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -43,7 +43,7 @@ $(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes \ # -$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \ +$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(BUILD_TOOLS_SRC_DIRS), \ EXCLUDES := \
--- a/make/Docs.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/Docs.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,4 +1,4 @@ -# Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2020, 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,10 +57,7 @@ ################################################################################ # Javadoc settings -# On top of the sources that was used to compile the JDK, we need some -# extra java.rmi sources that are used just for javadoc. -MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \ - $(SUPPORT_OUTPUTDIR)/rmic/* $(TOPDIR)/src/*/share/doc/stub) +MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) ) # URLs JAVADOC_BASE_URL := https://docs.oracle.com/pls/topic/lookup?ctx=javase$(VERSION_NUMBER)&id=homepage
--- a/make/Global.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/Global.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -45,7 +45,7 @@ $(info $(_) make <name>-image # Build just the image for any of: ) $(info $(_) # jdk, test, docs, symbols, legacy-jre, static-libs) $(info $(_) make <phase> # Build the specified phase and everything it depends on) - $(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic)) + $(info $(_) # (gensrc, java, copy, libs, launchers, gendata)) $(info $(_) make *-only # Applies to most targets and disables building the) $(info $(_) # dependencies for that target. This is faster but may) $(info $(_) # result in incorrect build results!) @@ -82,7 +82,7 @@ $(info $(_) make <module> # Build <module> and everything it depends on) $(info $(_) make <module>-<phase> # Compile the specified phase for the specified module) $(info $(_) # and everything it depends on) - $(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic)) + $(info $(_) # (gensrc, java, copy, libs, launchers, gendata)) $(info ) $(info Make control variables) $(info $(_) CONF= # Build all configurations (note, assignment is empty))
--- a/make/Main.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/Main.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -72,9 +72,6 @@ interim-langtools: +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimLangtools.gmk) -interim-rmic: - +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk) - interim-tzdb: +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimTZDB.gmk) @@ -89,7 +86,7 @@ +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsHotspot.gmk) ALL_TARGETS += buildtools-langtools interim-langtools \ - interim-rmic interim-tzdb buildtools-jdk buildtools-modules \ + interim-tzdb buildtools-jdk buildtools-modules \ buildtools-hotspot ################################################################################ @@ -194,16 +191,6 @@ ALL_TARGETS += $(JAVA_TARGETS) ################################################################################ -# Targets for running rmic. -$(eval $(call DeclareRecipesForPhase, RMIC, \ - TARGET_SUFFIX := rmic, \ - FILE_PREFIX := Rmic, \ - MAKE_SUBDIR := rmic, \ - CHECK_MODULES := $(ALL_MODULES))) - -ALL_TARGETS += $(RMIC_TARGETS) - -################################################################################ # Targets for compiling native libraries $(eval $(call DeclareRecipesForPhase, LIBS, \ TARGET_SUFFIX := libs, \ @@ -688,10 +675,6 @@ $(GENDATA_TARGETS): interim-langtools buildtools-jdk - interim-rmic: interim-langtools - - $(RMIC_TARGETS): interim-langtools interim-rmic - $(JAVA_TARGETS): interim-langtools # Declare dependencies between hotspot-<variant>* targets @@ -732,9 +715,6 @@ # Declare dependencies between the module meta targets $(foreach m, $(ALL_MODULES), $(eval $m: $(call FindDepsForModule,$m))) - # Declare dependencies between <module>-rmic to <module>-java - $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java)) - # Declare dependencies from <module>-lib to <module>-java # Skip modules that do not have java source. $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java)) @@ -768,7 +748,7 @@ jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src - jdk.jdeps-gendata: java rmic + jdk.jdeps-gendata: java # The ct.sym generation uses all the moduleinfos as input jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) @@ -790,7 +770,6 @@ # Declare dependencies from <module>-jmod to all other module targets $(foreach m, $(JAVA_MODULES), $(eval $m_JMOD_DEPS += $m-java)) $(foreach m, $(GENDATA_MODULES), $(eval $m_JMOD_DEPS += $m-gendata)) - $(foreach m, $(RMIC_MODULES), $(eval $m_JMOD_DEPS += $m-rmic)) $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs)) $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers)) $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy)) @@ -856,7 +835,7 @@ zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \ $(filter jdk.crypto%, $(JAVA_TARGETS)) - zip-source: gensrc rmic + zip-source: gensrc jrtfs-jar: interim-langtools @@ -903,11 +882,11 @@ bootcycle-images: jdk-image - docs-jdk-api-javadoc: $(GENSRC_TARGETS) rmic + docs-jdk-api-javadoc: $(GENSRC_TARGETS) - docs-javase-api-javadoc: $(GENSRC_TARGETS) rmic + docs-javase-api-javadoc: $(GENSRC_TARGETS) - docs-reference-api-javadoc: $(GENSRC_TARGETS) rmic + docs-reference-api-javadoc: $(GENSRC_TARGETS) docs-jdk-api-modulegraph: exploded-image buildtools-modules @@ -989,7 +968,7 @@ # If not already set, set the JVM specific tools targets JVM_TOOLS_TARGETS ?= buildtools-hotspot -buildtools: buildtools-langtools interim-langtools interim-rmic \ +buildtools: buildtools-langtools interim-langtools \ buildtools-jdk $(JVM_TOOLS_TARGETS) # Declare dependencies from hotspot-<variant> targets @@ -1012,8 +991,6 @@ java: $(JAVA_TARGETS) -rmic: $(RMIC_TARGETS) - libs: $(LIBS_TARGETS) static-libs: $(STATIC_LIBS_TARGETS) @@ -1031,7 +1008,6 @@ $(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc)) $(foreach m, $(JAVA_MODULES), $(eval $m: $m-java)) $(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata)) -$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic)) $(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs)) $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers)) $(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy)) @@ -1131,7 +1107,7 @@ all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-gensrc gensrc gendata \ - copy java rmic libs static-libs launchers jmods \ + copy java libs static-libs launchers jmods \ jdk.jdwp.agent-gensrc $(ALL_MODULES) demos \ exploded-image-base exploded-image \ create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
--- a/make/ZipSource.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/ZipSource.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, 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 @@ -39,18 +39,12 @@ # Create the directory structure for src.zip using symlinks. # <module>/<package>/<file>.java -# Find extra source dirs for a module that are not part of normal compilation -# but should be included in src.zip. -# $1: Module to find dirs for -ExtraSrcDirs = \ - $(wildcard $(SUPPORT_OUTPUTDIR)/rmic/$(strip $1)) - ALL_MODULES := $(FindAllModules) # Generate the src dirs in the first make invocation and then call this makefile # again to create src.zip. $(foreach m, $(ALL_MODULES), \ - $(foreach d, $(call FindModuleSrcDirs, $m) $(call ExtraSrcDirs, $m), \ + $(foreach d, $(call FindModuleSrcDirs, $m), \ $(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$d)/$m) \ $(if $(SRC_GENERATED), , \ $(eval $$($d_TARGET): $d ; \
--- a/make/autoconf/basic_tools.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/basic_tools.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -393,12 +393,25 @@ AC_MSG_CHECKING([if codesign certificate is present]) $RM codesign-testfile $TOUCH codesign-testfile - $CODESIGN -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= + $CODESIGN -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile 2>&AS_MESSAGE_LOG_FD \ + >&AS_MESSAGE_LOG_FD || CODESIGN= $RM codesign-testfile if test "x$CODESIGN" = x; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes]) + # Verify that the codesign has --option runtime + AC_MSG_CHECKING([if codesign has --option runtime]) + $RM codesign-testfile + $TOUCH codesign-testfile + $CODESIGN --option runtime -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile \ + 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= + $RM codesign-testfile + if test "x$CODESIGN" = x; then + AC_MSG_ERROR([codesign does not have --option runtime. macOS 10.13.6 and above is required.]) + else + AC_MSG_RESULT([yes]) + fi fi fi UTIL_REQUIRE_PROGS(SETFILE, SetFile)
--- a/make/autoconf/build-performance.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/build-performance.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, 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 @@ -167,36 +167,38 @@ AC_DEFUN([BPERF_SETUP_CCACHE], [ - AC_ARG_ENABLE([ccache], - [AS_HELP_STRING([--enable-ccache], - [enable using ccache to speed up recompilations @<:@disabled@:>@])]) + # Check if ccache is available + CCACHE_AVAILABLE=true - CCACHE_STATUS= - AC_MSG_CHECKING([is ccache enabled]) - if test "x$enable_ccache" = xyes; then - if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then - AC_MSG_RESULT([yes]) - OLD_PATH="$PATH" - if test "x$TOOLCHAIN_PATH" != x; then - PATH=$TOOLCHAIN_PATH:$PATH - fi - UTIL_REQUIRE_PROGS(CCACHE, ccache) - PATH="$OLD_PATH" - CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`] - CCACHE_STATUS="Active ($CCACHE_VERSION)" - else - AC_MSG_RESULT([no]) - AC_MSG_WARN([ccache is not supported with toolchain type $TOOLCHAIN_TYPE]) - fi - elif test "x$enable_ccache" = xno; then - AC_MSG_RESULT([no, explicitly disabled]) - CCACHE_STATUS="Disabled" - elif test "x$enable_ccache" = x; then - AC_MSG_RESULT([no]) + OLD_PATH="$PATH" + if test "x$TOOLCHAIN_PATH" != x; then + PATH=$TOOLCHAIN_PATH:$PATH + fi + UTIL_PATH_PROGS(CCACHE, ccache) + PATH="$OLD_PATH" + + AC_MSG_CHECKING([if ccache is available]) + if test "x$TOOLCHAIN_TYPE" != "xgcc" && test "x$TOOLCHAIN_TYPE" != "xclang"; then + AC_MSG_RESULT([no, not supported for toolchain type $TOOLCHAIN_TYPE]) + CCACHE_AVAILABLE=false + elif test "x$CCACHE" = "x"; then + AC_MSG_RESULT([no, ccache binary missing or not executable]) + CCACHE_AVAILABLE=false else - AC_MSG_RESULT([unknown]) - AC_MSG_ERROR([--enable-ccache does not accept any parameters]) + AC_MSG_RESULT([yes]) fi + + CCACHE_STATUS="" + UTIL_ARG_ENABLE(NAME: ccache, DEFAULT: false, AVAILABLE: $CCACHE_AVAILABLE, + DESC: [enable using ccache to speed up recompilations], + CHECKING_MSG: [if ccache is enabled], + IF_ENABLED: [ + CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`] + CCACHE_STATUS="Active ($CCACHE_VERSION)" + ], + IF_DISABLED: [ + CCACHE="" + ]) AC_SUBST(CCACHE) AC_ARG_WITH([ccache-dir], @@ -284,10 +286,10 @@ # AC_DEFUN([BPERF_SETUP_ICECC], [ - AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc], - [enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])]) + UTIL_ARG_ENABLE(NAME: icecc, DEFAULT: false, RESULT: ENABLE_ICECC, + DESC: [enable distributed compilation of native code using icecc/icecream]) - if test "x${enable_icecc}" = "xyes"; then + if test "x$ENABLE_ICECC" = "xtrue"; then UTIL_REQUIRE_PROGS(ICECC_CMD, icecc) old_path="$PATH" @@ -349,56 +351,44 @@ else BUILD_ICECC="${ICECC}" fi - AC_SUBST(ICECC) - AC_SUBST(BUILD_ICECC) fi + + AC_SUBST(ICECC) + AC_SUBST(BUILD_ICECC) ]) AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS], [ - - ############################################################################### - # - # Can the C/C++ compiler use precompiled headers? - # - AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], - [disable using precompiled headers when compiling C++ @<:@enabled@:>@])], - [ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes]) - - USE_PRECOMPILED_HEADER=true - AC_MSG_CHECKING([If precompiled header is enabled]) - if test "x$ENABLE_PRECOMPH" = xno; then - AC_MSG_RESULT([no, forced]) - USE_PRECOMPILED_HEADER=false - elif test "x$ICECC" != "x"; then + # Are precompiled headers available? + PRECOMPILED_HEADERS_AVAILABLE=true + AC_MSG_CHECKING([if precompiled headers are available]) + if test "x$ICECC" != "x"; then AC_MSG_RESULT([no, does not work effectively with icecc]) - USE_PRECOMPILED_HEADER=false + PRECOMPILED_HEADERS_AVAILABLE=false elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then AC_MSG_RESULT([no, does not work with Solaris Studio]) - USE_PRECOMPILED_HEADER=false + PRECOMPILED_HEADERS_AVAILABLE=false elif test "x$TOOLCHAIN_TYPE" = xxlc; then AC_MSG_RESULT([no, does not work with xlc]) - USE_PRECOMPILED_HEADER=false + PRECOMPILED_HEADERS_AVAILABLE=false + elif test "x$TOOLCHAIN_TYPE" = xgcc; then + # Check that the compiler actually supports precomp headers. + echo "int alfa();" > conftest.h + $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD + if test ! -f conftest.hpp.gch; then + PRECOMPILED_HEADERS_AVAILABLE=false + AC_MSG_RESULT([no, gcc fails to compile properly with -x c++-header]) + else + AC_MSG_RESULT([yes]) + fi + $RM conftest.h conftest.hpp.gch else AC_MSG_RESULT([yes]) fi - if test "x$ENABLE_PRECOMPH" = xyes; then - # Check that the compiler actually supports precomp headers. - if test "x$TOOLCHAIN_TYPE" = xgcc; then - AC_MSG_CHECKING([that precompiled headers work]) - echo "int alfa();" > conftest.h - $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD - if test ! -f conftest.hpp.gch; then - USE_PRECOMPILED_HEADER=false - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([yes]) - fi - $RM conftest.h conftest.hpp.gch - fi - fi - + UTIL_ARG_ENABLE(NAME: precompiled-headers, DEFAULT: auto, + RESULT: USE_PRECOMPILED_HEADER, AVAILABLE: $PRECOMPILED_HEADERS_AVAILABLE, + DESC: [enable using precompiled headers when compiling C++]) AC_SUBST(USE_PRECOMPILED_HEADER) ]) @@ -442,29 +432,28 @@ if test "$MX_VALUE" -lt "512"; then MX_VALUE=512 fi - UTIL_ADD_JVM_ARG_IF_OK([-Xms${MS_VALUE}M -Xmx${MX_VALUE}M],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA]) + + JAVAC_SERVER_AVAILABLE=true + SJAVAC_MEMORY_OPT="-Xms${MS_VALUE}M -Xmx${MX_VALUE}M" + UTIL_ADD_JVM_ARG_IF_OK([$SJAVAC_MEMORY_OPT],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA]) + if test "x$JVM_ARG_OK" = "xfalse"; then + AC_MSG_WARN([Could not set '$SJAVAC_MEMORY_OPT' on bootjdk, disabling sjavac and javac server]) + JAVAC_SERVER_AVAILABLE=false + fi AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS) - AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac], - [use sjavac to do fast incremental compiles @<:@disabled@:>@])], - [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC="no"]) - if test "x$JVM_ARG_OK" = "xfalse"; then - AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac]) - ENABLE_SJAVAC="no" - fi - AC_MSG_CHECKING([whether to use sjavac]) - AC_MSG_RESULT([$ENABLE_SJAVAC]) + UTIL_ARG_ENABLE(NAME: sjavac, DEFAULT: false, AVAILABLE: $JAVAC_SERVER_AVAILABLE, + DESC: [use sjavac to do fast incremental compiles], + CHECKING_MSG: [whether to use sjavac], + IF_ENABLED: [ ENABLE_SJAVAC="yes" ], + IF_DISABLED: [ ENABLE_SJAVAC="no" ]) AC_SUBST(ENABLE_SJAVAC) - AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--disable-javac-server], - [disable javac server @<:@enabled@:>@])], - [ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="yes"]) - if test "x$JVM_ARG_OK" = "xfalse"; then - AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server]) - ENABLE_JAVAC_SERVER="no" - fi - AC_MSG_CHECKING([whether to use javac server]) - AC_MSG_RESULT([$ENABLE_JAVAC_SERVER]) + UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true, AVAILABLE: $JAVAC_SERVER_AVAILABLE, + DESC: [enable javac server], + CHECKING_MSG: [whether to use javac server], + IF_ENABLED: [ ENABLE_JAVAC_SERVER="yes" ], + IF_DISABLED: [ ENABLE_JAVAC_SERVER="no" ]) AC_SUBST(ENABLE_JAVAC_SERVER) if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
--- a/make/autoconf/compare.sh.in Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/compare.sh.in Wed Mar 25 21:31:09 2020 -0400 @@ -95,6 +95,9 @@ fi fi +export HOTSPOT_BUILD_TIME="@HOTSPOT_BUILD_TIME@" +export USE_PRECOMPILED_HEADER="@USE_PRECOMPILED_HEADER@" + # Now locate the main script and run it. REAL_COMPARE_SCRIPT="$TOPDIR/make/scripts/compare.sh" if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
--- a/make/autoconf/flags-cflags.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/flags-cflags.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -132,29 +132,17 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS], [ - AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors], - [do not consider native warnings to be an error @<:@enabled@:>@])]) - # Set default value. - if test "x$TOOLCHAIN_TYPE" = xxlc; then - WARNINGS_AS_ERRORS=false + if test "x$TOOLCHAIN_TYPE" != xxlc; then + WARNINGS_AS_ERRORS_DEFAULT=true else - WARNINGS_AS_ERRORS=true + WARNINGS_AS_ERRORS_DEFAULT=false fi - AC_MSG_CHECKING([if native warnings are errors]) - if test "x$enable_warnings_as_errors" = "xyes"; then - AC_MSG_RESULT([yes (explicitly set)]) - WARNINGS_AS_ERRORS=true - elif test "x$enable_warnings_as_errors" = "xno"; then - AC_MSG_RESULT([no (explicitly set)]) - WARNINGS_AS_ERRORS=false - elif test "x$enable_warnings_as_errors" = "x"; then - AC_MSG_RESULT([${WARNINGS_AS_ERRORS} (default)]) - else - AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument]) - fi - + UTIL_ARG_ENABLE(NAME: warnings-as-errors, DEFAULT: $WARNINGS_AS_ERRORS_DEFAULT, + RESULT: WARNINGS_AS_ERRORS, + DEFAULT_DESC: [auto], + DESC: [consider native warnings to be an error]) AC_SUBST(WARNINGS_AS_ERRORS) case "${TOOLCHAIN_TYPE}" in
--- a/make/autoconf/hotspot.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/hotspot.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -116,50 +116,32 @@ # AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST], [ - AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest], - [Disables building of the Hotspot unit tests @<:@enabled@:>@])]) - GTEST_AVAILABLE=true AC_MSG_CHECKING([if Hotspot gtest test source is present]) if test -e "${TOPDIR}/test/hotspot/gtest"; then AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no, cannot run gtest]) + AC_MSG_RESULT([no, cannot build gtest]) GTEST_AVAILABLE=false fi # On solaris, we also must have the libstlport.so.1 library, setup in # LIB_SETUP_LIBRARIES. if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - if test "x$STLPORT_LIB" = "x"; then + AC_MSG_CHECKING([if the libstlport.so.1 library is present]) + if test "x$STLPORT_LIB" != "x"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no, cannot build gtest]) GTEST_AVAILABLE=false fi fi - AC_MSG_CHECKING([if Hotspot gtest unit tests should be built]) - if test "x$enable_hotspot_gtest" = "xyes"; then - if test "x$GTEST_AVAILABLE" = "xtrue"; then - AC_MSG_RESULT([yes, forced]) - BUILD_GTEST="true" - else - AC_MSG_ERROR([Cannot build gtest with missing dependencies]) - fi - elif test "x$enable_hotspot_gtest" = "xno"; then - AC_MSG_RESULT([no, forced]) - BUILD_GTEST="false" - elif test "x$enable_hotspot_gtest" = "x"; then - if test "x$GTEST_AVAILABLE" = "xtrue"; then - AC_MSG_RESULT([yes]) - BUILD_GTEST="true" - else - AC_MSG_RESULT([no]) - BUILD_GTEST="false" - fi - else - AC_MSG_ERROR([--enable-gtest must be either yes or no]) - fi - + UTIL_ARG_ENABLE(NAME: hotspot-gtest, DEFAULT: auto, + RESULT: BUILD_GTEST, AVAILABLE: $GTEST_AVAILABLE, + DEFAULT_DESC: [enabled if possible to build], + DESC: [enable building of the Hotspot unit tests]) AC_SUBST(BUILD_GTEST) ]) @@ -175,6 +157,15 @@ HOTSPOT_TARGET_CPU_ARCH=zero fi + AC_ARG_WITH([hotspot-build-time], [AS_HELP_STRING([--with-hotspot-build-time], + [timestamp to use in hotspot version string, empty for on-the-fly @<:@empty@:>@])]) + + if test "x$with_hotspot_build_time" != x; then + HOTSPOT_BUILD_TIME="$with_hotspot_build_time" + fi + AC_SUBST(HOTSPOT_BUILD_TIME) + + # Override hotspot cpu definitions for ARM platforms if test "x$OPENJDK_TARGET_CPU" = xarm; then HOTSPOT_TARGET_CPU=arm_32
--- a/make/autoconf/jdk-options.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/jdk-options.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -46,19 +46,17 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL], [ DEBUG_LEVEL="release" + + UTIL_ARG_ENABLE(NAME: debug, DEFAULT: false, RESULT: ENABLE_DEBUG, + DESC: [enable debugging (shorthand for --with-debug-level=fastdebug)], + IF_ENABLED: [ DEBUG_LEVEL="fastdebug" ]) + AC_MSG_CHECKING([which debug level to use]) - AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], - [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])], - [ - ENABLE_DEBUG="${enableval}" - DEBUG_LEVEL="fastdebug" - ], [ENABLE_DEBUG="no"]) - AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level], [set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])], [ DEBUG_LEVEL="${withval}" - if test "x$ENABLE_DEBUG" = xyes; then + if test "x$ENABLE_DEBUG" = xtrue; then AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.]) fi ]) @@ -103,77 +101,42 @@ # AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM], [ - AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only], - [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"]) - - AC_MSG_CHECKING([if custom source is suppressed (openjdk-only)]) - AC_MSG_RESULT([$enable_openjdk_only]) - if test "x$enable_openjdk_only" = "xyes"; then - SUPPRESS_CUSTOM_EXTENSIONS="true" - elif test "x$enable_openjdk_only" = "xno"; then - SUPPRESS_CUSTOM_EXTENSIONS="false" - else - AC_MSG_ERROR([Invalid value for --enable-openjdk-only: $enable_openjdk_only]) - fi + UTIL_ARG_ENABLE(NAME: openjdk-only, DEFAULT: false, + RESULT: SUPPRESS_CUSTOM_EXTENSIONS, + DESC: [suppress building custom source even if present], + CHECKING_MSG: [if custom source is suppressed (openjdk-only)]) ]) AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], [ # Should we build a JDK without a graphical UI? - AC_MSG_CHECKING([headless only]) - AC_ARG_ENABLE([headless-only], [AS_HELP_STRING([--enable-headless-only], - [only build headless (no GUI) support @<:@disabled@:>@])]) - - if test "x$enable_headless_only" = "xyes"; then - ENABLE_HEADLESS_ONLY="true" - AC_MSG_RESULT([yes]) - elif test "x$enable_headless_only" = "xno"; then - ENABLE_HEADLESS_ONLY="false" - AC_MSG_RESULT([no]) - elif test "x$enable_headless_only" = "x"; then - ENABLE_HEADLESS_ONLY="false" - AC_MSG_RESULT([no]) - else - AC_MSG_ERROR([--enable-headless-only can only take yes or no]) - fi - + UTIL_ARG_ENABLE(NAME: headless-only, DEFAULT: false, + RESULT: ENABLE_HEADLESS_ONLY, + DESC: [only build headless (no GUI) support], + CHECKING_MSG: [if we should build headless-only (no GUI)]) AC_SUBST(ENABLE_HEADLESS_ONLY) # should we linktime gc unused code sections in the JDK build ? - AC_MSG_CHECKING([linktime gc]) - AC_ARG_ENABLE([linktime-gc], [AS_HELP_STRING([--enable-linktime-gc], - [linktime gc unused code sections in the JDK build @<:@disabled@:>@])]) - - if test "x$enable_linktime_gc" = "xyes"; then - ENABLE_LINKTIME_GC="true" - AC_MSG_RESULT([yes]) - elif test "x$enable_linktime_gc" = "xno"; then - ENABLE_LINKTIME_GC="false" - AC_MSG_RESULT([no]) - elif test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = xs390x; then - ENABLE_LINKTIME_GC="true" - AC_MSG_RESULT([yes]) - elif test "x$enable_linktime_gc" = "x"; then - ENABLE_LINKTIME_GC="false" - AC_MSG_RESULT([no]) + if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = xs390x; then + LINKTIME_GC_DEFAULT=true else - AC_MSG_ERROR([--enable-linktime-gc can only take yes or no]) + LINKTIME_GC_DEFAULT=false fi + UTIL_ARG_ENABLE(NAME: linktime-gc, DEFAULT: $LINKTIME_GC_DEFAULT, + DEFAULT_DESC: [auto], RESULT: ENABLE_LINKTIME_GC, + DESC: [use link time gc on unused code sections in the JDK build], + CHECKING_MSG: [if linker should clean out unused code (linktime-gc)]) AC_SUBST(ENABLE_LINKTIME_GC) - - # Should we build the complete docs, or just a lightweight version? - AC_ARG_ENABLE([full-docs], [AS_HELP_STRING([--enable-full-docs], - [build complete documentation @<:@enabled if all tools found@:>@])]) - - # Verify dependencies + # Check for full doc dependencies + FULL_DOCS_AVAILABLE=true AC_MSG_CHECKING([for graphviz dot]) if test "x$DOT" != "x"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no, cannot generate full docs]) - FULL_DOCS_DEP_MISSING=true + FULL_DOCS_AVAILABLE=false fi AC_MSG_CHECKING([for pandoc]) @@ -181,35 +144,13 @@ AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no, cannot generate full docs]) - FULL_DOCS_DEP_MISSING=true + FULL_DOCS_AVAILABLE=false fi - AC_MSG_CHECKING([full docs]) - if test "x$enable_full_docs" = xyes; then - if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then - AC_MSG_RESULT([no, missing dependencies]) - HELP_MSG_MISSING_DEPENDENCY([dot]) - AC_MSG_ERROR([Cannot enable full docs with missing dependencies. See above. $HELP_MSG]) - else - ENABLE_FULL_DOCS=true - AC_MSG_RESULT([yes, forced]) - fi - elif test "x$enable_full_docs" = xno; then - ENABLE_FULL_DOCS=false - AC_MSG_RESULT([no, forced]) - elif test "x$enable_full_docs" = x; then - # Check for prerequisites - if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then - ENABLE_FULL_DOCS=false - AC_MSG_RESULT([no, missing dependencies]) - else - ENABLE_FULL_DOCS=true - AC_MSG_RESULT([yes, dependencies present]) - fi - else - AC_MSG_ERROR([--enable-full-docs can only take yes or no]) - fi - + # Should we build the complete docs, or just a lightweight version? + UTIL_ARG_ENABLE(NAME: full-docs, DEFAULT: auto, RESULT: ENABLE_FULL_DOCS, + AVAILABLE: $FULL_DOCS_AVAILABLE, DESC: [build complete documentation], + DEFAULT_DESC: [enabled if all tools found]) AC_SUBST(ENABLE_FULL_DOCS) # Choose cacerts source file @@ -229,14 +170,8 @@ AC_SUBST(CACERTS_FILE) # Enable or disable unlimited crypto - AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--disable-unlimited-crypto], - [Disable unlimited crypto policy @<:@enabled@:>@])],, - [enable_unlimited_crypto=yes]) - if test "x$enable_unlimited_crypto" = "xyes"; then - UNLIMITED_CRYPTO=true - else - UNLIMITED_CRYPTO=false - fi + UTIL_ARG_ENABLE(NAME: unlimited-crypto, DEFAULT: true, RESULT: UNLIMITED_CRYPTO, + DESC: [enable unlimited crypto policy]) AC_SUBST(UNLIMITED_CRYPTO) # Should we build the serviceability agent (SA)? @@ -422,14 +357,19 @@ # AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE], [ - AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage], - [enable native compilation with code coverage data@<:@disabled@:>@])]) - GCOV_ENABLED="false" - if test "x$enable_native_coverage" = "xyes"; then - case $TOOLCHAIN_TYPE in - gcc | clang) - AC_MSG_CHECKING([if native coverage is enabled]) - AC_MSG_RESULT([yes]) + UTIL_ARG_ENABLE(NAME: native-coverage, DEFAULT: false, RESULT: GCOV_ENABLED, + DESC: [enable native compilation with code coverage data], + CHECK_AVAILABLE: [ + AC_MSG_CHECKING([if native coverage is available]) + if test "x$TOOLCHAIN_TYPE" = "xgcc" || + test "x$TOOLCHAIN_TYPE" = "xclang"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AVAILABLE=false + fi + ], + IF_ENABLED: [ GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline" GCOV_LDFLAGS="-fprofile-arcs" JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS" @@ -440,18 +380,7 @@ CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS" LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS" LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS" - GCOV_ENABLED="true" - ;; - *) - AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc or clang]) - ;; - esac - elif test "x$enable_native_coverage" = "xno"; then - AC_MSG_CHECKING([if native coverage is enabled]) - AC_MSG_RESULT([no]) - elif test "x$enable_native_coverage" != "x"; then - AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"]) - fi + ]) AC_SUBST(GCOV_ENABLED) AC_ARG_WITH(jcov, [AS_HELP_STRING([--with-jcov], @@ -498,14 +427,19 @@ # AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER], [ - AC_ARG_ENABLE(asan, [AS_HELP_STRING([--enable-asan], - [enable AddressSanitizer if possible @<:@disabled@:>@])]) - ASAN_ENABLED="no" - if test "x$enable_asan" = "xyes"; then - case $TOOLCHAIN_TYPE in - gcc | clang) - AC_MSG_CHECKING([if asan is enabled]) - AC_MSG_RESULT([yes]) + UTIL_ARG_ENABLE(NAME: asan, DEFAULT: false, + DESC: [enable AddressSanitizer], + CHECK_AVAILABLE: [ + AC_MSG_CHECKING([if AddressSanitizer (asan) is available]) + if test "x$TOOLCHAIN_TYPE" = "xgcc" || + test "x$TOOLCHAIN_TYPE" = "xclang"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AVAILABLE=false + fi + ], + IF_ENABLED: [ ASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer" ASAN_LDFLAGS="-fsanitize=address" JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS" @@ -517,17 +451,10 @@ LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $ASAN_LDFLAGS" LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $ASAN_LDFLAGS" ASAN_ENABLED="yes" - ;; - *) - AC_MSG_ERROR([--enable-asan only works with toolchain type gcc or clang]) - ;; - esac - elif test "x$enable_asan" = "xno"; then - AC_MSG_CHECKING([if asan is enabled]) - AC_MSG_RESULT([no]) - elif test "x$enable_asan" != "x"; then - AC_MSG_ERROR([--enable-asan can only be assigned "yes" or "no"]) - fi + ], + IF_DISABLED: [ + ASAN_ENABLED="no" + ]) AC_SUBST(ASAN_ENABLED) ]) @@ -539,26 +466,23 @@ # AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD], [ - AC_ARG_ENABLE([static-build], [AS_HELP_STRING([--enable-static-build], - [enable static library build @<:@disabled@:>@])]) - STATIC_BUILD=false - if test "x$enable_static_build" = "xyes"; then - AC_MSG_CHECKING([if static build is enabled]) - AC_MSG_RESULT([yes]) - if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then - AC_MSG_ERROR([--enable-static-build is only supported for macosx builds]) - fi - STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1" - CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" - CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" - STATIC_BUILD=true - elif test "x$enable_static_build" = "xno"; then - AC_MSG_CHECKING([if static build is enabled]) - AC_MSG_RESULT([no]) - elif test "x$enable_static_build" != "x"; then - AC_MSG_ERROR([--enable-static-build can only be assigned "yes" or "no"]) - fi - + UTIL_ARG_ENABLE(NAME: static-build, DEFAULT: false, RESULT: STATIC_BUILD, + DESC: [enable static library build], + CHECKING_MSG: [if static build is enabled], + CHECK_AVAILABLE: [ + AC_MSG_CHECKING([if static build is available]) + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AVAILABLE=false + fi + ], + IF_ENABLED: [ + STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1" + CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" + CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" + ]) AC_SUBST(STATIC_BUILD) ]) @@ -569,24 +493,10 @@ # AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS], [ - AC_ARG_ENABLE([keep-packaged-modules], [AS_HELP_STRING([--disable-keep-packaged-modules], - [Do not keep packaged modules in jdk image @<:@enable@:>@])]) - - AC_MSG_CHECKING([if packaged modules are kept]) - if test "x$enable_keep_packaged_modules" = "xyes"; then - AC_MSG_RESULT([yes]) - JLINK_KEEP_PACKAGED_MODULES=true - elif test "x$enable_keep_packaged_modules" = "xno"; then - AC_MSG_RESULT([no]) - JLINK_KEEP_PACKAGED_MODULES=false - elif test "x$enable_keep_packaged_modules" = "x"; then - AC_MSG_RESULT([yes (default)]) - JLINK_KEEP_PACKAGED_MODULES=true - else - AC_MSG_RESULT([error]) - AC_MSG_ERROR([--enable-keep-packaged-modules accepts no argument]) - fi - + UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: true, + RESULT: JLINK_KEEP_PACKAGED_MODULES, + DESC: [enable keeping of packaged modules in jdk image], + CHECKING_MSG: [if packaged modules are kept]) AC_SUBST(JLINK_KEEP_PACKAGED_MODULES) ]) @@ -596,36 +506,20 @@ # AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER], [ - AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler], - [forces build of the jtreg failure handler to be enabled, missing dependencies - become fatal errors. Default is auto, where the failure handler is built if all - dependencies are present and otherwise just disabled.])]) - - AC_MSG_CHECKING([if jtreg failure handler should be built]) - - if test "x$enable_jtreg_failure_handler" = "xyes"; then - if test "x$JT_HOME" = "x"; then - AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.]) - else - BUILD_FAILURE_HANDLER=true - AC_MSG_RESULT([yes, forced]) - fi - elif test "x$enable_jtreg_failure_handler" = "xno"; then - BUILD_FAILURE_HANDLER=false - AC_MSG_RESULT([no, forced]) - elif test "x$enable_jtreg_failure_handler" = "xauto" \ - || test "x$enable_jtreg_failure_handler" = "x"; then - if test "x$JT_HOME" = "x"; then - BUILD_FAILURE_HANDLER=false - AC_MSG_RESULT([no, missing jtreg]) - else - BUILD_FAILURE_HANDLER=true - AC_MSG_RESULT([yes, jtreg present]) - fi - else - AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler]) - fi - + UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto, + RESULT: BUILD_FAILURE_HANDLER, + DESC: [enable keeping of packaged modules in jdk image], + DEFAULT_DESC: [enabled if jtreg is present], + CHECKING_MSG: [if the jtreg failure handler should be built], + CHECK_AVAILABLE: [ + AC_MSG_CHECKING([if the jtreg failure handler is available]) + if test "x$JT_HOME" != "x"; then + AC_MSG_RESULT([yes]) + else + AVAILABLE=false + AC_MSG_RESULT([no (jtreg not present)]) + fi + ]) AC_SUBST(BUILD_FAILURE_HANDLER) ]) @@ -635,39 +529,14 @@ # AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST], [ - AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist], - [forces enabling or disabling of the generation of a CDS classlist at build time. - Default is to generate it when either the server or client JVMs are built and - enable-cds is true.])]) - - # In jvm-features.m4 ENABLE_CDS is set to true iff all JVM variants has cds - # enabled. - - AC_MSG_CHECKING([if the CDS classlist generation should be enabled]) - if test "x$enable_generate_classlist" = "xyes"; then - AC_MSG_RESULT([yes, forced]) - ENABLE_GENERATE_CLASSLIST="true" - if test "x$ENABLE_CDS" = "xfalse"; then - # In GenerateLinkOptData.gmk, DumpLoadedClassList is used to generate the - # classlist file. It never will work in this case since the VM will report - # an error for DumpLoadedClassList when CDS is disabled. - AC_MSG_ERROR([Generation of classlist is not possible without JVM feature 'cds']) - fi - elif test "x$enable_generate_classlist" = "xno"; then - AC_MSG_RESULT([no, forced]) - ENABLE_GENERATE_CLASSLIST="false" - elif test "x$enable_generate_classlist" = "x"; then - if test "x$ENABLE_CDS" = "xtrue"; then - AC_MSG_RESULT([yes]) - ENABLE_GENERATE_CLASSLIST="true" - else - AC_MSG_RESULT([no]) - ENABLE_GENERATE_CLASSLIST="false" - fi - else - AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist]) - fi - + # In GenerateLinkOptData.gmk, DumpLoadedClassList is used to generate the + # classlist file. It never will work if CDS is disabled, since the VM will report + # an error for DumpLoadedClassList. + UTIL_ARG_ENABLE(NAME: generate-classlist, DEFAULT: auto, + RESULT: ENABLE_GENERATE_CLASSLIST, AVAILABLE: $ENABLE_CDS, + DESC: [enable generation of a CDS classlist at build time], + DEFAULT_DESC: [enabled if the JVM feature 'cds' is enabled for all JVM variants], + CHECKING_MSG: [if the CDS classlist generation should be enabled]) AC_SUBST(ENABLE_GENERATE_CLASSLIST) ]) @@ -699,56 +568,33 @@ # AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES], [ - AC_ARG_ENABLE([manpages], [AS_HELP_STRING([--disable-manpages], - [Set to disable copy of static man pages @<:@enabled@:>@])]) - - BUILD_MANPAGES="true" - AC_MSG_CHECKING([if static man pages should be copied]) - if test "x$enable_manpages" = "x"; then - AC_MSG_RESULT([yes]) - elif test "x$enable_manpages" = "xyes"; then - AC_MSG_RESULT([yes, forced]) - elif test "x$enable_manpages" = "xno"; then - AC_MSG_RESULT([no, forced]) - BUILD_MANPAGES="false" - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([--enable-manpages can only yes/no or empty]) - fi - + UTIL_ARG_ENABLE(NAME: manpages, DEFAULT: true, RESULT: BUILD_MANPAGES, + DESC: [enable copying of static man pages], + CHECKING_MSG: [if static man pages should be copied]) AC_SUBST(BUILD_MANPAGES) ]) ################################################################################ # # Disable the default CDS archive generation -# cross compilation - disabled # AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE], [ - AC_ARG_ENABLE([cds-archive], [AS_HELP_STRING([--disable-cds-archive], - [Set to disable generation of a default CDS archive in the product image @<:@enabled@:>@])]) - - AC_MSG_CHECKING([if a default CDS archive should be generated]) - if test "x$ENABLE_CDS" = "xfalse"; then - AC_MSG_RESULT([no, because CDS is disabled]) - BUILD_CDS_ARCHIVE="false" - elif test "x$COMPILE_TYPE" = "xcross"; then - AC_MSG_RESULT([no, not possible with cross compilation]) - BUILD_CDS_ARCHIVE="false" - elif test "x$enable_cds_archive" = "xyes"; then - AC_MSG_RESULT([yes, forced]) - BUILD_CDS_ARCHIVE="true" - elif test "x$enable_cds_archive" = "x"; then - AC_MSG_RESULT([yes]) - BUILD_CDS_ARCHIVE="true" - elif test "x$enable_cds_archive" = "xno"; then - AC_MSG_RESULT([no, forced]) - BUILD_CDS_ARCHIVE="false" - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([--enable-cds_archive can only be yes/no or empty]) - fi - + UTIL_ARG_ENABLE(NAME: cds-archive, DEFAULT: auto, RESULT: BUILD_CDS_ARCHIVE, + DESC: [enable generation of a default CDS archive in the product image], + DEFAULT_DESC: [enabled if possible], + CHECKING_MSG: [if a default CDS archive should be generated], + CHECK_AVAILABLE: [ + AC_MSG_CHECKING([if CDS archive is available]) + if test "x$ENABLE_CDS" = "xfalse"; then + AC_MSG_RESULT([no (CDS is disabled)]) + AVAILABLE=false + elif test "x$COMPILE_TYPE" = "xcross"; then + AC_MSG_RESULT([no (not possible with cross compilation)]) + AVAILABLE=false + else + AC_MSG_RESULT([yes]) + fi + ]) AC_SUBST(BUILD_CDS_ARCHIVE) ])
--- a/make/autoconf/jvm-features.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/jvm-features.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -171,12 +171,14 @@ m4_undefine([FEATURE_SHELL]) ]) - # Warn if the user has both enabled and disabled a feature - # If this happens, disable will override enable. + # Check if the user has both enabled and disabled a feature UTIL_GET_MATCHING_VALUES(enabled_and_disabled, $JVM_FEATURES_ENABLED, \ $JVM_FEATURES_DISABLED) if test "x$enabled_and_disabled" != x; then - AC_MSG_WARN([Disabling of these features will override enabling: '$enabled_and_disabled']) + AC_MSG_NOTICE([These feature are both enabled and disabled: '$enabled_and_disabled']) + AC_MSG_NOTICE([This can happen if you mix --with-jvm-features and --enable-jvm-feature-*]) + AC_MSG_NOTICE([The recommendation is to only use --enable-jvm-feature-*]) + AC_MSG_ERROR([Cannot continue]) fi # Clean up lists and announce results to user
--- a/make/autoconf/lib-ffi.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/lib-ffi.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,10 @@ ################################################################################ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI], [ + UTIL_ARG_ENABLE(NAME: libffi-bundling, DEFAULT: false, + RESULT: ENABLE_LIBFFI_BUNDLING, + DESC: [enable bundling of libffi.so to make the built JDK runnable on more systems]) + AC_ARG_WITH(libffi, [AS_HELP_STRING([--with-libffi], [specify prefix directory for the libffi package (expecting the libraries under PATH/lib and the headers under PATH/include)])]) @@ -35,8 +39,6 @@ [specify directory for the libffi include files])]) AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib], [specify directory for the libffi library])]) - AC_ARG_ENABLE(libffi-bundling, [AS_HELP_STRING([--enable-libffi-bundling], - [enable bundling of libffi.so to make the built JDK runnable on more systems])]) if test "x$NEEDS_LIB_FFI" = xfalse; then if (test "x${with_libffi}" != x && test "x${with_libffi}" != xno) || \ @@ -114,20 +116,6 @@ AC_MSG_ERROR([Found libffi but could not link and compile with it. $HELP_MSG]) fi - AC_MSG_CHECKING([if libffi should be bundled]) - if test "x$enable_libffi_bundling" = "x"; then - AC_MSG_RESULT([no]) - ENABLE_LIBFFI_BUNDLING=false - elif test "x$enable_libffi_bundling" = "xno"; then - AC_MSG_RESULT([no, forced]) - ENABLE_LIBFFI_BUNDLING=false - elif test "x$enable_libffi_bundling" = "xyes"; then - AC_MSG_RESULT([yes, forced]) - ENABLE_LIBFFI_BUNDLING=true - else - AC_MSG_ERROR([Invalid value for --enable-libffi-bundling]) - fi - # Find the libffi.so.X to bundle if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then AC_MSG_CHECKING([for libffi lib file location])
--- a/make/autoconf/platform.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/platform.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, 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 @@ -563,11 +563,14 @@ AC_DEFUN([PLATFORM_CHECK_DEPRECATION], [ - AC_ARG_ENABLE(deprecated-ports, [AS_HELP_STRING([--enable-deprecated-ports@<:@=yes/no@:>@], - [Suppress the error when configuring for a deprecated port @<:@no@:>@])]) + UTIL_ARG_ENABLE(NAME: deprecated-ports, DEFAULT: false, + RESULT: ENABLE_DEPRECATED_PORTS, + DESC: [suppress the error when configuring for a deprecated port]) - if test "x$OPENJDK_TARGET_OS" = xsolaris || (test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc && test "x$with_jvm_variants" != xzero); then - if test "x$enable_deprecated_ports" = "xyes"; then + if test "x$OPENJDK_TARGET_OS" = xsolaris || \ + (test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc && \ + test "x$with_jvm_variants" != xzero); then + if test "x$ENABLE_DEPRECATED_PORTS" = "xtrue"; then AC_MSG_WARN([The Solaris and SPARC ports are deprecated and may be removed in a future release.]) else AC_MSG_ERROR(m4_normalize([The Solaris and SPARC ports are deprecated and may be removed in a
--- a/make/autoconf/spec.gmk.in Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/spec.gmk.in Wed Mar 25 21:31:09 2020 -0400 @@ -156,6 +156,7 @@ IMPORT_MODULES_MAKE:=@IMPORT_MODULES_MAKE@ COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@ +HOTSPOT_BUILD_TIME:=@HOTSPOT_BUILD_TIME@ # Platform naming variables LAUNCHER_NAME:=@LAUNCHER_NAME@ @@ -656,7 +657,7 @@ BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS) BUILD_JAR=@FIXPATH@ $(BUILD_JDK)/bin/jar -# Interim langtools and rmic modules and arguments +# Interim langtools modules and arguments INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES)) INTERIM_LANGTOOLS_ADD_EXPORTS := \ @@ -675,15 +676,6 @@ JAVAC_MAIN_CLASS = -m jdk.compiler.interim/com.sun.tools.javac.Main JAVADOC_MAIN_CLASS = -m jdk.javadoc.interim/jdk.javadoc.internal.tool.Main -INTERIM_RMIC_BASE_MODULES := jdk.rmic -INTERIM_RMIC_MODULES := $(addsuffix .interim, $(INTERIM_RMIC_BASE_MODULES)) - # -# Use = to delay expansion of PathList since it's not available in this file. -INTERIM_RMIC_ARGS = --limit-modules java.base,jdk.compiler,jdk.javadoc \ - --module-path $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules \ - $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules) \ - # - # You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ... # Use = assignment to be able to override in bootcycle-spec.gmk NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)
--- a/make/autoconf/util.m4 Tue Mar 24 14:50:32 2020 -0700 +++ b/make/autoconf/util.m4 Wed Mar 25 21:31:09 2020 -0400 @@ -53,7 +53,7 @@ AC_DEFUN([UTIL_DEFUN_NAMED], [ AC_DEFUN($1, [ - m4_foreach(arg, m4_split($2), [ + m4_foreach(arg, m4_split(m4_normalize($2)), [ m4_if(m4_bregexp(arg, [^\*]), -1, [ m4_set_add(legal_named_args, arg) @@ -66,11 +66,12 @@ ]) m4_foreach([arg], [$3], [ + m4_if(m4_bregexp(arg, [: ]), -1, m4_define([arg], m4_bpatsubst(arg, [:], [: ]))) m4_define(arg_name, m4_substr(arg, 0, m4_bregexp(arg, [: ]))) - m4_set_contains(legal_named_args, arg_name, [],[AC_MSG_ERROR([Internal error: arg_name is not a valid named argument to [$1]. Valid arguments are 'm4_set_contents(legal_named_args, [ ])'.])]) + m4_set_contains(legal_named_args, arg_name, [],[AC_MSG_ERROR([Internal error: m4_if(arg_name, , arg, arg_name) is not a valid named argument to [$1]. Valid arguments are 'm4_set_contents(defined_args, [ ]) m4_set_contents(legal_named_args, [ ])'.])]) m4_set_remove(required_named_args, arg_name) m4_set_remove(legal_named_args, arg_name) - m4_pushdef([ARG_][]arg_name, m4_substr(arg, m4_incr(m4_incr(m4_bregexp(arg, [: ]))))) + m4_pushdef([ARG_][]arg_name, m4_bpatsubst(m4_substr(arg, m4_incr(m4_incr(m4_bregexp(arg, [: ])))), [^\s*], [])) m4_set_add(defined_args, arg_name) m4_undefine([arg_name]) ]) @@ -97,6 +98,27 @@ ############################################################################### # Assert that a programmatic condition holds. If not, exit with an error message. +# Check that a shell expression gives return code 0 +# +# $1: The shell expression to evaluate +# $2: A message to describe the expression in case of failure +# $2: An message to print in case of failure [optional] +# +AC_DEFUN([UTIL_ASSERT_SHELL_TEST], +[ + ASSERTION_MSG="m4_normalize([$3])" + if $1; then + $ECHO Assertion failed: $2 + if test "x$3" != x; then + $ECHO Assertion message: "$3" + fi + exit 1 + fi +]) + + +############################################################################### +# Assert that a programmatic condition holds. If not, exit with an error message. # Check that two strings are equal. # # $1: The actual string found @@ -105,15 +127,50 @@ # AC_DEFUN([UTIL_ASSERT_STRING_EQUALS], [ - ASSERTION_MSG="m4_normalize([$3])" - if test "x[$1]" != "x[$2]"; then - $ECHO Assertion failed: Actual value '[$1]' \("[$1]"\) did not match \ - expected value '[$2]' \("[$2]"\) - if test "x$ASSERTION_MSG" != x; then - $ECHO Assertion message: "$ASSERTION_MSG" - fi - exit 1 - fi + UTIL_ASSERT_SHELL_TEST( + [test "x[$1]" != "x[$2]"], + [Actual value '[$1]' \("[$1]"\) did not match expected value '[$2]' \("[$2]"\)], + $3) +]) + +############################################################################### +# Assert that a programmatic condition holds. If not, exit with an error message. +# Check that two strings not are equal. +# +# $1: The actual string found +# $2: The expected string +# $3: An message to print in case of failure [optional] +# +AC_DEFUN([UTIL_ASSERT_STRING_NOT_EQUALS], +[ + UTIL_ASSERT_SHELL_TEST( + [test "x[$1]" = "x[$2]"], + [Actual value '[$1]' \("[$1]"\) unexpectedly matched '[$2]' \("[$2]"\)], + $3) +]) + +############################################################################### +# Assert that a programmatic condition holds. If not, exit with an error message. +# Check that the given expression evaluates to the string 'true' +# +# $1: The expression to evaluate +# $2: An message to print in case of failure [optional] +# +AC_DEFUN([UTIL_ASSERT_TRUE], +[ + UTIL_ASSERT_STRING_EQUALS($1, true, $3) +]) + +############################################################################### +# Assert that a programmatic condition holds. If not, exit with an error message. +# Check that the given expression does not evaluate to the string 'true' +# +# $1: The expression to evaluate +# $2: An message to print in case of failure [optional] +# +AC_DEFUN([UTIL_ASSERT_NOT_TRUE], +[ + UTIL_ASSERT_STRING_NOT_EQUALS($1, true, $3) ]) ############################################################################### @@ -218,20 +275,11 @@ ############################################################################### # Register a --enable argument but mark it as deprecated # $1: The name of the with argument to deprecate, not including --enable- -# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) -# $3: Messages to user. AC_DEFUN([UTIL_DEPRECATED_ARG_ENABLE], [ AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], - [Deprecated. Option is kept for backwards compatibility and is ignored])]) - if test "x$enable_$2" != x; then - AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.]) - - if test "x$3" != x; then - AC_MSG_WARN([$3]) - fi - - fi + [Deprecated. Option is kept for backwards compatibility and is ignored])], + [AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])]) ]) ############################################################################### @@ -250,6 +298,143 @@ ]) ############################################################################### +# Creates a command-line option using the --enable-* pattern. Will return a +# value of 'true' or 'false' in the RESULT variable, depending on whether the +# option was enabled or not by the user. The option can not be turned on if it +# is not available, as specified by AVAILABLE and/or AVAILABLE_CHECK. +# +# Arguments: +# NAME: The base name of this option (i.e. what follows --enable-). Required. +# RESULT: The name of the variable to set to the result. Defaults to +# <NAME in uppercase>_RESULT. +# DEFAULT: The default value for this option. Can be true, false or auto. +# Defaults to true. +# AVAILABLE: If true, this option is allowed to be selected. Defaults to true. +# DESC: A description of this option. Defaults to a generic and unhelpful +# string. +# DEFAULT_DESC: A message describing the default value, for the help. Defaults +# to the literal value of DEFAULT. +# CHECKING_MSG: The message to present to user when checking this option. +# Defaults to a generic message. +# CHECK_AVAILABLE: An optional code block to execute to determine if the +# option should be available. Must set AVAILABLE to 'false' if not. +# IF_GIVEN: An optional code block to execute if the option was given on the +# command line (regardless of the value). +# IF_ENABLED: An optional code block to execute if the option is turned on. +# IF_DISABLED: An optional code block to execute if the option is turned off. +# +UTIL_DEFUN_NAMED([UTIL_ARG_ENABLE], + [*NAME RESULT DEFAULT AVAILABLE DESC DEFAULT_DESC CHECKING_MSG + CHECK_AVAILABLE IF_GIVEN IF_ENABLED IF_DISABLED], [$@], +[ + ########################## + # Part 1: Set up m4 macros + ########################## + + # If DEFAULT is not specified, set it to 'true'. + m4_define([ARG_DEFAULT], m4_if(ARG_DEFAULT, , true, ARG_DEFAULT)) + + # If AVAILABLE is not specified, set it to 'true'. + m4_define([ARG_AVAILABLE], m4_if(ARG_AVAILABLE, , true, ARG_AVAILABLE)) + + # If DEFAULT_DESC is not specified, calculate it from DEFAULT. + m4_define([ARG_DEFAULT_DESC], m4_if(ARG_DEFAULT_DESC, , m4_if(ARG_DEFAULT, true, enabled, m4_if(ARG_DEFAULT, false, disabled, ARG_DEFAULT)), ARG_DEFAULT_DESC)) + + # If RESULT is not specified, set it to 'ARG_NAME[_ENABLED]'. + m4_define([ARG_RESULT], m4_if(ARG_RESULT, , m4_translit(ARG_NAME, [a-z-], [A-Z_])[_ENABLED], ARG_RESULT)) + # Construct shell variable names for the option + m4_define(ARG_OPTION, [enable_]m4_translit(ARG_NAME, [-], [_])) + m4_define(ARG_GIVEN, m4_translit(ARG_NAME, [a-z-], [A-Z_])[_GIVEN]) + + # If DESC is not specified, set it to a generic description. + m4_define([ARG_DESC], m4_if(ARG_DESC, , [Enable the ARG_NAME feature], m4_normalize(ARG_DESC))) + + # If CHECKING_MSG is not specified, set it to a generic description. + m4_define([ARG_CHECKING_MSG], m4_if(ARG_CHECKING_MSG, , [for --enable-ARG_NAME], ARG_CHECKING_MSG)) + + # If the code blocks are not given, set them to the empty statements to avoid + # tripping up bash. + m4_define([ARG_CHECK_AVAILABLE], m4_if(ARG_CHECK_AVAILABLE, , :, ARG_CHECK_AVAILABLE)) + m4_define([ARG_IF_GIVEN], m4_if(ARG_IF_GIVEN, , :, ARG_IF_GIVEN)) + m4_define([ARG_IF_ENABLED], m4_if(ARG_IF_ENABLED, , :, ARG_IF_ENABLED)) + m4_define([ARG_IF_DISABLED], m4_if(ARG_IF_DISABLED, , :, ARG_IF_DISABLED)) + + ########################## + # Part 2: Set up autoconf shell code + ########################## + + # Check that DEFAULT has a valid value + if test "[x]ARG_DEFAULT" != xtrue && test "[x]ARG_DEFAULT" != xfalse && \ + test "[x]ARG_DEFAULT" != xauto ; then + AC_MSG_ERROR([Internal error: Argument DEFAULT to [UTIL_ARG_ENABLE] can only be true, false or auto, was: 'ARG_DEFAULT']) + fi + + # Check that AVAILABLE has a valid value + if test "[x]ARG_AVAILABLE" != xtrue && test "[x]ARG_AVAILABLE" != xfalse; then + AC_MSG_ERROR([Internal error: Argument AVAILABLE to [UTIL_ARG_ENABLE] can only be true or false, was: 'ARG_AVAILABLE']) + fi + + AC_ARG_ENABLE(ARG_NAME, AS_HELP_STRING([--enable-]ARG_NAME, + [ARG_DESC [ARG_DEFAULT_DESC]]), [ARG_GIVEN=true], [ARG_GIVEN=false]) + + # Check if the option is available + AVAILABLE=ARG_AVAILABLE + # Run the available check block (if any), which can overwrite AVAILABLE. + ARG_CHECK_AVAILABLE + + # Check if the option should be turned on + AC_MSG_CHECKING(ARG_CHECKING_MSG) + if test x$ARG_GIVEN = xfalse; then + if test ARG_DEFAULT = auto; then + # If not given, and default is auto, set it to true iff it's available. + ARG_RESULT=$AVAILABLE + REASON="from default 'auto'" + else + ARG_RESULT=ARG_DEFAULT + REASON="default" + fi + else + if test x$ARG_OPTION = xyes; then + ARG_RESULT=true + REASON="from command line" + elif test x$ARG_OPTION = xno; then + ARG_RESULT=false + REASON="from command line" + elif test x$ARG_OPTION = xauto; then + if test ARG_DEFAULT = auto; then + # If both given and default is auto, set it to true iff it's available. + ARG_RESULT=$AVAILABLE + else + ARG_RESULT=ARG_DEFAULT + fi + REASON="from command line 'auto'" + else + AC_MSG_ERROR([Option [--enable-]ARG_NAME can only be 'yes', 'no' or 'auto']) + fi + fi + + if test x$ARG_RESULT = xtrue; then + AC_MSG_RESULT([enabled, $REASON]) + if test x$AVAILABLE = xfalse; then + AC_MSG_ERROR([Option [--enable-]ARG_NAME is not available]) + fi + else + AC_MSG_RESULT([disabled, $REASON]) + fi + + # Execute result payloads, if present + if test x$ARG_GIVEN = xtrue; then + ARG_IF_GIVEN + fi + + if test x$ARG_RESULT = xtrue; then + ARG_IF_ENABLED + else + ARG_IF_DISABLED + fi +]) + +############################################################################### # Test that variable $1 denoting a program is not empty. If empty, exit with an error. # $1: variable to check AC_DEFUN([UTIL_CHECK_NONEMPTY],
--- a/make/common/FindTests.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/common/FindTests.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -52,9 +52,11 @@ JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS)) JTREG_GROUP_FILES := $(foreach root, $(JTREG_TESTROOTS), \ - $(eval include $(root)/TEST.ROOT) \ - $(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \ - $(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \ + $(if $(wildcard $(root)/TEST.ROOT), \ + $(eval include $(root)/TEST.ROOT) \ + $(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \ + $(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \ + ) \ ) # Cache the expensive to calculate test names in a generated makefile.
--- a/make/common/JavaCompilation.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/common/JavaCompilation.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, 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 @@ -154,6 +154,7 @@ # SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC # JVM:=path to ..bin/java # ADD_JAVAC_FLAGS:=javac flags to append to the default ones. +# DISABLED_WARNINGS:=list of Xlint warnings that should be disabled # SRC:=one or more directories to search for sources. The order of the source roots # is significant. The first found file of a certain name has priority. # BIN:=store classes here @@ -198,9 +199,15 @@ $1_FLAGS := -g endif $1_FLAGS += $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS) + + ifneq ($$($1_DISABLED_WARNINGS), ) + $1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS))) + endif + ifneq ($$($1_CLASSPATH), ) $1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH)) endif + ifeq ($$($1_JAVAC),) $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) endif
--- a/make/common/Modules.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/common/Modules.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, 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 @@ -171,6 +171,7 @@ jdk.naming.dns \ jdk.naming.rmi \ jdk.net \ + jdk.nio.mapmode \ jdk.rmic \ jdk.scripting.nashorn \ jdk.sctp \
--- a/make/common/RMICompilation.gmk Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -# -# Copyright (c) 2011, 2019, 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. -# - -# Setup make rules for creating an RMI compilation. -# -# Parameter 1 is the name of the rule. This name is used as variable prefix, -# and the targets generated are listed in a variable by that name. -# -# Remaining parameters are named arguments. These include: -# CLASSES:=List of classes to generate stubs for -# CLASSES_DIR:=Directory where to look for classes -# STUB_CLASSES_DIR:=Directory in where to put stub classes -# RUN_V11:=Set to run rmic with -v1.1 -# RUN_V12:=Set to run rmic with -v1.2 -# KEEP_GENERATED:=Set to keep generated sources around -# STUB_SOURCES_DIR:=Directory to put generated sources in -SetupRMICompilation = $(NamedParamsMacroTemplate) -define SetupRMICompilationBody - - $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated - - $1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES)) - $1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH))) - $1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH))) - $1_TARGETS := $$($1_STUB_FILES) - $1_ARGS := - ifneq (,$$($1_RUN_V11)) - $1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH))) - $1_TARGETS += $$($1_SKEL_FILES) - $1_ARGS += -v1.1 - endif - ifneq (,$$($1_RUN_V12)) - $1_ARGS += -v1.2 - endif - - $1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f)) - $1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES))) - $1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES))) - - ifneq ($$($1_KEEP_GENERATED), ) - $1_ARGS += -keepgenerated - $1_JAVA_TARGETS := $$(subst .class,.java,$$($1_TARGETS)) - ifneq ($$($1_STUB_SOURCES_DIR), ) - # This is where the java files are created by rmic - $1_JAVA_TARGETS_REL := $$(subst $$($1_STUB_CLASSES_DIR),, $$($1_JAVA_TARGETS)) - # This is where the caller wants the java files - $1_JAVA_TARGETS := $$(addprefix $$($1_STUB_SOURCES_DIR), $$($1_JAVA_TARGETS_REL)) - endif - $1_TARGETS += $$($1_JAVA_TARGETS) - endif - - $1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES)) - - $$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES) - - $$($1_DEP_FILE): $$($1_CLASS_FILES) - $$(call LogInfo, Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES)) - $$(call MakeDir, $$($1_STUB_CLASSES_DIR)) - $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \ - -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ - $$(if $$($1_STUB_SOURCES_DIR), \ - $$(foreach f, $$($1_JAVA_TARGETS_REL), \ - $(MKDIR) -p $$(dir $$($1_STUB_SOURCES_DIR)/$$f) ; \ - $(MV) $$($1_STUB_CLASSES_DIR)/$$f $$($1_STUB_SOURCES_DIR)/$$f ; \ - ) \ - ) \ - $(TOUCH) $$@ - - - $1 := $$($1_TARGETS) $$($1_DEP_FILE) - -endef
--- a/make/common/SetupJavaCompilers.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/common/SetupJavaCompilers.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, 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,8 +31,6 @@ include JavaCompilation.gmk -DISABLE_WARNINGS ?= -Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally - JDK_SOURCE_TARGET_FLAGS := -source $(JDK_SOURCE_TARGET_VERSION) \ -target $(JDK_SOURCE_TARGET_VERSION) @@ -48,7 +46,7 @@ $(JAVA_TOOL_FLAGS_SMALL) \ $(BOOT_JDK_SOURCETARGET) \ -XDignore.symbol.file=true -g \ - -Xlint:all$(COMMA)-deprecation$(COMMA)-options -Werror, \ + $(JAVAC_WARNINGS) -Xlint:-options, \ DISABLE_SJAVAC := true, \ )) @@ -66,7 +64,7 @@ JVM := $(JAVA_SMALL), \ JAVAC := $(NEW_JAVAC), \ FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -XDstringConcat=inline \ - $(DISABLE_WARNINGS) -Xlint:-options, \ + $(JAVAC_WARNINGS) -Xlint:-options, \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) @@ -80,16 +78,6 @@ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) -# The generate new bytecode javac setup uses the new compiler to compile for the -# new jdk. This new bytecode might only be possible to run using the new jvm. -$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \ - JVM := $(JAVA_JAVAC), \ - JAVAC := $(NEW_JAVAC), \ - FLAGS := $(JDK_SOURCE_TARGET_FLAGS) \ - -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA))) - # After the jdk is built, we want to build demos using only the recently # generated jdk classes and nothing else, no jdk source, etc etc. # I.e. the rt.jar, but since rt.jar has not yet been generated @@ -97,7 +85,8 @@ $(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \ JVM := $(JAVA_SMALL), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none $(DISABLE_WARNINGS), \ + FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \ + $(JAVAC_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) @@ -108,7 +97,7 @@ $(JAVA_TOOL_FLAGS_SMALL) \ --release 8 \ -XDignore.symbol.file=true -g \ - -Xlint:all -Werror, \ + $(JAVAC_WARNINGS), \ DISABLE_SJAVAC := true, \ ))
--- a/make/conf/jib-profiles.js Tue Mar 24 14:50:32 2020 -0700 +++ b/make/conf/jib-profiles.js Wed Mar 25 21:31:09 2020 -0400 @@ -248,7 +248,7 @@ common.main_profile_base = { dependencies: ["boot_jdk", "gnumake", "jtreg", "jib", "autoconf", "jmh", "jcov"], default_make_targets: ["product-bundles", "test-bundles", "static-libs-bundles"], - configure_args: concat(["--enable-jtreg-failure-handler"], + configure_args: concat("--enable-jtreg-failure-handler", "--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK", "--disable-manpages", "--disable-jvm-feature-shenandoahgc", @@ -466,8 +466,7 @@ build_cpu: "x64", dependencies: ["devkit", "build_devkit", "cups"], configure_args: [ - "--openjdk-target=aarch64-linux-gnu", "--with-freetype=bundled", - "--disable-warnings-as-errors" + "--openjdk-target=aarch64-linux-gnu", ], }, @@ -539,7 +538,7 @@ }); // Generate -gcov profiles - [ "linux-x64", "macosx-x64" ].forEach(function (name) { + [ "linux-aarch64", "linux-x64", "macosx-x64" ].forEach(function (name) { var gcovName = name + "-gcov"; profiles[gcovName] = clone(profiles[name]); profiles[gcovName].default_make_targets = ["product-bundles", "test-bundles"]; @@ -626,7 +625,7 @@ }); // JCov profiles build JCov-instrumented JDK image based on images provided through dependencies. - [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"] + [ "linux-aarch64", "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"] .forEach(function (name) { var jcovName = name + "-jcov"; profiles[jcovName] = clone(common.main_profile_base); @@ -777,13 +776,17 @@ = concat(profiles[cmpBaselineName].default_make_targets, "docs"); } profiles[cmpBaselineName].make_args = [ "COMPARE_BUILD=CONF=" ]; + profiles[cmpBaselineName].configure_args = concat( + profiles[cmpBaselineName].configure_args, + "--with-hotspot-build-time=n/a", + "--disable-precompiled-headers"); // Do not inherit artifact definitions from base profile delete profiles[cmpBaselineName].artifacts; }); }); // Artifacts of JCov profiles - [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"] + [ "linux-aarch64", "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"] .forEach(function (name) { var o = artifactData[name] var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version); @@ -803,7 +806,7 @@ }); // Artifacts of gcov (native-code-coverage) profiles - [ "linux-x64", "macosx-x64" ].forEach(function (name) { + [ "linux-aarch64", "linux-x64", "macosx-x64" ].forEach(function (name) { var o = artifactData[name] var pf = o.platform var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
--- a/make/data/charsetmapping/MS950.map Tue Mar 24 14:50:32 2020 -0700 +++ b/make/data/charsetmapping/MS950.map Wed Mar 25 21:31:09 2020 -0400 @@ -23,10 +23,10 @@ # 0xF9FD -> u256F -> 0xA2A3 # 0xA2CC -> u5341 -> 0xA451 # 0xA2CE -> u5345 -> 0xA4CA -# 0xF9F9 -> u2550 -> 0xA2A4 -# 0xF9E9 -> u255E -> 0xA2A5 -# 0xF9EA -> u256A -> 0xA2A6 -# 0xF9EB -> u2561 -> 0xA2A7 +# 0xA2A4 -> u2550 -> 0xF9F9 +# 0xA2A5 -> u255E -> 0xF9E9 +# 0xA2A6 -> u256A -> 0xF9EA +# 0xA2A7 -> u2561 -> 0xF9EB # # Column #1 is the cp950 code (in hex) # Column #2 is the Unicode (in hex as 0xXXXX)
--- a/make/data/charsetmapping/MS950.nr Tue Mar 24 14:50:32 2020 -0700 +++ b/make/data/charsetmapping/MS950.nr Wed Mar 25 21:31:09 2020 -0400 @@ -6,13 +6,13 @@ # (we don't need a MS950.c2b, the entries of MS950.c2b-irreversible # are added in MS950.b2c already) # -0xF9FA 0x256D +0xA2A4 0x2550 +0xA2A5 0x255E +0xA2A6 0x256A +0xA2A7 0x2561 +0xA2CC 0x5341 +0xA2CE 0x5345 +0xF9FA 0x256D 0xF9FB 0x256E 0xF9FC 0x2570 0xF9FD 0x256F -0xA2CC 0x5341 -0xA2CE 0x5345 -0xF9F9 0x2550 -0xF9E9 0x255E -0xF9EA 0x256A -0xF9EB 0x2561
--- a/make/data/lsrdata/language-subtag-registry.txt Tue Mar 24 14:50:32 2020 -0700 +++ b/make/data/lsrdata/language-subtag-registry.txt Wed Mar 25 21:31:09 2020 -0400 @@ -1,4 +1,4 @@ -File-Date: 2019-09-16 +File-Date: 2020-03-16 %% Type: language Subtag: aa @@ -47129,6 +47129,16 @@ Creole continuum in Eastern Suriname and Western French Guiana %% Type: variant +Subtag: peano +Description: Latino Sine Flexione +Description: Interlingua de API +Description: Interlingua de Peano +Prefix: la +Comments: Peano’s Interlingua, created in 1903 by Giuseppe Peano as an + international auxiliary language +Added: 2020-03-12 +%% +Type: variant Subtag: petr1708 Description: Petrine orthography Added: 2010-10-10
--- a/make/devkit/createJMHBundle.sh Tue Mar 24 14:50:32 2020 -0700 +++ b/make/devkit/createJMHBundle.sh Wed Mar 25 21:31:09 2020 -0400 @@ -40,10 +40,10 @@ cd $JAR_DIR rm -f * -wget http://central.maven.org/maven2/org/apache/commons/commons-math3/$COMMONS_MATH3_VERSION/commons-math3-$COMMONS_MATH3_VERSION.jar -wget http://central.maven.org/maven2/net/sf/jopt-simple/jopt-simple/$JOPT_SIMPLE_VERSION/jopt-simple-$JOPT_SIMPLE_VERSION.jar -wget http://central.maven.org/maven2/org/openjdk/jmh/jmh-core/$JMH_VERSION/jmh-core-$JMH_VERSION.jar -wget http://central.maven.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/$JMH_VERSION/jmh-generator-annprocess-$JMH_VERSION.jar +wget https://repo.maven.apache.org/maven2/org/apache/commons/commons-math3/$COMMONS_MATH3_VERSION/commons-math3-$COMMONS_MATH3_VERSION.jar +wget https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/$JOPT_SIMPLE_VERSION/jopt-simple-$JOPT_SIMPLE_VERSION.jar +wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-core/$JMH_VERSION/jmh-core-$JMH_VERSION.jar +wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/$JMH_VERSION/jmh-generator-annprocess-$JMH_VERSION.jar tar -cvzf ../$BUNDLE_NAME *
--- a/make/hotspot/gensrc/GensrcJfr.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/hotspot/gensrc/GensrcJfr.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2020, 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 @@ $(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \ JAVAC := $(JAVAC), \ - FLAGS := $(DISABLE_WARNINGS), \ + FLAGS := -Xlint:all -Werror, \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ DISABLE_SJAVAC := true, \ @@ -41,6 +41,7 @@ SETUP := GENERATE_JFRBYTECODE, \ SRC := $(JFR_TOOLS_SRCDIR), \ BIN := $(JFR_TOOLS_OUTPUTDIR), \ + DISABLED_WARNINGS := try, \ )) TARGETS += $(BUILD_JFR_TOOLS)
--- a/make/hotspot/gensrc/GensrcJvmti.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/hotspot/gensrc/GensrcJvmti.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2020, 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 @@ -34,7 +34,7 @@ $(eval $(call SetupJavaCompiler, GENERATE_OLDBYTECODE, \ JAVAC := $(JAVAC), \ - FLAGS := $(DISABLE_WARNINGS), \ + FLAGS := -Xlint:all -Werror, \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ DISABLE_SJAVAC := true, \ @@ -43,6 +43,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JVMTI_TOOLS, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(JVMTI_TOOLS_SRCDIR), \ + DISABLED_WARNINGS := rawtypes cast, \ INCLUDE_FILES := jvmtiGen.java jvmtiEnvFill.java, \ BIN := $(JVMTI_TOOLS_OUTPUTDIR), \ ))
--- a/make/hotspot/ide/CreateVSProject.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/hotspot/ide/CreateVSProject.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2020, 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 @@ -98,7 +98,7 @@ $(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \ SETUP := GENERATE_OLDBYTECODE, \ - ADD_JAVAC_FLAGS := -Xlint:-auxiliaryclass, \ + DISABLED_WARNINGS := auxiliaryclass deprecation rawtypes unchecked cast, \ SRC := $(TOPDIR)/make/hotspot/src/classes, \ BIN := $(TOOLS_OUTPUTDIR), \ ))
--- a/make/hotspot/lib/CompileJvm.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/hotspot/lib/CompileJvm.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -75,6 +75,10 @@ -DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \ # +ifneq ($(HOTSPOT_BUILD_TIME), ) + CFLAGS_VM_VERSION += -DHOTSPOT_BUILD_TIME='"$(HOTSPOT_BUILD_TIME)"' +endif + ################################################################################ # Disabled warnings
--- a/make/jdk/netbeans/jmx/build.xml Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/netbeans/jmx/build.xml Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ <!-- - Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -60,37 +60,7 @@ </target> - <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ --> - <!-- Call rmic-jmx subtargets --> - - <target name="-rmic-jmx" depends="-init,-rmic-jmx-jrmp" - description="Calls -init,-rmic-jmx-jrmp" - /> - - - <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> - <!-- Generate RMI JRMP stub class files for remote objects --> - <!-- Generated java files are kept in a separate directory --> - - <target name="-rmic-jmx-jrmp" depends="-init" - description="Generate RMI JRMP stub class files for remote objects. Keep generated java files in separate dir." > - - <!-- Dir to keep generated stub source --> - <mkdir dir="${gensrc.dir}" /> - - <rmic base="${classes.dir}/javax/management" - sourcebase="${gensrc.dir}" - includeAntRuntime="no" - includeJavaRuntime="no" - stubversion="1.2" - > - <include name="javax/management/remote/rmi/RMIConnectionImpl.class" /> - <include name="javax/management/remote/rmi/RMIServerImpl.class" /> - </rmic> - - </target> - - <target name="-post-compile" depends="-init,-rmic-jmx" + <target name="-post-compile" depends="-init" description="Jar JMX class files (including RMI stubs)" > <mkdir dir="${dist.dir}/lib"/> <jar jarfile="${dist.dir}/lib/${jar.jmx.name}"
--- a/make/jdk/src/classes/build/tools/cldrconverter/Bundle.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/cldrconverter/Bundle.java Wed Mar 25 21:31:09 2020 -0400 @@ -191,6 +191,7 @@ String[] cldrBundles = getCLDRPath().split(","); // myMap contains resources for id. + @SuppressWarnings("unchecked") Map<String, Object> myMap = new HashMap<>(); int index; for (index = 0; index < cldrBundles.length; index++) { @@ -230,10 +231,12 @@ } for (String k : COMPACT_NUMBER_PATTERN_KEYS) { + @SuppressWarnings("unchecked") List<String> patterns = (List<String>) myMap.remove(k); if (patterns != null) { // Convert the map value from List<String> to String[], replacing any missing // entry from the parents map, if any. + @SuppressWarnings("unchecked") final List<String> pList = (List<String>)parentsMap.get(k); int size = patterns.size(); int psize = pList != null ? pList.size() : 0; @@ -286,7 +289,7 @@ handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterAbbreviations"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNarrows"); - adjustEraNames(myMap, calendarType); + adjustEraNames(myMap, parentsMap, calendarType); handleDateTimeFormatPatterns(TIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "TimePatterns"); handleDateTimeFormatPatterns(DATE_PATTERN_KEYS, myMap, parentsMap, calendarType, "DatePatterns"); @@ -410,8 +413,9 @@ } /** - * Fills in any empty elements with its parent element. Returns true if the resulting array is - * identical to its parent array. + * Fills in any empty elements with its parent element, falling back to + * aliased one if parent element is not found. Returns true if the resulting + * array is identical to its parent array. * * @param parents * @param key @@ -423,7 +427,7 @@ return false; } if (value instanceof String[]) { - Object pvalue = parents.get(key); + Object pvalue = parents.getOrDefault(key, parents.get(CLDRConverter.aliases.get(key))); if (pvalue != null && pvalue instanceof String[]) { String[] strings = (String[]) value; String[] pstrings = (String[]) pvalue; @@ -442,7 +446,7 @@ * Adjusts String[] for era names because JRE's Calendars use different * ERA value indexes in the Buddhist, Japanese Imperial, and Islamic calendars. */ - private void adjustEraNames(Map<String, Object> map, CalendarType type) { + private void adjustEraNames(Map<String, Object> map, Map<String, Object> pMap, CalendarType type) { String[][] eraNames = new String[ERA_KEYS.length][]; String[] realKeys = new String[ERA_KEYS.length]; int index = 0; @@ -450,6 +454,9 @@ String realKey = type.keyElementName() + key; String[] value = (String[]) map.get(realKey); if (value != null) { + // first fill in missing elements from parents map. + fillInElements(pMap, realKey, value); + switch (type) { case GREGORIAN: break;
--- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java Wed Mar 25 21:31:09 2020 -0400 @@ -434,7 +434,7 @@ parentData.keySet().stream() .filter(key -> key.startsWith(PARENT_LOCALE_PREFIX)) .forEach(key -> { - parentLocalesMap.put(key, new TreeSet( + parentLocalesMap.put(key, new TreeSet<String>( Arrays.asList(((String)parentData.get(key)).split(" ")))); }); @@ -481,7 +481,7 @@ }); } - private static void parseLDMLFile(File srcfile, AbstractLDMLHandler handler) throws Exception { + private static void parseLDMLFile(File srcfile, AbstractLDMLHandler<?> handler) throws Exception { info("..... Parsing " + srcfile.getName() + " ....."); SAXParserFactory pf = SAXParserFactory.newInstance(); pf.setValidating(true); @@ -574,7 +574,7 @@ * Translate the aliases into the real entries in the bundle map. */ static void handleAliases(Map<String, Object> bundleMap) { - Set bundleKeys = bundleMap.keySet(); + Set<String> bundleKeys = bundleMap.keySet(); try { for (String key : aliases.keySet()) { String targetKey = aliases.get(key); @@ -1158,10 +1158,10 @@ private static Stream<String> pluralRulesStream() { return handlerPlurals.getData().entrySet().stream() - .filter(e -> !((Map<String, String>)e.getValue()).isEmpty()) + .filter(e -> !(e.getValue()).isEmpty()) .map(e -> { String loc = e.getKey(); - Map<String, String> rules = (Map<String, String>)e.getValue(); + Map<String, String> rules = e.getValue(); return " {\"" + loc + "\", \"" + rules.entrySet().stream() .map(rule -> rule.getKey() + ":" + rule.getValue().replaceFirst("@.*", ""))
--- a/make/jdk/src/classes/build/tools/cldrconverter/PluralsParseHandler.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/cldrconverter/PluralsParseHandler.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ * plurals.xml */ -class PluralsParseHandler extends AbstractLDMLHandler<Object> { +class PluralsParseHandler extends AbstractLDMLHandler<Map<String, String>> { @Override public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException { // avoid HTTP traffic to unicode.org @@ -82,13 +82,13 @@ switch (qName) { case "pluralRule": assert !(currentContainer instanceof Entry); - Entry entry = (Entry)currentContainer; + Entry<?> entry = (Entry<?>)currentContainer; final String count = entry.getKey(); final String rule = (String)entry.getValue(); String locales = ((KeyContainer)(currentContainer.getParent())).getKey(); Arrays.stream(locales.split("\\s")) .forEach(loc -> { - Map<String, String> rules = (Map<String, String>)get(loc); + Map<String, String> rules = get(loc); if (rules == null) { rules = new HashMap<>(); put(loc, rules);
--- a/make/jdk/src/classes/build/tools/dtdbuilder/DTDBuilder.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/dtdbuilder/DTDBuilder.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -139,7 +139,7 @@ } int i = namesVector.size(); namesVector.addElement(name); - namesHash.put(name, new Integer(i)); + namesHash.put(name, i); return (short) i; }
--- a/make/jdk/src/classes/build/tools/dtdbuilder/DTDInputStream.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/dtdbuilder/DTDInputStream.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -92,8 +92,8 @@ * Push an entire input stream */ void push(Reader in) throws IOException { - stack.push(new Integer(ln)); - stack.push(new Integer(ch)); + stack.push(Integer.valueOf(ln)); + stack.push(Integer.valueOf(ch)); stack.push(this.in); this.in = in; ch = in.read();
--- a/make/jdk/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -87,12 +87,12 @@ ResourceBundle rules, info; info = (ResourceBundle) Class.forName( - localizedBundleName("sun.text.resources", "BreakIteratorInfo")).newInstance(); + localizedBundleName("sun.text.resources", "BreakIteratorInfo")).getDeclaredConstructor().newInstance(); classNames = info.getStringArray("BreakIteratorClasses"); rules = (ResourceBundle) Class.forName( - localizedBundleName("sun.text.resources", "BreakIteratorRules")).newInstance(); + localizedBundleName("sun.text.resources", "BreakIteratorRules")).getDeclaredConstructor().newInstance(); if (info.containsKey("CharacterData")) { generateDataFile(info.getString("CharacterData"),
--- a/make/jdk/src/classes/build/tools/generatebreakiteratordata/RuleBasedBreakIteratorBuilder.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatebreakiteratordata/RuleBasedBreakIteratorBuilder.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -290,7 +290,7 @@ } lastOpen = c; - parenStack.push(new Character((char)c)); + parenStack.push(Character.valueOf((char)c)); if (c == '<') { sawVarName = true; } @@ -902,11 +902,11 @@ // if we're adding rules to the backward state table, mark the initial state // as a looping state if (!forward) { - loopingStates.addElement(new Integer(1)); + loopingStates.addElement(Integer.valueOf(1)); } // put the current state on the decision point list before we start - decisionPointList.addElement(new Integer(currentState)); // we want currentState to + decisionPointList.addElement(Integer.valueOf(currentState)); // we want currentState to // be 1 here... currentState = tempStateTable.size() - 1; // but after that, we want it to be // 1 less than the state number of the next state @@ -978,7 +978,7 @@ // if the period is followed by an asterisk, then just set the current // state to loop back on itself if (p + 1 < rule.length() && rule.charAt(p + 1) == '*' && state[0] != 0) { - decisionPointList.addElement(new Integer(state[0])); + decisionPointList.addElement(Integer.valueOf(state[0])); pendingChars = ""; ++p; } @@ -1012,7 +1012,7 @@ // it to the end of the state table int newState = tempStateTable.size(); if (loopingStates.size() != 0) { - statesToBackfill.addElement(new Integer(newState)); + statesToBackfill.addElement(Integer.valueOf(newState)); } state = new short[numCategories + 1]; if (sawEarlyBreak) { @@ -1032,7 +1032,7 @@ lastState = currentState; do { ++currentState; - decisionPointList.addElement(new Integer(currentState)); + decisionPointList.addElement(Integer.valueOf(currentState)); } while (currentState + 1 < tempStateTable.size()); } } @@ -1058,7 +1058,7 @@ if (c == '*') { for (int i = lastState + 1; i < tempStateTable.size(); i++) { Vector<Integer> temp = new Vector<>(); - temp.addElement(new Integer(i)); + temp.addElement(Integer.valueOf(i)); updateStateTable(temp, pendingChars, (short)(lastState + 1)); } } @@ -1121,7 +1121,7 @@ // add the current state to the decision point list (add it at the // BEGINNING so we can find it later) - decisionPointList.insertElementAt(new Integer(currentState), 0); + decisionPointList.insertElementAt(Integer.valueOf(currentState), 0); // finally, push a copy of the current decision point list onto the // stack (this keeps track of the active decision point list before @@ -1208,7 +1208,7 @@ for (int i = 0; i < tempState.length; i++) { if (tempState[i] > tempStateNum) { updateStateTable(exitPoints, - new Character((char)(i + 0x100)).toString(), + Character.valueOf((char)(i + 0x100)).toString(), tempState[i]); } } @@ -1330,7 +1330,7 @@ short[] newValues, Vector<Integer> rowsBeingUpdated) { short[] oldValues = tempStateTable.elementAt(rowNum); - boolean isLoopingState = loopingStates.contains(new Integer(rowNum)); + boolean isLoopingState = loopingStates.contains(Integer.valueOf(rowNum)); // for each of the cells in the rows we're reconciling, do... for (int i = 0; i < oldValues.length; i++) { @@ -1343,7 +1343,7 @@ // if oldValues is a looping state and the state the current cell points to // is too, then we can just stomp over the current value of that cell (and // set the clear-looping-states flag if necessary) - else if (isLoopingState && loopingStates.contains(new Integer(oldValues[i]))) { + else if (isLoopingState && loopingStates.contains(Integer.valueOf(oldValues[i]))) { if (newValues[i] != 0) { if (oldValues[i] == 0) { clearLoopingStates = true; @@ -1401,29 +1401,29 @@ // if the decision point list contains either of the parent rows, // update it to include the new row as well - if ((decisionPointList.contains(new Integer(oldRowNum)) - || decisionPointList.contains(new Integer(newRowNum))) - && !decisionPointList.contains(new Integer(combinedRowNum)) + if ((decisionPointList.contains(Integer.valueOf(oldRowNum)) + || decisionPointList.contains(Integer.valueOf(newRowNum))) + && !decisionPointList.contains(Integer.valueOf(combinedRowNum)) ) { - decisionPointList.addElement(new Integer(combinedRowNum)); + decisionPointList.addElement(Integer.valueOf(combinedRowNum)); } // do the same thing with the list of rows being updated - if ((rowsBeingUpdated.contains(new Integer(oldRowNum)) - || rowsBeingUpdated.contains(new Integer(newRowNum))) - && !rowsBeingUpdated.contains(new Integer(combinedRowNum)) + if ((rowsBeingUpdated.contains(Integer.valueOf(oldRowNum)) + || rowsBeingUpdated.contains(Integer.valueOf(newRowNum))) + && !rowsBeingUpdated.contains(Integer.valueOf(combinedRowNum)) ) { - decisionPointList.addElement(new Integer(combinedRowNum)); + decisionPointList.addElement(Integer.valueOf(combinedRowNum)); } // now (groan) do the same thing for all the entries on the // decision point stack for (int k = 0; k < decisionPointStack.size(); k++) { Vector<Integer> dpl = decisionPointStack.elementAt(k); - if ((dpl.contains(new Integer(oldRowNum)) - || dpl.contains(new Integer(newRowNum))) - && !dpl.contains(new Integer(combinedRowNum)) + if ((dpl.contains(Integer.valueOf(oldRowNum)) + || dpl.contains(Integer.valueOf(newRowNum))) + && !dpl.contains(Integer.valueOf(combinedRowNum)) ) { - dpl.addElement(new Integer(combinedRowNum)); + dpl.addElement(Integer.valueOf(combinedRowNum)); } } @@ -1536,10 +1536,10 @@ private void eliminateBackfillStates(int baseState) { // don't do anything unless this state is actually in the backfill list... - if (statesToBackfill.contains(new Integer(baseState))) { + if (statesToBackfill.contains(Integer.valueOf(baseState))) { // if it is, take it out - statesToBackfill.removeElement(new Integer(baseState)); + statesToBackfill.removeElement(Integer.valueOf(baseState)); // then go through and recursively call this function for every // state that the base state points to @@ -1608,7 +1608,7 @@ int[] rowNumMap = new int[tempStateTable.size()]; Stack<Integer> rowsToFollow = new Stack<>(); - rowsToFollow.push(new Integer(1)); + rowsToFollow.push(Integer.valueOf(1)); rowNumMap[1] = 1; // determine which states are no longer reachable from the start state @@ -1622,7 +1622,7 @@ if (row[i] != 0) { if (rowNumMap[row[i]] == 0) { rowNumMap[row[i]] = row[i]; - rowsToFollow.push(new Integer(row[i])); + rowsToFollow.push(Integer.valueOf(row[i])); } } }
--- a/make/jdk/src/classes/build/tools/generatecharacter/CharacterName.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatecharacter/CharacterName.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,3 +1,28 @@ +/* + * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + package build.tools.generatecharacter; import java.io.*;
--- a/make/jdk/src/classes/build/tools/generatecharacter/CharacterScript.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatecharacter/CharacterScript.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,3 +1,28 @@ +/* + * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + package build.tools.generatecharacter; import java.util.regex.*; @@ -118,7 +143,7 @@ // Character.getType() != Character.UNASSIGNED // first (return UNKNOWN for unassigned) - ArrayList<int[]> list = new ArrayList(); + ArrayList<int[]> list = new ArrayList<>(); list.add(scripts[0]); int[] last = scripts[0]; @@ -156,7 +181,7 @@ } for (i = 0; i < list.size(); i++) { - int[] a = (int[])list.get(i); + int[] a = list.get(i); String name = "UNKNOWN"; if (a[2] != -1) name = names[a[2]].toUpperCase(Locale.US);
--- a/make/jdk/src/classes/build/tools/generatecharacter/PrintCharacterRanges.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatecharacter/PrintCharacterRanges.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, 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 @@ -45,16 +45,16 @@ int end() { return end; } } - private static List/*<BooleanRange>*/ recoverBooleanRanges(String methodName) throws Exception { - List result = new ArrayList(); + private static List<BooleanRange> recoverBooleanRanges(String methodName) throws Exception { + List<BooleanRange> result = new ArrayList<>(); int currentRangeStart = -1; - Method method = Character.class.getDeclaredMethod(methodName, new Class[] { Character.TYPE }); + Method method = Character.class.getDeclaredMethod(methodName, new Class<?>[] { Character.TYPE }); if (method == null) { throw new RuntimeException("No method \"" + methodName + "\"(C) found"); } for (int i = 0; i <= 255; i++) { - boolean methodRes = ((Boolean) method.invoke(null, new Object[] { new Character((char) i) })).booleanValue(); + boolean methodRes = ((Boolean) method.invoke(null, new Object[] { Character.valueOf((char) i) })).booleanValue(); if (methodRes) { if (currentRangeStart < 0) { currentRangeStart = i; @@ -91,17 +91,17 @@ return s.toString(); } - private static void printBooleanRanges(List/*<BooleanRange>*/ ranges, String methodName) { + private static void printBooleanRanges(List<BooleanRange> ranges, String methodName) { System.out.print(methodName + ":"); - for (Iterator iter = ranges.iterator(); iter.hasNext();) { - BooleanRange range = (BooleanRange) iter.next(); + for (Iterator<BooleanRange> iter = ranges.iterator(); iter.hasNext();) { + BooleanRange range = iter.next(); System.out.print(" [ " + describe(range.begin()) + ", " + describe(range.end()) + " ]"); } System.out.println(""); } private static void recoverAndPrintBooleanRanges(String methodName) throws Exception { - List ranges = recoverBooleanRanges(methodName); + List<BooleanRange> ranges = recoverBooleanRanges(methodName); printBooleanRanges(ranges, methodName); } @@ -121,17 +121,17 @@ int offset() { return offset; } } - private static List/*<ShiftRange>*/ recoverShiftRanges(String methodName) throws Exception { - List result = new ArrayList(); + private static List<ShiftRange> recoverShiftRanges(String methodName) throws Exception { + List<ShiftRange> result = new ArrayList<>(); int currentRangeStart = -1; int currentRangeOffset = -1; - Method method = Character.class.getDeclaredMethod(methodName, new Class[] { Character.TYPE }); + Method method = Character.class.getDeclaredMethod(methodName, new Class<?>[] { Character.TYPE }); if (method == null) { throw new RuntimeException("No method \"" + methodName + "\"(C) found"); } for (int i = 0; i <= 255; i++) { - char methodRes = ((Character) method.invoke(null, new Object[] { new Character((char) i) })).charValue(); + char methodRes = ((Character) method.invoke(null, new Object[] { Character.valueOf((char) i) })).charValue(); if (methodRes != i) { int offset = methodRes - i; if (currentRangeStart < 0) { @@ -155,11 +155,11 @@ return result; } - private static void printShiftRanges(List/*<ShiftRange>*/ ranges, String methodName) { + private static void printShiftRanges(List<ShiftRange> ranges, String methodName) { System.out.print(methodName + ":"); boolean isFirst = true; - for (Iterator iter = ranges.iterator(); iter.hasNext();) { - ShiftRange range = (ShiftRange) iter.next(); + for (Iterator<ShiftRange> iter = ranges.iterator(); iter.hasNext();) { + ShiftRange range = iter.next(); if (isFirst) { isFirst = false; } else { @@ -173,7 +173,7 @@ } private static void recoverAndPrintShiftRanges(String methodName) throws Exception { - List ranges = recoverShiftRanges(methodName); + List<ShiftRange> ranges = recoverShiftRanges(methodName); printShiftRanges(ranges, methodName); }
--- a/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, 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 @@ -322,7 +322,7 @@ specialCaseNewCurrenciesDefaultFractionDigits[specialCaseCount] = getDefaultFractionDigits(newCurrency); specialCaseNewCurrenciesNumericCode[specialCaseCount] = getNumericCode(newCurrency); } - specialCaseMap.put(currencyInfo, new Integer(specialCaseCount)); + specialCaseMap.put(currencyInfo, Integer.valueOf(specialCaseCount)); return specialCaseCount++; }
--- a/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, 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 @@ -215,10 +215,7 @@ + " static final Map<String, String[]> multiEquivsMap;\n" + " static final Map<String, String> regionVariantEquivMap;\n\n" + " static {\n" - + " singleEquivMap = new HashMap<>();\n" - + " multiEquivsMap = new HashMap<>();\n" - + " regionVariantEquivMap = new HashMap<>();\n\n" - + " // This is an auto-generated file and should not be manually edited.\n"; + + " singleEquivMap = new HashMap<>("; private static final String footerText = " }\n\n" @@ -242,6 +239,12 @@ Paths.get(fileName))) { writer.write(getOpenJDKCopyright()); writer.write(headerText + + (int)(sortedLanguageMap1.size() / 0.75f + 1) + ");\n" + + " multiEquivsMap = new HashMap<>(" + + (int)(sortedLanguageMap2.size() / 0.75f + 1) + ");\n" + + " regionVariantEquivMap = new HashMap<>(" + + (int)(sortedRegionVariantMap.size() / 0.75f + 1) + ");\n\n" + + " // This is an auto-generated file and should not be manually edited.\n" + " // LSR Revision: " + LSRrevisionDate); writer.newLine();
--- a/make/jdk/src/classes/build/tools/jdwpgen/Parse.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/jdwpgen/Parse.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import java.util.*; import java.io.*; +import java.lang.reflect.InvocationTargetException; class Parse { @@ -144,12 +145,18 @@ return null; } else { try { - Node node = (Node)proto.getClass().newInstance(); + Node node = (Node)proto.getClass().getDeclaredConstructor().newInstance(); node.set(kind, list, izer.lineno()); return node; } catch (InstantiationException exc) { error(exc.toString()); return null; + } catch (NoSuchMethodException exc) { + error(exc.toString()); + return null; + } catch (InvocationTargetException exc) { + error(exc.toString()); + return null; } catch (IllegalAccessException exc) { error(exc.toString()); return null;
--- a/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java Wed Mar 25 21:31:09 2020 -0400 @@ -75,7 +75,7 @@ } return "<dt>Module Graph:</dt>" + "<dd>" - + "<a class=moduleGraph href=\"" + imageFile + "\">" + + "<a class=\"module-graph\" href=\"" + imageFile + "\">" + getImage(moduleName, imageFile, thumbnailHeight, false) + hoverImage + "</a>"
--- a/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -67,7 +67,7 @@ } public Set<String> getZoneIds() { - return new TreeSet(regionIds); + return new TreeSet<String>(regionIds); } public Map<String, String> getAliasMap() { @@ -100,6 +100,7 @@ return (ZoneRules)obj; } try { + @SuppressWarnings("unchecked") ZoneRules zrules = buildRules(zoneId, (List<ZoneLine>)obj); zones.put(zoneId, zrules); return zrules;
--- a/make/jdk/src/classes/build/tools/x11wrappergen/WrapperGenerator.java Tue Mar 24 14:50:32 2020 -0700 +++ b/make/jdk/src/classes/build/tools/x11wrappergen/WrapperGenerator.java Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,11 +47,11 @@ String defaultBaseClass = "XWrapperBase"; String compile_options = "-lX11"; - static Hashtable symbolTable = new Hashtable(); - static Hashtable sizeTable32bit = new Hashtable(); - static Hashtable sizeTable64bit = new Hashtable(); - static Hashtable knownSizes32 = new Hashtable(); - static Hashtable knownSizes64 = new Hashtable(); + static Hashtable<String, BaseType> symbolTable = new Hashtable<>(); + static Hashtable<String, String> sizeTable32bit = new Hashtable<>(); + static Hashtable<String, String> sizeTable64bit = new Hashtable<>(); + static Hashtable<String, Integer> knownSizes32 = new Hashtable<>(); + static Hashtable<String, Integer> knownSizes64 = new Hashtable<>(); static { /* knownSizes64.put("", Integer.valueOf()); @@ -391,7 +391,7 @@ alias = true; aliasName = attributes[4]; } else if (type == TYPE_ARRAY || type == TYPE_PTR || type == TYPE_STRUCT) { - referencedType = (BaseType)symbolTable.get(mod); + referencedType = symbolTable.get(mod); if (referencedType == null) { log.warning("Can't find type for name " + mod); } @@ -457,7 +457,7 @@ private static class StructType extends BaseType { - Vector members; + Vector<BaseType> members; String description; boolean packed; int size; @@ -472,7 +472,7 @@ */ public StructType(String _desc) { - members = new Vector(); + members = new Vector<>(); parseDescription(_desc); } public int getNumFields() @@ -495,7 +495,7 @@ return description; } - public Enumeration getMembers() + public Enumeration<BaseType> getMembers() { return members.elements(); } @@ -545,8 +545,8 @@ * Returns String containing Java code calculating size of the structure depending on the data model */ public String getSize() { - String s32 = (String) WrapperGenerator.sizeTable32bit.get(getName()); - String s64 = (String) WrapperGenerator.sizeTable64bit.get(getName()); + String s32 = WrapperGenerator.sizeTable32bit.get(getName()); + String s64 = WrapperGenerator.sizeTable64bit.get(getName()); if (s32 == null || s64 == null) { return (s32 == null)?(s64):(s32); } @@ -558,8 +558,8 @@ } public String getOffset(AtomicType atp) { String key = getName()+"."+(atp.isAlias() ? atp.getAliasName() : atp.getName()); - String s64 = (String) WrapperGenerator.sizeTable64bit.get(key); - String s32 = (String) WrapperGenerator.sizeTable32bit.get(key); + String s64 = WrapperGenerator.sizeTable64bit.get(key); + String s32 = WrapperGenerator.sizeTable32bit.get(key); if (s32 == null || s64 == null) { return (s32 == null)?(s64):(s32); } @@ -573,7 +573,7 @@ private static class FunctionType extends BaseType { - Vector args; + Vector<BaseType> args; String description; boolean packed; String returnType; @@ -582,7 +582,7 @@ public FunctionType(String _desc) { - args = new Vector(); + args = new Vector<>(); description = _desc; setName(_desc); } @@ -618,7 +618,7 @@ return description; } - public Collection getArguments() + public Collection<BaseType> getArguments() { return args; } @@ -653,28 +653,28 @@ public String getOffsets(StructType stp,AtomicType atp, boolean wide) { String key = stp.getName()+"."+atp.getName(); - return wide == true ? (String) sizeTable64bit.get(key) : (String) sizeTable32bit.get(key); + return wide == true ? sizeTable64bit.get(key) : sizeTable32bit.get(key); } public String getStructSize(StructType stp, boolean wide) { - return wide == true ? (String) sizeTable64bit.get(stp.getName()) : (String) sizeTable32bit.get(stp.getName()); + return wide == true ? sizeTable64bit.get(stp.getName()) : sizeTable32bit.get(stp.getName()); } public int getLongSize(boolean wide) { - return Integer.parseInt(wide == true ? (String)sizeTable64bit.get("long") : (String)sizeTable32bit.get("long")); + return Integer.parseInt(wide == true ? sizeTable64bit.get("long") : sizeTable32bit.get("long")); } public int getPtrSize(boolean wide) { - return Integer.parseInt(wide == true ? (String)sizeTable64bit.get("ptr") : (String)sizeTable32bit.get("ptr")); + return Integer.parseInt(wide == true ? sizeTable64bit.get("ptr") : sizeTable32bit.get("ptr")); } public int getBoolSize(boolean wide) { return getOrdinalSize("Bool", wide); } public int getOrdinalSize(String ordinal, boolean wide) { - return Integer.parseInt(wide == true ? (String)sizeTable64bit.get(ordinal) : (String)sizeTable32bit.get(ordinal)); + return Integer.parseInt(wide == true ? sizeTable64bit.get(ordinal) : sizeTable32bit.get(ordinal)); } public void writeToString(StructType stp, PrintWriter pw) { @@ -682,7 +682,7 @@ pw.println("\n\n\tString getName() {\n\t\treturn \"" + stp.getName()+ "\"; \n\t}"); pw.println("\n\n\tString getFieldsAsString() {\n\t\tStringBuilder ret = new StringBuilder(" + stp.getNumFields() * 40 + ");\n"); - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration<BaseType> e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType tp = (AtomicType) e.nextElement(); type = tp.getType(); @@ -718,7 +718,7 @@ } else { prefix = "\t"; } - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration<BaseType> e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType tp = (AtomicType) e.nextElement(); type = tp.getType(); @@ -753,7 +753,7 @@ int acc_size_32 = 0; int acc_size_64 = 0; String s_log = (generateLog?"log.finest(\"\");":""); - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration<BaseType> e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType tp = (AtomicType) e.nextElement(); type = tp.getType(); @@ -946,7 +946,7 @@ pw.println("\tprivate static Unsafe unsafe = XlibWrapper.unsafe;"); pw.println("\tprivate boolean __executed = false;"); pw.println("\tprivate boolean __disposed = false;"); - Iterator iter = ft.getArguments().iterator(); + Iterator<BaseType> iter = ft.getArguments().iterator(); while (iter.hasNext()) { AtomicType at = (AtomicType)iter.next(); if (at.isIn()) { @@ -1110,8 +1110,8 @@ public void writeJavaWrapperClass(String outputDir) { try { - for (Enumeration e = symbolTable.elements() ; e.hasMoreElements() ;) { - BaseType tp = (BaseType) e.nextElement(); + for (Enumeration<BaseType> e = symbolTable.elements() ; e.hasMoreElements() ;) { + BaseType tp = e.nextElement(); if (tp instanceof StructType) { StructType st = (StructType) tp; writeWrapper(outputDir, st); @@ -1132,7 +1132,7 @@ int j=0; BaseType tp; StructType stp; - Enumeration eo; + Enumeration<BaseType> eo; try { @@ -1158,7 +1158,7 @@ pw.println("\n\nint main(){"); j=0; for ( eo = symbolTable.elements() ; eo.hasMoreElements() ;) { - tp = (BaseType) eo.nextElement(); + tp = eo.nextElement(); if (tp instanceof StructType) { stp = (StructType) tp; @@ -1181,14 +1181,14 @@ for (eo = symbolTable.elements() ; eo.hasMoreElements() ;) { - tp = (BaseType) eo.nextElement(); + tp = eo.nextElement(); if (tp instanceof StructType) { stp = (StructType) tp; if (stp.getIsInterface()) { continue; } - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration<BaseType> e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType atp = (AtomicType) e.nextElement(); if (atp.isAlias()) continue; pw.println("printf(\""+ stp.getName() + "." + atp.getName() + "\t%d\\n\""+ @@ -1277,7 +1277,7 @@ } else if (line != null) { - BaseType bt = (BaseType) symbolTable.get(line); + BaseType bt = symbolTable.get(line); if (bt == null) { if (line.startsWith("!")) { FunctionType ft = new FunctionType(line);
--- a/make/rmic/Rmic-java.management.rmi.gmk Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -# -# Copyright (c) 2011, 2019, 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 RmicCommon.gmk - -########################################################################################## -# -# Generate RMI stubs -# - -JMX_RMI_CLASSES := javax.management.remote.rmi.RMIConnectionImpl \ - javax.management.remote.rmi.RMIServerImpl - -# Generate into gensrc dir where sources get picked up for javadoc, then move the classes -# into the stub classes dir. -$(eval $(call SetupRMICompilation,RMI_GEN, \ - CLASSES := $(JMX_RMI_CLASSES), \ - CLASSES_DIR := $(CLASSES_DIR)/java.management.rmi, \ - STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/java.management.rmi, \ - RUN_V12 := true, \ - KEEP_GENERATED := true, \ - STUB_SOURCES_DIR := $(RMIC_GENSRC_DIR)/java.management.rmi, \ -)) - -########################################################################################## - -all: $(RMI_GEN) - -.PHONY: all
--- a/make/rmic/Rmic-java.rmi.gmk Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -# -# Copyright (c) 2011, 2013, 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 RmicCommon.gmk - -################################################################################ -# -# Generate RMI stubs -# - -$(eval $(call SetupRMICompilation,RMI_12, \ - CLASSES := sun.rmi.server.Activation$$ActivationSystemImpl \ - java.rmi.activation.ActivationGroup, \ - CLASSES_DIR := $(CLASSES_DIR)/java.rmi, \ - STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/java.rmi, \ - RUN_V12 := true)) -GENCLASSES += $(RMI_12) - - -################################################################################ - -all: $(RMI_12) - -.PHONY: all
--- a/make/rmic/Rmic-jdk.naming.rmi.gmk Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# -# Copyright (c) 2011, 2013, 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 RmicCommon.gmk - -########################################################################################## -# -# Generate RMI stubs -# - -$(eval $(call SetupRMICompilation,RMI_12, \ - CLASSES := com.sun.jndi.rmi.registry.ReferenceWrapper, \ - CLASSES_DIR := $(CLASSES_DIR)/jdk.naming.rmi, \ - STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/jdk.naming.rmi, \ - RUN_V12 := true)) - -########################################################################################## - -all: $(RMI_12) - -.PHONY: all
--- a/make/rmic/RmicCommon.gmk Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# -# Copyright (c) 2011, 2017, 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 RMICompilation.gmk - -################################################################################ - -RMIC_MAIN_CLASS := -m jdk.rmic.interim/sun.rmi.rmic.Main - -RMIC := $(JAVA_SMALL) $(INTERIM_RMIC_ARGS) $(RMIC_MAIN_CLASS) - -CLASSES_DIR := $(JDK_OUTPUTDIR)/modules -# NOTE: If the smart javac dependency management is reintroduced, these classes -# risk interfering with the dependency checking. In that case they will need to -# be kept separate. -STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules -RMIC_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/rmic - -################################################################################
--- a/make/scripts/compare_exceptions.sh.incl Tue Mar 24 14:50:32 2020 -0700 +++ b/make/scripts/compare_exceptions.sh.incl Wed Mar 25 21:31:09 2020 -0400 @@ -36,13 +36,15 @@ # Diff exceptions if [ "$OPENJDK_TARGET_OS" = "linux" ]; then - ACCEPTED_BIN_DIFF=" - ./lib/server/libjvm.so - ./hotspot/gtest/server/libjvm.so - " - STRIP_BEFORE_COMPARE=" - ./hotspot/gtest/server/libjvm.so - " + if [ "$HOTSPOT_BUILD_TIME" = "" -o "$USE_PRECOMPILED_HEADER" = "true" ]; then + ACCEPTED_BIN_DIFF=" + ./lib/server/libjvm.so + ./hotspot/gtest/server/libjvm.so + " + STRIP_BEFORE_COMPARE=" + ./hotspot/gtest/server/libjvm.so + " + fi elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then SKIP_BIN_DIFF="true" SKIP_FULLDUMP_DIFF="true"
--- a/make/test/BuildFailureHandler.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/test/BuildFailureHandler.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,7 @@ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \ BIN := $(FH_SUPPORT)/classes, \ + DISABLED_WARNINGS := deprecation serial try, \ COPY := .properties, \ CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \ JAR := $(FH_JAR), \
--- a/make/test/BuildMicrobenchmark.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/test/BuildMicrobenchmark.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2020, 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,6 +77,7 @@ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(TOPDIR)/test/jdk/java/lang/invoke, \ INCLUDE_FILES := indify/Indify.java, \ + DISABLED_WARNINGS := rawtypes unchecked serial deprecation, \ BIN := $(MICROBENCHMARK_TOOLS_CLASSES), \ )) @@ -88,7 +89,8 @@ JVM := $(JAVA) --add-modules jdk.unsupported --limit-modules java.management, \ JAVAC := $(NEW_JAVAC), \ DISABLE_SJAVAC := true, \ - FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none $(DISABLE_WARNINGS), \ + FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \ + -Xlint:all -Werror, \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ )) @@ -96,7 +98,8 @@ # Build microbenchmark suite for the current JDK $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \ SETUP := MICROBENCHMARK_JAVA_COMPILER, \ - ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH) -Xlint -Xlint:-processing -Werror, \ + ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH), \ + DISABLED_WARNINGS := processing rawtypes cast serial deprecation, \ SRC := $(MICROBENCHMARK_SRC), \ BIN := $(MICROBENCHMARK_CLASSES), \ ))
--- a/make/test/JtregGraalUnit.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/test/JtregGraalUnit.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -61,7 +61,6 @@ $(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar TEST_JAVAC_FLAGS := \ - -Xlint:none \ -processorpath $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \ --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED \ @@ -114,6 +113,7 @@ EXCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \ BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \ CLASSPATH := $(TEST_COMPILE_CP), \ + DISABLED_WARNINGS := processing, \ ADD_JAVAC_FLAGS := $(TEST_JAVAC_FLAGS), \ COPY := .input, \ )) @@ -131,6 +131,7 @@ $(TEST_COMPILE_CP) \ $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests \ , \ + DISABLED_WARNINGS := processing, \ ADD_JAVAC_FLAGS := \ $(TEST_JAVAC_FLAGS) \ -XDstringConcat=inline \ @@ -155,6 +156,7 @@ SRC := $(TEST_DIR)/com.oracle.mxtool.junit, \ BIN := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit, \ JAR := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit.jar, \ + DISABLED_WARNINGS := processing, \ CLASSPATH := $(LIB_OUTPUTDIR)/junit-4.12.jar, \ ))
--- a/make/test/JtregNativeJdk.gmk Tue Mar 24 14:50:32 2020 -0700 +++ b/make/test/JtregNativeJdk.gmk Wed Mar 25 21:31:09 2020 -0400 @@ -55,7 +55,7 @@ # Platform specific setup ifeq ($(call isTargetOs, windows), true) - BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c + BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c exelauncher.c WIN_LIB_JAVA := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := $(WIN_LIB_JAVA) @@ -69,14 +69,17 @@ BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c ifeq ($(call isTargetOs, linux), true) BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava + BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -ldl else ifeq ($(call isTargetOs, solaris), true) BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava -lsocket -lnsl + BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -lthread -ldl endif BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := -ljli BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := -ljvm endif ifeq ($(call isTargetOs, macosx), true) + BUILD_JDK_JTREG_EXCLUDE += exelauncher.c BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libTestMainKeyWindow := -ObjC BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := -framework JavaVM \ -framework Cocoa -framework JavaNativeFoundation
--- a/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -136,7 +136,7 @@ private JRadioButton openRadioButton; private JRadioButton saveRadioButton; private JRadioButton customButton; - private JComboBox lafComboBox; + private JComboBox<SupportedLaF> lafComboBox; private JRadioButton justFilesRadioButton; private JRadioButton justDirectoriesRadioButton; private JRadioButton bothFilesAndDirectoriesRadioButton; @@ -158,7 +158,7 @@ for (UIManager.LookAndFeelInfo lafInfo : installedLafs) { try { Class<?> lnfClass = Class.forName(lafInfo.getClassName()); - LookAndFeel laf = (LookAndFeel) (lnfClass.newInstance()); + LookAndFeel laf = (LookAndFeel) (lnfClass.getDeclaredConstructor().newInstance()); if (laf.isSupportedLookAndFeel()) { String name = lafInfo.getName(); SupportedLaF supportedLaF = new SupportedLaF(name, laf); @@ -292,7 +292,7 @@ showButton.setMnemonic('s'); // Create laf combo box - lafComboBox = new JComboBox(supportedLaFs.toArray()); + lafComboBox = new JComboBox<>(supportedLaFs.toArray(new SupportedLaF[0])); lafComboBox.setSelectedItem(nimbusLaF); lafComboBox.setEditable(false); lafComboBox.addActionListener(optionListener); @@ -729,7 +729,7 @@ frame.pack(); } catch (UnsupportedLookAndFeelException exc) { // This should not happen because we already checked - ((DefaultComboBoxModel) lafComboBox.getModel()). + ((DefaultComboBoxModel<?>) lafComboBox.getModel()). removeElement(supportedLaF); } }
--- a/src/demo/share/jfc/Font2DTest/Font2DTest.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/Font2DTest/Font2DTest.java Wed Mar 25 21:31:09 2020 -0400 @@ -67,7 +67,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.util.EnumSet; import java.util.StringTokenizer; import java.util.BitSet; import javax.swing.*; @@ -101,8 +100,8 @@ private final ChoiceV2 transformMenu; private final ChoiceV2 transformMenuG2; private final ChoiceV2 methodsMenu; - private final JComboBox antiAliasMenu; - private final JComboBox fracMetricsMenu; + private final JComboBox<FontPanel.AAValues> antiAliasMenu; + private final JComboBox<FontPanel.FMValues> fracMetricsMenu; private final JSlider contrastSlider; @@ -151,10 +150,10 @@ methodsMenu = new ChoiceV2( this ); antiAliasMenu = - new JComboBox(EnumSet.allOf(FontPanel.AAValues.class).toArray()); + new JComboBox<>(FontPanel.AAValues.values()); antiAliasMenu.addActionListener(this); fracMetricsMenu = - new JComboBox(EnumSet.allOf(FontPanel.FMValues.class).toArray()); + new JComboBox<>(FontPanel.FMValues.values()); fracMetricsMenu.addActionListener(this); contrastSlider = new JSlider(JSlider.HORIZONTAL, 100, 250, @@ -359,7 +358,7 @@ userTextDialog.pack(); userTextDialog.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { - userTextDialog.hide(); + userTextDialog.setVisible(false); } }); @@ -385,7 +384,7 @@ printDialog.setResizable( false ); printDialog.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { - printDialog.hide(); + printDialog.setVisible(false); } }); printDialog.getContentPane().setLayout( new GridLayout( printModeCBs.length + 2, 1 )); @@ -402,7 +401,7 @@ fontInfoDialog.setResizable( false ); fontInfoDialog.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { - fontInfoDialog.hide(); + fontInfoDialog.setVisible(false); showFontInfoCBMI.setState( false ); } }); @@ -467,7 +466,7 @@ int style = fontStyles[styleMenu.getSelectedIndex()]; Font f; for (int i = 0; i < listCount; i++) { - String fontName = (String)fontMenu.getItemAt(i); + String fontName = fontMenu.getItemAt(i); f = new Font(fontName, style, size); if ((rm.getSelectedIndex() != RangeMenu.SURROGATES_AREA_INDEX) && canDisplayRange(f, rangeStart, rangeEnd)) { @@ -673,9 +672,9 @@ /// Set the visibility of User Text dialog if ( selectedText == fp.USER_TEXT ) - userTextDialog.show(); + userTextDialog.setVisible(true); else - userTextDialog.hide(); + userTextDialog.setVisible(false); /// Change the visibility/status/availability of Print JDialog buttons printModeCBs[ fp.ONE_PAGE ].setSelected( true ); if ( selectedText == fp.FILE_TEXT || selectedText == fp.USER_TEXT ) { @@ -793,10 +792,10 @@ lcdContrast, userTextOpt ); if ( showFontInfoOpt ) { fireUpdateFontInfo(); - fontInfoDialog.show(); + fontInfoDialog.setVisible(true); } else - fontInfoDialog.hide(); + fontInfoDialog.setVisible(false); } catch ( Exception ex ) { fireChangeStatus( "ERROR: Failed to Load Options File; See Stack Trace", true ); @@ -819,7 +818,7 @@ } }); f.pack(); - f.show(); + f.setVisible(true); } catch ( Exception ex ) { fireChangeStatus( "ERROR: Failed to Load PNG File; See Stack Trace", true ); @@ -861,7 +860,7 @@ else if ( itemName.equals( "Page Setup..." )) fp.doPageSetup(); else if ( itemName.equals( "Print..." )) - printDialog.show(); + printDialog.setVisible(true); else if ( itemName.equals( "Close" )) parent.dispose(); else if ( itemName.equals( "Exit" )) @@ -893,19 +892,19 @@ if ( itemName.equals( "Print" )) { for ( int i = 0; i < printModeCBs.length; i++ ) if ( printModeCBs[i].isSelected() ) { - printDialog.hide(); + printDialog.setVisible(false); fp.doPrint( i ); } } else if ( itemName.equals( "Cancel" )) - printDialog.hide(); + printDialog.setVisible(false); /// Update button from Usert Text JDialog... else if ( itemName.equals( "Update" )) fp.setTextToDraw( fp.USER_TEXT, null, parseUserText( userTextArea.getText() ), null ); } else if ( source instanceof JComboBox ) { - JComboBox c = (JComboBox) source; + JComboBox<?> c = (JComboBox<?>) source; /// RangeMenu handles actions by itself and then calls fireRangeChanged, /// so it is not listed or handled here @@ -996,10 +995,10 @@ else if ( cbmi == showFontInfoCBMI ) { if ( showFontInfoCBMI.getState() ) { fireUpdateFontInfo(); - fontInfoDialog.show(); + fontInfoDialog.setVisible(true); } else - fontInfoDialog.hide(); + fontInfoDialog.setVisible(false); } } } @@ -1039,7 +1038,7 @@ f.getContentPane().add( f2dt ); f.pack(); - f.show(); + f.setVisible(true); } /// Inner class definitions... @@ -1070,7 +1069,7 @@ } } - private final class ChoiceV2 extends JComboBox { + private final class ChoiceV2 extends JComboBox<String> { private BitSet bitSet = null; @@ -1141,7 +1140,7 @@ this.choice = choice; } - public Component getListCellRendererComponent(JList list, + public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected,
--- a/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Oracle nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import java.awt.AWTPermission; -import java.awt.Frame; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.*; - -/** - * Font2DTestApplet.java - * - * @author Shinsuke Fukuda - * @author Ankit Patel [Conversion to Swing - 01/07/30] - */ - -/// Applet version of Font2DTest that wraps the actual demo - -public final class Font2DTestApplet extends JApplet { - public void init() { - /// Check if necessary permission is given... - SecurityManager security = System.getSecurityManager(); - if ( security != null ) { - try { - security.checkPermission( new AWTPermission( "showWindowWithoutWarningBanner" )); - } - catch ( SecurityException e ) { - System.out.println( "NOTE: showWindowWithoutWarningBanner AWTPermission not given.\n" + - "Zoom window will contain warning banner at bottom when shown\n" ); - } - try { - security.checkPrintJobAccess(); - } - catch ( SecurityException e ) { - System.out.println( "NOTE: queuePrintJob RuntimePermission not given.\n" + - "Printing feature will not be available\n" ); - } - } - - final JFrame f = new JFrame( "Font2DTest" ); - final Font2DTest f2dt = new Font2DTest( f, true ); - f.addWindowListener( new WindowAdapter() { - public void windowClosing( WindowEvent e ) { f.dispose(); } - }); - - f.getContentPane().add( f2dt ); - f.pack(); - f.show(); - } -}
--- a/src/demo/share/jfc/Font2DTest/FontPanel.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/Font2DTest/FontPanel.java Wed Mar 25 21:31:09 2020 -0400 @@ -74,7 +74,6 @@ import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.text.AttributedString; -import java.util.EnumSet; import java.util.Vector; import javax.imageio.*; @@ -392,7 +391,7 @@ setTransformG2( g2transform ); // ABP setDrawMethod( method ); setRenderingHints(AAValues.getValue(aa), FMValues.getValue(fm), - new Integer(contrast)); + Integer.valueOf(contrast)); } /// Writes the current screen to PNG file @@ -434,7 +433,7 @@ private int canvasInset_X = 5, canvasInset_Y = 5; /// LineBreak'ed TextLayout vector - private Vector lineBreakTLs = null; + private Vector<TextLayout> lineBreakTLs = null; /// Whether the current draw command requested is for printing private boolean isPrinting = false; @@ -800,7 +799,7 @@ if ( textToUse == FILE_TEXT ) { if ( !isPrinting ) f2dt.fireChangeStatus( "LineBreaking Text... Please Wait", false ); - lineBreakTLs = new Vector(); + lineBreakTLs = new Vector<>(); for ( int i = 0; i < fileText.length; i++ ) { AttributedString as = new AttributedString( fileText[i], g2.getFont().getAttributes() ); @@ -929,7 +928,7 @@ float xPos, yPos = (float) canvasInset_Y; g2.drawRect( 0, 0, w - 1, h - 1 ); for ( int i = drawStart; i <= drawEnd; i++ ) { - TextLayout oneLine = (TextLayout) lineBreakTLs.elementAt( i ); + TextLayout oneLine = lineBreakTLs.elementAt( i ); xPos = oneLine.isLeftToRight() ? canvasInset_X : ( (float) w - oneLine.getAdvance() - canvasInset_X ); @@ -992,9 +991,9 @@ /// Back up metrics and other drawing info before printing modifies it int backupDrawStart = drawStart, backupDrawEnd = drawEnd; int backupNumCharAcross = numCharAcross, backupNumCharDown = numCharDown; - Vector backupLineBreakTLs = null; + Vector<TextLayout> backupLineBreakTLs = null; if ( textToUse == FILE_TEXT ) - backupLineBreakTLs = (Vector) lineBreakTLs.clone(); + backupLineBreakTLs = new Vector<>(lineBreakTLs); printPageNumber = pageIndex; isPrinting = true; @@ -1137,7 +1136,7 @@ zoomAreaWidth / 2, (int) ( maxAscent * ZOOM )); g2.dispose(); if ( !nowZooming ) - zoomWindow.show(); + zoomWindow.setVisible(true); /// This is sort of redundant... since there is a paint function /// inside zoomWindow definition that does the drawImage. /// (I should be able to call just repaint() here) @@ -1176,7 +1175,7 @@ public void mouseReleased( MouseEvent e ) { if ( textToUse == RANGE_TEXT || textToUse == ALL_GLYPHS ) { if ( nowZooming ) - zoomWindow.hide(); + zoomWindow.setVisible(false); nowZooming = false; } this.setCursor( Cursor.getDefaultCursor() ); @@ -1246,7 +1245,7 @@ } public static Object getValue(int ordinal) { if (valArray == null) { - valArray = (FMValues[])EnumSet.allOf(FMValues.class).toArray(new FMValues[0]); + valArray = FMValues.values(); } for (int i=0;i<valArray.length;i++) { if (valArray[i].ordinal() == ordinal) { @@ -1257,7 +1256,7 @@ } private static FMValues[] getArray() { if (valArray == null) { - valArray = (FMValues[])EnumSet.allOf(FMValues.class).toArray(new FMValues[0]); + valArray = FMValues.values(); } return valArray; } @@ -1308,7 +1307,7 @@ public static Object getValue(int ordinal) { if (valArray == null) { - valArray = (AAValues[])EnumSet.allOf(AAValues.class).toArray(new AAValues[0]); + valArray = AAValues.values(); } for (int i=0;i<valArray.length;i++) { if (valArray[i].ordinal() == ordinal) { @@ -1320,8 +1319,7 @@ private static AAValues[] getArray() { if (valArray == null) { - Object [] oa = EnumSet.allOf(AAValues.class).toArray(new AAValues[0]); - valArray = (AAValues[])(EnumSet.allOf(AAValues.class).toArray(new AAValues[0])); + valArray = AAValues.values(); } return valArray; }
--- a/src/demo/share/jfc/Font2DTest/RangeMenu.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/Font2DTest/RangeMenu.java Wed Mar 25 21:31:09 2020 -0400 @@ -62,7 +62,7 @@ /// Custom made choice menu that holds data for unicode range -public final class RangeMenu extends JComboBox implements ActionListener { +public final class RangeMenu extends JComboBox<String> implements ActionListener { private static final int[][] UNICODE_RANGES = getUnicodeRanges(); private static final String[] UNICODE_RANGE_NAMES = getUnicodeRangeNames(); @@ -181,12 +181,12 @@ Object source = e.getSource(); if ( source instanceof JComboBox ) { - String rangeName = (String)((JComboBox)source).getSelectedItem(); + String rangeName = (String)((JComboBox<?>)source).getSelectedItem(); if ( rangeName.equals("Custom...") ) { useCustomRange = true; customRangeDialog.setLocationRelativeTo(parent); - customRangeDialog.show(); + customRangeDialog.setVisible(true); } else { useCustomRange = false; @@ -195,7 +195,7 @@ } else if ( source instanceof JButton ) { /// Since it is only "OK" button that sends any action here... - customRangeDialog.hide(); + customRangeDialog.setVisible(false); } }
--- a/src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java Wed Mar 25 21:31:09 2020 -0400 @@ -64,7 +64,7 @@ try { if (obj instanceof String) { className = (String) obj; - obj = Class.forName(className).newInstance(); + obj = Class.forName(className).getDeclaredConstructor().newInstance(); } if (obj instanceof Component) { add((Component) obj);
--- a/src/demo/share/jfc/J2Ddemo/java2d/GlobalControls.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/GlobalControls.java Wed Mar 25 21:31:09 2020 -0400 @@ -63,7 +63,7 @@ "USHORT_x555_RGB", "BYTE_GRAY", "USHORT_GRAY", "BYTE_BINARY", "BYTE_INDEXED", "BYTE_BINARY 2 bit", "BYTE_BINARY 4 bit", "INT_RGBx", "USHORT_555x_RGB" }; - public final JComboBox screenCombo; + public final JComboBox<String> screenCombo; public TextureChooser texturechooser; public JCheckBox aliasCB, renderCB, toolBarCB; public JCheckBox compositeCB, textureCB; @@ -83,7 +83,7 @@ textureCB = createCheckBox("Texture", false, 2); compositeCB = createCheckBox("AlphaComposite", false, 3); - screenCombo = new JComboBox(); + screenCombo = new JComboBox<>(); screenCombo.setPreferredSize(new Dimension(120, 18)); screenCombo.setLightWeightPopupEnabled(true); screenCombo.setFont(font);
--- a/src/demo/share/jfc/J2Ddemo/java2d/Tools.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/Tools.java Wed Mar 25 21:31:09 2020 -0400 @@ -94,7 +94,7 @@ protected boolean focus; public JToggleButton toggleB; public JButton printB; - public JComboBox screenCombo; + public JComboBox<String> screenCombo; public JToggleButton renderB, aliasB; public JToggleButton textureB, compositeB; public JButton startStopB; @@ -167,7 +167,7 @@ toolbar.setPreferredSize(new Dimension(6*25, 26)); } - screenCombo = new JComboBox(); + screenCombo = new JComboBox<>(); screenCombo.setPreferredSize(new Dimension(100, 18)); screenCombo.setFont(font); for (String name : GlobalControls.screenNames) {
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Clipping/Areas.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Clipping/Areas.java Wed Mar 25 21:31:09 2020 -0400 @@ -151,7 +151,6 @@ Areas demo; JToolBar toolbar; - JComboBox combo; public DemoControls(Areas demo) { super(demo.name);
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Fonts/Tree.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Fonts/Tree.java Wed Mar 25 21:31:09 2020 -0400 @@ -51,8 +51,8 @@ public class Tree extends AnimatingSurface { private char theC = 'A'; - private Character theT = new Character(theC); - private Character theR = new Character((char) (theC + 1)); + private Character theT = Character.valueOf(theC); + private Character theR = Character.valueOf((char) (theC + 1)); public Tree() { setBackground(WHITE); @@ -65,9 +65,9 @@ @Override public void step(int w, int h) { setSleepAmount(4000); - theT = new Character(theC = ((char) (theC + 1))); - theR = new Character((char) (theC + 1)); - if (theR.compareTo(new Character('z')) == 0) { + theT = Character.valueOf(theC = ((char) (theC + 1))); + theR = Character.valueOf((char) (theC + 1)); + if (theR.compareTo(Character.valueOf('z')) == 0) { theC = 'A'; } }
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Images/ImageOps.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Images/ImageOps.java Wed Mar 25 21:31:09 2020 -0400 @@ -188,20 +188,20 @@ static class DemoControls extends CustomControls implements ActionListener { ImageOps demo; - JComboBox imgCombo, opsCombo; + JComboBox<String> imgCombo, opsCombo; Font font = new Font(Font.SERIF, Font.PLAIN, 10); @SuppressWarnings("LeakingThisInConstructor") public DemoControls(ImageOps demo) { super(demo.name); this.demo = demo; - add(imgCombo = new JComboBox()); + add(imgCombo = new JComboBox<>()); imgCombo.setFont(font); for (String name : ImageOps.imgName) { imgCombo.addItem(name); } imgCombo.addActionListener(this); - add(opsCombo = new JComboBox()); + add(opsCombo = new JComboBox<>()); opsCombo.setFont(font); for (String name : ImageOps.opsName) { opsCombo.addItem(name);
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/Balls.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/Balls.java Wed Mar 25 21:31:09 2020 -0400 @@ -71,7 +71,7 @@ private boolean active; protected Ball[] balls = new Ball[colors.length]; protected boolean clearToggle; - protected JComboBox combo; + protected JComboBox<String> combo; public Balls() { setBackground(WHITE); @@ -279,7 +279,7 @@ addTool("B", demo.balls[4].isSelected); addTool("I", demo.balls[5].isSelected); addTool("V", demo.balls[6].isSelected); - add(combo = new JComboBox()); + add(combo = new JComboBox<>()); combo.addItem("10"); combo.addItem("20"); combo.addItem("30");
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/BezierScroller.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/BezierScroller.java Wed Mar 25 21:31:09 2020 -0400 @@ -60,7 +60,6 @@ import java2d.AnimatingControlsSurface; import java2d.CustomControls; import javax.swing.AbstractButton; -import javax.swing.JComboBox; import javax.swing.JToggleButton; import javax.swing.JToolBar; @@ -320,7 +319,6 @@ BezierScroller demo; JToolBar toolbar; - JComboBox combo; public DemoControls(BezierScroller demo) { super(demo.name);
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/GradAnim.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/GradAnim.java Wed Mar 25 21:31:09 2020 -0400 @@ -266,13 +266,13 @@ class DemoControls extends CustomControls implements ActionListener { GradAnim demo; - JComboBox combo; + JComboBox<String> combo; @SuppressWarnings("LeakingThisInConstructor") public DemoControls(GradAnim demo) { super(demo.name); this.demo = demo; - combo = new JComboBox(); + combo = new JComboBox<>(); combo.addActionListener(this); combo.addItem("2-color GradientPaint"); combo.addItem("3-color LinearGradientPaint");
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/TextureAnim.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/TextureAnim.java Wed Mar 25 21:31:09 2020 -0400 @@ -299,7 +299,7 @@ TextureAnim demo; JToolBar toolbar; - JComboBox combo; + JComboBox<String> combo; JMenu menu; JMenuItem[] menuitems; int iconSize = 20; @@ -318,7 +318,7 @@ addTool("RO", "rotate", false); addTool("SX", "shear x", false); addTool("SY", "shear y", false); - add(combo = new JComboBox()); + add(combo = new JComboBox<>()); combo.addActionListener(this); combo.addItem("8"); combo.addItem("16");
--- a/src/demo/share/jfc/Metalworks/MetalworksPrefs.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/Metalworks/MetalworksPrefs.java Wed Mar 25 21:31:09 2020 -0400 @@ -162,7 +162,7 @@ JPanel protoPanel = new JPanel(); JLabel protoLabel = new JLabel("Protocol"); - JComboBox protocol = new JComboBox(); + JComboBox<String> protocol = new JComboBox<>(); protocol.addItem("SMTP"); protocol.addItem("IMAP"); protocol.addItem("Other..."); @@ -171,7 +171,7 @@ JPanel attachmentPanel = new JPanel(); JLabel attachmentLabel = new JLabel("Attachments"); - JComboBox attach = new JComboBox(); + JComboBox<String> attach = new JComboBox<>(); attach.addItem("Download Always"); attach.addItem("Ask size > 1 Meg"); attach.addItem("Ask size > 5 Meg");
--- a/src/demo/share/jfc/Notepad/ElementTreePanel.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/Notepad/ElementTreePanel.java Wed Mar 25 21:31:09 2020 -0400 @@ -115,7 +115,7 @@ if (as != null) { StringBuilder retBuffer = new StringBuilder("["); - Enumeration names = as.getAttributeNames(); + Enumeration<?> names = as.getAttributeNames(); while (names.hasMoreElements()) { Object nextName = names.nextElement();
--- a/src/demo/share/jfc/Stylepad/Stylepad.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/Stylepad/Stylepad.java Wed Mar 25 21:31:09 2020 -0400 @@ -255,8 +255,8 @@ w.loadDocument(); } - JComboBox createFamilyChoices() { - JComboBox b = new JComboBox(); + JComboBox<String> createFamilyChoices() { + JComboBox<String> b = new JComboBox<>(); String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment(). getAvailableFontFamilyNames(); for (String fontName : fontNames) {
--- a/src/demo/share/jfc/SwingSet2/ButtonDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/ButtonDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -61,12 +61,12 @@ JPanel radioButtonPanel = new JPanel(); JPanel toggleButtonPanel = new JPanel(); - Vector buttons = new Vector(); - Vector checkboxes = new Vector(); - Vector radiobuttons = new Vector(); - Vector togglebuttons = new Vector(); + Vector<Component> buttons = new Vector<>(); + Vector<Component> checkboxes = new Vector<>(); + Vector<Component> radiobuttons = new Vector<>(); + Vector<Component> togglebuttons = new Vector<>(); - Vector currentControls = buttons; + Vector<Component> currentControls = buttons; JButton button; JCheckBox check; @@ -466,12 +466,12 @@ String command = cb.getActionCommand(); if(command == "Enabled") { for(int i = 0; i < currentControls.size(); i++) { - c = (Component) currentControls.elementAt(i); + c = currentControls.elementAt(i); c.setEnabled(cb.isSelected()); c.invalidate(); } } else if(command == "PaintBorder") { - c = (Component) currentControls.elementAt(0); + c = currentControls.elementAt(0); if(c instanceof AbstractButton) { for(int i = 0; i < currentControls.size(); i++) { b = (AbstractButton) currentControls.elementAt(i); @@ -480,7 +480,7 @@ } } } else if(command == "PaintFocus") { - c = (Component) currentControls.elementAt(0); + c = currentControls.elementAt(0); if(c instanceof AbstractButton) { for(int i = 0; i < currentControls.size(); i++) { b = (AbstractButton) currentControls.elementAt(i); @@ -489,7 +489,7 @@ } } } else if(command == "ContentFilled") { - c = (Component) currentControls.elementAt(0); + c = currentControls.elementAt(0); if(c instanceof AbstractButton) { for(int i = 0; i < currentControls.size(); i++) { b = (AbstractButton) currentControls.elementAt(i); @@ -549,7 +549,7 @@ } } - public Vector getCurrentControls() { + public Vector<Component> getCurrentControls() { return currentControls; } }
--- a/src/demo/share/jfc/SwingSet2/ColorChooserDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/ColorChooserDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -128,7 +128,7 @@ okListener, null); - dialog.show(); + dialog.setVisible(true); if(e.getSource() == outerColorButton) { bezAnim.setOuterColor(chosen);
--- a/src/demo/share/jfc/SwingSet2/ComboBoxDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/ComboBoxDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -57,13 +57,13 @@ Face face; JLabel faceLabel; - JComboBox hairCB; - JComboBox eyesCB; - JComboBox mouthCB; + JComboBox<?> hairCB; + JComboBox<?> eyesCB; + JComboBox<?> mouthCB; - JComboBox presetCB; + JComboBox<?> presetCB; - Hashtable parts = new Hashtable(); + Hashtable<String, Object> parts = new Hashtable<>(); /** * main method allows us to run as a standalone demo. @@ -111,28 +111,31 @@ JLabel l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.presets"))); l.setAlignmentX(JLabel.LEFT_ALIGNMENT); - presetCB = (JComboBox) comboBoxPanel.add(createPresetComboBox()); + presetCB = createPresetComboBox(); presetCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT); l.setLabelFor(presetCB); + comboBoxPanel.add(presetCB); comboBoxPanel.add(Box.createRigidArea(VGAP30)); l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.hair_description"))); l.setAlignmentX(JLabel.LEFT_ALIGNMENT); - hairCB = (JComboBox) comboBoxPanel.add(createHairComboBox()); + hairCB = createHairComboBox(); hairCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT); l.setLabelFor(hairCB); + comboBoxPanel.add(hairCB); comboBoxPanel.add(Box.createRigidArea(VGAP15)); l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.eyes_description"))); l.setAlignmentX(JLabel.LEFT_ALIGNMENT); - eyesCB = (JComboBox) comboBoxPanel.add(createEyesComboBox()); + eyesCB = createEyesComboBox(); eyesCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT); l.setLabelFor(eyesCB); + comboBoxPanel.add(eyesCB); comboBoxPanel.add(Box.createRigidArea(VGAP15)); l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.mouth_description"))); l.setAlignmentX(JLabel.LEFT_ALIGNMENT); - mouthCB = (JComboBox) comboBoxPanel.add(createMouthComboBox()); + mouthCB = (JComboBox<?>) comboBoxPanel.add(createMouthComboBox()); mouthCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT); l.setLabelFor(mouthCB); comboBoxPanel.add(Box.createRigidArea(VGAP15)); @@ -217,36 +220,36 @@ return face; } - JComboBox createHairComboBox() { - JComboBox cb = new JComboBox(); + JComboBox<String> createHairComboBox() { + JComboBox<String> cb = new JComboBox<>(); fillComboBox(cb); cb.addActionListener(this); return cb; } - JComboBox createEyesComboBox() { - JComboBox cb = new JComboBox(); + JComboBox<String> createEyesComboBox() { + JComboBox<String> cb = new JComboBox<>(); fillComboBox(cb); cb.addActionListener(this); return cb; } - JComboBox createNoseComboBox() { - JComboBox cb = new JComboBox(); + JComboBox<String> createNoseComboBox() { + JComboBox<String> cb = new JComboBox<>(); fillComboBox(cb); cb.addActionListener(this); return cb; } - JComboBox createMouthComboBox() { - JComboBox cb = new JComboBox(); + JComboBox<String> createMouthComboBox() { + JComboBox<String> cb = new JComboBox<>(); fillComboBox(cb); cb.addActionListener(this); return cb; } - JComboBox createPresetComboBox() { - JComboBox cb = new JComboBox(); + JComboBox<String> createPresetComboBox() { + JComboBox<String> cb = new JComboBox<>(); cb.addItem(getString("ComboBoxDemo.preset1")); cb.addItem(getString("ComboBoxDemo.preset2")); cb.addItem(getString("ComboBoxDemo.preset3")); @@ -261,7 +264,7 @@ return cb; } - void fillComboBox(JComboBox cb) { + void fillComboBox(JComboBox<String> cb) { cb.addItem(getString("ComboBoxDemo.brent")); cb.addItem(getString("ComboBoxDemo.georges")); cb.addItem(getString("ComboBoxDemo.hans")); @@ -279,15 +282,15 @@ public void actionPerformed(ActionEvent e) { if(e.getSource() == hairCB) { - String name = (String) parts.get((String) hairCB.getSelectedItem()); + String name = (String) parts.get(hairCB.getSelectedItem()); face.setHair((ImageIcon) parts.get(name + "hair")); faceLabel.repaint(); } else if(e.getSource() == eyesCB) { - String name = (String) parts.get((String) eyesCB.getSelectedItem()); + String name = (String) parts.get(eyesCB.getSelectedItem()); face.setEyes((ImageIcon) parts.get(name + "eyes")); faceLabel.repaint(); } else if(e.getSource() == mouthCB) { - String name = (String) parts.get((String) mouthCB.getSelectedItem()); + String name = (String) parts.get(mouthCB.getSelectedItem()); face.setMouth((ImageIcon) parts.get(name + "mouth")); faceLabel.repaint(); } else if(e.getSource() == presetCB) {
--- a/src/demo/share/jfc/SwingSet2/DemoModule.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/DemoModule.java Wed Mar 25 21:31:09 2020 -0400 @@ -51,7 +51,7 @@ * * @author Jeff Dinkins */ -public class DemoModule extends JApplet { +public class DemoModule extends JFrame { // The preferred size of the demo private int PREFERRED_WIDTH = 680; @@ -190,7 +190,7 @@ frame.getContentPane().add(getDemoPanel(), BorderLayout.CENTER); getDemoPanel().setPreferredSize(new Dimension(PREFERRED_WIDTH, PREFERRED_HEIGHT)); frame.pack(); - frame.show(); + frame.setVisible(true); } public JPanel createHorizontalPanel(boolean threeD) {
--- a/src/demo/share/jfc/SwingSet2/DirectionPanel.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/DirectionPanel.java Wed Mar 25 21:31:09 2020 -0400 @@ -92,9 +92,9 @@ } public void setSelection( String selection ) { - Enumeration e = group.getElements(); + Enumeration<AbstractButton> e = group.getElements(); while( e.hasMoreElements() ) { - JRadioButton b = (JRadioButton)e.nextElement(); + AbstractButton b = e.nextElement(); if( b.getActionCommand().equals(selection) ) { b.setSelected(true); } @@ -147,10 +147,7 @@ getAccessibleContext().setAccessibleName(direction); getAccessibleContext().setAccessibleDescription(description); setSelected(selected); - } - - public boolean isFocusTraversable() { - return false; + setFocusable(false); } public void setBorder(Border b) {
--- a/src/demo/share/jfc/SwingSet2/ExampleFileView.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/ExampleFileView.java Wed Mar 25 21:31:09 2020 -0400 @@ -59,9 +59,9 @@ * @author Jeff Dinkins */ public class ExampleFileView extends FileView { - private Hashtable icons = new Hashtable(5); - private Hashtable fileDescriptions = new Hashtable(5); - private Hashtable typeDescriptions = new Hashtable(5); + private Hashtable<String, Icon> icons = new Hashtable<>(5); + private Hashtable<File, String> fileDescriptions = new Hashtable<>(5); + private Hashtable<String, String> typeDescriptions = new Hashtable<>(5); /** * The name of the file. Do nothing special here. Let @@ -85,7 +85,7 @@ * @see FileView#getDescription */ public String getDescription(File f) { - return (String) fileDescriptions.get(f); + return fileDescriptions.get(f); }; /** @@ -111,7 +111,7 @@ * @see FileView#getTypeDescription */ public String getTypeDescription(File f) { - return (String) typeDescriptions.get(getExtension(f)); + return typeDescriptions.get(getExtension(f)); } /** @@ -149,7 +149,7 @@ Icon icon = null; String extension = getExtension(f); if(extension != null) { - icon = (Icon) icons.get(extension); + icon = icons.get(extension); } return icon; }
--- a/src/demo/share/jfc/SwingSet2/FileChooserDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/FileChooserDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -273,7 +273,7 @@ dialog.getContentPane().add(custom, BorderLayout.CENTER); dialog.pack(); dialog.setLocationRelativeTo(getDemoPanel()); - dialog.show(); + dialog.setVisible(true); } }; return createButton(a);
--- a/src/demo/share/jfc/SwingSet2/InternalFrameDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/InternalFrameDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -59,9 +59,9 @@ ImageIcon icon1, icon2, icon3, icon4; ImageIcon smIcon1, smIcon2, smIcon3, smIcon4; - public Integer FIRST_FRAME_LAYER = new Integer(1); - public Integer DEMO_FRAME_LAYER = new Integer(2); - public Integer PALETTE_LAYER = new Integer(3); + public Integer FIRST_FRAME_LAYER = Integer.valueOf(1); + public Integer DEMO_FRAME_LAYER = Integer.valueOf(2); + public Integer PALETTE_LAYER = Integer.valueOf(3); public int FRAME0_X = 15; public int FRAME0_Y = 280;
--- a/src/demo/share/jfc/SwingSet2/LayoutControlPanel.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/LayoutControlPanel.java Wed Mar 25 21:31:09 2020 -0400 @@ -104,7 +104,7 @@ // Make sure the controls' text position and label alignment match // the initial value of the associated direction panel. for(int i = 0; i < demo.getCurrentControls().size(); i++) { - Component c = (Component) demo.getCurrentControls().elementAt(i); + Component c = demo.getCurrentControls().elementAt(i); setPosition(c, RIGHT, CENTER); setAlignment(c,CENTER,CENTER); } @@ -173,7 +173,7 @@ } for(int i = 0; i < demo.getCurrentControls().size(); i++) { - Component c = (Component) demo.getCurrentControls().elementAt(i); + Component c = demo.getCurrentControls().elementAt(i); int hPos, vPos, hAlign, vAlign; if( c instanceof AbstractButton ) { hPos = ((AbstractButton)c).getHorizontalTextPosition(); @@ -228,7 +228,7 @@ hPos = RIGHT; vPos = BOTTOM; } for(int i = 0; i < demo.getCurrentControls().size(); i++) { - Component c = (Component) demo.getCurrentControls().elementAt(i); + Component c = demo.getCurrentControls().elementAt(i); setPosition(c, hPos, vPos); } demo.invalidate(); @@ -267,7 +267,7 @@ hPos = RIGHT; vPos = BOTTOM; } for(int i = 0; i < demo.getCurrentControls().size(); i++) { - Component c = (Component) demo.getCurrentControls().elementAt(i); + Component c = demo.getCurrentControls().elementAt(i); setAlignment(c,hPos,vPos); c.invalidate(); }
--- a/src/demo/share/jfc/SwingSet2/ListDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/ListDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -59,7 +59,7 @@ * @author Jeff Dinkins */ public class ListDemo extends DemoModule { - JList list; + JList<String> list; JPanel prefixList; JPanel suffixList; @@ -69,7 +69,7 @@ GeneratedListModel listModel; - Vector checkboxes = new Vector(); + Vector<JCheckBox> checkboxes = new Vector<>(); /** * main method allows us to run as a standalone demo. @@ -103,7 +103,7 @@ centerPanel.add(Box.createRigidArea(HGAP30)); // Create the list - list = new JList(); + list = new JList<>(); list.setCellRenderer(new CompanyLogoListCellRenderer()); listModel = new GeneratedListModel(this); list.setModel(listModel); @@ -293,12 +293,12 @@ } - class GeneratedListModel extends AbstractListModel { + class GeneratedListModel extends AbstractListModel<String> { ListDemo demo; Permuter permuter; - public Vector prefix = new Vector(); - public Vector suffix = new Vector(); + public Vector<String> prefix = new Vector<>(); + public Vector<String> suffix = new Vector<>(); public GeneratedListModel (ListDemo demo) { this.demo = demo; @@ -337,7 +337,7 @@ return prefix.size() * suffix.size(); } - public Object getElementAt(int index) { + public String getElementAt(int index) { if(permuter == null) { update(); } @@ -363,7 +363,7 @@ class CompanyLogoListCellRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent( - JList list, + JList<?> list, Object value, int index, boolean isSelected,
--- a/src/demo/share/jfc/SwingSet2/OptionPaneDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/OptionPaneDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -163,7 +163,7 @@ message[0] = getString("OptionPaneDemo.componentmessage"); message[1] = new JTextField(getString("OptionPaneDemo.componenttextfield")); - JComboBox cb = new JComboBox(); + JComboBox<String> cb = new JComboBox<>(); cb.addItem(getString("OptionPaneDemo.component_cb1")); cb.addItem(getString("OptionPaneDemo.component_cb2")); cb.addItem(getString("OptionPaneDemo.component_cb3"));
--- a/src/demo/share/jfc/SwingSet2/SliderDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/SliderDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -164,7 +164,9 @@ s.setPaintLabels( true ); s.setSnapToTicks( true ); - s.getLabelTable().put(new Integer(11), new JLabel(new Integer(11).toString(), JLabel.CENTER)); + @SuppressWarnings("unchecked") + Dictionary<Object, Object> labelTable = s.getLabelTable(); + labelTable.put(Integer.valueOf(11), new JLabel(Integer.valueOf(11).toString(), JLabel.CENTER)); s.setLabelTable( s.getLabelTable() ); s.getAccessibleContext().setAccessibleName(getString("SliderDemo.minorticks"));
--- a/src/demo/share/jfc/SwingSet2/SplitPaneDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/SplitPaneDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -165,7 +165,7 @@ JLabel label; divSize = new JTextField(); - divSize.setText(new Integer(splitPane.getDividerSize()).toString()); + divSize.setText(Integer.toString(splitPane.getDividerSize())); divSize.setColumns(5); divSize.getAccessibleContext().setAccessibleName(getString("SplitPaneDemo.divider_size")); divSize.addActionListener(new ActionListener() {
--- a/src/demo/share/jfc/SwingSet2/SwingSet2.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/SwingSet2.java Wed Mar 25 21:31:09 2020 -0400 @@ -71,12 +71,7 @@ void loadDemos() { for(int i = 0; i < demos.length;) { - if(isApplet() && demos[i].equals("FileChooserDemo")) { - // don't load the file chooser demo if we are - // an applet - } else { - loadDemo(demos[i]); - } + loadDemo(demos[i]); i++; } } @@ -126,9 +121,6 @@ // Used only if swingset is an application private JFrame frame = null; - // Used only if swingset is an applet - private SwingSet2Applet applet = null; - // To debug or not to debug, that is the question private boolean DEBUG = true; private int debugCounter = 0; @@ -151,27 +143,21 @@ private boolean dragEnabled = false; - public SwingSet2(SwingSet2Applet applet) { - this(applet, null); + public SwingSet2() { + this(null); } /** * SwingSet2 Constructor */ - public SwingSet2(SwingSet2Applet applet, GraphicsConfiguration gc) { - - // Note that applet may be null if this is started as an application - this.applet = applet; - + public SwingSet2(GraphicsConfiguration gc) { String lafClassName = UIManager.getLookAndFeel().getClass().getName(); lookAndFeelData = getInstalledLookAndFeelData(); currentLookAndFeel = Arrays.stream(lookAndFeelData) .filter(laf -> lafClassName.equals(laf.className)) .findFirst().get(); - if (!isApplet()) { - frame = createFrame(gc); - } + frame = createFrame(gc); // set the layout setLayout(new BorderLayout()); @@ -198,7 +184,7 @@ SwingUtilities.invokeLater(() -> { // Create SwingSet on the default monitor UIManager.put("swing.boldMetal", Boolean.FALSE); - SwingSet2 swingset = new SwingSet2(null, GraphicsEnvironment. + SwingSet2 swingset = new SwingSet2(GraphicsEnvironment. getLocalGraphicsEnvironment(). getDefaultScreenDevice(). getDefaultConfiguration()); @@ -218,11 +204,7 @@ menuBar = createMenus(); - if (isApplet()) { - applet.setJMenuBar(menuBar); - } else { frame.setJMenuBar(menuBar); - } // creates popup menu accessible via keyboard popupMenu = createPopupMenu(); @@ -309,13 +291,11 @@ "FileMenu.save_as_accessible_description", null); - if(!isApplet()) { - fileMenu.addSeparator(); + fileMenu.addSeparator(); - createMenuItem(fileMenu, "FileMenu.exit_label", "FileMenu.exit_mnemonic", - "FileMenu.exit_accessible_description", new ExitAction(this) - ); - } + createMenuItem(fileMenu, "FileMenu.exit_label", "FileMenu.exit_mnemonic", + "FileMenu.exit_accessible_description", new ExitAction(this) + ); // Create these menu items for the first SwingSet only. if (numSSs == 0) { @@ -431,7 +411,6 @@ // ***** create the multiscreen menu, if we have multiple screens - if (!isApplet()) { GraphicsDevice[] screens = GraphicsEnvironment. getLocalGraphicsEnvironment(). getScreenDevices(); @@ -449,7 +428,6 @@ createMultiscreenMenuItem(multiScreenMenu, i); } } - } return menuBar; } @@ -578,7 +556,7 @@ // register key binding to activate popup menu InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); - map.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, InputEvent.SHIFT_MASK), + map.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, InputEvent.SHIFT_DOWN_MASK), "postMenuAction"); map.put(KeyStroke.getKeyStroke(KeyEvent.VK_CONTEXT_MENU, 0), "postMenuAction"); getActionMap().put("postMenuAction", new ActivatePopupMenuAction(this, popup)); @@ -659,37 +637,34 @@ /** - * Bring up the SwingSet2 demo by showing the frame (only - * applicable if coming up as an application, not an applet); + * Bring up the SwingSet2 demo by showing the frame */ public void showSwingSet2() { - if(!isApplet() && getFrame() != null) { - // put swingset in a frame and show it - JFrame f = getFrame(); - f.setTitle(getString("Frame.title")); - f.getContentPane().add(this, BorderLayout.CENTER); - f.pack(); + // put swingset in a frame and show it + JFrame f = getFrame(); + f.setTitle(getString("Frame.title")); + f.getContentPane().add(this, BorderLayout.CENTER); + f.pack(); - Rectangle screenRect = f.getGraphicsConfiguration().getBounds(); - Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets( - f.getGraphicsConfiguration()); + Rectangle screenRect = f.getGraphicsConfiguration().getBounds(); + Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets( + f.getGraphicsConfiguration()); - // Make sure we don't place the demo off the screen. - int centerWidth = screenRect.width < f.getSize().width ? - screenRect.x : - screenRect.x + screenRect.width/2 - f.getSize().width/2; - int centerHeight = screenRect.height < f.getSize().height ? - screenRect.y : - screenRect.y + screenRect.height/2 - f.getSize().height/2; + // Make sure we don't place the demo off the screen. + int centerWidth = screenRect.width < f.getSize().width ? + screenRect.x : + screenRect.x + screenRect.width/2 - f.getSize().width/2; + int centerHeight = screenRect.height < f.getSize().height ? + screenRect.y : + screenRect.y + screenRect.height/2 - f.getSize().height/2; - centerHeight = centerHeight < screenInsets.top ? - screenInsets.top : centerHeight; + centerHeight = centerHeight < screenInsets.top ? + screenInsets.top : centerHeight; - f.setLocation(centerWidth, centerHeight); - f.show(); - numSSs++; - swingSets.add(this); - } + f.setLocation(centerWidth, centerHeight); + f.setVisible(true); + numSSs++; + swingSets.add(this); } // ******************************************************* @@ -703,8 +678,8 @@ setStatus(getString("Status.loading") + getString(classname + ".name")); DemoModule demo = null; try { - Class demoClass = Class.forName(classname); - Constructor demoConstructor = demoClass.getConstructor(new Class[]{SwingSet2.class}); + Class<?> demoClass = Class.forName(classname); + Constructor<?> demoConstructor = demoClass.getConstructor(new Class[]{SwingSet2.class}); demo = (DemoModule) demoConstructor.newInstance(new Object[]{this}); addDemo(demo); } catch (Exception e) { @@ -713,21 +688,6 @@ } /** - * Determines if this is an applet or application - */ - public boolean isApplet() { - return (applet != null); - } - - /** - * Returns the applet instance - */ - public SwingSet2Applet getApplet() { - return applet; - } - - - /** * Returns the frame instance */ public JFrame getFrame() { @@ -763,8 +723,6 @@ if(contentPane == null) { if(getFrame() != null) { contentPane = getFrame().getContentPane(); - } else if (getApplet() != null) { - contentPane = getApplet().getContentPane(); } } return contentPane; @@ -886,15 +844,11 @@ } private void updateThisSwingSet() { - if (isApplet()) { - SwingUtilities.updateComponentTreeUI(getApplet()); + JFrame frame = getFrame(); + if (frame == null) { + SwingUtilities.updateComponentTreeUI(this); } else { - JFrame frame = getFrame(); - if (frame == null) { - SwingUtilities.updateComponentTreeUI(this); - } else { - SwingUtilities.updateComponentTreeUI(frame); - } + SwingUtilities.updateComponentTreeUI(frame); } SwingUtilities.updateComponentTreeUI(popupMenu); @@ -909,12 +863,8 @@ public void updateLookAndFeel() { try { UIManager.setLookAndFeel(currentLookAndFeel.className); - if (isApplet()) { - updateThisSwingSet(); - } else { - for (SwingSet2 ss : swingSets) { - ss.updateThisSwingSet(); - } + for (SwingSet2 ss : swingSets) { + ss.updateThisSwingSet(); } } catch (Exception ex) { System.out.println("Failed loading L&F: " + currentLookAndFeel); @@ -1142,12 +1092,8 @@ public void actionPerformed(ActionEvent e) { boolean dragEnabled = ((JCheckBoxMenuItem)e.getSource()).isSelected(); - if (isApplet()) { - setDragEnabled(dragEnabled); - } else { - for (SwingSet2 ss : swingSets) { - ss.setDragEnabled(dragEnabled); - } + for (SwingSet2 ss : swingSets) { + ss.setDragEnabled(dragEnabled); } } } @@ -1208,12 +1154,8 @@ button.addActionListener(new OkAction(aboutBox)); } aboutBox.pack(); - if (isApplet()) { - aboutBox.setLocationRelativeTo(getApplet()); - } else { - aboutBox.setLocationRelativeTo(getFrame()); - } - aboutBox.show(); + aboutBox.setLocationRelativeTo(getFrame()); + aboutBox.setVisible(true); } } @@ -1231,13 +1173,13 @@ getScreenDevices(); if (screen == ALL_SCREENS) { for (int i = 0; i < gds.length; i++) { - SwingSet2 swingset = new SwingSet2(null, + SwingSet2 swingset = new SwingSet2( gds[i].getDefaultConfiguration()); swingset.setDragEnabled(dragEnabled); } } else { - SwingSet2 swingset = new SwingSet2(null, + SwingSet2 swingset = new SwingSet2( gds[screen].getDefaultConfiguration()); swingset.setDragEnabled(dragEnabled); }
--- a/src/demo/share/jfc/SwingSet2/SwingSet2Applet.java Tue Mar 24 14:50:32 2020 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* - * - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Oracle nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.text.*; -import javax.swing.border.*; -import javax.swing.colorchooser.*; -import javax.swing.filechooser.*; -import javax.accessibility.*; - -import java.awt.*; -import java.awt.event.*; -import java.beans.*; -import java.util.*; -import java.io.*; -import java.applet.*; -import java.net.*; - -/** - * - * - * @author Jeff Dinkins - */ - -public class SwingSet2Applet extends JApplet { - public void init() { - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(new SwingSet2(this), BorderLayout.CENTER); - } - - public URL getURL(String filename) { - URL codeBase = this.getCodeBase(); - URL url = null; - - try { - url = new URL(codeBase, filename); - System.out.println(url); - } catch (java.net.MalformedURLException e) { - System.out.println("Error: badly specified URL"); - return null; - } - - return url; - } - - -}
--- a/src/demo/share/jfc/SwingSet2/TableDemo.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/SwingSet2/TableDemo.java Wed Mar 25 21:31:09 2020 -0400 @@ -75,8 +75,8 @@ JSlider interCellSpacingSlider; JSlider rowHeightSlider; - JComboBox selectionModeComboBox = null; - JComboBox resizeModeComboBox = null; + JComboBox<String> selectionModeComboBox = null; + JComboBox<String> resizeModeComboBox = null; JLabel headerLabel; JLabel footerLabel; @@ -126,7 +126,7 @@ JPanel printPanel = new JPanel(new ColumnLayout()); getDemoPanel().add(controlPanel, BorderLayout.NORTH); - Vector relatedComponents = new Vector(); + Vector<JComponent> relatedComponents = new Vector<>(); // check box panel @@ -245,7 +245,7 @@ selectMode.setBorder(new TitledBorder(getString("TableDemo.selection_mode"))); - selectionModeComboBox = new JComboBox() { + selectionModeComboBox = new JComboBox<>() { public Dimension getMaximumSize() { return getPreferredSize(); } @@ -256,7 +256,7 @@ selectionModeComboBox.setSelectedIndex(tableView.getSelectionModel().getSelectionMode()); selectionModeComboBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - JComboBox source = (JComboBox)e.getSource(); + JComboBox<?> source = (JComboBox<?>)e.getSource(); tableView.setSelectionMode(source.getSelectedIndex()); } }); @@ -272,7 +272,7 @@ resizeMode.setBorder(new TitledBorder(getString("TableDemo.autoresize_mode"))); - resizeModeComboBox = new JComboBox() { + resizeModeComboBox = new JComboBox<>() { public Dimension getMaximumSize() { return getPreferredSize(); } @@ -285,7 +285,7 @@ resizeModeComboBox.setSelectedIndex(tableView.getAutoResizeMode()); resizeModeComboBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - JComboBox source = (JComboBox)e.getSource(); + JComboBox<?> source = (JComboBox<?>)e.getSource(); tableView.setAutoResizeMode(source.getSelectedIndex()); } }); @@ -367,7 +367,7 @@ * * @param components The list of objects that are related */ - void buildAccessibleGroup(Vector components) { + void buildAccessibleGroup(Vector<JComponent> components) { AccessibleContext context = null; int numComponents = components.size(); @@ -492,55 +492,55 @@ // Create the dummy data (a few rows of names) final Object[][] data = { - {"Mike", "Albers", green, getString("TableDemo.brazil"), new Double(44.0), strawberry}, - {"Mark", "Andrews", blue, getString("TableDemo.curse"), new Double(3), grapes}, - {"Brian", "Beck", black, getString("TableDemo.bluesbros"), new Double(2.7182818285), raspberry}, - {"Lara", "Bunni", red, getString("TableDemo.airplane"), new Double(15), strawberry}, - {"Roger", "Brinkley", blue, getString("TableDemo.man"), new Double(13), peach}, - {"Brent", "Christian", black, getString("TableDemo.bladerunner"), new Double(23), broccoli}, - {"Mark", "Davidson", darkgreen, getString("TableDemo.brazil"), new Double(27), asparagus}, - {"Jeff", "Dinkins", blue, getString("TableDemo.ladyvanishes"), new Double(8), kiwi}, - {"Ewan", "Dinkins", yellow, getString("TableDemo.bugs"), new Double(2), strawberry}, - {"Amy", "Fowler", violet, getString("TableDemo.reservoir"), new Double(3), raspberry}, - {"Hania", "Gajewska", purple, getString("TableDemo.jules"), new Double(5), raspberry}, - {"David", "Geary", blue, getString("TableDemo.pulpfiction"), new Double(3), watermelon}, -// {"James", "Gosling", pink, getString("TableDemo.tennis"), new Double(21), donut}, - {"Eric", "Hawkes", blue, getString("TableDemo.bladerunner"), new Double(.693), pickle}, - {"Shannon", "Hickey", green, getString("TableDemo.shawshank"), new Double(2), grapes}, - {"Earl", "Johnson", green, getString("TableDemo.pulpfiction"), new Double(8), carrot}, - {"Robi", "Khan", green, getString("TableDemo.goodfellas"), new Double(89), apple}, - {"Robert", "Kim", blue, getString("TableDemo.mohicans"), new Double(655321), strawberry}, - {"Janet", "Koenig", turquoise, getString("TableDemo.lonestar"), new Double(7), peach}, - {"Jeff", "Kesselman", blue, getString("TableDemo.stuntman"), new Double(17), pineapple}, - {"Onno", "Kluyt", orange, getString("TableDemo.oncewest"), new Double(8), broccoli}, - {"Peter", "Korn", sunpurple, getString("TableDemo.musicman"), new Double(12), sparegrass}, + {"Mike", "Albers", green, getString("TableDemo.brazil"), Double.valueOf(44.0), strawberry}, + {"Mark", "Andrews", blue, getString("TableDemo.curse"), Double.valueOf(3), grapes}, + {"Brian", "Beck", black, getString("TableDemo.bluesbros"), Double.valueOf(2.7182818285), raspberry}, + {"Lara", "Bunni", red, getString("TableDemo.airplane"), Double.valueOf(15), strawberry}, + {"Roger", "Brinkley", blue, getString("TableDemo.man"), Double.valueOf(13), peach}, + {"Brent", "Christian", black, getString("TableDemo.bladerunner"), Double.valueOf(23), broccoli}, + {"Mark", "Davidson", darkgreen, getString("TableDemo.brazil"), Double.valueOf(27), asparagus}, + {"Jeff", "Dinkins", blue, getString("TableDemo.ladyvanishes"), Double.valueOf(8), kiwi}, + {"Ewan", "Dinkins", yellow, getString("TableDemo.bugs"), Double.valueOf(2), strawberry}, + {"Amy", "Fowler", violet, getString("TableDemo.reservoir"), Double.valueOf(3), raspberry}, + {"Hania", "Gajewska", purple, getString("TableDemo.jules"), Double.valueOf(5), raspberry}, + {"David", "Geary", blue, getString("TableDemo.pulpfiction"), Double.valueOf(3), watermelon}, +// {"James", "Gosling", pink, getString("TableDemo.tennis"), Double.valueOf(21), donut}, + {"Eric", "Hawkes", blue, getString("TableDemo.bladerunner"), Double.valueOf(.693), pickle}, + {"Shannon", "Hickey", green, getString("TableDemo.shawshank"), Double.valueOf(2), grapes}, + {"Earl", "Johnson", green, getString("TableDemo.pulpfiction"), Double.valueOf(8), carrot}, + {"Robi", "Khan", green, getString("TableDemo.goodfellas"), Double.valueOf(89), apple}, + {"Robert", "Kim", blue, getString("TableDemo.mohicans"), Double.valueOf(655321), strawberry}, + {"Janet", "Koenig", turquoise, getString("TableDemo.lonestar"), Double.valueOf(7), peach}, + {"Jeff", "Kesselman", blue, getString("TableDemo.stuntman"), Double.valueOf(17), pineapple}, + {"Onno", "Kluyt", orange, getString("TableDemo.oncewest"), Double.valueOf(8), broccoli}, + {"Peter", "Korn", sunpurple, getString("TableDemo.musicman"), Double.valueOf(12), sparegrass}, - {"Rick", "Levenson", black, getString("TableDemo.harold"), new Double(1327), raspberry}, - {"Brian", "Lichtenwalter", jfcblue, getString("TableDemo.fifthelement"), new Double(22), pear}, - {"Malini", "Minasandram", beige, getString("TableDemo.joyluck"), new Double(9), corn}, - {"Michael", "Martak", green, getString("TableDemo.city"), new Double(3), strawberry}, - {"David", "Mendenhall", forestgreen, getString("TableDemo.schindlerslist"), new Double(7), peach}, - {"Phil", "Milne", suspectpink, getString("TableDemo.withnail"), new Double(3), banana}, - {"Lynn", "Monsanto", cybergreen, getString("TableDemo.dasboot"), new Double(52), peach}, - {"Hans", "Muller", rustred, getString("TableDemo.eraserhead"), new Double(0), pineapple}, - {"Joshua", "Outwater", blue, getString("TableDemo.labyrinth"), new Double(3), pineapple}, - {"Tim", "Prinzing", blue, getString("TableDemo.firstsight"), new Double(69), pepper}, - {"Raj", "Premkumar", jfcblue2, getString("TableDemo.none"), new Double(7), broccoli}, - {"Howard", "Rosen", green, getString("TableDemo.defending"), new Double(7), strawberry}, + {"Rick", "Levenson", black, getString("TableDemo.harold"), Double.valueOf(1327), raspberry}, + {"Brian", "Lichtenwalter", jfcblue, getString("TableDemo.fifthelement"), Double.valueOf(22), pear}, + {"Malini", "Minasandram", beige, getString("TableDemo.joyluck"), Double.valueOf(9), corn}, + {"Michael", "Martak", green, getString("TableDemo.city"), Double.valueOf(3), strawberry}, + {"David", "Mendenhall", forestgreen, getString("TableDemo.schindlerslist"), Double.valueOf(7), peach}, + {"Phil", "Milne", suspectpink, getString("TableDemo.withnail"), Double.valueOf(3), banana}, + {"Lynn", "Monsanto", cybergreen, getString("TableDemo.dasboot"), Double.valueOf(52), peach}, + {"Hans", "Muller", rustred, getString("TableDemo.eraserhead"), Double.valueOf(0), pineapple}, + {"Joshua", "Outwater", blue, getString("TableDemo.labyrinth"), Double.valueOf(3), pineapple}, + {"Tim", "Prinzing", blue, getString("TableDemo.firstsight"), Double.valueOf(69), pepper}, + {"Raj", "Premkumar", jfcblue2, getString("TableDemo.none"), Double.valueOf(7), broccoli}, + {"Howard", "Rosen", green, getString("TableDemo.defending"), Double.valueOf(7), strawberry}, {"Ray", "Ryan", black, getString("TableDemo.buckaroo"), - new Double(3.141592653589793238462643383279502884197169399375105820974944), banana}, - {"Georges", "Saab", aqua, getString("TableDemo.bicycle"), new Double(290), cantaloupe}, - {"Tom", "Santos", blue, getString("TableDemo.spinaltap"), new Double(241), pepper}, - {"Rich", "Schiavi", blue, getString("TableDemo.repoman"), new Double(0xFF), pepper}, - {"Nancy", "Schorr", green, getString("TableDemo.fifthelement"), new Double(47), watermelon}, - {"Keith", "Sprochi", darkgreen, getString("TableDemo.2001"), new Double(13), watermelon}, - {"Matt", "Tucker", eblue, getString("TableDemo.starwars"), new Double(2), broccoli}, - {"Dmitri", "Trembovetski", red, getString("TableDemo.aliens"), new Double(222), tomato}, - {"Scott", "Violet", violet, getString("TableDemo.raiders"), new Double(-97), banana}, - {"Kathy", "Walrath", darkgreen, getString("TableDemo.thinman"), new Double(8), pear}, - {"Nathan", "Walrath", black, getString("TableDemo.chusingura"), new Double(3), grapefruit}, - {"Steve", "Wilson", green, getString("TableDemo.raiders"), new Double(7), onion}, - {"Kathleen", "Zelony", gray, getString("TableDemo.dog"), new Double(13), grapes} + Double.valueOf(3.141592653589793238462643383279502884197169399375105820974944), banana}, + {"Georges", "Saab", aqua, getString("TableDemo.bicycle"), Double.valueOf(290), cantaloupe}, + {"Tom", "Santos", blue, getString("TableDemo.spinaltap"), Double.valueOf(241), pepper}, + {"Rich", "Schiavi", blue, getString("TableDemo.repoman"), Double.valueOf(0xFF), pepper}, + {"Nancy", "Schorr", green, getString("TableDemo.fifthelement"), Double.valueOf(47), watermelon}, + {"Keith", "Sprochi", darkgreen, getString("TableDemo.2001"), Double.valueOf(13), watermelon}, + {"Matt", "Tucker", eblue, getString("TableDemo.starwars"), Double.valueOf(2), broccoli}, + {"Dmitri", "Trembovetski", red, getString("TableDemo.aliens"), Double.valueOf(222), tomato}, + {"Scott", "Violet", violet, getString("TableDemo.raiders"), Double.valueOf(-97), banana}, + {"Kathy", "Walrath", darkgreen, getString("TableDemo.thinman"), Double.valueOf(8), pear}, + {"Nathan", "Walrath", black, getString("TableDemo.chusingura"), Double.valueOf(3), grapefruit}, + {"Steve", "Wilson", green, getString("TableDemo.raiders"), Double.valueOf(7), onion}, + {"Kathleen", "Zelony", gray, getString("TableDemo.dog"), Double.valueOf(13), grapes} }; // Create a model of the data. @@ -549,7 +549,7 @@ public int getRowCount() { return data.length;} public Object getValueAt(int row, int col) {return data[row][col];} public String getColumnName(int column) {return names[column];} - public Class getColumnClass(int c) {return getValueAt(0, c).getClass();} + public Class<?> getColumnClass(int c) {return getValueAt(0, c).getClass();} public boolean isCellEditable(int row, int col) {return col != 5;} public void setValueAt(Object aValue, int row, int column) { data[row][column] = aValue; } }; @@ -557,7 +557,7 @@ // Create the table tableView = new JTable(dataModel); - TableRowSorter sorter = new TableRowSorter(dataModel); + TableRowSorter<TableModel> sorter = new TableRowSorter<>(dataModel); tableView.setRowSorter(sorter); // Show colors by rendering them in their own color. @@ -575,7 +575,7 @@ }; // Create a combo box to show that you can use one in a table. - JComboBox comboBox = new JComboBox(); + JComboBox<NamedColor> comboBox = new JComboBox<>(); comboBox.addItem(aqua); comboBox.addItem(beige); comboBox.addItem(black);
--- a/src/demo/share/jfc/TableExample/JDBCAdapter.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/TableExample/JDBCAdapter.java Wed Mar 25 21:31:09 2020 -0400 @@ -125,12 +125,6 @@ connection.close(); } - @Override - protected void finalize() throws Throwable { - close(); - super.finalize(); - } - ////////////////////////////////////////////////////////////////////////// // // Implementation of the TableModel Interface
--- a/src/demo/share/jfc/TableExample/OldJTable.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/TableExample/OldJTable.java Wed Mar 25 21:31:09 2020 -0400 @@ -72,7 +72,7 @@ return addColumn(columnIdentifier, width, null, null, null); } - public TableColumn addColumn(Object columnIdentifier, List columnData) { + public TableColumn addColumn(Object columnIdentifier, List<?> columnData) { return addColumn(columnIdentifier, -1, null, null, columnData); } @@ -86,7 +86,7 @@ public TableColumn addColumn(Object columnIdentifier, int width, TableCellRenderer renderer, - TableCellEditor editor, List columnData) { + TableCellEditor editor, List<?> columnData) { checkDefaultTableModel(); // Set up the model side first @@ -112,7 +112,7 @@ ((DefaultTableModel)getModel()).addRow(rowData); } - public void addRow(List rowData) { + public void addRow(List<?> rowData) { checkDefaultTableModel(); ((DefaultTableModel)getModel()).addRow(rowData.toArray()); } @@ -132,7 +132,7 @@ ((DefaultTableModel)getModel()).insertRow(rowIndex, rowData); } - public void insertRow(int rowIndex, List rowData) { + public void insertRow(int rowIndex, List<?> rowData) { checkDefaultTableModel(); ((DefaultTableModel)getModel()).insertRow(rowIndex, rowData.toArray()); } @@ -142,7 +142,7 @@ ((DefaultTableModel)getModel()).setNumRows(newSize); } - public void setDataVector(Object[][] newData, List columnIds) { + public void setDataVector(Object[][] newData, List<?> columnIds) { checkDefaultTableModel(); ((DefaultTableModel)getModel()).setDataVector( newData, columnIds.toArray());
--- a/src/demo/share/jfc/TableExample/TableExample3.java Tue Mar 24 14:50:32 2020 -0700 +++ b/src/demo/share/jfc/TableExample/TableExample3.java Wed Mar 25 21:31:09 2020 -0400 @@ -73,27 +73,27 @@ final String[] names = { "First Name", "Last Name", "Favorite Color", "Favorite Number", "Vegetarian" }; final Object[][] data = { - { "Mark", "Andrews", "Red", new Integer(2), Boolean.TRUE }, - { "Tom", "Ball", "Blue", new Integer(99), Boolean.FALSE }, - { "Alan", "Chung", "Green", new Integer(838), Boolean.FALSE }, - { "Jeff", "Dinkins", "Turquois", new Integer(8), Boolean.TRUE }, - { "Amy", "Fowler", "Yellow", new Integer(3), Boolean.FALSE }, - { "Brian", "Gerhold", "Green", new Integer(0), Boolean.FALSE }, - { "James", "Gosling", "Pink", new Integer(21), Boolean.FALSE }, - { "David", "Karlton", "Red", new Integer(1), Boolean.FALSE }, - { "Dave", "Kloba", "Yellow", new Integer(14), Boolean.FALSE }, - { "Peter", "Korn", "Purple", new Integer(12), Boolean.FALSE }, - { "Phil", "Milne", "Purple", new Integer(3), Boolean.FALSE }, - { "Dave", "Moore", "Green", new Integer(88), Boolean.FALSE }, - { "Hans", "Muller", "Maroon", new Integer(5), Boolean.FALSE }, - { "Rick", "Levenson", "Blue", new Integer(2), Boolean.FALSE }, - { "Tim", "Prinzing", "Blue", new Integer(22), Boolean.FALSE }, - { "Chester", "Rose", "Black", new Integer(0), Boolean.FALSE },