# HG changeset patch # User jwilhelm # Date 1518251135 -3600 # Node ID c8a33db795b6dae734667232cc4cb9d9a7b793e6 # Parent 67aa88701d46781060e393d26ee07b727551be36# Parent 5e2d2067da488466c64af4f4809dae6c4ef44d1f Merge diff -r 67aa88701d46 -r c8a33db795b6 .hgtags --- a/.hgtags Sat Feb 10 09:48:51 2018 +0000 +++ b/.hgtags Sat Feb 10 09:25:35 2018 +0100 @@ -467,3 +467,5 @@ 5b834ec962366e00d4445352a999a3ac14e26f64 jdk-10+39 860326263d1f6a83996d7da0f4c66806ae4aa1eb jdk-10+40 3eae36c6baa5f916a3024cf1513e22357e00185d jdk-10+41 +4b62b815b4f49970b91a952929cf50115c263cb3 jdk-10+42 +107413b070b92c88bde6230ceb4a19b579781068 jdk-10+43 diff -r 67aa88701d46 -r c8a33db795b6 make/Docs.gmk --- a/make/Docs.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/Docs.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -1,4 +1,4 @@ -# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 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 @@ -200,7 +200,7 @@ # define setup_gengraph_dot_to_png $1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot - $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png + $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2/module-graph.png # For each module needing a graph, create a png file from the dot file # generated by the GenGraphs tool and store it in the target dir. diff -r 67aa88701d46 -r c8a33db795b6 make/autoconf/configure --- a/make/autoconf/configure Sat Feb 10 09:48:51 2018 +0000 +++ b/make/autoconf/configure Sat Feb 10 09:25:35 2018 +0100 @@ -129,25 +129,18 @@ } test_generated_up_to_date() { - if test "x`which hg 2> /dev/null | grep -v '^no hg in'`" != x; then - conf_updated_autoconf_files=`cd $conf_script_dir && hg status -mard . 2> /dev/null` - conf_source_files="$conf_script_dir/configure.ac $conf_script_dir/*.m4" - if test "x$CUSTOM_CONFIG_DIR" != x; then - conf_custom_updated_autoconf_files=`cd $CUSTOM_CONFIG_DIR && hg status -mard . 2> /dev/null` - conf_custom_source_files="$CUSTOM_CONFIG_DIR/*.m4" - else - conf_custom_updated_autoconf_files="" - conf_custom_source_files="" + conf_source_files="$conf_script_dir/configure.ac $conf_script_dir/*.m4" + if test "x$CUSTOM_CONFIG_DIR" != x; then + conf_custom_source_files="$CUSTOM_CONFIG_DIR/*.m4" + else + conf_custom_source_files="" + fi + + for file in $conf_source_files $conf_custom_source_files ; do + if test $file -nt $generated_script; then + return 0 fi - - if test "x${conf_updated_autoconf_files}${conf_custom_updated_autoconf_files}" != x; then - for file in $conf_source_files $conf_custom_source_files ; do - if test $file -nt $generated_script; then - return 0 - fi - done - fi - fi + done return 1 } diff -r 67aa88701d46 -r c8a33db795b6 make/autoconf/flags.m4 --- a/make/autoconf/flags.m4 Sat Feb 10 09:48:51 2018 +0000 +++ b/make/autoconf/flags.m4 Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# 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 @@ -918,7 +918,6 @@ -MD -Zc:wchar_t- -W3 -wd4800 \ -DWIN32_LEAN_AND_MEAN \ -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -D_WINSOCK_DEPRECATED_NO_WARNINGS \ -DWIN32 -DIAL" if test "x$OPENJDK_$1_CPU" = xx86_64; then $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" @@ -1113,10 +1112,11 @@ # Additional macosx handling if test "x$OPENJDK_$1_OS" = xmacosx; then - # MACOSX_VERSION_MIN is the c++ and ld is -mmacosx-version-min argument. The expected - # format is X.Y.Z. It's hard-coded to the minimum OSX version on which the - # JDK can be built and makes the linked binaries compatible even if built on - # a newer version of the OS. + # MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built + # binaries should be compatible with, even if compiled on a newer version + # of the OS. It currently has a hard coded value. Setting this also limits + # exposure to API changes in header files. Bumping this is likely to + # require code changes to build. MACOSX_VERSION_MIN=10.7.0 AC_SUBST(MACOSX_VERSION_MIN) @@ -1150,6 +1150,7 @@ $2JVM_CFLAGS="[$]$2JVM_CFLAGS \ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" + $2ARFLAGS="$2$ARFLAGS -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" if test -n "$MACOSX_VERSION_MAX"; then $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ diff -r 67aa88701d46 -r c8a33db795b6 make/autoconf/lib-bundled.m4 --- a/make/autoconf/lib-bundled.m4 Sat Feb 10 09:48:51 2018 +0000 +++ b/make/autoconf/lib-bundled.m4 Sat Feb 10 09:25:35 2018 +0100 @@ -209,7 +209,17 @@ AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) fi + LIBZ_CFLAGS="" + LIBZ_LIBS="" + if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then + LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib" + else + LIBZ_LIBS="-lz" + fi + AC_SUBST(USE_EXTERNAL_LIBZ) + AC_SUBST(LIBZ_CFLAGS) + AC_SUBST(LIBZ_LIBS) ]) ################################################################################ diff -r 67aa88701d46 -r c8a33db795b6 make/autoconf/spec.gmk.in --- a/make/autoconf/spec.gmk.in Sat Feb 10 09:48:51 2018 +0000 +++ b/make/autoconf/spec.gmk.in Sat Feb 10 09:25:35 2018 +0100 @@ -737,6 +737,8 @@ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ +LIBZ_CFLAGS:=@LIBZ_CFLAGS@ +LIBZ_LIBS:=@LIBZ_LIBS@ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@ MSVCR_DLL:=@MSVCR_DLL@ MSVCP_DLL:=@MSVCP_DLL@ diff -r 67aa88701d46 -r c8a33db795b6 make/autoconf/version-numbers --- a/make/autoconf/version-numbers Sat Feb 10 09:48:51 2018 +0000 +++ b/make/autoconf/version-numbers Sat Feb 10 09:25:35 2018 +0100 @@ -25,7 +25,7 @@ # Default version numbers to use unless overridden by configure -DEFAULT_VERSION_FEATURE=10 +DEFAULT_VERSION_FEATURE=11 DEFAULT_VERSION_INTERIM=0 DEFAULT_VERSION_UPDATE=0 DEFAULT_VERSION_PATCH=0 diff -r 67aa88701d46 -r c8a33db795b6 make/conf/jib-profiles.js --- a/make/conf/jib-profiles.js Sat Feb 10 09:48:51 2018 +0000 +++ b/make/conf/jib-profiles.js Sat Feb 10 09:25:35 2018 +0100 @@ -1089,7 +1089,8 @@ if (input.build_type == "promoted") { args = concat(args, // This needs to be changed when we start building release candidates - "--with-version-pre=ea", + // with-version-pre must be set to ea for 'ea' and empty for fcs build + "--with-version-pre=", "--without-version-opt"); } else { args = concat(args, "--with-version-opt=" + common.build_id); diff -r 67aa88701d46 -r c8a33db795b6 make/devkit/Makefile --- a/make/devkit/Makefile Sat Feb 10 09:48:51 2018 +0000 +++ b/make/devkit/Makefile Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 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 @@ -23,7 +23,7 @@ # questions. # -########################################################################################## +################################################################################ # # This Makefile, together with Tools.gmk, can be used to compile a set of # gcc based cross compilation, portable, self contained packages, capable @@ -31,60 +31,55 @@ # # In addition to the makefiles, access to Oracle Linux installation # media is required. This has been tested against Oracle Enterprise Linux -# 5.5. Set variables RPM_DIR_x86_64 and RPM_DIR_i686 respectively to point -# to directory containing the RPMs. +# 6.4. # -# By default this Makefile will build crosstools for: -# * i686-unknown-linux-gnu -# * x86_64-unknown-linux-gnu -# The x86_64 version of the compilers will work in multi arch mode and will -# be able to compile 32bit binaries with the -m32 flag. This makes the -# explicit cross compiler for i686 somewhat redundant and is a known issue. +# By default this Makefile will build a native toolchain for the current +# platform if called with something like this: +# +# make tars # -# To build the full set of crosstools, use a command line looking like this: -# -# make tars RPM_DIR_x86_64=/tmp/oel64-x86_64/Packages/ RPM_DIR_i686=/tmp/oel64-i686/Packages/ +# To build the full set of crosstools for additional platforms, use a command +# line looking like this: # -# To create a x86_64 package without the redundant i686 cross compiler, do -# like this: +# make tars platforms="x86_64-unknown-linux-gnu sparc64-unknown-linux-gnu" # -# make tars platforms=x86_64-unknown-linux-gnu RPM_DIR_x86_64=/tmp/oel64-x86_64/Packages/ RPM_DIR_i686=/tmp/oel64-i686/Packages/ - -# -# Main makefile which iterates over all host and target platforms. +# This is the makefile which iterates over all host and target platforms. # os := $(shell uname -o) -cpu := x86_64 -#$(shell uname -p) - -# -# This wrapper script can handle exactly these platforms -# -platforms := $(foreach p,x86_64 i686,$(p)-unknown-linux-gnu) -#platforms := $(foreach p,x86_64,$(p)-unknown-linux-gnu) +cpu := $(shell uname -p) # Figure out what platform this is building on. me := $(cpu)-$(if $(findstring Linux,$(os)),unknown-linux-gnu) $(info Building on platform $(me)) +# +# By default just build for the current platform, which is assumed to be Linux +# +platforms := $(me) +host_platforms := $(platforms) +target_platforms := $(platforms) +$(info host_platforms $(host_platforms)) +$(info target_platforms $(target_platforms)) + all compile : $(platforms) ifeq (,$(SKIP_ME)) $(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me))) endif -OUTPUTDIR = $(abspath ../../build/devkit) -RESULT = $(OUTPUTDIR)/result +OUTPUT_ROOT = $(abspath ../../build/devkit) +RESULT = $(OUTPUT_ROOT)/result submakevars = HOST=$@ BUILD=$(me) \ RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \ - OUTPUTDIR=$(OUTPUTDIR) -$(platforms) : + OUTPUT_ROOT=$(OUTPUT_ROOT) +$(host_platforms) : @echo 'Building compilers for $@' - @echo 'Targets: $(platforms)' - for p in $@ $(filter-out $@,$(platforms)); do \ + @echo 'Targets: $(target_platforms)' + for p in $(filter $@, $(target_platforms)) $(filter-out $@, $(target_platforms)); do \ + $(MAKE) -f Tools.gmk download-rpms $(submakevars) TARGET=$$p && \ $(MAKE) -f Tools.gmk all $(submakevars) \ TARGET=$$p || exit 1 ; \ done @@ -92,12 +87,8 @@ $(MAKE) -f Tools.gmk ccache $(submakevars) TARGET=$@ @echo 'All done"' -$(foreach a,i686 x86_64,$(eval $(a) : $(filter $(a)%,$(platforms)))) - -ia32 : i686 today := $(shell date +%Y%m%d) - define Mktar $(1)_tar = $$(RESULT)/sdk-$(1)-$$(today).tar.gz $$($(1)_tar) : PLATFORM = $(1) @@ -105,7 +96,7 @@ $$($(1)_tar) : $(1) $$(shell find $$(RESULT)/$(1)) endef -$(foreach p,$(platforms),$(eval $(call Mktar,$(p)))) +$(foreach p,$(host_platforms),$(eval $(call Mktar,$(p)))) tars : all $(TARFILES) onlytars : $(TARFILES) @@ -115,7 +106,9 @@ touch $@ clean : - rm -rf build result + rm -rf $(addprefix ../../build/devkit/, result $(host_platforms)) +dist-clean: clean + rm -rf $(addprefix ../../build/devkit/, src download) FORCE : -.PHONY : $(configs) $(platforms) +.PHONY : all compile tars $(configs) $(host_platforms) clean dist-clean diff -r 67aa88701d46 -r c8a33db795b6 make/devkit/Tools.gmk --- a/make/devkit/Tools.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/devkit/Tools.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 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 @@ -44,24 +44,42 @@ $(info BUILD=$(BUILD)) ARCH := $(word 1,$(subst -, ,$(TARGET))) +$(info ARCH=$(ARCH)) ########################################################################################## # Define external dependencies # Latest that could be made to work. -gcc_ver := gcc-4.9.2 -binutils_ver := binutils-2.25 -ccache_ver := ccache-3.2.1 -mpfr_ver := mpfr-3.0.1 -gmp_ver := gmp-4.3.2 -mpc_ver := mpc-1.0.1 +GCC_VER := 7.3.0 +ifeq ($(GCC_VER), 7.3.0) + gcc_ver := gcc-7.3.0 + binutils_ver := binutils-2.30 + ccache_ver := ccache-3.3.6 + mpfr_ver := mpfr-3.1.5 + gmp_ver := gmp-6.1.2 + mpc_ver := mpc-1.0.3 + gdb_ver := gdb-8.1 +else ifeq ($(GCC_VER), 4.9.2) + gcc_ver := gcc-4.9.2 + binutils_ver := binutils-2.25 + ccache_ver := ccache-3.2.1 + mpfr_ver := mpfr-3.0.1 + gmp_ver := gmp-4.3.2 + mpc_ver := mpc-1.0.1 + gdb_ver := gdb-7.12.1 +else + $(error Unsupported GCC version) +endif -GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.bz2 -BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.bz2 -CCACHE := http://samba.org/ftp/ccache/$(ccache_ver).tar.gz +GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz +BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.xz +CCACHE := https://samba.org/ftp/ccache/$(ccache_ver).tar.xz MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2 GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2 -MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz +MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz +GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz + +OEL_URL := http://yum.oracle.com/repo/OracleLinux/OL6/4/base/$(ARCH)/ # RPMs in OEL6.4 LINUX_VERSION := OEL6.4 @@ -85,30 +103,9 @@ libgcc \ zlib zlib-devel \ libffi libffi-devel \ - fontconfig fontconfig-devel - -ifeq ($(ARCH),x86_64) - RPM_DIR ?= $(RPM_DIR_x86_64) - RPM_ARCHS := x86_64 noarch - ifeq ($(BUILD),$(HOST)) - ifeq ($(TARGET),$(HOST)) - # When building the native compiler for x86_64, enable mixed mode. - RPM_ARCHS += i386 i686 - endif - endif -else - RPM_DIR ?= $(RPM_DIR_i686) - RPM_ARCHS := i386 i686 -endif - -# Sort to remove duplicates -RPM_FILE_LIST := $(sort $(foreach a,$(RPM_ARCHS),$(wildcard $(patsubst %,$(RPM_DIR)/%*$a.rpm,$(RPM_LIST))))) - -#$(info RPM_FILE_LIST $(RPM_FILE_LIST)) - -ifeq ($(RPM_FILE_LIST),) - $(error Found no RPMs, RPM_DIR must point to list of directories to search for RPMs) -endif + fontconfig fontconfig-devel \ + systemtap-sdt-devel \ + # ########################################################################################## # Define common directories and files @@ -122,13 +119,14 @@ endif # Define directories -RESULT := $(OUTPUTDIR)/result -BUILDDIR := $(OUTPUTDIR)/$(HOST)/$(TARGET) +RESULT := $(OUTPUT_ROOT)/result +BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET) PREFIX := $(RESULT)/$(HOST) TARGETDIR := $(PREFIX)/$(TARGET) SYSROOT := $(TARGETDIR)/sysroot -DOWNLOAD := $(OUTPUTDIR)/download -SRCDIR := $(OUTPUTDIR)/src +DOWNLOAD := $(OUTPUT_ROOT)/download +DOWNLOAD_RPMS := $(DOWNLOAD)/rpms +SRCDIR := $(OUTPUT_ROOT)/src # Marker file for unpacking rpms rpms := $(SYSROOT)/rpms_unpacked @@ -136,6 +134,16 @@ # Need to patch libs that are linker scripts to use non-absolute paths libs := $(SYSROOT)/libs_patched +################################################################################ +# Download RPMs +download-rpms: + mkdir -p $(DOWNLOAD_RPMS) + # Only run this if rpm dir is empty. + ifeq ($(wildcard $(DOWNLOAD_RPMS)/*.rpm), ) + cd $(DOWNLOAD_RPMS) && \ + wget -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(OEL_URL) + endif + ########################################################################################## # Unpack source packages @@ -147,7 +155,7 @@ $$($(1)_CFG) : $$($(1)_FILE) mkdir -p $$(SRCDIR) - tar -C $$(SRCDIR) -x$$(if $$(findstring .gz, $$<),z,j)f $$< + tar -C $$(SRCDIR) -xf $$< $$(foreach p,$$(abspath $$(wildcard $$(notdir $$($(1)_DIR)).patch)), \ echo PATCHING $$(p) ; \ patch -d $$($(1)_DIR) -p1 -i $$(p) ; \ @@ -159,15 +167,32 @@ endef # Download and unpack all source packages -$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC,$(eval $(call Download,$(p)))) +$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB,$(eval $(call Download,$(p)))) ########################################################################################## # Unpack RPMS +ifeq ($(ARCH),x86_64) + RPM_ARCHS := x86_64 noarch + ifeq ($(BUILD),$(HOST)) + ifeq ($(TARGET),$(HOST)) + # When building the native compiler for x86_64, enable mixed mode. + RPM_ARCHS += i386 i686 + endif + endif +else ifeq ($(ARCH),i686)) + RPM_ARCHS := i386 i686 +else + RPM_ARCHS := $(ARCH) +endif + +RPM_FILE_LIST := $(sort $(foreach a, $(RPM_ARCHS), \ + $(wildcard $(patsubst %,$(DOWNLOAD_RPMS)/%*$a.rpm,$(RPM_LIST))) \ +)) + # Note. For building linux you should install rpm2cpio. define unrpm - $(SYSROOT)/$(notdir $(1)).unpacked \ - : $(1) + $(SYSROOT)/$(notdir $(1)).unpacked : $(1) $$(rpms) : $(SYSROOT)/$(notdir $(1)).unpacked endef @@ -210,19 +235,20 @@ ########################################################################################## # Create links for ffi header files so that they become visible by default when using the # devkit. - -$(SYSROOT)/usr/include/ffi.h: $(rpms) - cd $(@D) && rm $(@F) && ln -s ../lib/libffi-*/include/$(@F) . +ifeq ($(ARCH), x86_64) + $(SYSROOT)/usr/include/ffi.h: $(rpms) + cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) . -$(SYSROOT)/usr/include/ffitarget.h: $(rpms) - cd $(@D) && rm $(@F) && ln -s ../lib/libffi-*/include/$(@F) . + $(SYSROOT)/usr/include/ffitarget.h: $(rpms) + cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) . -SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h + SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h +endif ########################################################################################## # Define marker files for each source package to be compiled -$(foreach t,binutils mpfr gmp mpc gcc ccache,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done)) +$(foreach t,binutils mpfr gmp mpc gcc ccache gdb,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done)) ########################################################################################## @@ -234,7 +260,8 @@ PATHEXT = $(RESULT)/$(BUILD)/bin: PATHPRE = PATH=$(PATHEXT)$(PATH) -BUILDPAR = -j16 +NUM_CORES := $(shell cat /proc/cpuinfo | grep -c processor) +BUILDPAR = -j$(NUM_CORES) # Default commands to when making MAKECMD = @@ -317,6 +344,8 @@ --disable-nls \ --program-prefix=$(TARGET)- \ --enable-multilib \ + --enable-gold \ + --enable-plugins \ ) > $(@D)/log.config 2>&1 @echo 'done' @@ -392,7 +421,6 @@ --with-sysroot=$(SYSROOT) \ --enable-languages=c,c++ \ --enable-shared \ - --enable-multilib \ --disable-nls \ --with-gnu-as \ --with-gnu-ld \ @@ -410,6 +438,23 @@ $(mpfr) : $(gmp) $(mpc) : $(gmp) $(mpfr) +################################################################################ +# Build gdb but only where host and target match +ifeq ($(HOST), $(TARGET)) + $(BUILDDIR)/$(gdb_ver)/Makefile: $(GDB_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" $(GDB_CFG) \ + $(CONFIG) \ + --with-sysroot=$(SYSROOT) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' + + $(gdb): $(gcc) +endif + ########################################################################################## # very straightforward. just build a ccache. it is only for host. $(BUILDDIR)/$(ccache_ver)/Makefile \ @@ -434,7 +479,7 @@ if [ ! -e $(PREFIX)/bin/$(TARGET)-$$f ]; \ then \ cd $(PREFIX)/bin && \ - ln -s $$f $(TARGET)-$$f ; \ + ln -fs $$f $(TARGET)-$$f ; \ fi \ done @touch $@ @@ -451,7 +496,7 @@ if [ ! -e $(TARGETDIR)/$(l)/$$f ]; then \ mkdir -p $(TARGETDIR)/$(l) && \ cd $(TARGETDIR)/$(l)/ && \ - ln -s $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \ + ln -fs $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \ fi \ done;) @echo 'done' @@ -471,6 +516,7 @@ $(PATHPRE) $(ENVS) $(MAKE) $(BUILDPAR) -f $< -C $( $(&1 @echo -n 'installing...' $(PATHPRE) $(MAKE) $(INSTALLPAR) -f $< -C $( $(&1 + @mkdir -p $(@D) @touch $@ @echo 'done' @@ -486,17 +532,38 @@ echo 'DEVKIT_NAME="$(gcc_ver) - $(LINUX_VERSION)"' >> $@ echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@ echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$$host/sysroot"' >> $@ + echo 'DEVKIT_EXTRA_PATH="$$DEVKIT_ROOT/bin"' >> $@ + +########################################################################################## +# Copy these makefiles into the root of the kit +$(PREFIX)/Makefile: ./Makefile + rm -rf $@ + cp $< $@ + +$(PREFIX)/Tools.gmk: ./Tools.gmk + rm -rf $@ + cp $< $@ + +THESE_MAKEFILES := $(PREFIX)/Makefile $(PREFIX)/Tools.gmk ########################################################################################## ifeq ($(TARGET), $(HOST)) + # To build with dtrace support, the build needs access to the dtrace executable from the + # sysroot. Generally we don't want to add binaries in the sysroot to the path, but + # luckily this seems to execute well enough on a different host Linux distro, so symlink + # it into the main bin dir. + $(PREFIX)/bin/dtrace: + @echo 'Creating dtrace soft link' + ln -s ../$(HOST)/sysroot/usr/bin/dtrace $@ + $(PREFIX)/bin/%: @echo 'Creating missing $* soft link' ln -s $(TARGET)-$* $@ missing-links := $(addprefix $(PREFIX)/bin/, \ addr2line ar as c++ c++filt elfedit g++ gcc gprof ld nm objcopy ranlib readelf \ - size strings strip) + size strings strip ld.bfd ld.gold dtrace) endif ########################################################################################## @@ -507,7 +574,9 @@ libs : $(libs) sysroot : rpms libs gcc : sysroot $(gcc) $(gccpatch) -all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) +gdb : $(gdb) +all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) \ + $(THESE_MAKEFILES) gdb # this is only built for host. so separate. ccache : $(ccache) diff -r 67aa88701d46 -r c8a33db795b6 make/devkit/createMacosxDevkit.sh --- a/make/devkit/createMacosxDevkit.sh Sat Feb 10 09:48:51 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# This script copies part of an Xcode installer into a devkit suitable -# for building OpenJDK and OracleJDK. The installation .dmg files for Xcode -# and the aux tools need to be available. -# erik.joelsson@oracle.com - -USAGE="$0 []" - -if [ "$1" = "" ] || [ "$2" = "" ]; then - echo $USAGE - exit 1 -fi - -XCODE_DMG="$1" -XQUARTZ_DMG="$2" -GNU_MAKE="$3" -AUXTOOLS_DMG="$4" - -SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" -BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" - -# Mount XCODE_DMG -if [ -e "/Volumes/Xcode" ]; then - hdiutil detach /Volumes/Xcode -fi -hdiutil attach $XCODE_DMG - -# Find the version of Xcode -XCODE_VERSION="$(/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version \ - | awk '/Xcode/ { print $2 }' )" -SDK_VERSION="MacOSX10.9" -if [ ! -e "/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk" ]; then - echo "Expected SDK version not found: ${SDK_VERSION}" - exit 1 -fi - -DEVKIT_ROOT="${BUILD_DIR}/Xcode${XCODE_VERSION}-${SDK_VERSION}" -DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" - -echo "Xcode version: $XCODE_VERSION" -echo "Creating devkit in $DEVKIT_ROOT" - -################################################################################ -# Copy files to root -mkdir -p $DEVKIT_ROOT -if [ ! -d $DEVKIT_ROOT/Xcode.app ]; then - echo "Copying Xcode.app..." - cp -RH "/Volumes/Xcode/Xcode.app" $DEVKIT_ROOT/ -fi -# Trim out some seemingly unneeded parts to save space. -rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Applications -rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/iPhone* -rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Documentation -rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/share/man -( cd $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \ - && rm -rf `ls | grep -v ${SDK_VERSION}` ) -rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk/usr/share/man - -hdiutil detach /Volumes/Xcode - -################################################################################ -# Copy Freetype into sysroot -if [ -e "/Volumes/XQuartz-*" ]; then - hdiutil detach /Volumes/XQuartz-* -fi -hdiutil attach $XQUARTZ_DMG - -echo "Copying freetype..." -rm -rf /tmp/XQuartz -pkgutil --expand /Volumes/XQuartz-*/XQuartz.pkg /tmp/XQuartz/ -rm -rf /tmp/x11 -mkdir /tmp/x11 -cd /tmp/x11 -cat /tmp/XQuartz/x11.pkg/Payload | gunzip -dc | cpio -i - -mkdir -p $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/ -mkdir -p $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/lib/ -cp -RH opt/X11/include/freetype2 \ - $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/ -cp -RH opt/X11/include/ft2build.h \ - $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/ -cp -RH opt/X11/lib/libfreetype.* \ - $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/lib/ - -cd - - -hdiutil detach /Volumes/XQuartz-* - -################################################################################ -# Copy gnu make -mkdir -p $DEVKIT_ROOT/bin -cp $GNU_MAKE $DEVKIT_ROOT/bin - -################################################################################ -# Optionally copy PackageMaker - -if [ -e "$AUXTOOLS_DMG" ]; then - if [ -e "/Volumes/Auxiliary Tools" ]; then - hdiutil detach "/Volumes/Auxiliary Tools" - fi - hdiutil attach $AUXTOOLS_DMG - - echo "Copying PackageMaker.app..." - cp -RH "/Volumes/Auxiliary Tools/PackageMaker.app" $DEVKIT_ROOT/ - - hdiutil detach "/Volumes/Auxiliary Tools" -fi - -################################################################################ -# Generate devkit.info - -echo-info() { - echo "$1" >> $DEVKIT_ROOT/devkit.info -} - -echo "Generating devkit.info..." -rm -f $DEVKIT_ROOT/devkit.info -echo-info "# This file describes to configure how to interpret the contents of this devkit" -echo-info "# The parameters used to create this devkit were:" -echo-info "# $*" -echo-info "DEVKIT_NAME=\"Xcode $XCODE_VERSION (devkit)\"" -echo-info "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:\$DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/bin\"" -echo-info "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk\"" -echo-info "DEVKIT_EXTRA_PATH=\"\$DEVKIT_ROOT/bin:\$DEVKIT_ROOT/PackageMaker.app/Contents/MacOS:\$DEVKIT_TOOLCHAIN_PATH\"" - -################################################################################ -# Copy this script - -echo "Copying this script..." -cp $0 $DEVKIT_ROOT/ - -################################################################################ -# Create bundle - -echo "Creating bundle..." -(cd $DEVKIT_ROOT && tar c - . | gzip - > "$DEVKIT_BUNDLE") diff -r 67aa88701d46 -r c8a33db795b6 make/devkit/createMacosxDevkit6.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/devkit/createMacosxDevkit6.sh Sat Feb 10 09:25:35 2018 +0100 @@ -0,0 +1,161 @@ +#!/bin/bash +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script copies part of an Xcode installer into a devkit suitable +# for building OpenJDK and OracleJDK. The installation .dmg files for Xcode +# and the aux tools need to be available. +# erik.joelsson@oracle.com + +USAGE="$0 []" + +if [ "$1" = "" ] || [ "$2" = "" ]; then + echo $USAGE + exit 1 +fi + +XCODE_DMG="$1" +XQUARTZ_DMG="$2" +GNU_MAKE="$3" +AUXTOOLS_DMG="$4" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" + +# Mount XCODE_DMG +if [ -e "/Volumes/Xcode" ]; then + hdiutil detach /Volumes/Xcode +fi +hdiutil attach $XCODE_DMG + +# Find the version of Xcode +XCODE_VERSION="$(/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version \ + | awk '/Xcode/ { print $2 }' )" +SDK_VERSION="MacOSX10.9" +if [ ! -e "/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk" ]; then + echo "Expected SDK version not found: ${SDK_VERSION}" + exit 1 +fi + +DEVKIT_ROOT="${BUILD_DIR}/Xcode${XCODE_VERSION}-${SDK_VERSION}" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Xcode version: $XCODE_VERSION" +echo "Creating devkit in $DEVKIT_ROOT" + +################################################################################ +# Copy files to root +mkdir -p $DEVKIT_ROOT +if [ ! -d $DEVKIT_ROOT/Xcode.app ]; then + echo "Copying Xcode.app..." + cp -RH "/Volumes/Xcode/Xcode.app" $DEVKIT_ROOT/ +fi +# Trim out some seemingly unneeded parts to save space. +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Applications +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/iPhone* +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Documentation +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/share/man +( cd $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \ + && rm -rf `ls | grep -v ${SDK_VERSION}` ) +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk/usr/share/man + +hdiutil detach /Volumes/Xcode + +################################################################################ +# Copy Freetype into sysroot +if [ -e "/Volumes/XQuartz-*" ]; then + hdiutil detach /Volumes/XQuartz-* +fi +hdiutil attach $XQUARTZ_DMG + +echo "Copying freetype..." +rm -rf /tmp/XQuartz +pkgutil --expand /Volumes/XQuartz-*/XQuartz.pkg /tmp/XQuartz/ +rm -rf /tmp/x11 +mkdir /tmp/x11 +cd /tmp/x11 +cat /tmp/XQuartz/x11.pkg/Payload | gunzip -dc | cpio -i + +mkdir -p $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/ +mkdir -p $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/lib/ +cp -RH opt/X11/include/freetype2 \ + $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/ +cp -RH opt/X11/include/ft2build.h \ + $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/ +cp -RH opt/X11/lib/libfreetype.* \ + $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/lib/ + +cd - + +hdiutil detach /Volumes/XQuartz-* + +################################################################################ +# Copy gnu make +mkdir -p $DEVKIT_ROOT/bin +cp $GNU_MAKE $DEVKIT_ROOT/bin + +################################################################################ +# Optionally copy PackageMaker + +if [ -e "$AUXTOOLS_DMG" ]; then + if [ -e "/Volumes/Auxiliary Tools" ]; then + hdiutil detach "/Volumes/Auxiliary Tools" + fi + hdiutil attach $AUXTOOLS_DMG + + echo "Copying PackageMaker.app..." + cp -RH "/Volumes/Auxiliary Tools/PackageMaker.app" $DEVKIT_ROOT/ + + hdiutil detach "/Volumes/Auxiliary Tools" +fi + +################################################################################ +# Generate devkit.info + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "# The parameters used to create this devkit were:" +echo-info "# $*" +echo-info "DEVKIT_NAME=\"Xcode $XCODE_VERSION (devkit)\"" +echo-info "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:\$DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/bin\"" +echo-info "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk\"" +echo-info "DEVKIT_EXTRA_PATH=\"\$DEVKIT_ROOT/bin:\$DEVKIT_ROOT/PackageMaker.app/Contents/MacOS:\$DEVKIT_TOOLCHAIN_PATH\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle..." +(cd $DEVKIT_ROOT && tar c - . | gzip - > "$DEVKIT_BUNDLE") diff -r 67aa88701d46 -r c8a33db795b6 make/devkit/createMacosxDevkit9.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/devkit/createMacosxDevkit9.sh Sat Feb 10 09:25:35 2018 +0100 @@ -0,0 +1,146 @@ +#!/bin/bash +# +# Copyright (c) 2015, 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. +# + +# This script copies parts of an Xcode installation into a devkit suitable +# for building OpenJDK and OracleJDK. The installation Xcode_X.X.xip needs +# to be either installed or extracted using for example Archive Utility. +# The easiest way to accomplish this is to right click the file in Finder +# and choose "Open With -> Archive Utility", or possible typing +# "open Xcode_9.2.xip" in a terminal. +# erik.joelsson@oracle.com + +USAGE="$0 " + +if [ "$1" = "" ]; then + echo $USAGE + exit 1 +fi + +XCODE_APP="$1" +XCODE_APP_DIR_NAME="${XCODE_APP##*/}" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" + +# Find the version of Xcode +XCODE_VERSION="$($XCODE_APP/Contents/Developer/usr/bin/xcodebuild -version \ + | awk '/Xcode/ { print $2 }' )" +SDK_VERSION="MacOSX10.13" +if [ ! -e "$XCODE_APP/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk" ]; then + echo "Expected SDK version not found: ${SDK_VERSION}" + exit 1 +fi + +DEVKIT_ROOT="${BUILD_DIR}/Xcode${XCODE_VERSION}-${SDK_VERSION}" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Xcode version: $XCODE_VERSION" +echo "Creating devkit in $DEVKIT_ROOT" + +mkdir -p $DEVKIT_ROOT + +################################################################################ +# Copy the relevant parts of Xcode.app, removing things that are both big and +# unecessary for our purposes, without building an impossibly long exclude list. +# +# Not including WatchSimulator.platform makes ibtool crashes in some situations. +# It doesn't seem to matter which extra platform is included, but that is the +# smallest one. + +EXCLUDE_DIRS=" \ + Contents/_CodeSignature \ + $XCODE_APP_DIR_NAME/Contents/Applications \ + $XCODE_APP_DIR_NAME/Contents/Resources \ + $XCODE_APP_DIR_NAME/Contents/Library \ + $XCODE_APP_DIR_NAME/Contents/XPCServices \ + $XCODE_APP_DIR_NAME/Contents/OtherFrameworks \ + $XCODE_APP_DIR_NAME/Contents/Developer/Documentation \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/share \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/libexec/git-core \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/bin/git* \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/bin/svn* \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/lib/libgit* \ + $XCODE_APP_DIR_NAME/Contents/Developer/usr/lib/libsvn* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/MacOSX.platform/usr \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/swift* \ + $XCODE_APP_DIR_NAME/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/arc \ + Platforms/AppleTVSimulator.platform \ + Platforms/iPhoneSimulator.platform \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/LLDB.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/ModelIO.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/XCSUI.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/SceneKit.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/XCBuild.framework \ + $XCODE_APP_DIR_NAME/Contents/SharedFrameworks/GPUTools.framework \ + $(cd $XCODE_APP/.. && ls -d $XCODE_APP_DIR_NAME/Contents/Developer/Platforms/* \ + | grep -v MacOSX.platform | grep -v WatchSimulator.platform) \ +" + +for ex in $EXCLUDE_DIRS; do + EXCLUDE_ARGS+="--exclude=$ex " +done + +echo "Copying Xcode.app..." +echo rsync -rlH $INCLUDE_ARGS $EXCLUDE_ARGS "$XCODE_APP" $DEVKIT_ROOT/ +rsync -rlH $INCLUDE_ARGS $EXCLUDE_ARGS "$XCODE_APP" $DEVKIT_ROOT/ + +################################################################################ + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "DEVKIT_NAME=\"Xcode $XCODE_VERSION (devkit)\"" +echo-info "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:\$DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/bin\"" +echo-info "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$SDK_VERSION.sdk\"" +echo-info "DEVKIT_EXTRA_PATH=\"\$DEVKIT_TOOLCHAIN_PATH\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle..." +GZIP=$(command -v pigz) +if [ -z "$GZIP" ]; then + GZIP="gzip" +fi +(cd $DEVKIT_ROOT && tar c - . | $GZIP - > "$DEVKIT_BUNDLE") diff -r 67aa88701d46 -r c8a33db795b6 make/hotspot/lib/JvmOverrideFiles.gmk --- a/make/hotspot/lib/JvmOverrideFiles.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/hotspot/lib/JvmOverrideFiles.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -32,6 +32,8 @@ ifeq ($(TOOLCHAIN_TYPE), gcc) BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0 BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments + BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized + BUILD_LIBJVM_interp_masm_x86.cpp_CXXFLAGS := -Wno-uninitialized endif ifeq ($(OPENJDK_TARGET_OS), linux) diff -r 67aa88701d46 -r c8a33db795b6 make/jdk/src/classes/build/tools/taglet/ModuleGraph.java --- a/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java Sat Feb 10 09:48:51 2018 +0000 +++ b/make/jdk/src/classes/build/tools/taglet/ModuleGraph.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -64,7 +64,7 @@ } String moduleName = ((ModuleElement) element).getQualifiedName().toString(); - String imageFile = moduleName + "-graph.png"; + String imageFile = moduleName + "/module-graph.png"; int thumbnailHeight = -1; String hoverImage = ""; if (!moduleName.equals("java.base")) { diff -r 67aa88701d46 -r c8a33db795b6 make/launcher/Launcher-jdk.pack.gmk --- a/make/launcher/Launcher-jdk.pack.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/launcher/Launcher-jdk.pack.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -82,7 +82,7 @@ CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC, \ CFLAGS_macosx := -fPIC, \ - DISABLED_WARNINGS_gcc := unused-result, \ + DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \ MAPFILE := $(UNPACK_MAPFILE),\ LDFLAGS := $(UNPACKEXE_ZIPOBJS) \ $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ diff -r 67aa88701d46 -r c8a33db795b6 make/lib/Awt2dLibraries.gmk --- a/make/lib/Awt2dLibraries.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/Awt2dLibraries.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -358,7 +358,8 @@ WARNINGS_AS_ERRORS_xlc := false, \ DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \ unused-result maybe-uninitialized format \ - format-security int-to-pointer-cast parentheses, \ + format-security int-to-pointer-cast parentheses \ + implicit-fallthrough, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \ E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \ MAPFILE := $(TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \ @@ -491,7 +492,7 @@ CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ - DISABLED_WARNINGS_gcc := clobbered, \ + DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \ MAPFILE := $(TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -669,7 +670,7 @@ CFLAGS_windows = -DCC_NOEX, \ WARNINGS_AS_ERRORS_xlc := false, \ DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \ - type-limits missing-field-initializers, \ + type-limits missing-field-initializers implicit-fallthrough, \ DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ maybe-uninitialized, \ DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ @@ -905,9 +906,18 @@ LIBSPLASHSCREEN_LIBS := - ifneq ($(USE_EXTERNAL_LIBZ), true) + ifeq ($(USE_EXTERNAL_LIBZ), false) LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.base/share/native/libzip/zlib - LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS) + else + ifeq ($(OPENJDK_TARGET_OS), macosx) + ifeq ($(USE_EXTERNAL_LIBPNG), false) + # When building our own libpng and using an external libz, we need to + # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See + # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h + # for details. + LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng + endif + endif endif ifeq ($(OPENJDK_TARGET_OS), macosx) @@ -933,8 +943,9 @@ EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \ OPTIMIZATION := LOW, \ CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \ - $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \ - DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized shift-negative-value, \ + $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \ + DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \ + maybe-uninitialized shift-negative-value implicit-fallthrough, \ DISABLED_WARNINGS_clang := incompatible-pointer-types, \ DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \ E_STATEMENT_NOT_REACHED, \ @@ -942,8 +953,8 @@ MAPFILE := $(TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \ LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ - LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \ - $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \ + LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \ + $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \ LIBS_aix := -liconv, \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ RC_FLAGS := $(RC_FLAGS) \ diff -r 67aa88701d46 -r c8a33db795b6 make/lib/CoreLibraries.gmk --- a/make/lib/CoreLibraries.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/CoreLibraries.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -67,7 +67,7 @@ CFLAGS_linux_ppc64le := -ffp-contract=off, \ CFLAGS_linux_s390x := -ffp-contract=off, \ CFLAGS_linux_aarch64 := -ffp-contract=off, \ - DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_gcc := sign-compare misleading-indentation, \ DISABLED_WARNINGS_microsoft := 4146 4244 4018, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ @@ -82,7 +82,7 @@ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ SRC := $(LIBFDLIBM_SRC), \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ - LDFLAGS := -nostdlib -r -arch x86_64, \ + LDFLAGS := -nostdlib $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ )) @@ -113,6 +113,7 @@ SRC := $(TOPDIR)/src/java.base/share/native/libverify, \ OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ CFLAGS := $(CFLAGS_JDKLIB), \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ DISABLED_WARNINGS_microsoft := 4244 4267, \ MAPFILE := $(TOPDIR)/make/mapfiles/libverify/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -224,11 +225,12 @@ SRC := $(TOPDIR)/src/java.base/share/native/libzip, \ EXCLUDES := $(LIBZIP_EXCLUDES), \ CFLAGS := $(CFLAGS_JDKLIB) \ - $(ZLIB_CPPFLAGS) \ + $(LIBZ_CFLAGS) \ -I$(TOPDIR)/src/java.base/share/native/libjava \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ MAPFILE := $(TOPDIR)/make/mapfiles/libzip/mapfile-vers, \ REORDER := $(BUILD_LIBZIP_REORDER), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -236,7 +238,7 @@ LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \ -export:ZIP_ReadEntry -export:ZIP_GetNextEntry \ -export:ZIP_InflateFully -export:ZIP_CRC32 -export:ZIP_FreeEntry, \ - LIBS_unix := -ljvm -ljava $(LIBZ), \ + LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \ LIBS_solaris := -lc, \ LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ @@ -270,6 +272,7 @@ EXCLUDES := $(LIBJIMAGE_EXCLUDES), \ CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ CFLAGS_unix := -UDEBUG, \ MAPFILE := $(TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ @@ -341,8 +344,9 @@ LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS)) +LIBJLI_CFLAGS += $(LIBZ_CFLAGS) + ifneq ($(USE_EXTERNAL_LIBZ), true) - LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) LIBJLI_EXTRA_FILES += \ $(addprefix $(TOPDIR)/src/java.base/share/native/libzip/zlib/, \ inflate.c \ @@ -362,6 +366,7 @@ EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \ OPTIMIZATION := HIGH, \ CFLAGS := $(LIBJLI_CFLAGS), \ + DISABLED_WARNINGS_gcc := maybe-uninitialized, \ DISABLED_WARNINGS_solstudio := \ E_ASM_DISABLES_OPTIMIZATION \ E_STATEMENT_NOT_REACHED, \ @@ -390,7 +395,7 @@ -export:JLI_PreprocessArg \ -export:JLI_AddArgsFromEnvVar \ -export:JLI_GetAppArgIndex, \ - LIBS_unix := $(LIBZ), \ + LIBS_unix := $(LIBZ_LIBS), \ LIBS_linux := $(LIBDL) -lc -lpthread, \ LIBS_solaris := $(LIBDL) -lc, \ LIBS_aix := $(LIBDL),\ @@ -437,7 +442,7 @@ EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \ OPTIMIZATION := HIGH, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ - LDFLAGS := -nostdlib -r, \ + LDFLAGS := -nostdlib $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \ )) diff -r 67aa88701d46 -r c8a33db795b6 make/lib/Lib-java.instrument.gmk --- a/make/lib/Lib-java.instrument.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/Lib-java.instrument.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -68,7 +68,7 @@ LDFLAGS_macosx := -Wl$(COMMA)-all_load, \ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \ LIBS := $(JDKLIB_LIBS), \ - LIBS_unix := -ljava -ljvm $(LIBZ), \ + LIBS_unix := -ljava -ljvm $(LIBZ_LIBS), \ LIBS_linux := -ljli $(LIBDL), \ LIBS_solaris := -ljli $(LIBDL), \ LIBS_aix := -liconv -ljli_static $(LIBDL), \ diff -r 67aa88701d46 -r c8a33db795b6 make/lib/Lib-jdk.crypto.ec.gmk --- a/make/lib/Lib-jdk.crypto.ec.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/Lib-jdk.crypto.ec.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -54,7 +54,7 @@ -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ $(BUILD_LIBSUNEC_FLAGS), \ - DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \ DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \ MAPFILE := $(TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ diff -r 67aa88701d46 -r c8a33db795b6 make/lib/Lib-jdk.jdwp.agent.gmk --- a/make/lib/Lib-jdk.jdwp.agent.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/Lib-jdk.jdwp.agent.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -43,6 +43,7 @@ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \ $(LIBDT_SOCKET_CPPFLAGS), \ + DISABLED_WARNINGS_gcc := shift-negative-value, \ MAPFILE := $(TOPDIR)/make/mapfiles/libdt_socket/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff -r 67aa88701d46 -r c8a33db795b6 make/lib/Lib-jdk.pack.gmk --- a/make/lib/Lib-jdk.pack.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/Lib-jdk.pack.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -40,6 +40,7 @@ -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \ $(LIBJAVA_HEADER_FLAGS), \ CFLAGS_release := -DPRODUCT, \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ MAPFILE := $(TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff -r 67aa88701d46 -r c8a33db795b6 make/lib/LibCommon.gmk --- a/make/lib/LibCommon.gmk Sat Feb 10 09:48:51 2018 +0000 +++ b/make/lib/LibCommon.gmk Sat Feb 10 09:25:35 2018 +0100 @@ -68,12 +68,3 @@ INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE)) ################################################################################ - -# Define it here since there are multiple uses. -ifeq ($(USE_EXTERNAL_LIBZ), true) - LIBZ := -lz -else - ZLIB_CPPFLAGS := -I$(TOPDIR)/src/java.base/share/native/libzip/zlib -endif - -############################################################################### diff -r 67aa88701d46 -r c8a33db795b6 src/hotspot/os/aix/os_aix.cpp --- a/src/hotspot/os/aix/os_aix.cpp Sat Feb 10 09:48:51 2018 +0000 +++ b/src/hotspot/os/aix/os_aix.cpp Sat Feb 10 09:25:35 2018 +0100 @@ -1462,7 +1462,6 @@ os::Aix::meminfo_t mi; if (os::Aix::get_meminfo(&mi)) { - char buffer[256]; if (os::Aix::on_aix()) { st->print_cr("physical total : " SIZE_FORMAT, mi.real_total); st->print_cr("physical free : " SIZE_FORMAT, mi.real_free); @@ -1476,10 +1475,9 @@ // pgsp_free: size of system ASP times percentage of system ASP unused st->print_cr("physical total : " SIZE_FORMAT, mi.real_total); st->print_cr("system asp total : " SIZE_FORMAT, mi.pgsp_total); - st->print_cr("%% system asp used : " SIZE_FORMAT, + st->print_cr("%% system asp used : %.2f", mi.pgsp_total ? (100.0f * (mi.pgsp_total - mi.pgsp_free) / mi.pgsp_total) : -1.0f); } - st->print_raw(buffer); } st->cr(); diff -r 67aa88701d46 -r c8a33db795b6 src/hotspot/share/gc/g1/g1RemSet.cpp --- a/src/hotspot/share/gc/g1/g1RemSet.cpp Sat Feb 10 09:48:51 2018 +0000 +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp Sat Feb 10 09:25:35 2018 +0100 @@ -586,20 +586,6 @@ return; } - // While we are processing RSet buffers during the collection, we - // actually don't want to scan any cards on the collection set, - // since we don't want to update remembered sets with entries that - // point into the collection set, given that live objects from the - // collection set are about to move and such entries will be stale - // very soon. This change also deals with a reliability issue which - // involves scanning a card in the collection set and coming across - // an array that was being chunked and looking malformed. Note, - // however, that if evacuation fails, we have to scan any objects - // that were not moved and create any missing entries. - if (r->in_collection_set()) { - return; - } - // The result from the hot card cache insert call is either: // * pointer to the current card // (implying that the current card is not 'hot'), @@ -624,8 +610,7 @@ // Check whether the region formerly in the cache should be // ignored, as discussed earlier for the original card. The - // region could have been freed while in the cache. The cset is - // not relevant here, since we're in concurrent phase. + // region could have been freed while in the cache. if (!r->is_old_or_humongous()) { return; } diff -r 67aa88701d46 -r c8a33db795b6 src/hotspot/share/runtime/arguments.cpp diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/java/nio/channels/SelectableChannel.java --- a/src/java.base/share/classes/java/nio/channels/SelectableChannel.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/java/nio/channels/SelectableChannel.java Sat Feb 10 09:25:35 2018 +0100 @@ -121,7 +121,7 @@ // keySet, may be empty but is never null, typ. a tiny array // boolean isRegistered, protected by key set // regLock, lock object to prevent duplicate registrations - // boolean isBlocking, protected by regLock + // blocking mode, protected by regLock /** * Tells whether or not this channel is currently registered with any diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java --- a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -26,7 +26,14 @@ package java.nio.channels.spi; import java.io.IOException; -import java.nio.channels.*; +import java.nio.channels.CancelledKeyException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.ClosedSelectorException; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.IllegalSelectorException; +import java.nio.channels.SelectableChannel; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; /** @@ -67,8 +74,8 @@ // Lock for registration and configureBlocking operations private final Object regLock = new Object(); - // Blocking mode, protected by regLock - boolean blocking = true; + // True when non-blocking, need regLock to change; + private volatile boolean nonBlocking; /** * Initializes a new instance of this class. @@ -197,7 +204,7 @@ throw new ClosedChannelException(); if ((ops & ~validOps()) != 0) throw new IllegalArgumentException(); - if (blocking) + if (isBlocking()) throw new IllegalBlockingModeException(); SelectionKey k = findKey(sel); if (k != null) { @@ -264,9 +271,7 @@ // -- Blocking -- public final boolean isBlocking() { - synchronized (regLock) { - return blocking; - } + return !nonBlocking; } public final Object blockingLock() { @@ -287,12 +292,13 @@ synchronized (regLock) { if (!isOpen()) throw new ClosedChannelException(); - if (blocking == block) - return this; - if (block && haveValidKeys()) - throw new IllegalBlockingModeException(); - implConfigureBlocking(block); - blocking = block; + boolean blocking = !nonBlocking; + if (block != blocking) { + if (block && haveValidKeys()) + throw new IllegalBlockingModeException(); + implConfigureBlocking(block); + nonBlocking = !block; + } } return this; } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/java/util/Locale.java --- a/src/java.base/share/classes/java/util/Locale.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/java/util/Locale.java Sat Feb 10 09:25:35 2018 +0100 @@ -808,17 +808,26 @@ } static Locale getInstance(BaseLocale baseloc, LocaleExtensions extensions) { - LocaleKey key = new LocaleKey(baseloc, extensions); - return LOCALECACHE.get(key); + if (extensions == null) { + return LOCALECACHE.get(baseloc); + } else { + LocaleKey key = new LocaleKey(baseloc, extensions); + return LOCALECACHE.get(key); + } } - private static class Cache extends LocaleObjectCache { + private static class Cache extends LocaleObjectCache { private Cache() { } @Override - protected Locale createObject(LocaleKey key) { - return new Locale(key.base, key.exts); + protected Locale createObject(Object key) { + if (key instanceof BaseLocale) { + return new Locale((BaseLocale)key, null); + } else { + LocaleKey lk = (LocaleKey)key; + return new Locale(lk.base, lk.exts); + } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java --- a/src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/jdk/internal/org/xml/sax/SAXException.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -30,6 +30,12 @@ package jdk.internal.org.xml.sax; +import java.io.IOException; +import java.io.InvalidClassException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; + /** * Encapsulate a general SAX error or warning. * @@ -68,7 +74,6 @@ public SAXException () { super(); - this.exception = null; } @@ -79,7 +84,6 @@ */ public SAXException (String message) { super(message); - this.exception = null; } @@ -94,8 +98,7 @@ */ public SAXException (Exception e) { - super(); - this.exception = e; + super(e); } @@ -110,8 +113,7 @@ */ public SAXException (String message, Exception e) { - super(message); - this.exception = e; + super(message, e); } @@ -127,15 +129,15 @@ public String getMessage () { String message = super.getMessage(); + Throwable cause = super.getCause(); - if (message == null && exception != null) { - return exception.getMessage(); + if (message == null && cause != null) { + return cause.getMessage(); } else { return message; } } - /** * Return the embedded exception, if any. * @@ -143,7 +145,7 @@ */ public Exception getException () { - return exception; + return getExceptionInternal(); } /** @@ -152,7 +154,7 @@ * @return Return the cause of the exception */ public Throwable getCause() { - return exception; + return super.getCause(); } /** @@ -162,6 +164,7 @@ */ public String toString () { + Throwable exception = super.getCause(); if (exception != null) { return super.toString() + "\n" + exception.toString(); } else { @@ -175,11 +178,59 @@ // Internal state. ////////////////////////////////////////////////////////////////////// + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField( "exception", Exception.class ) + }; + + /** + * Writes "exception" field to the stream. + * + * @param out stream used for serialization. + * @throws IOException thrown by ObjectOutputStream + */ + private void writeObject(ObjectOutputStream out) + throws IOException { + ObjectOutputStream.PutField fields = out.putFields(); + fields.put("exception", getExceptionInternal()); + out.writeFields(); + } /** - * @serial The embedded exception if tunnelling, or null. + * Reads the "exception" field from the stream. + * And initializes the "exception" if it wasn't + * done before. + * + * @param in stream used for deserialization + * @throws IOException thrown by ObjectInputStream + * @throws ClassNotFoundException thrown by ObjectInputStream */ - private Exception exception; + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + ObjectInputStream.GetField fields = in.readFields(); + Exception exception = (Exception) fields.get("exception", null); + Throwable superCause = super.getCause(); + + // if super.getCause() and 'exception' fields present then always use + // getCause() value. Otherwise, use 'exception' to initialize cause + if (superCause == null && exception != null) { + try { + super.initCause(exception); + } catch (IllegalStateException e) { + throw new InvalidClassException("Inconsistent state: two causes"); + } + } + } + + // Internal method to guard against overriding of public getException + // method by SAXException subclasses + private Exception getExceptionInternal() { + Throwable cause = super.getCause(); + if (cause instanceof Exception) { + return (Exception) cause; + } else { + return null; + } + } // Added serialVersionUID to preserve binary compatibility static final long serialVersionUID = 583241635256073760L; diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties --- a/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties Sat Feb 10 09:25:35 2018 +0100 @@ -30,12 +30,12 @@ java.launcher.opt.hotspot =\ {0}\t est un synonyme pour la machine virtuelle "{1}" [en phase d''abandon]\n # Translators please note do not translate the options themselves -java.launcher.opt.footer = \ -cp \n -classpath \n --class-path \n Liste distincte {0} de r\u00E9pertoires, d''archives JAR\n et d'archives ZIP pour rechercher des fichiers de classe.\n -p \n --module-path ...\n Liste distincte {0} de r\u00E9pertoires, chaque r\u00E9pertoire\n est un r\u00E9pertoire de modules.\n --upgrade-module-path ...\n Liste distincte {0} de r\u00E9pertoires, chaque r\u00E9pertoire\n est un r\u00E9pertoire de module qui remplace les modules\n pouvant \u00EAtre mis \u00E0 niveau dans l'image d'ex\u00E9cution\n --add-modules [,...]\n modules racine \u00E0 r\u00E9soudre en plus du module initial.\n peut \u00E9galement \u00EAtre ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH.\n --list-modules\n r\u00E9pertorier les modules observables et quitter\n -d \n --describe-module \n d\u00E9crire un module et quitter\n --dry-run cr\u00E9er une machine virtuelle et charger la classe principale mais ne pas ex\u00E9cuter la m\u00E9thode principale.\n L'option--dry-run peut \u00EAtre utile pour la validation des\n options de ligne de commande telles que la configuration syst\u00E8me de module.\n --validate-modules\n valider tous les modules et quitter\n L'option --validate-modules peut \u00EAtre utile pour la recherche de\n conflits et d'autres erreurs avec des modules dans le chemin de module.\n -D=\n d\u00E9finir une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|module|gc|jni]\n activer la sortie en mode verbose\n -version afficher la version de produit dans le flux d'erreur et quitter\n --version afficher la version de produit dans le flux de sortie et quitter\n -showversion afficher la version de produit dans le flux d'erreur et continuer\n --show-version\n afficher la version de produit dans le flux de sortie et continuer\n --show-module-resolution\n afficher la sortie de r\u00E9solution de module lors du d\u00E9marrage\n -? -h -help\n afficher ce message d'aide dans le flux d'erreur\n --help afficher ce message d'erreur dans le flux de sortie\n -X afficher l'aide sur des options suppl\u00E9mentaires dans le flux d'erreur\n --help-extra afficher l'aide sur des options suppl\u00E9mentaires dans le flux de sortie\n -ea[:...|:]\n -enableassertions[:...|:]\n activer des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:...|:]\n -disableassertions[:...|:]\n d\u00E9sactiver des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activer des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactiver des assertions syst\u00E8me\n -agentlib:[=]\n charger la biblioth\u00E8que d'agent natif , par ex. -agentlib:jdwp\n voir \u00E9galement -agentlib:jdwp=help\n -agentpath:[=]\n charger la biblioth\u00E8que d'agent natif par nom de chemin complet\n -javaagent:[=]\n charger l'agent de langage de programmation, voir \ -java.lang.instrument\n -splash:\n afficher l'\u00E9cran d'accueil avec l'image indiqu\u00E9e\n Les images redimensionn\u00E9es HiDPI sont automatiquement prises en charge et utilis\u00E9es\n si elles sont disponibles. Le nom de fichier d'une image non redimensionn\u00E9e, par ex. image.ext,\n doit toujours \u00EAtre transmis comme argument \u00E0 l'option -splash.\n L'image redimensionn\u00E9e fournie la plus appropri\u00E9e sera automatiquement\n s\u00E9lectionn\u00E9e.\n Pour plus d'informations, reportez-vous \u00E0 la documentation relative \u00E0 l'API SplashScreen\n fichiers @argument\n fichiers d'arguments contenant des options\n -disable-@files\n emp\u00EAcher le d\u00E9veloppement suppl\u00E9mentaire de fichiers d'arguments\nAfin d'indiquer un argument pour une option longue, vous pouvez utiliser --= ou\n-- .\n +java.launcher.opt.footer = \ -cp \n -classpath \n --class-path \n Liste, avec s\u00E9parateur {0}, de r\u00E9pertoires, d''archives JAR\n et d'archives ZIP pour rechercher des fichiers de classe.\n -p \n --module-path ...\n Liste, avec s\u00E9parateur {0}, de r\u00E9pertoires, chaque r\u00E9pertoire\n est un r\u00E9pertoire de modules.\n --upgrade-module-path ...\n Liste, avec s\u00E9parateur {0}, de r\u00E9pertoires, chaque r\u00E9pertoire\n est un r\u00E9pertoire de module qui remplace les modules\n pouvant \u00EAtre mis \u00E0 niveau dans l'image d'ex\u00E9cution\n --add-modules [,...]\n modules racine \u00E0 r\u00E9soudre en plus du module initial.\n peut \u00E9galement \u00EAtre ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH.\n --list-modules\n r\u00E9pertorier les modules observables et quitter\n -d \n --describe-module \n d\u00E9crire un module et quitter\n --dry-run cr\u00E9er une machine virtuelle et charger la classe principale mais ne pas ex\u00E9cuter la m\u00E9thode principale.\n L'option--dry-run peut \u00EAtre utile pour la validation des\n options de ligne de commande telles que la configuration du syst\u00E8me de modules.\n --validate-modules\n valider tous les modules et quitter\n L'option --validate-modules peut \u00EAtre utile pour la recherche de\n conflits et d'autres erreurs avec des modules dans le chemin de modules.\n -D=\n d\u00E9finir une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|module|gc|jni]\n activer la sortie en mode verbose\n -version afficher la version de produit dans le flux d'erreur et quitter\n --version afficher la version de produit dans le flux de sortie et quitter\n -showversion afficher la version de produit dans le flux d'erreur et continuer\n --show-version\n afficher la version de produit dans le flux de sortie et continuer\n --show-module-resolution\n afficher la sortie de r\u00E9solution de module lors du d\u00E9marrage\n -? -h -help\n afficher ce message d'aide dans le flux d'erreur\n --help afficher ce message d'erreur dans le flux de sortie\n -X afficher l'aide sur des options suppl\u00E9mentaires dans le flux d'erreur\n --help-extra afficher l'aide sur des options suppl\u00E9mentaires dans le flux de sortie\n -ea[:...|:]\n -enableassertions[:...|:]\n activer des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:...|:]\n -disableassertions[:...|:]\n d\u00E9sactiver des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activer des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactiver des assertions syst\u00E8me\n -agentlib:[=]\n charger la biblioth\u00E8que d'agent natif , par ex. -agentlib:jdwp\n voir \u00E9galement -agentlib:jdwp=help\n -agentpath:[=]\n charger la biblioth\u00E8que d'agent natif par nom de chemin complet\n -javaagent:[=]\n charger \ +l'agent de langage de programmation, voir java.lang.instrument\n -splash:\n afficher l'\u00E9cran d'accueil avec l'image indiqu\u00E9e\n Les images redimensionn\u00E9es HiDPI sont automatiquement prises en charge et utilis\u00E9es\n si elles sont disponibles. Le nom de fichier d'une image non redimensionn\u00E9e, par ex. image.ext,\n doit toujours \u00EAtre transmis comme argument \u00E0 l'option -splash.\n L'image redimensionn\u00E9e fournie la plus appropri\u00E9e sera automatiquement\n s\u00E9lectionn\u00E9e.\n Pour plus d'informations, reportez-vous \u00E0 la documentation relative \u00E0 l'API SplashScreen\n fichiers @argument\n fichiers d'arguments contenant des options\n -disable-@files\n emp\u00EAcher le d\u00E9veloppement suppl\u00E9mentaire de fichiers d'arguments\nAfin d'indiquer un argument pour une option longue, vous pouvez utiliser --= ou\n-- .\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a :\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc: journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatages\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration.\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss d\u00E9finition de la taille de pile de thread Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads =(,)*\n met \u00E0 jour pour lire , sans tenir compte\n de la d\u00E9claration de module. \n peut \u00EAtre ALL-UNNAMED pour lire tous les\n modules sans nom.\n --add-exports /=(,)*\n met \u00E0 jour pour exporter vers ,\n sans tenir compte de la d\u00E9claration de module.\n peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n les modules sans nom.\n --add-opens /=(,)*\n met \u00E0 jour pour ouvrir vers\n , sans tenir compte de la d\u00E9claration de module.\n --illegal-access=\n autorise ou refuse l''acc\u00E8s \u00E0 des membres de types dans des modules nomm\u00E9s\n par code \ -dans des modules sans nom.\n est l''une des valeurs suivantes : "deny", "permit", "warn" ou "debug"\n Cette option sera enlev\u00E9e dans une version ult\u00E9rieure.\n --limit-modules [,...]\n limite l''univers des modules observables\n --patch-module =({0})*\n remplace ou augmente un module avec des classes et des ressources\n dans des fichiers ou r\u00E9pertoires JAR.\n --disable-@files d\u00E9sactive d''autres d\u00E9veloppements de fichier d''argument\n\nCes options suppl\u00E9mentaires peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n +java.launcher.X.usage=\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a:\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc: journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatages\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration.\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss d\u00E9finition de la taille de pile de thread Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads =(,)*\n met \u00E0 jour pour lire , sans tenir compte\n de la d\u00E9claration de module. \n peut \u00EAtre ALL-UNNAMED pour lire tous les\n modules sans nom.\n --add-exports /=(,)*\n met \u00E0 jour pour exporter vers ,\n sans tenir compte de la d\u00E9claration de module.\n peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n les modules sans nom.\n --add-opens /=(,)*\n met \u00E0 jour pour ouvrir vers\n , sans tenir compte de la d\u00E9claration de module.\n --illegal-access=\n autorise ou refuse l''acc\u00E8s \u00E0 des membres de types dans des modules nomm\u00E9s\n par code \ +dans des modules sans nom.\n est l''une des valeurs suivantes : "deny", "permit", "warn" ou "debug"\n Cette option sera enlev\u00E9e dans une version ult\u00E9rieure.\n --limit-modules [,...]\n limite l''univers des modules observables\n --patch-module =({0})*\n remplace ou augmente un module avec des classes et des ressources\n dans des fichiers JAR ou des r\u00E9pertoires.\n --disable-@files d\u00E9sactive d''autres d\u00E9veloppements de fichier d''argument\n\nCes options suppl\u00E9mentaires peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\nLes options suivantes sont propres \u00E0 Mac OS X :\n -XstartOnFirstThread\n ex\u00E9cute la m\u00E9thode main() sur le premier thread (AppKit)\n -Xdock:name=\n remplace le nom d'application par d\u00E9faut affich\u00E9 dans l'ancrage\n -Xdock:icon=\n remplace l'ic\u00F4ne par d\u00E9faut affich\u00E9e dans l'ancrage\n\n diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java --- a/src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -136,7 +136,7 @@ if (fileLockTable == null) { synchronized (this) { if (fileLockTable == null) { - fileLockTable = FileLockTable.newSharedFileLockTable(this, fdObj); + fileLockTable = new FileLockTable(this, fdObj); } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java --- a/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -27,11 +27,32 @@ import java.io.FileDescriptor; import java.io.IOException; -import java.net.*; +import java.net.DatagramSocket; +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.NetworkInterface; +import java.net.PortUnreachableException; +import java.net.ProtocolFamily; +import java.net.SocketAddress; +import java.net.SocketOption; +import java.net.StandardProtocolFamily; +import java.net.StandardSocketOptions; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; -import java.util.*; +import java.nio.channels.AlreadyBoundException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.DatagramChannel; +import java.nio.channels.MembershipKey; +import java.nio.channels.NotYetConnectedException; +import java.nio.channels.SelectionKey; +import java.nio.channels.UnsupportedAddressTypeException; +import java.nio.channels.spi.SelectorProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; + import sun.net.ResourceManager; import sun.net.ext.ExtendedSocketOptions; @@ -49,9 +70,6 @@ // Our file descriptor private final FileDescriptor fd; - - // fd value needed for dev/poll. This value will remain valid - // even after the value in the file descriptor object has been set to -1 private final int fdVal; // The protocol family of the socket @@ -67,10 +85,10 @@ private int cachedSenderPort; // Lock held by current reading or connecting thread - private final Object readLock = new Object(); + private final ReentrantLock readLock = new ReentrantLock(); // Lock held by current writing or connecting thread - private final Object writeLock = new Object(); + private final ReentrantLock writeLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -103,7 +121,6 @@ // -- End of fields protected by stateLock - public DatagramChannelImpl(SelectorProvider sp) throws IOException { @@ -138,16 +155,27 @@ throw new UnsupportedOperationException("IPv6 not available"); } } - this.family = family; - this.fd = Net.socket(family, false); - this.fdVal = IOUtil.fdVal(fd); - this.state = ST_UNCONNECTED; + + ResourceManager.beforeUdpCreate(); + try { + this.family = family; + this.fd = Net.socket(family, false); + this.fdVal = IOUtil.fdVal(fd); + this.state = ST_UNCONNECTED; + } catch (IOException ioe) { + ResourceManager.afterUdpClose(); + throw ioe; + } } public DatagramChannelImpl(SelectorProvider sp, FileDescriptor fd) throws IOException { super(sp); + + // increment UDP count to match decrement when closing + ResourceManager.beforeUdpCreate(); + this.family = Net.isIPv6Available() ? StandardProtocolFamily.INET6 : StandardProtocolFamily.INET; this.fd = fd; @@ -328,7 +356,8 @@ public SocketAddress receive(ByteBuffer dst) throws IOException { if (dst.isReadOnly()) throw new IllegalArgumentException("Read-only buffer"); - synchronized (readLock) { + readLock.lock(); + try { ensureOpen(); // Socket was not bound before attempting receive if (localAddress() == null) @@ -348,6 +377,8 @@ if (n == IOStatus.UNAVAILABLE) return null; } else { + // Cannot receive into user's buffer when running with a + // security manager and not connected bb = Util.getTemporaryDirectBuffer(dst.remaining()); for (;;) { do { @@ -379,6 +410,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -425,7 +458,8 @@ if (src == null) throw new NullPointerException(); - synchronized (writeLock) { + writeLock.lock(); + try { ensureOpen(); InetSocketAddress isa = Net.checkAddress(target); InetAddress ia = isa.getAddress(); @@ -474,6 +508,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -534,7 +570,8 @@ public int read(ByteBuffer buf) throws IOException { if (buf == null) throw new NullPointerException(); - synchronized (readLock) { + readLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -555,6 +592,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -563,7 +602,8 @@ { if ((offset < 0) || (length < 0) || (offset > dsts.length - length)) throw new IndexOutOfBoundsException(); - synchronized (readLock) { + readLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -584,13 +624,16 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } public int write(ByteBuffer buf) throws IOException { if (buf == null) throw new NullPointerException(); - synchronized (writeLock) { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -611,6 +654,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -619,7 +664,8 @@ { if ((offset < 0) || (length < 0) || (offset > srcs.length - length)) throw new IndexOutOfBoundsException(); - synchronized (writeLock) { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (!isConnected()) @@ -640,6 +686,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -661,8 +709,10 @@ @Override public DatagramChannel bind(SocketAddress local) throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpen(); if (localAddress != null) @@ -692,7 +742,11 @@ Net.bind(family, fd, isa.getAddress(), isa.getPort()); localAddress = Net.localAddress(fd); } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } @@ -714,8 +768,10 @@ @Override public DatagramChannel connect(SocketAddress sa) throws IOException { - synchronized(readLock) { - synchronized(writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { ensureOpenAndUnconnected(); InetSocketAddress isa = Net.checkAddress(sa); @@ -741,10 +797,9 @@ localAddress = Net.localAddress(fd); // flush any packets already received. - boolean blocking = false; synchronized (blockingLock()) { + boolean blocking = isBlocking(); try { - blocking = isBlocking(); ByteBuffer tmpBuf = ByteBuffer.allocate(100); if (blocking) { configureBlocking(false); @@ -759,14 +814,20 @@ } } } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } public DatagramChannel disconnect() throws IOException { - synchronized(readLock) { - synchronized(writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { if (!isConnected() || !isOpen()) return this; @@ -783,7 +844,11 @@ // refresh local address localAddress = Net.localAddress(fd); } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } @@ -1087,7 +1152,8 @@ int poll(int events, long timeout) throws IOException { assert Thread.holdsLock(blockingLock()) && !isBlocking(); - synchronized (readLock) { + readLock.lock(); + try { int n = 0; try { begin(); @@ -1102,6 +1168,8 @@ end(n > 0); } return n; + } finally { + readLock.unlock(); } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java --- a/src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -25,10 +25,22 @@ package sun.nio.ch; -import java.io.*; -import java.net.*; -import java.nio.*; -import java.nio.channels.*; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.DatagramSocketImpl; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.NetworkInterface; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketOption; +import java.net.SocketTimeoutException; +import java.net.StandardSocketOptions; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.DatagramChannel; +import java.nio.channels.IllegalBlockingModeException; // Make a datagram-socket channel look like a datagram socket. @@ -178,7 +190,6 @@ dc.configureBlocking(false); try { - int n; SocketAddress sender; if ((sender = dc.receive(bb)) != null) return sender; @@ -188,19 +199,18 @@ throw new ClosedChannelException(); long st = System.currentTimeMillis(); int result = dc.poll(Net.POLLIN, to); - if (result > 0 && - ((result & Net.POLLIN) != 0)) { + if (result > 0 && ((result & Net.POLLIN) != 0)) { if ((sender = dc.receive(bb)) != null) return sender; } to -= System.currentTimeMillis() - st; if (to <= 0) throw new SocketTimeoutException(); - } } finally { - if (dc.isOpen()) + try { dc.configureBlocking(true); + } catch (ClosedChannelException e) { } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java --- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -1083,49 +1083,19 @@ // -- Locks -- - - // keeps track of locks on this file private volatile FileLockTable fileLockTable; - // indicates if file locks are maintained system-wide (as per spec) - private static boolean isSharedFileLockTable; - - // indicates if the disableSystemWideOverlappingFileLockCheck property - // has been checked - private static volatile boolean propertyChecked; - - // The lock list in J2SE 1.4/5.0 was local to each FileChannel instance so - // the overlap check wasn't system wide when there were multiple channels to - // the same file. This property is used to get 1.4/5.0 behavior if desired. - private static boolean isSharedFileLockTable() { - if (!propertyChecked) { - synchronized (FileChannelImpl.class) { - if (!propertyChecked) { - String value = GetPropertyAction.privilegedGetProperty( - "sun.nio.ch.disableSystemWideOverlappingFileLockCheck"); - isSharedFileLockTable = ((value == null) || value.equals("false")); - propertyChecked = true; - } - } - } - return isSharedFileLockTable; - } - private FileLockTable fileLockTable() throws IOException { if (fileLockTable == null) { synchronized (this) { if (fileLockTable == null) { - if (isSharedFileLockTable()) { - int ti = threads.add(); - try { - ensureOpen(); - fileLockTable = FileLockTable.newSharedFileLockTable(this, fd); - } finally { - threads.remove(ti); - } - } else { - fileLockTable = new SimpleFileLockTable(); + int ti = threads.add(); + try { + ensureOpen(); + fileLockTable = new FileLockTable(this, fd); + } finally { + threads.remove(ti); } } } @@ -1229,59 +1199,6 @@ fileLockTable.remove(fli); } - // -- File lock support -- - - /** - * A simple file lock table that maintains a list of FileLocks obtained by a - * FileChannel. Use to get 1.4/5.0 behaviour. - */ - private static class SimpleFileLockTable extends FileLockTable { - // synchronize on list for access - private final List lockList = new ArrayList(2); - - public SimpleFileLockTable() { - } - - private void checkList(long position, long size) - throws OverlappingFileLockException - { - assert Thread.holdsLock(lockList); - for (FileLock fl: lockList) { - if (fl.overlaps(position, size)) { - throw new OverlappingFileLockException(); - } - } - } - - public void add(FileLock fl) throws OverlappingFileLockException { - synchronized (lockList) { - checkList(fl.position(), fl.size()); - lockList.add(fl); - } - } - - public void remove(FileLock fl) { - synchronized (lockList) { - lockList.remove(fl); - } - } - - public List removeAll() { - synchronized(lockList) { - List result = new ArrayList(lockList); - lockList.clear(); - return result; - } - } - - public void replace(FileLock fl1, FileLock fl2) { - synchronized (lockList) { - lockList.remove(fl1); - lockList.add(fl2); - } - } - } - // -- Native methods -- // Creates a new mapping diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/FileLockTable.java --- a/src/java.base/share/classes/sun/nio/ch/FileLockTable.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/FileLockTable.java Sat Feb 10 09:25:35 2018 +0100 @@ -25,64 +25,27 @@ package sun.nio.ch; -import java.nio.channels.*; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.lang.ref.*; import java.io.FileDescriptor; import java.io.IOException; - -abstract class FileLockTable { - protected FileLockTable() { - } - - /** - * Creates and returns a file lock table for a channel that is connected to - * the a system-wide map of all file locks for the Java virtual machine. - */ - public static FileLockTable newSharedFileLockTable(Channel channel, - FileDescriptor fd) - throws IOException - { - return new SharedFileLockTable(channel, fd); - } - - /** - * Adds a file lock to the table. - * - * @throws OverlappingFileLockException if the file lock overlaps - * with an existing file lock in the table - */ - public abstract void add(FileLock fl) throws OverlappingFileLockException; - - /** - * Remove an existing file lock from the table. - */ - public abstract void remove(FileLock fl); - - /** - * Removes all file locks from the table. - * - * @return The list of file locks removed - */ - public abstract List removeAll(); - - /** - * Replaces an existing file lock in the table. - */ - public abstract void replace(FileLock fl1, FileLock fl2); -} - +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import java.nio.channels.Channel; +import java.nio.channels.FileLock; +import java.nio.channels.OverlappingFileLockException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; /** * A file lock table that is over a system-wide map of all file locks. */ -class SharedFileLockTable extends FileLockTable { - +class FileLockTable { /** * A weak reference to a FileLock. *

- * SharedFileLockTable uses a list of file lock references to avoid keeping the + * FileLockTable uses a list of file lock references to avoid keeping the * FileLock (and FileChannel) alive. */ private static class FileLockReference extends WeakReference { @@ -118,14 +81,17 @@ // Locks obtained for this channel private final Set locks; - SharedFileLockTable(Channel channel, FileDescriptor fd) throws IOException { + /** + * Creates a file lock table for a channel that is connected to the + * system-wide map of all file locks for the Java virtual machine. + */ + FileLockTable(Channel channel, FileDescriptor fd) throws IOException { this.channel = channel; this.fileKey = FileKey.create(fd); this.locks = new HashSet(); } - @Override - public void add(FileLock fl) throws OverlappingFileLockException { + void add(FileLock fl) throws OverlappingFileLockException { List list = lockMap.get(fileKey); for (;;) { @@ -176,8 +142,7 @@ } } - @Override - public void remove(FileLock fl) { + void remove(FileLock fl) { assert fl != null; // the lock must exist so the list of locks must be present @@ -201,8 +166,7 @@ } } - @Override - public List removeAll() { + List removeAll() { List result = new ArrayList(); List list = lockMap.get(fileKey); if (list != null) { @@ -234,8 +198,7 @@ return result; } - @Override - public void replace(FileLock fromLock, FileLock toLock) { + void replace(FileLock fromLock, FileLock toLock) { // the lock must exist so there must be a list List list = lockMap.get(fileKey); assert list != null; diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/IOUtil.java --- a/src/java.base/share/classes/sun/nio/ch/IOUtil.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/IOUtil.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -78,7 +78,7 @@ src.position(pos); int n = writeFromNativeBuffer(fd, bb, position, - directIO, alignment, nd); + directIO, alignment, nd); if (n > 0) { // now update src src.position(pos + n); @@ -161,8 +161,7 @@ if (!(buf instanceof DirectBuffer)) { ByteBuffer shadow; if (directIO) - shadow = Util.getTemporaryAlignedDirectBuffer(rem, - alignment); + shadow = Util.getTemporaryAlignedDirectBuffer(rem, alignment); else shadow = Util.getTemporaryDirectBuffer(rem); shadow.put(buf); @@ -241,8 +240,7 @@ int rem = dst.remaining(); if (directIO) { Util.checkRemainingBufferSizeAligned(rem, alignment); - bb = Util.getTemporaryAlignedDirectBuffer(rem, - alignment); + bb = Util.getTemporaryAlignedDirectBuffer(rem, alignment); } else { bb = Util.getTemporaryDirectBuffer(rem); } @@ -277,8 +275,7 @@ return 0; int n = 0; if (position != -1) { - n = nd.pread(fd, ((DirectBuffer)bb).address() + pos, - rem, position); + n = nd.pread(fd, ((DirectBuffer)bb).address() + pos, rem, position); } else { n = nd.read(fd, ((DirectBuffer)bb).address() + pos, rem); } @@ -332,8 +329,7 @@ if (!(buf instanceof DirectBuffer)) { ByteBuffer shadow; if (directIO) { - shadow = Util.getTemporaryAlignedDirectBuffer(rem, - alignment); + shadow = Util.getTemporaryAlignedDirectBuffer(rem, alignment); } else { shadow = Util.getTemporaryDirectBuffer(rem); } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java --- a/src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -25,9 +25,20 @@ package sun.nio.ch; -import java.io.*; -import java.net.*; -import java.nio.channels.*; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.net.StandardSocketOptions; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.NotYetBoundException; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; // Make a server-socket channel look like a server socket. @@ -37,7 +48,7 @@ // class. // -public class ServerSocketAdaptor // package-private +class ServerSocketAdaptor // package-private extends ServerSocket { @@ -96,13 +107,18 @@ try { if (!ssc.isBound()) throw new NotYetBoundException(); + if (timeout == 0) { + // for compatibility reasons: accept connection if available + // when configured non-blocking SocketChannel sc = ssc.accept(); if (sc == null && !ssc.isBlocking()) throw new IllegalBlockingModeException(); return sc.socket(); } + if (!ssc.isBlocking()) + throw new IllegalBlockingModeException(); ssc.configureBlocking(false); try { SocketChannel sc; @@ -121,10 +137,10 @@ throw new SocketTimeoutException(); } } finally { - if (ssc.isOpen()) + try { ssc.configureBlocking(true); + } catch (ClosedChannelException e) { } } - } catch (Exception x) { Net.translateException(x); assert false; @@ -178,8 +194,7 @@ if (!isBound()) return "ServerSocket[unbound]"; return "ServerSocket[addr=" + getInetAddress() + - // ",port=" + getPort() + - ",localport=" + getLocalPort() + "]"; + ",localport=" + getLocalPort() + "]"; } public void setReceiveBufferSize(int size) throws SocketException { diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java --- a/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -27,10 +27,25 @@ import java.io.FileDescriptor; import java.io.IOException; -import java.net.*; -import java.nio.channels.*; -import java.nio.channels.spi.*; -import java.util.*; +import java.net.InetSocketAddress; +import java.net.ProtocolFamily; +import java.net.ServerSocket; +import java.net.SocketAddress; +import java.net.SocketOption; +import java.net.StandardProtocolFamily; +import java.net.StandardSocketOptions; +import java.nio.channels.AlreadyBoundException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.NotYetBoundException; +import java.nio.channels.SelectionKey; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.nio.channels.spi.SelectorProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; + import sun.net.NetHooks; /** @@ -47,16 +62,13 @@ // Our file descriptor private final FileDescriptor fd; - - // fd value needed for dev/poll. This value will remain valid - // even after the value in the file descriptor object has been set to -1 - private int fdVal; + private final int fdVal; // ID of native thread currently blocked in this channel, for signalling private volatile long thread; // Lock held by thread currently blocked in this channel - private final Object lock = new Object(); + private final ReentrantLock acceptLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -77,7 +89,7 @@ private boolean isReuseAddress; // Our socket adaptor, if any - ServerSocket socket; + private ServerSocket socket; // -- End of fields protected by stateLock @@ -211,7 +223,8 @@ @Override public ServerSocketChannel bind(SocketAddress local, int backlog) throws IOException { - synchronized (lock) { + acceptLock.lock(); + try { if (!isOpen()) throw new ClosedChannelException(); if (isBound()) @@ -227,12 +240,15 @@ synchronized (stateLock) { localAddress = Net.localAddress(fd); } + } finally { + acceptLock.unlock(); } return this; } public SocketChannel accept() throws IOException { - synchronized (lock) { + acceptLock.lock(); + try { if (!isOpen()) throw new ClosedChannelException(); if (!isBound()) @@ -278,6 +294,8 @@ } return sc; + } finally { + acceptLock.unlock(); } } @@ -353,7 +371,8 @@ int poll(int events, long timeout) throws IOException { assert Thread.holdsLock(blockingLock()) && !isBlocking(); - synchronized (lock) { + acceptLock.lock(); + try { int n = 0; try { begin(); @@ -368,6 +387,8 @@ end(n > 0); } return n; + } finally { + acceptLock.unlock(); } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java --- a/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -25,10 +25,23 @@ package sun.nio.ch; -import java.io.*; -import java.net.*; -import java.nio.*; -import java.nio.channels.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketImpl; +import java.net.SocketOption; +import java.net.SocketTimeoutException; +import java.net.StandardSocketOptions; +import java.nio.ByteBuffer; +import java.nio.channels.Channels; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.SocketChannel; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.util.concurrent.TimeUnit; @@ -45,7 +58,7 @@ // java.net.Socket so as to simplify tracking future changes to that class. // -public class SocketAdaptor +class SocketAdaptor extends Socket { @@ -89,7 +102,6 @@ throw new IllegalBlockingModeException(); try { - if (timeout == 0) { sc.connect(remote); return; @@ -119,8 +131,9 @@ } } } finally { - if (sc.isOpen()) + try { sc.configureBlocking(true); + } catch (ClosedChannelException e) { } } } catch (Exception x) { @@ -188,10 +201,11 @@ synchronized (sc.blockingLock()) { if (!sc.isBlocking()) throw new IllegalBlockingModeException(); + if (timeout == 0) return sc.read(bb); + sc.configureBlocking(false); - try { int n; if ((n = sc.read(bb)) != 0) @@ -213,10 +227,10 @@ throw new SocketTimeoutException(); } } finally { - if (sc.isOpen()) + try { sc.configureBlocking(true); + } catch (ClosedChannelException e) { } } - } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java --- a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -27,11 +27,30 @@ import java.io.FileDescriptor; import java.io.IOException; -import java.net.*; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ProtocolFamily; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketOption; +import java.net.StandardProtocolFamily; +import java.net.StandardSocketOptions; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; -import java.util.*; +import java.nio.channels.AlreadyBoundException; +import java.nio.channels.AlreadyConnectedException; +import java.nio.channels.AsynchronousCloseException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.ConnectionPendingException; +import java.nio.channels.NoConnectionPendingException; +import java.nio.channels.NotYetConnectedException; +import java.nio.channels.SelectionKey; +import java.nio.channels.SocketChannel; +import java.nio.channels.spi.SelectorProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; + import sun.net.NetHooks; import sun.net.ext.ExtendedSocketOptions; @@ -49,9 +68,6 @@ // Our file descriptor object private final FileDescriptor fd; - - // fd value needed for dev/poll. This value will remain valid - // even after the value in the file descriptor object has been set to -1 private final int fdVal; // IDs of native threads doing reads and writes, for signalling @@ -59,10 +75,10 @@ private volatile long writerThread; // Lock held by current reading or connecting thread - private final Object readLock = new Object(); + private final ReentrantLock readLock = new ReentrantLock(); // Lock held by current writing or connecting thread - private final Object writeLock = new Object(); + private final ReentrantLock writeLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -89,7 +105,6 @@ // Input/Output open private boolean isInputOpen = true; private boolean isOutputOpen = true; - private boolean readyToConnect = false; // Socket adaptor, created on demand private Socket socket; @@ -298,7 +313,8 @@ if (buf == null) throw new NullPointerException(); - synchronized (readLock) { + readLock.lock(); + try { if (!ensureReadOpen()) return -1; int n = 0; @@ -418,6 +434,8 @@ assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -426,7 +444,8 @@ { if ((offset < 0) || (length < 0) || (offset > dsts.length - length)) throw new IndexOutOfBoundsException(); - synchronized (readLock) { + readLock.lock(); + try { if (!ensureReadOpen()) return -1; long n = 0; @@ -453,13 +472,16 @@ } assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } public int write(ByteBuffer buf) throws IOException { if (buf == null) throw new NullPointerException(); - synchronized (writeLock) { + writeLock.lock(); + try { ensureWriteOpen(); int n = 0; try { @@ -484,6 +506,8 @@ } assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -492,7 +516,8 @@ { if ((offset < 0) || (length < 0) || (offset > srcs.length - length)) throw new IndexOutOfBoundsException(); - synchronized (writeLock) { + writeLock.lock(); + try { ensureWriteOpen(); long n = 0; try { @@ -517,12 +542,15 @@ } assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } // package-private int sendOutOfBandData(byte b) throws IOException { - synchronized (writeLock) { + writeLock.lock(); + try { ensureWriteOpen(); int n = 0; try { @@ -547,6 +575,8 @@ } assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } @@ -568,8 +598,10 @@ @Override public SocketChannel bind(SocketAddress local) throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); @@ -587,7 +619,11 @@ Net.bind(fd, isa.getAddress(), isa.getPort()); localAddress = Net.localAddress(fd); } + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } return this; } @@ -616,14 +652,16 @@ } public boolean connect(SocketAddress sa) throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { ensureOpenAndUnconnected(); InetSocketAddress isa = Net.checkAddress(sa); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(isa.getAddress().getHostAddress(), - isa.getPort()); + isa.getPort()); synchronized (blockingLock()) { int n = 0; try { @@ -636,8 +674,8 @@ // notify hook only if unbound if (localAddress == null) { NetHooks.beforeTcpConnect(fd, - isa.getAddress(), - isa.getPort()); + isa.getAddress(), + isa.getPort()); } readerThread = NativeThread.current(); } @@ -646,10 +684,9 @@ if (ia.isAnyLocalAddress()) ia = InetAddress.getLocalHost(); n = Net.connect(fd, - ia, - isa.getPort()); - if ( (n == IOStatus.INTERRUPTED) - && isOpen()) + ia, + isa.getPort()); + if ((n == IOStatus.INTERRUPTED) && isOpen()) continue; break; } @@ -686,13 +723,19 @@ } } return false; + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } } public boolean finishConnect() throws IOException { - synchronized (readLock) { - synchronized (writeLock) { + readLock.lock(); + try { + writeLock.lock(); + try { synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); @@ -714,24 +757,20 @@ } if (!isBlocking()) { for (;;) { - n = checkConnect(fd, false, - readyToConnect); - if ( (n == IOStatus.INTERRUPTED) - && isOpen()) + n = checkConnect(fd, false); + if ((n == IOStatus.INTERRUPTED) && isOpen()) continue; break; } } else { for (;;) { - n = checkConnect(fd, true, - readyToConnect); + n = checkConnect(fd, true); if (n == 0) { // Loop in case of // spurious notifications continue; } - if ( (n == IOStatus.INTERRUPTED) - && isOpen()) + if ((n == IOStatus.INTERRUPTED) && isOpen()) continue; break; } @@ -769,7 +808,11 @@ return true; } return false; + } finally { + writeLock.unlock(); } + } finally { + readLock.unlock(); } } @@ -903,9 +946,6 @@ if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { newOps = intOps; sk.nioReadyOps(newOps); - // No need to poll again in checkConnect, - // the error will be detected there - readyToConnect = true; return (newOps & ~oldOps) != 0; } @@ -918,7 +958,6 @@ ((intOps & SelectionKey.OP_CONNECT) != 0) && ((state == ST_UNCONNECTED) || (state == ST_PENDING))) { newOps |= SelectionKey.OP_CONNECT; - readyToConnect = true; } if (((ops & Net.POLLOUT) != 0) && @@ -942,7 +981,8 @@ int poll(int events, long timeout) throws IOException { assert Thread.holdsLock(blockingLock()) && !isBlocking(); - synchronized (readLock) { + readLock.lock(); + try { int n = 0; try { begin(); @@ -957,6 +997,8 @@ end(n > 0); } return n; + } finally { + readLock.unlock(); } } @@ -1024,8 +1066,7 @@ // -- Native methods -- - private static native int checkConnect(FileDescriptor fd, - boolean block, boolean ready) + private static native int checkConnect(FileDescriptor fd, boolean block) throws IOException; private static native int sendOutOfBandData(FileDescriptor fd, byte data) diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/security/provider/PolicyFile.java --- a/src/java.base/share/classes/sun/security/provider/PolicyFile.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/security/provider/PolicyFile.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -580,8 +580,8 @@ k.add(policy); return k; }); - Object[] source = {policy, pe.getLocalizedMessage()}; - System.err.println(LocalizedMessage.getMessage + Object[] source = {policy, pe.getNonlocalizedMessage()}; + System.err.println(LocalizedMessage.getNonlocalized (POLICY + ".error.parsing.policy.message", source)); if (debug != null) { pe.printStackTrace(); @@ -808,14 +808,14 @@ Object[] source = {pe.permission, ite.getTargetException().toString()}; System.err.println( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( POLICY + ".error.adding.Permission.perm.message", source)); } catch (Exception e) { Object[] source = {pe.permission, e.toString()}; System.err.println( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( POLICY + ".error.adding.Permission.perm.message", source)); } @@ -826,7 +826,7 @@ } catch (Exception e) { Object[] source = {e.toString()}; System.err.println( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( POLICY + ".error.adding.Entry.message", source)); } @@ -1803,7 +1803,7 @@ if (colonIndex == -1) { Object[] source = {pe.name}; throw new Exception( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( "alias.name.not.provided.pe.name.", source)); } @@ -1811,7 +1811,7 @@ if ((suffix = getDN(suffix, keystore)) == null) { Object[] source = {value.substring(colonIndex+1)}; throw new Exception( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( "unable.to.perform.substitution.on.alias.suffix", source)); } @@ -1821,7 +1821,7 @@ } else { Object[] source = {prefix}; throw new Exception( - LocalizedMessage.getMessage( + LocalizedMessage.getNonlocalized( "substitution.value.prefix.unsupported", source)); } @@ -2037,7 +2037,7 @@ super(type); if (type == null) { throw new NullPointerException - (LocalizedMessage.getMessage("type.can.t.be.null")); + (LocalizedMessage.getNonlocalized("type.can.t.be.null")); } this.type = type; this.name = name; diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/security/provider/PolicyParser.java --- a/src/java.base/share/classes/sun/security/provider/PolicyParser.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/security/provider/PolicyParser.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -205,8 +205,8 @@ if (!domainEntries.containsKey(domainName)) { domainEntries.put(domainName, de); } else { - LocalizedMessage localizedMsg = - new LocalizedMessage("duplicate.keystore.domain.name"); + LocalizedMessage localizedMsg = new LocalizedMessage( + "duplicate.keystore.domain.name"); Object[] source = {domainName}; String msg = "duplicate keystore domain name: " + domainName; @@ -220,7 +220,7 @@ } if (keyStoreUrlString == null && storePassURL != null) { - throw new ParsingException(LocalizedMessage.getMessage + throw new ParsingException(LocalizedMessage.getNonlocalized ("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore")); } } @@ -362,7 +362,7 @@ keyStoreType = match("quoted string"); } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage("expected.keystore.type")); + LocalizedMessage.getNonlocalized("expected.keystore.type")); } // parse keystore provider @@ -375,7 +375,7 @@ keyStoreProvider = match("quoted string"); } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage("expected.keystore.provider")); + LocalizedMessage.getNonlocalized("expected.keystore.provider")); } } @@ -425,7 +425,7 @@ if (e.codeBase != null) throw new ParsingException( st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("multiple.Codebase.expressions")); e.codeBase = match("quoted string"); peekAndMatch(","); @@ -433,7 +433,7 @@ if (e.signedBy != null) throw new ParsingException( st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("multiple.SignedBy.expressions")); e.signedBy = match("quoted string"); @@ -452,7 +452,7 @@ if (actr <= cctr) throw new ParsingException( st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("SignedBy.has.empty.alias")); peekAndMatch(","); @@ -495,7 +495,7 @@ } throw new ParsingException (st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name")); } } @@ -532,7 +532,7 @@ } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("expected.codeBase.or.SignedBy.or.Principal")); } } @@ -556,7 +556,7 @@ } else { throw new ParsingException(st.lineno(), - LocalizedMessage.getMessage + LocalizedMessage.getNonlocalized ("expected.permission.entry")); } } @@ -733,7 +733,7 @@ switch (lookahead) { case StreamTokenizer.TT_NUMBER: throw new ParsingException(st.lineno(), expect, - LocalizedMessage.getMessage("number.") + + LocalizedMessage.getNonlocalized("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: LocalizedMessage localizedMsg = new LocalizedMessage @@ -826,10 +826,10 @@ switch (lookahead) { case StreamTokenizer.TT_NUMBER: throw new ParsingException(st.lineno(), ";", - LocalizedMessage.getMessage("number.") + + LocalizedMessage.getNonlocalized("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: - throw new ParsingException(LocalizedMessage.getMessage + throw new ParsingException(LocalizedMessage.getNonlocalized ("expected.read.end.of.file.")); default: lookahead = st.nextToken(); @@ -987,7 +987,7 @@ */ public PrincipalEntry(String principalClass, String principalName) { if (principalClass == null || principalName == null) - throw new NullPointerException(LocalizedMessage.getMessage + throw new NullPointerException(LocalizedMessage.getNonlocalized ("null.principalClass.or.principalName")); this.principalClass = principalClass; this.principalName = principalName; @@ -1339,8 +1339,6 @@ public ParsingException(int line, String msg) { super("line " + line + ": " + msg); - // don't call form.format unless getLocalizedMessage is called - // to avoid unnecessary permission checks localizedMsg = new LocalizedMessage("line.number.msg"); source = new Object[] {line, msg}; } @@ -1348,16 +1346,14 @@ public ParsingException(int line, String expect, String actual) { super("line " + line + ": expected [" + expect + "], found [" + actual + "]"); - // don't call form.format unless getLocalizedMessage is called - // to avoid unnecessary permission checks localizedMsg = new LocalizedMessage ("line.number.expected.expect.found.actual."); source = new Object[] {line, expect, actual}; } - @Override - public String getLocalizedMessage() { - return i18nMessage != null ? i18nMessage : localizedMsg.format(source); + public String getNonlocalizedMessage() { + return i18nMessage != null ? i18nMessage : + localizedMsg.formatNonlocalized(source); } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java Sat Feb 10 09:25:35 2018 +0100 @@ -439,11 +439,11 @@ // 8171319: keytool should print out warnings when reading or // generating cert/cert req using weak algorithms - {"the.certificate.request", "Die Zertifikatsanforderung"}, + {"the.certificate.request", "Die Zertifikatanforderung"}, {"the.issuer", "Der Aussteller"}, {"the.generated.certificate", "Das generierte Zertifikat"}, {"the.generated.crl", "Die generierte CRL"}, - {"the.generated.certificate.request", "Die generierte Zertifikatsanforderung"}, + {"the.generated.certificate.request", "Die generierte Zertifikatanforderung"}, {"the.certificate", "Das Zertifikat"}, {"the.crl", "Die CRL"}, {"the.tsa.certificate", "Das TSA-Zertifikat"}, @@ -459,7 +459,7 @@ {".PATTERN.printX509Cert.with.weak", "Eigent\u00FCmer: {0}\nAussteller: {1}\nSeriennummer: {2}\nG\u00FCltig von: {3} bis: {4}\nZertifikatsfingerprints:\n\t SHA1: {5}\n\t SHA256: {6}\nSignaturalgorithmusname: {7}\nPublic Key-Algorithmus von Subject: {8}\nVersion: {9}"}, {"PKCS.10.with.weak", - "PKCS #10-Zertifikatsanforderung (Version 1.0)\nSubject: %1$s\nFormat: %2$s\nPublic Key: %3$s\nSignaturalgorithmus: %4$s\n"}, + "PKCS #10-Zertifikatanforderung (Version 1.0)\nSubject: %1$s\nFormat: %2$s\nPublic Key: %3$s\nSignaturalgorithmus: %4$s\n"}, {"verified.by.s.in.s.weak", "Von %1$s in %2$s mit %3$s verifiziert"}, {"whose.sigalg.risk", "%1$s verwendet den Signaturalgorithmus %2$s. Dies gilt als Sicherheitsrisiko."}, {"whose.key.risk", "%1$s verwendet %2$s. Dies gilt als Sicherheitsrisiko."}, diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/security/util/LocalizedMessage.java --- a/src/java.base/share/classes/sun/security/util/LocalizedMessage.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/security/util/LocalizedMessage.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -42,7 +42,7 @@ public class LocalizedMessage { - private static final Resources resources = new Resources(); + private static final Resources RESOURCES = new Resources(); private final String key; @@ -59,16 +59,28 @@ /** * Return a localized string corresponding to the key stored in this - * object, formatted with the provided arguments. When the VM is booted, - * this method will obtain the correct localized message and format it - * using java.text.MessageFormat. Otherwise, a non-localized string is - * returned, and the formatting is performed by simplified formatting code. + * object, formatted with the provided arguments. This method should only + * be called when the VM is booted and all resources needed to obtain + * and format the localized message are loaded (or can be loaded). * * @param arguments The arguments that should be placed in the message * @return A formatted message string */ - public String format(Object... arguments) { - return getMessage(key, arguments); + public String formatLocalized(Object... arguments) { + return getLocalized(key, arguments); + } + + /** + * Return a non-localized string corresponding to the key stored in this + * object, formatted with the provided arguments. All strings are obtained + * from sun.security.util.Resources, and the formatting only supports + * simple positional argument replacement (e.g. {1}). + * + * @param arguments The arguments that should be placed in the message + * @return A formatted message string + */ + public String formatNonlocalized(Object... arguments) { + return getNonlocalized(key, arguments); } /** @@ -81,10 +93,10 @@ * @param arguments The arguments that should be placed in the message * @return A formatted message string */ - public static String getMessageUnbooted(String key, - Object... arguments) { + public static String getNonlocalized(String key, + Object... arguments) { - String value = resources.getString(key); + String value = RESOURCES.getString(key); if (arguments == null || arguments.length == 0) { return value; } @@ -110,8 +122,7 @@ try { int index = Integer.parseInt(indexStr); sb.append(arguments[index]); - } - catch(NumberFormatException e) { + } catch (NumberFormatException e) { // argument index is not an integer throw new RuntimeException("not an integer: " + indexStr); } @@ -123,29 +134,22 @@ /** * Return a localized string corresponding to the provided key, and - * formatted with the provided arguments. When the VM is booted, this - * method will obtain the correct localized message and format it using - * java.text.MessageFormat. Otherwise, a non-localized string is returned, - * and the formatting is performed by simplified formatting code. + * formatted with the provided arguments. This method should only be + * called when the VM is booted and all resources needed to obtain + * and format the localized message are loaded (or can be loaded). * * @param key The key of the desired string in the security resource bundle * @param arguments The arguments that should be placed in the message * @return A formatted message string */ - public static String getMessage(String key, - Object... arguments) { + public static String getLocalized(String key, Object... arguments) { - if (jdk.internal.misc.VM.isBooted()) { - // Localization and formatting resources are available - String value = ResourcesMgr.getString(key); - if (arguments == null) { - return value; - } - java.text.MessageFormat form = new java.text.MessageFormat(value); - return form.format(arguments); - } else { - return getMessageUnbooted(key, arguments); + String value = ResourcesMgr.getString(key); + if (arguments == null) { + return value; } + java.text.MessageFormat form = new java.text.MessageFormat(value); + return form.format(arguments); } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/util/locale/BaseLocale.java --- a/src/java.base/share/classes/sun/util/locale/BaseLocale.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/util/locale/BaseLocale.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -31,8 +31,8 @@ */ package sun.util.locale; + import java.lang.ref.SoftReference; - import java.util.StringJoiner; public final class BaseLocale { @@ -48,26 +48,28 @@ private volatile int hash; - // This method must be called only when creating the Locale.* constants. - private BaseLocale(String language, String region) { - this.language = language; - this.script = ""; - this.region = region; - this.variant = ""; - } - - private BaseLocale(String language, String script, String region, String variant) { - this.language = (language != null) ? LocaleUtils.toLowerString(language).intern() : ""; - this.script = (script != null) ? LocaleUtils.toTitleString(script).intern() : ""; - this.region = (region != null) ? LocaleUtils.toUpperString(region).intern() : ""; - this.variant = (variant != null) ? variant.intern() : ""; + // This method must be called with normalize = false only when creating the + // Locale.* constants and non-normalized BaseLocale$Keys used for lookup. + private BaseLocale(String language, String script, String region, String variant, + boolean normalize) { + if (normalize) { + this.language = LocaleUtils.toLowerString(language).intern(); + this.script = LocaleUtils.toTitleString(script).intern(); + this.region = LocaleUtils.toUpperString(region).intern(); + this.variant = variant.intern(); + } else { + this.language = language; + this.script = script; + this.region = region; + this.variant = variant; + } } // Called for creating the Locale.* constants. No argument // validation is performed. public static BaseLocale createInstance(String language, String region) { - BaseLocale base = new BaseLocale(language, region); - CACHE.put(new Key(language, region), base); + BaseLocale base = new BaseLocale(language, "", region, "", false); + CACHE.put(new Key(base), base); return base; } @@ -84,7 +86,7 @@ } } - Key key = new Key(language, script, region, variant); + Key key = new Key(language, script, region, variant, false); BaseLocale baseLocale = CACHE.get(key); return baseLocale; } @@ -123,16 +125,16 @@ @Override public String toString() { StringJoiner sj = new StringJoiner(", "); - if (language.length() > 0) { + if (!language.isEmpty()) { sj.add("language=" + language); } - if (script.length() > 0) { + if (!script.isEmpty()) { sj.add("script=" + script); } - if (region.length() > 0) { + if (!region.isEmpty()) { sj.add("region=" + region); } - if (variant.length() > 0) { + if (!variant.isEmpty()) { sj.add("variant=" + variant); } return sj.toString(); @@ -155,10 +157,17 @@ } private static final class Key { - private final SoftReference lang; - private final SoftReference scrt; - private final SoftReference regn; - private final SoftReference vart; + /** + * Keep a SoftReference to the Key data if normalized (actually used + * as a cache key) and not initialized via the constant creation path. + * + * This allows us to avoid creating SoftReferences on lookup Keys + * (which are short-lived) and for Locales created via + * Locale#createConstant. + */ + private final SoftReference holderRef; + private final BaseLocale holder; + private final boolean normalized; private final int hash; @@ -166,15 +175,16 @@ * Creates a Key. language and region must be normalized * (intern'ed in the proper case). */ - private Key(String language, String region) { - assert language.intern() == language - && region.intern() == region; - - lang = new SoftReference<>(language); - scrt = new SoftReference<>(""); - regn = new SoftReference<>(region); - vart = new SoftReference<>(""); + private Key(BaseLocale locale) { + this.holder = locale; + this.holderRef = null; this.normalized = true; + String language = locale.getLanguage(); + String region = locale.getRegion(); + assert LocaleUtils.toLowerString(language).intern() == language + && LocaleUtils.toUpperString(region).intern() == region + && locale.getVariant() == "" + && locale.getScript() == ""; int h = language.hashCode(); if (region != "") { @@ -186,51 +196,64 @@ hash = h; } - public Key(String language, String script, String region, String variant) { - this(language, script, region, variant, false); + private Key(String language, String script, String region, + String variant, boolean normalize) { + if (language == null) { + language = ""; + } + if (script == null) { + script = ""; + } + if (region == null) { + region = ""; + } + if (variant == null) { + variant = ""; + } + + BaseLocale locale = new BaseLocale(language, script, region, variant, normalize); + this.normalized = normalize; + if (normalized) { + this.holderRef = new SoftReference<>(locale); + this.holder = null; + } else { + this.holderRef = null; + this.holder = locale; + } + this.hash = hashCode(locale); } - private Key(String language, String script, String region, - String variant, boolean normalized) { + public int hashCode() { + return hash; + } + + private int hashCode(BaseLocale locale) { int h = 0; - if (language != null) { - lang = new SoftReference<>(language); - int len = language.length(); - for (int i = 0; i < len; i++) { - h = 31*h + LocaleUtils.toLower(language.charAt(i)); - } - } else { - lang = new SoftReference<>(""); + String lang = locale.getLanguage(); + int len = lang.length(); + for (int i = 0; i < len; i++) { + h = 31*h + LocaleUtils.toLower(lang.charAt(i)); } - if (script != null) { - scrt = new SoftReference<>(script); - int len = script.length(); - for (int i = 0; i < len; i++) { - h = 31*h + LocaleUtils.toLower(script.charAt(i)); - } - } else { - scrt = new SoftReference<>(""); + String scrt = locale.getScript(); + len = scrt.length(); + for (int i = 0; i < len; i++) { + h = 31*h + LocaleUtils.toLower(scrt.charAt(i)); } - if (region != null) { - regn = new SoftReference<>(region); - int len = region.length(); - for (int i = 0; i < len; i++) { - h = 31*h + LocaleUtils.toLower(region.charAt(i)); - } - } else { - regn = new SoftReference<>(""); + String regn = locale.getRegion(); + len = regn.length(); + for (int i = 0; i < len; i++) { + h = 31*h + LocaleUtils.toLower(regn.charAt(i)); } - if (variant != null) { - vart = new SoftReference<>(variant); - int len = variant.length(); - for (int i = 0; i < len; i++) { - h = 31*h + variant.charAt(i); - } - } else { - vart = new SoftReference<>(""); + String vart = locale.getVariant(); + len = vart.length(); + for (int i = 0; i < len; i++) { + h = 31*h + vart.charAt(i); } - hash = h; - this.normalized = normalized; + return h; + } + + private BaseLocale getBaseLocale() { + return (holder == null) ? holderRef.get() : holder; } @Override @@ -238,46 +261,31 @@ if (this == obj) { return true; } - if (obj instanceof Key && this.hash == ((Key)obj).hash) { - String tl = this.lang.get(); - String ol = ((Key)obj).lang.get(); - if (tl != null && ol != null && - LocaleUtils.caseIgnoreMatch(ol, tl)) { - String ts = this.scrt.get(); - String os = ((Key)obj).scrt.get(); - if (ts != null && os != null && - LocaleUtils.caseIgnoreMatch(os, ts)) { - String tr = this.regn.get(); - String or = ((Key)obj).regn.get(); - if (tr != null && or != null && - LocaleUtils.caseIgnoreMatch(or, tr)) { - String tv = this.vart.get(); - String ov = ((Key)obj).vart.get(); - return (ov != null && ov.equals(tv)); - } - } + BaseLocale other = ((Key) obj).getBaseLocale(); + BaseLocale locale = this.getBaseLocale(); + if (other != null && locale != null + && LocaleUtils.caseIgnoreMatch(other.getLanguage(), locale.getLanguage()) + && LocaleUtils.caseIgnoreMatch(other.getScript(), locale.getScript()) + && LocaleUtils.caseIgnoreMatch(other.getRegion(), locale.getRegion()) + // variant is case sensitive in JDK! + && other.getVariant().equals(locale.getVariant())) { + return true; } } return false; } - @Override - public int hashCode() { - return hash; - } - public static Key normalize(Key key) { if (key.normalized) { return key; } - String lang = LocaleUtils.toLowerString(key.lang.get()).intern(); - String scrt = LocaleUtils.toTitleString(key.scrt.get()).intern(); - String regn = LocaleUtils.toUpperString(key.regn.get()).intern(); - String vart = key.vart.get().intern(); // preserve upper/lower cases - - return new Key(lang, scrt, regn, vart, true); + // Only normalized keys may be softly referencing the data holder + assert (key.holder != null && key.holderRef == null); + BaseLocale locale = key.holder; + return new Key(locale.getLanguage(), locale.getScript(), + locale.getRegion(), locale.getVariant(), true); } } @@ -288,18 +296,12 @@ @Override protected Key normalizeKey(Key key) { - assert key.lang.get() != null && - key.scrt.get() != null && - key.regn.get() != null && - key.vart.get() != null; - return Key.normalize(key); } @Override protected BaseLocale createObject(Key key) { - return new BaseLocale(key.lang.get(), key.scrt.get(), - key.regn.get(), key.vart.get()); + return Key.normalize(key).getBaseLocale(); } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java --- a/src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/share/classes/sun/util/locale/LocaleObjectCache.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -37,8 +37,8 @@ import java.util.concurrent.ConcurrentMap; public abstract class LocaleObjectCache { - private ConcurrentMap> map; - private ReferenceQueue queue = new ReferenceQueue<>(); + private final ConcurrentMap> map; + private final ReferenceQueue queue = new ReferenceQueue<>(); public LocaleObjectCache() { this(16, 0.75f, 16); @@ -57,17 +57,14 @@ value = entry.get(); } if (value == null) { + key = normalizeKey(key); V newVal = createObject(key); - // make sure key is normalized *after* the object creation - // so that newVal is assured to be created from a valid key. - key = normalizeKey(key); if (key == null || newVal == null) { // subclass must return non-null key/value object return null; } CacheEntry newEntry = new CacheEntry<>(key, newVal, queue); - entry = map.putIfAbsent(key, newEntry); if (entry == null) { value = newVal; @@ -92,7 +89,7 @@ private void cleanStaleEntries() { CacheEntry entry; while ((entry = (CacheEntry)queue.poll()) != null) { - map.remove(entry.getKey()); + map.remove(entry.getKey(), entry); } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java --- a/src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -25,10 +25,14 @@ package sun.nio.ch; -import java.io.*; +import java.io.FileDescriptor; +import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.Pipe; +import java.nio.channels.SelectionKey; +import java.nio.channels.spi.SelectorProvider; +import java.util.concurrent.locks.ReentrantLock; class SinkChannelImpl @@ -40,17 +44,17 @@ private static final NativeDispatcher nd = new FileDispatcherImpl(); // The file descriptor associated with this channel - FileDescriptor fd; + private final FileDescriptor fd; // fd value needed for dev/poll. This value will remain valid // even after the value in the file descriptor object has been set to -1 - int fdVal; + private final int fdVal; // ID of native thread doing write, for signalling private volatile long thread; - // Lock held by current reading thread - private final Object lock = new Object(); + // Lock held by current writing thread + private final ReentrantLock writeLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -155,8 +159,9 @@ } public int write(ByteBuffer src) throws IOException { - ensureOpen(); - synchronized (lock) { + writeLock.lock(); + try { + ensureOpen(); int n = 0; try { begin(); @@ -172,14 +177,18 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } public long write(ByteBuffer[] srcs) throws IOException { if (srcs == null) throw new NullPointerException(); - ensureOpen(); - synchronized (lock) { + + writeLock.lock(); + try { + ensureOpen(); long n = 0; try { begin(); @@ -195,6 +204,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + writeLock.unlock(); } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java --- a/src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -25,10 +25,14 @@ package sun.nio.ch; -import java.io.*; +import java.io.FileDescriptor; +import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.nio.channels.spi.*; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.Pipe; +import java.nio.channels.SelectionKey; +import java.nio.channels.spi.SelectorProvider; +import java.util.concurrent.locks.ReentrantLock; class SourceChannelImpl @@ -40,17 +44,17 @@ private static final NativeDispatcher nd = new FileDispatcherImpl(); // The file descriptor associated with this channel - FileDescriptor fd; + private final FileDescriptor fd; // fd value needed for dev/poll. This value will remain valid // even after the value in the file descriptor object has been set to -1 - int fdVal; + private final int fdVal; // ID of native thread doing read, for signalling private volatile long thread; // Lock held by current reading thread - private final Object lock = new Object(); + private final ReentrantLock readLock = new ReentrantLock(); // Lock held by any thread that modifies the state fields declared below // DO NOT invoke a blocking I/O operation while holding this lock! @@ -155,8 +159,10 @@ } public int read(ByteBuffer dst) throws IOException { - ensureOpen(); - synchronized (lock) { + + readLock.lock(); + try { + ensureOpen(); int n = 0; try { begin(); @@ -172,6 +178,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } @@ -186,8 +194,10 @@ public long read(ByteBuffer[] dsts) throws IOException { if (dsts == null) throw new NullPointerException(); - ensureOpen(); - synchronized (lock) { + + readLock.lock(); + try { + ensureOpen(); long n = 0; try { begin(); @@ -203,6 +213,8 @@ end((n > 0) || (n == IOStatus.UNAVAILABLE)); assert IOStatus.check(n); } + } finally { + readLock.unlock(); } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/unix/native/libnio/ch/SocketChannelImpl.c --- a/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -47,8 +47,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this, - jobject fdo, jboolean block, - jboolean ready) + jobject fdo, jboolean block) { int error = 0; socklen_t n = sizeof(int); @@ -56,19 +55,16 @@ int result = 0; struct pollfd poller; - poller.revents = 1; - if (!ready) { - poller.fd = fd; - poller.events = POLLOUT; - poller.revents = 0; - result = poll(&poller, 1, block ? -1 : 0); - if (result < 0) { - JNU_ThrowIOExceptionWithLastError(env, "Poll failed"); - return IOS_THROWN; - } - if (!block && (result == 0)) - return IOS_UNAVAILABLE; + poller.fd = fd; + poller.events = POLLOUT; + poller.revents = 0; + result = poll(&poller, 1, block ? -1 : 0); + if (result < 0) { + JNU_ThrowIOExceptionWithLastError(env, "Poll failed"); + return IOS_THROWN; } + if (!block && (result == 0)) + return IOS_UNAVAILABLE; if (poller.revents) { errno = 0; diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java --- a/src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/windows/classes/sun/nio/ch/SinkChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -44,7 +44,7 @@ implements SelChImpl { // The SocketChannel assoicated with this pipe - SocketChannel sc; + final SocketChannel sc; public FileDescriptor getFD() { return ((SocketChannelImpl)sc).getFD(); diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java --- a/src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/windows/classes/sun/nio/ch/SourceChannelImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -43,7 +43,7 @@ implements SelChImpl { // The SocketChannel assoicated with this pipe - SocketChannel sc; + private final SocketChannel sc; public FileDescriptor getFD() { return ((SocketChannelImpl) sc).getFD(); diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/windows/native/libnet/net_util_md.c --- a/src/java.base/windows/native/libnet/net_util_md.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/windows/native/libnet/net_util_md.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -525,7 +525,7 @@ int len = sizeof (l); if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) { if (l.l_onoff == 0) { - WSASendDisconnect(fd, NULL); + shutdown(fd, SD_SEND); } } ret = closesocket (fd); diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/windows/native/libnio/ch/SocketChannelImpl.c --- a/src/java.base/windows/native/libnio/ch/SocketChannelImpl.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/windows/native/libnio/ch/SocketChannelImpl.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -55,8 +55,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this, - jobject fdo, jboolean block, - jboolean ready) + jobject fdo, jboolean block) { int optError = 0; int lastError = 0; diff -r 67aa88701d46 -r c8a33db795b6 src/java.base/windows/native/libnio/ch/SocketDispatcher.c --- a/src/java.base/windows/native/libnio/ch/SocketDispatcher.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.base/windows/native/libnio/ch/SocketDispatcher.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -272,7 +272,7 @@ int len = sizeof(l); if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) { if (l.l_onoff == 0) { - WSASendDisconnect(fd, NULL); + shutdown(fd, SD_SEND); } } } diff -r 67aa88701d46 -r c8a33db795b6 src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m --- a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m Sat Feb 10 09:25:35 2018 +0100 @@ -342,9 +342,7 @@ #define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask) -#if defined(MAC_OS_X_VERSION_10_12) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 && \ - __LP64__ +#if defined(MAC_OS_X_VERSION_10_12) && __LP64__ // 10.12 changed `mask` to NSEventMask (unsigned long long) for x86_64 builds. - (NSEvent *)nextEventMatchingMask:(NSEventMask)mask #else diff -r 67aa88701d46 -r c8a33db795b6 src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h Sat Feb 10 09:25:35 2018 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 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. + */ + +/* + * This header file is used to hijack the include of "zlib.h" from libpng on + * Macos. We do that to be able to build on macos 10.13 or later, but still + * keep binary compatibility with older versions (as specified to configure). + * + * The problem is that in 10.13, Macos shipped with a newer version of zlib, + * which exports the function inflateValidate. There is a call to this + * function in pngrutil.c, guarded by a preprocessor check of ZLIB_VERNUM being + * high enough. If we compile this call in and link to the newer version of + * zlib, we will get link errors if the code is executed on an older Mac with + * an older version of zlib. + * + * The zlib.h header in Macos has been annotated with Macos specific macros that + * guard these kinds of version specific APIs, but libpng is not using those + * checks in its conditionals, just ZLIB_VERNUM. To fix this, we check for the + * MAC_OS_X_VERSION_MIN_REQUIRED macro here and adjust the ZLIB_VERNUM to the + # known version bundled with that release. This solution is certainly a hack, + * but it seems the affected versions of zlib.h are compatible enough for this + * to work. + */ + +#include +#include + +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 +# undef ZLIB_VERNUM +# define ZLIB_VERNUM 0x1250 +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13 +# undef ZLIB_VERNUM +# define ZLIB_VERNUM 0x1280 +#endif diff -r 67aa88701d46 -r c8a33db795b6 src/java.desktop/share/legal/harfbuzz.md --- a/src/java.desktop/share/legal/harfbuzz.md Sat Feb 10 09:48:51 2018 +0000 +++ b/src/java.desktop/share/legal/harfbuzz.md Sat Feb 10 09:25:35 2018 +0100 @@ -1,4 +1,4 @@ -## Harfbuzz v1.3.0 +## Harfbuzz v1.7.1 ### Harfbuzz License @@ -6,21 +6,20 @@

 
-HarfBuzz is licensed under the so-called "Old MIT" license.  Details follow.
+HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
 For parts of HarfBuzz that are licensed under different licenses see individual
 files names COPYING in subdirectories where applicable.
 
-Copyright © 2010,2011,2012, 2013  Google, Inc.
-Copyright © 2012, 2013  Mozilla Foundation
+Copyright © 2010,2011,2012  Google, Inc.
+Copyright © 2012  Mozilla Foundation
 Copyright © 2011  Codethink Limited
 Copyright © 2008,2010  Nokia Corporation and/or its subsidiary(-ies)
 Copyright © 2009  Keith Stribley
-Copyright (C) 2012 Grigori Goronzy 
-Copyright © 2009, 2011  Martin Hosken and SIL International
+Copyright © 2009  Martin Hosken and SIL International
 Copyright © 2007  Chris Wilson
 Copyright © 2006  Behdad Esfahbod
 Copyright © 2005  David Turner
-Copyright © 2004,2007,2008,2009,2010, 2013  Red Hat, Inc.
+Copyright © 2004,2007,2008,2009,2010  Red Hat, Inc.
 Copyright © 1998-2004  David Turner and Werner Lemberg
 
 For full copyright notices consult the individual files in the package.
@@ -44,10 +43,12 @@
 ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 
-All source code, except for one section, is licensed as above.   The one
+All source code, except for one section, is licensed as above. The one
 exception is licensed with a slightly different MIT variant:
 The contents of this directory are licensed under the following terms:
 
+Copyright (C) 2012 Grigori Goronzy 
+
 Permission to use, copy, modify, and/or distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
 copyright notice and this permission notice appear in all copies.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: Die Gesamtanzahl von Knoten in Entityreferenzen betr\u00E4gt "{0}". Das liegt \u00FCber dem von "{2}" festgelegten Grenzwert "{1}".
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: CatalogResolver ist mit dem Katalog "{0}" aktiviert, eine CatalogException wird jedoch zur\u00FCckgegeben.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: El n\u00FAmero total de nodos en las referencias de entidad es de "{0}" que supera el l\u00EDmite de "{1}" definido por "{2}".
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: CatalogResolver est\u00E1 activado con el cat\u00E1logo "{0}", pero se ha devuelto una excepci\u00F3n CatalogException.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007 : Le nombre total de noeuds dans les r\u00E9f\u00E9rences d''entit\u00E9 est "{0}", soit plus que la limite de "{1}" d\u00E9finie par "{2}".
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001 : le CatalogResolver est activ\u00E9 avec le catalogue "{0}", mais une exception CatalogException est renvoy\u00E9e.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: il numero totale di nodi nei riferimenti entit\u00E0 \u00E8 "{0}". Tale valore supera il limite di "{1}" impostato da "{2}".
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: il CatalogResolver \u00E8 abilitato con il catalogo "{0}", ma viene restituita una CatalogException.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u306E\u5408\u8A08\u30CE\u30FC\u30C9\u6570\u306F"{0}"\u3067\u3001"{2}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{1}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: CatalogResolver\u306F\u30AB\u30BF\u30ED\u30B0"{0}"\u3067\u6709\u52B9\u3067\u3059\u304C\u3001CatalogException\u304C\u8FD4\u3055\u308C\u307E\u3059\u3002
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC758 \uCD1D \uB178\uB4DC \uC218\uAC00 "{2}"\uC5D0\uC11C \uC124\uC815\uD55C "{1}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{0}"\uC785\uB2C8\uB2E4.
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: CatalogResolver\uAC00 "{0}" \uCE74\uD0C8\uB85C\uADF8\uC5D0 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB418\uC5C8\uC9C0\uB9CC CatalogException\uC774 \uBC18\uD658\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: O n\u00FAmero total de n\u00F3s nas refer\u00EAncias da entidade \u00E9 de "{0}", o que est\u00E1 acima do limite de "{1}" definido por "{2}".
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: O CatalogResolver foi ativado com o cat\u00E1logo "{0}", mas uma CatalogException foi retornada.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: Det totala antalet noder i enhetsreferenser \u00E4r "{0}", vilket \u00E4r \u00F6ver gr\u00E4nsen "{1}" som har angetts av "{2}".
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: CatalogResolver \u00E4r aktiverat med katalogen "{0}", men ett CatalogException returneras.
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: \u5B9E\u4F53\u5F15\u7528\u4E2D\u7684\u8282\u70B9\u603B\u6570\u4E3A "{0}", \u8D85\u8FC7\u4E86 "{2}" \u8BBE\u7F6E\u7684\u9650\u5236 "{1}"\u3002
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: \u5DF2\u5BF9\u76EE\u5F55 "{0}" \u542F\u7528 CatalogResolver, \u4F46\u8FD4\u56DE\u4E86 CatalogException\u3002
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -304,4 +304,5 @@
         EntityReplacementLimit=JAXP00010007: \u5BE6\u9AD4\u53C3\u7167\u4E2D\u7684\u7BC0\u9EDE\u7E3D\u6578\u70BA "{0}"\uFF0C\u8D85\u904E "{2}" \u6240\u8A2D\u5B9A\u7684 "{1}" \u9650\u5236\u3002
 
 # Catalog 09
+# Technical term, do not translate: catalog
         CatalogException=JAXP00090001: CatalogResolver \u5DF2\u555F\u7528\u76EE\u9304 "{0}"\uFF0C\u4F46\u50B3\u56DE CatalogException\u3002
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_de.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_de.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_de.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,6 +30,7 @@
 CircularReference = JAXP09010001: Zirkelbezug ist nicht zul\u00E4ssig: "{0}".
 
 # Input or configuration errors
+# Technical term, do not translate: catalog
 InvalidCatalog = JAXP09020001: Das Dokumentelement eines Katalogs muss ein Katalog sein.
 InvalidEntryType = JAXP09020002: Der Eintragstyp "{0}" ist nicht g\u00FCltig.
 UriNotAbsolute = JAXP09020003: Die angegebene URI "{0}" ist nicht absolut.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: Unerwarteter Fehler bei der Konfiguration eines SAX-Parsers.
+# Technical term, do not translate: catalog
 ParsingFailed = JAXP09030002: Die Katalogdatei konnte nicht geparst werden.
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: Kein Katalog angegeben.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: Keine \u00DCbereinstimmung f\u00FCr publicId "{0}" und systemId "{1}" gefunden.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: Keine \u00DCbereinstimmung f\u00FCr href "{0}" und base "{1}" gefunden.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: URI kann nicht mit href "{0}" und base "{1}" erstellt werden.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_es.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_es.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_es.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: No est\u00E1 permitida la referencia circular: ''{0}''.
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: El elemento de documento de un cat\u00E1logo debe ser un cat\u00E1logo.
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: El elemento de documento de un cat\u00E1logo debe ser "catalog".
 InvalidEntryType = JAXP09020002: El tipo de entrada ''{0}'' no es v\u00E1lido.
 UriNotAbsolute = JAXP09020003: El URI especificado ''{0}'' no es absoluto.
 UriNotValidUrl = JAXP09020004: El URI especificado ''{0}'' no es una URL v\u00E1lida.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: Error inesperado al configurar el analizador SAX.
+# Technical term, do not translate: catalog
 ParsingFailed = JAXP09030002: Fallo al analizar el archivo de cat\u00E1logo.
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: No se ha especificado ning\u00FAn cat\u00E1logo.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: No se ha encontrado ninguna coincidencia para publicId ''{0}'' y systemId ''{1}''.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: No se ha encontrado ninguna coincidencia para href ''{0}'' y base ''{1}''.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: No se puede crear el URI con href ''{0}'' y base ''{1}''.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_fr.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_fr.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_fr.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001 : La r\u00E9f\u00E9rence circulaire n''est pas autoris\u00E9e : ''{0}''.
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001 : L'\u00E9l\u00E9ment de document d'un catalogue doit \u00EAtre un catalogue.
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001 : L'\u00E9l\u00E9ment de document d'un catalogue doit \u00EAtre CATALOG.
 InvalidEntryType = JAXP09020002 : Le type d''entr\u00E9e ''{0}'' n''est pas valide.
 UriNotAbsolute = JAXP09020003 : L''URI indiqu\u00E9 ''{0}'' n''est pas absolu.
 UriNotValidUrl = JAXP09020004 : L''URI indiqu\u00E9 ''{0}'' n''est pas une URL valide.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001 : Erreur inattendue lors de la configuration d'un analyseur SAX.
-ParsingFailed = JAXP09030002 : Echec de l'analyse du fichier de catalogue.
-NoCatalogFound = JAXP09030003 : Aucun catalogue n'est indiqu\u00E9.
+# Technical term, do not translate: catalog
+ParsingFailed = JAXP09030002 : Echec de l'analyse du fichier CATALOG.
+# Technical term, do not translate: catalog
+NoCatalogFound = JAXP09030003 : Aucun CATALOG n'est indiqu\u00E9.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001 : Aucune correspondance trouv\u00E9e pour publicId ''{0}'' et systemId ''{1}''.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002 : Aucune correspondance trouv\u00E9e pour l''\u00E9l\u00E9ment href ''{0}'' et la base ''{1}''.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003 : Impossible de construire l''URI \u00E0 l''aide de l''\u00E9l\u00E9ment href ''{0}'' et de la base ''{1}''.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_it.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_it.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_it.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: il riferimento circolare non \u00E8 consentito: ''{0}''.
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: l'elemento documento di un catalogo deve essere un catalogo.
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: l'elemento documento di un catalogo deve essere "catalog".
 InvalidEntryType = JAXP09020002: il tipo di voce ''{0}'' non \u00E8 valido.
 UriNotAbsolute = JAXP09020003: l''URI specificato ''{0}'' non \u00E8 assoluto.
 UriNotValidUrl = JAXP09020004: l''URI specificato ''{0}'' non \u00E8 valido.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: errore imprevisto durante la configurazione di un parser SAX.
+# Technical term, do not translate: catalog
 ParsingFailed = JAXP09030002: analisi del file catalogo non riuscita.
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: nessun catalogo specificato.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: nessuna corrispondenza trovata per publicId ''{0}'' e systemId ''{1}''.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: nessuna corrispondenza trovata per href ''{0}'' e base ''{1}''.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: impossibile creare l''URI utilizzando href ''{0}'' e base ''{1}''.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_ja.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_ja.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_ja.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: \u5FAA\u74B0\u53C2\u7167\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093: ''{0}''\u3002
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: \u30AB\u30BF\u30ED\u30B0\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u8981\u7D20\u306F\u30AB\u30BF\u30ED\u30B0\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: \u30AB\u30BF\u30ED\u30B0\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u8981\u7D20\u306Fcatalog\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 InvalidEntryType = JAXP09020002: \u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7''{0}''\u306F\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
 UriNotAbsolute = JAXP09020003: \u6307\u5B9A\u3055\u308C\u305FURI ''{0}''\u304C\u7D76\u5BFEURI\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
 UriNotValidUrl = JAXP09020004: \u6307\u5B9A\u3057\u305FURI ''{0}''\u306F\u6709\u52B9\u306AURL\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: SAX\u30D1\u30FC\u30B5\u30FC\u306E\u69CB\u6210\u4E2D\u306B\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002
-ParsingFailed = JAXP09030002: \u30AB\u30BF\u30ED\u30B0\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
+# Technical term, do not translate: catalog
+ParsingFailed = JAXP09030002: \u30AB\u30BF\u30ED\u30B0\u30D5\u30A1\u30A4\u30EB\u306E\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: \u30AB\u30BF\u30ED\u30B0\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: publicId ''{0}''\u304A\u3088\u3073systemId ''{1}''\u306B\u4E00\u81F4\u3059\u308B\u3082\u306E\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: href ''{0}''\u304A\u3088\u3073base ''{1}''\u306B\u4E00\u81F4\u3059\u308B\u3082\u306E\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: href ''{0}''\u304A\u3088\u3073base ''{1}''\u3092\u4F7F\u7528\u3057\u3066URI\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3002
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_ko.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_ko.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_ko.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,6 +30,7 @@
 CircularReference = JAXP09010001: \uC21C\uD658 \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC74C: ''{0}''.
 
 # Input or configuration errors
+# Technical term, do not translate: catalog
 InvalidCatalog = JAXP09020001: Catalog\uC758 \uBB38\uC11C \uC694\uC18C\uB294 catalog\uC5EC\uC57C \uD569\uB2C8\uB2E4.
 InvalidEntryType = JAXP09020002: \uD56D\uBAA9 \uC720\uD615 ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
 UriNotAbsolute = JAXP09020003: \uC9C0\uC815\uB41C URI ''{0}''\uC774(\uAC00) \uC808\uB300 \uACBD\uB85C\uAC00 \uC544\uB2D9\uB2C8\uB2E4.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: SAX \uAD6C\uBB38\uBD84\uC11D\uAE30\uB97C \uAD6C\uC131\uD558\uB294 \uC911 \uC608\uC0C1\uCE58 \uC54A\uC740 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
+# Technical term, do not translate: catalog
 ParsingFailed = JAXP09030002: Catalog \uD30C\uC77C\uC758 \uAD6C\uBB38\uBD84\uC11D\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: \uC9C0\uC815\uB41C catalog\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: publicId ''{0}'', systemId ''{1}''\uC5D0 \uB300\uD55C \uC77C\uCE58 \uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: href ''{0}'', base ''{1}''\uC5D0 \uB300\uD55C \uC77C\uCE58 \uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: href ''{0}'', base ''{1}''\uC744(\uB97C) \uC0AC\uC6A9\uD558\uC5EC URI\uB97C \uAD6C\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_pt_BR.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_pt_BR.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_pt_BR.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: A refer\u00EAncia circular n\u00E3o \u00E9 permitida: ''{0}''.
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: O elemento de documento de um cat\u00E1logo deve ser o cat\u00E1logo.
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: O elemento de documento de um cat\u00E1logo deve ser "catalog".
 InvalidEntryType = JAXP09020002: O tipo de entrada "{0}" n\u00E3o \u00E9 v\u00E1lido.
 UriNotAbsolute = JAXP09020003: O URI especificado ''{0}'' n\u00E3o \u00E9 absoluto.
 UriNotValidUrl = JAXP09020004: O URI especificado ''{0}'' n\u00E3o \u00E9 um URL v\u00E1lido.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: Erro inesperado ao configurar um parser SAX.
+# Technical term, do not translate: catalog
 ParsingFailed = JAXP09030002: Falha ao fazer parsing do arquivo de cat\u00E1logo.
-NoCatalogFound = JAXP09030003: Nenhum Cat\u00E1logo foi especificado.
+# Technical term, do not translate: catalog
+NoCatalogFound = JAXP09030003: Nenhum cat\u00E1logo foi especificado.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: Nenhuma correspond\u00EAncia foi encontrada para publicId ''{0}'' e systemId ''{1}''.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: Nenhuma correspond\u00EAncia foi encontrada para href ''{0}'' e base ''{1}''.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: N\u00E3o \u00E9 poss\u00EDvel construir o URI usando href ''{0}'' e base ''{1}''.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_sv.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_sv.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_sv.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: Cirkelreferens \u00E4r inte till\u00E5ten: ''{0}''.
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: Dokumentelementet f\u00F6r en katalog m\u00E5ste vara katalog.
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: Dokumentelementet f\u00F6r en katalog m\u00E5ste vara "catalog".
 InvalidEntryType = JAXP09020002: Posttypen ''{0}'' \u00E4r inte giltig.
 UriNotAbsolute = JAXP09020003: Den angivna URI:n, ''{0}'', \u00E4r inte absolut.
 UriNotValidUrl = JAXP09020004: Den angivna URI:n, ''{0}'', \u00E4r inte en giltig URL.
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: Ov\u00E4ntat fel vid konfiguration av en SAX-parser.
-ParsingFailed = JAXP09030002: Kunde inte tolka katalogfilen.
+# Technical term, do not translate: catalog
+ParsingFailed = JAXP09030002: Kunde inte tolka filen katalog.
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: Ingen katalog har angetts.
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: Ingen matchning hittades f\u00F6r publicId = ''{0}'' och systemId = ''{1}''.
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: Ingen matchning hittades f\u00F6r href = ''{0}'' och bas = ''{1}''.
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: Kan inte skapa URI med href = ''{0}'' och bas = ''{1}''.
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_zh_CN.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_zh_CN.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_zh_CN.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: \u4E0D\u5141\u8BB8\u5FAA\u73AF\u5F15\u7528: ''{0}''\u3002
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: catalog \u7684\u6587\u6863\u5143\u7D20\u5FC5\u987B\u662F catalog\u3002
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: \u76EE\u5F55\u7684\u6587\u6863\u5143\u7D20\u5FC5\u987B\u662F "catalog"\u3002
 InvalidEntryType = JAXP09020002: \u6761\u76EE\u7C7B\u578B ''{0}'' \u65E0\u6548\u3002
 UriNotAbsolute = JAXP09020003: \u6307\u5B9A\u7684 URI ''{0}'' \u4E0D\u662F\u7EDD\u5BF9\u7684\u3002
 UriNotValidUrl = JAXP09020004: \u6307\u5B9A\u7684 URI ''{0}'' \u4E0D\u662F\u6709\u6548\u7684 URL\u3002
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: \u914D\u7F6E SAX \u89E3\u6790\u5668\u65F6\u51FA\u73B0\u610F\u5916\u9519\u8BEF\u3002
-ParsingFailed = JAXP09030002: \u65E0\u6CD5\u5BF9 catalog \u6587\u4EF6\u8FDB\u884C\u89E3\u6790\u3002
-NoCatalogFound = JAXP09030003: \u672A\u6307\u5B9A catalog\u3002
+# Technical term, do not translate: catalog
+ParsingFailed = JAXP09030002: \u65E0\u6CD5\u5BF9\u76EE\u5F55\u6587\u4EF6\u8FDB\u884C\u89E3\u6790\u3002
+# Technical term, do not translate: catalog
+NoCatalogFound = JAXP09030003: \u672A\u6307\u5B9A\u76EE\u5F55\u3002
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: \u5BF9\u4E8E publicId ''{0}'' \u548C systemId ''{1}'', \u672A\u627E\u5230\u5339\u914D\u9879\u3002
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: \u5BF9\u4E8E href ''{0}'' \u548C base ''{1}'', \u672A\u627E\u5230\u5339\u914D\u9879\u3002
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: \u65E0\u6CD5\u4F7F\u7528 href ''{0}'' \u548C base ''{1}'' \u6784\u9020 URI\u3002
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_zh_TW.properties
--- a/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_zh_TW.properties	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages_zh_TW.properties	Sat Feb 10 09:25:35 2018 +0100
@@ -30,7 +30,8 @@
 CircularReference = JAXP09010001: \u4E0D\u5141\u8A31\u5FAA\u74B0\u53C3\u7167: ''{0}''\u3002
 
 # Input or configuration errors
-InvalidCatalog = JAXP09020001: Catalog \u7684\u6587\u4EF6\u5143\u7D20\u5FC5\u9808\u662F Catalog\u3002
+# Technical term, do not translate: catalog
+InvalidCatalog = JAXP09020001: catalog \u7684\u6587\u4EF6\u5143\u7D20\u5FC5\u9808\u662F catalog\u3002
 InvalidEntryType = JAXP09020002: \u9805\u76EE\u985E\u578B ''{0}'' \u7121\u6548\u3002
 UriNotAbsolute = JAXP09020003: \u6307\u5B9A\u7684 URI ''{0}'' \u4E0D\u662F\u7D55\u5C0D\u8DEF\u5F91\u3002
 UriNotValidUrl = JAXP09020004: \u6307\u5B9A\u7684 URI ''{0}'' \u4E0D\u662F\u6709\u6548\u7684 URL\u3002
@@ -41,12 +42,16 @@
 
 # Parsing errors
 ParserConf = JAXP09030001: \u8A2D\u5B9A SAX \u5256\u6790\u5668\u6642\u767C\u751F\u672A\u9810\u671F\u7684\u932F\u8AA4\u3002
-ParsingFailed = JAXP09030002: \u7121\u6CD5\u5256\u6790 Catalog \u6A94\u6848\u3002
+# Technical term, do not translate: catalog
+ParsingFailed = JAXP09030002: \u7121\u6CD5\u5256\u6790 catalog \u6A94\u6848\u3002
+# Technical term, do not translate: catalog
 NoCatalogFound = JAXP09030003: \u672A\u6307\u5B9A Catalog\u3002
 
 
 # Resolving errors
 NoMatchFound = JAXP09040001: \u627E\u4E0D\u5230\u7B26\u5408 publicId ''{0}'' \u548C systemId ''{1}'' \u7684\u9805\u76EE\u3002
+# Technical term, do not translate: href, base
 NoMatchURIFound = JAXP09040002: \u627E\u4E0D\u5230\u7B26\u5408 href ''{0}'' \u548C\u57FA\u790E ''{1}'' \u7684\u9805\u76EE\u3002
+# Technical term, do not translate: href, base
 FailedCreatingURI = JAXP09040003: \u7121\u6CD5\u4F7F\u7528 href ''{0}'' \u548C\u57FA\u790E ''{1}'' \u5EFA\u69CB URI\u3002
 
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/classes/org/xml/sax/SAXException.java
--- a/src/java.xml/share/classes/org/xml/sax/SAXException.java	Sat Feb 10 09:48:51 2018 +0000
+++ b/src/java.xml/share/classes/org/xml/sax/SAXException.java	Sat Feb 10 09:25:35 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -30,6 +30,12 @@
 
 package org.xml.sax;
 
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+
 /**
  * Encapsulate a general SAX error or warning.
  *
@@ -68,7 +74,6 @@
     public SAXException ()
     {
         super();
-        this.exception = null;
     }
 
 
@@ -79,7 +84,6 @@
      */
     public SAXException (String message) {
         super(message);
-        this.exception = null;
     }
 
 
@@ -94,8 +98,7 @@
      */
     public SAXException (Exception e)
     {
-        super();
-        this.exception = e;
+        super(e);
     }
 
 
@@ -110,8 +113,7 @@
      */
     public SAXException (String message, Exception e)
     {
-        super(message);
-        this.exception = e;
+        super(message, e);
     }
 
 
@@ -127,15 +129,15 @@
     public String getMessage ()
     {
         String message = super.getMessage();
+        Throwable cause = super.getCause();
 
-        if (message == null && exception != null) {
-            return exception.getMessage();
+        if (message == null && cause != null) {
+            return cause.getMessage();
         } else {
             return message;
         }
     }
 
-
     /**
      * Return the embedded exception, if any.
      *
@@ -143,7 +145,7 @@
      */
     public Exception getException ()
     {
-        return exception;
+        return getExceptionInternal();
     }
 
     /**
@@ -152,7 +154,7 @@
      * @return Return the cause of the exception
      */
     public Throwable getCause() {
-        return exception;
+        return super.getCause();
     }
 
     /**
@@ -162,6 +164,7 @@
      */
     public String toString ()
     {
+        Throwable exception = super.getCause();
         if (exception != null) {
             return super.toString() + "\n" + exception.toString();
         } else {
@@ -175,11 +178,59 @@
     // Internal state.
     //////////////////////////////////////////////////////////////////////
 
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField( "exception", Exception.class )
+    };
+
+    /**
+     * Writes "exception" field to the stream.
+     *
+     * @param out stream used for serialization.
+     * @throws IOException thrown by ObjectOutputStream
+     */
+    private void writeObject(ObjectOutputStream out)
+            throws IOException {
+        ObjectOutputStream.PutField fields = out.putFields();
+        fields.put("exception", getExceptionInternal());
+        out.writeFields();
+    }
 
     /**
-     * @serial The embedded exception if tunnelling, or null.
+     * Reads the "exception" field from the stream.
+     * And initializes the "exception" if it wasn't
+     * done before.
+     *
+     * @param in stream used for deserialization
+     * @throws IOException            thrown by ObjectInputStream
+     * @throws ClassNotFoundException thrown by ObjectInputStream
      */
-    private Exception exception;
+    private void readObject(ObjectInputStream in)
+            throws IOException, ClassNotFoundException {
+        ObjectInputStream.GetField fields = in.readFields();
+        Exception exception = (Exception) fields.get("exception", null);
+        Throwable superCause = super.getCause();
+
+        // if super.getCause() and 'exception' fields present then always use
+        // getCause() value. Otherwise, use 'exception' to initialize cause
+        if (superCause == null && exception != null) {
+            try {
+                super.initCause(exception);
+            } catch (IllegalStateException e) {
+                throw new InvalidClassException("Inconsistent state: two causes");
+            }
+        }
+    }
+
+    // Internal method to guard against overriding of public getException
+    // method by SAXException subclasses
+    private Exception getExceptionInternal() {
+        Throwable cause = super.getCause();
+        if (cause instanceof Exception) {
+            return (Exception) cause;
+        } else {
+            return null;
+        }
+    }
 
     // Added serialVersionUID to preserve binary compatibility
     static final long serialVersionUID = 583241635256073760L;
diff -r 67aa88701d46 -r c8a33db795b6 src/java.xml/share/legal/xmlresolver.md
--- a/src/java.xml/share/legal/xmlresolver.md	Sat Feb 10 09:48:51 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-## Apache XML Resolver Library v1.2
-
-### Apache XML Resolver Notice
-
-
-Apache XML Commons Resolver
-Copyright 2006 The Apache Software Foundation.
-
-This product includes software developed at
-The Apache Software Foundation http://www.apache.org/
-
-Portions of this code are derived from classes placed in the
-public domain by Arbortext on 10 Apr 2000. See:
-http://www.arbortext.com/customer_support/updates_and_technical_notes/catalogs/docs/README.htm
-
-
- -### Apache 2.0 License -
-
-                              Apache License
-                        Version 2.0, January 2004
-                     http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-   "License" shall mean the terms and conditions for use, reproduction,
-   and distribution as defined by Sections 1 through 9 of this document.
-
-   "Licensor" shall mean the copyright owner or entity authorized by
-   the copyright owner that is granting the License.
-
-   "Legal Entity" shall mean the union of the acting entity and all
-   other entities that control, are controlled by, or are under common
-   control with that entity. For the purposes of this definition,
-   "control" means (i) the power, direct or indirect, to cause the
-   direction or management of such entity, whether by contract or
-   otherwise, or (ii) ownership of fifty percent (50%) or more of the
-   outstanding shares, or (iii) beneficial ownership of such entity.
-
-   "You" (or "Your") shall mean an individual or Legal Entity
-   exercising permissions granted by this License.
-
-   "Source" form shall mean the preferred form for making modifications,
-   including but not limited to software source code, documentation
-   source, and configuration files.
-
-   "Object" form shall mean any form resulting from mechanical
-   transformation or translation of a Source form, including but
-   not limited to compiled object code, generated documentation,
-   and conversions to other media types.
-
-   "Work" shall mean the work of authorship, whether in Source or
-   Object form, made available under the License, as indicated by a
-   copyright notice that is included in or attached to the work
-   (an example is provided in the Appendix below).
-
-   "Derivative Works" shall mean any work, whether in Source or Object
-   form, that is based on (or derived from) the Work and for which the
-   editorial revisions, annotations, elaborations, or other modifications
-   represent, as a whole, an original work of authorship. For the purposes
-   of this License, Derivative Works shall not include works that remain
-   separable from, or merely link (or bind by name) to the interfaces of,
-   the Work and Derivative Works thereof.
-
-   "Contribution" shall mean any work of authorship, including
-   the original version of the Work and any modifications or additions
-   to that Work or Derivative Works thereof, that is intentionally
-   submitted to Licensor for inclusion in the Work by the copyright owner
-   or by an individual or Legal Entity authorized to submit on behalf of
-   the copyright owner. For the purposes of this definition, "submitted"
-   means any form of electronic, verbal, or written communication sent
-   to the Licensor or its representatives, including but not limited to
-   communication on electronic mailing lists, source code control systems,
-   and issue tracking systems that are managed by, or on behalf of, the
-   Licensor for the purpose of discussing and improving the Work, but
-   excluding communication that is conspicuously marked or otherwise
-   designated in writing by the copyright owner as "Not a Contribution."
-
-   "Contributor" shall mean Licensor and any individual or Legal Entity
-   on behalf of whom a Contribution has been received by Licensor and
-   subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
-   this License, each Contributor hereby grants to You a perpetual,
-   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-   copyright license to reproduce, prepare Derivative Works of,
-   publicly display, publicly perform, sublicense, and distribute the
-   Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
-   this License, each Contributor hereby grants to You a perpetual,
-   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-   (except as stated in this section) patent license to make, have made,
-   use, offer to sell, sell, import, and otherwise transfer the Work,
-   where such license applies only to those patent claims licensable
-   by such Contributor that are necessarily infringed by their
-   Contribution(s) alone or by combination of their Contribution(s)
-   with the Work to which such Contribution(s) was submitted. If You
-   institute patent litigation against any entity (including a
-   cross-claim or counterclaim in a lawsuit) alleging that the Work
-   or a Contribution incorporated within the Work constitutes direct
-   or contributory patent infringement, then any patent licenses
-   granted to You under this License for that Work shall terminate
-   as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
-   Work or Derivative Works thereof in any medium, with or without
-   modifications, and in Source or Object form, provided that You
-   meet the following conditions:
-
-   (a) You must give any other recipients of the Work or
-       Derivative Works a copy of this License; and
-
-   (b) You must cause any modified files to carry prominent notices
-       stating that You changed the files; and
-
-   (c) You must retain, in the Source form of any Derivative Works
-       that You distribute, all copyright, patent, trademark, and
-       attribution notices from the Source form of the Work,
-       excluding those notices that do not pertain to any part of
-       the Derivative Works; and
-
-   (d) If the Work includes a "NOTICE" text file as part of its
-       distribution, then any Derivative Works that You distribute must
-       include a readable copy of the attribution notices contained
-       within such NOTICE file, excluding those notices that do not
-       pertain to any part of the Derivative Works, in at least one
-       of the following places: within a NOTICE text file distributed
-       as part of the Derivative Works; within the Source form or
-       documentation, if provided along with the Derivative Works; or,
-       within a display generated by the Derivative Works, if and
-       wherever such third-party notices normally appear. The contents
-       of the NOTICE file are for informational purposes only and
-       do not modify the License. You may add Your own attribution
-       notices within Derivative Works that You distribute, alongside
-       or as an addendum to the NOTICE text from the Work, provided
-       that such additional attribution notices cannot be construed
-       as modifying the License.
-
-   You may add Your own copyright statement to Your modifications and
-   may provide additional or different license terms and conditions
-   for use, reproduction, or distribution of Your modifications, or
-   for any such Derivative Works as a whole, provided Your use,
-   reproduction, and distribution of the Work otherwise complies with
-   the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
-   any Contribution intentionally submitted for inclusion in the Work
-   by You to the Licensor shall be under the terms and conditions of
-   this License, without any additional terms or conditions.
-   Notwithstanding the above, nothing herein shall supersede or modify
-   the terms of any separate license agreement you may have executed
-   with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
-   names, trademarks, service marks, or product names of the Licensor,
-   except as required for reasonable and customary use in describing the
-   origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
-   agreed to in writing, Licensor provides the Work (and each
-   Contributor provides its Contributions) on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-   implied, including, without limitation, any warranties or conditions
-   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-   PARTICULAR PURPOSE. You are solely responsible for determining the
-   appropriateness of using or redistributing the Work and assume any
-   risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
-   whether in tort (including negligence), contract, or otherwise,
-   unless required by applicable law (such as deliberate and grossly
-   negligent acts) or agreed to in writing, shall any Contributor be
-   liable to You for damages, including any direct, indirect, special,
-   incidental, or consequential damages of any character arising as a
-   result of this License or out of the use or inability to use the
-   Work (including but not limited to damages for loss of goodwill,
-   work stoppage, computer failure or malfunction, or any and all
-   other commercial damages or losses), even if such Contributor
-   has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
-   the Work or Derivative Works thereof, You may choose to offer,
-   and charge a fee for, acceptance of support, warranty, indemnity,
-   or other liability obligations and/or rights consistent with this
-   License. However, in accepting such obligations, You may act only
-   on Your own behalf and on Your sole responsibility, not on behalf
-   of any other Contributor, and only if You agree to indemnify,
-   defend, and hold each Contributor harmless for any liability
-   incurred by, or claims asserted against, such Contributor by reason
-   of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
-   To apply the Apache License to your work, attach the following
-   boilerplate notice, with the fields enclosed by brackets "[]"
-   replaced with your own identifying information. (Don't include
-   the brackets!)  The text should be enclosed in the appropriate
-   comment syntax for the file format. We also recommend that a
-   file or class name and description of purpose be included on the
-   same "printed page" as the copyright notice for easier
-   identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -157,7 +157,7 @@ BINARY_LITERALS(JDK7, Fragments.FeatureBinaryLit, DiagKind.PLURAL), UNDERSCORES_IN_LITERALS(JDK7, Fragments.FeatureUnderscoreLit, DiagKind.PLURAL), STRINGS_IN_SWITCH(JDK7, Fragments.FeatureStringSwitch, DiagKind.PLURAL), - DEPRECATION_ON_IMPORT(MIN, JDK9), + DEPRECATION_ON_IMPORT(MIN, JDK8), SIMPLIFIED_VARARGS(JDK7), OBJECT_TO_PRIMITIVE_CAST(JDK7), ENFORCE_THIS_DOT_INIT(JDK7), diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 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 @@ -335,6 +335,9 @@ # 0: name compiler.err.duplicate.class=\u30AF\u30E9\u30B9{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 +# 0: name, 1: name +compiler.err.same.binary.name=\u30AF\u30E9\u30B9: {0}\u3068{1}\u306E\u30D0\u30A4\u30CA\u30EA\u540D\u304C\u540C\u3058\u3067\u3059 + compiler.err.duplicate.case.label=case\u30E9\u30D9\u30EB\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 compiler.err.duplicate.default.label=default\u30E9\u30D9\u30EB\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 @@ -550,6 +553,9 @@ # 0: set of flag compiler.err.mod.not.allowed.here=\u4FEE\u98FE\u5B50{0}\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +# 0: name +compiler.err.modifier.not.allowed.here=\u4FEE\u98FE\u5B50{0}\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.intf.not.allowed.here=\u3053\u3053\u3067\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 compiler.err.enums.must.be.static=\u5217\u6319\u578B\u306E\u5BA3\u8A00\u306Fstatic\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059 @@ -860,6 +866,8 @@ # 0: token compiler.err.var.not.allowed=\u3053\u3053\u3067\u306F''{0}''\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\n\u30EA\u30EA\u30FC\u30B910\u304B\u3089''{0}''\u306F\u5236\u9650\u3055\u308C\u305F\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u578B\u3067\u3042\u308A\u3001\u578B\u306E\u5BA3\u8A00\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 +compiler.warn.var.not.allowed=\u30EA\u30EA\u30FC\u30B910\u304B\u3089\u3001''var''\u306F\u5236\u9650\u3055\u308C\u305F\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u578B\u3067\u3042\u308A\u3001\u578B\u306E\u5BA3\u8A00\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + # 0: name (variable), 1: message segment compiler.err.cant.infer.local.var.type=\u30ED\u30FC\u30AB\u30EB\u5909\u6570{0}\u306E\u578B\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093\n({1}) @@ -2230,6 +2238,8 @@ compiler.misc.cant.resolve.modules=\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093 +compiler.misc.bad.requires.flag=\u4E0D\u6B63\u306A\u5FC5\u9808\u30D5\u30E9\u30B0: {0} + # 0: string compiler.err.invalid.module.specifier=\u30E2\u30B8\u30E5\u30FC\u30EB\u6307\u5B9A\u5B50\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093: {0} diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 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 @@ -335,6 +335,9 @@ # 0: name compiler.err.duplicate.class=\u7C7B\u91CD\u590D: {0} +# 0: name, 1: name +compiler.err.same.binary.name=\u7C7B\uFF1A{0} \u548C {1} \u5177\u6709\u76F8\u540C\u7684\u4E8C\u8FDB\u5236\u540D\u79F0 + compiler.err.duplicate.case.label=case \u6807\u7B7E\u91CD\u590D compiler.err.duplicate.default.label=default \u6807\u7B7E\u91CD\u590D @@ -550,6 +553,9 @@ # 0: set of flag compiler.err.mod.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u4FEE\u9970\u7B26{0} +# 0: name +compiler.err.modifier.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u4FEE\u9970\u7B26{0} + compiler.err.intf.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u63A5\u53E3 compiler.err.enums.must.be.static=\u53EA\u6709\u5728\u9759\u6001\u4E0A\u4E0B\u6587\u4E2D\u624D\u5141\u8BB8\u4F7F\u7528\u679A\u4E3E\u58F0\u660E @@ -860,6 +866,8 @@ # 0: token compiler.err.var.not.allowed=\u4ECE\u53D1\u884C\u7248 10 \u5F00\u59CB,\n\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528 ''{0}'', ''{0}'' \u662F\u53D7\u9650\u5236\u7684\u672C\u5730\u53D8\u91CF\u7C7B\u578B, \u65E0\u6CD5\u7528\u4E8E\u7C7B\u578B\u58F0\u660E +compiler.warn.var.not.allowed=\u4ECE\u53D1\u884C\u7248 10 \u5F00\u59CB\uFF0C''var'' \u662F\u53D7\u9650\u5236\u7684\u672C\u5730\u53D8\u91CF\u7C7B\u578B\uFF0C\u65E0\u6CD5\u7528\u4E8E\u7C7B\u578B\u58F0\u660E + # 0: name (variable), 1: message segment compiler.err.cant.infer.local.var.type=\u65E0\u6CD5\u63A8\u65AD\u672C\u5730\u53D8\u91CF {0} \u7684\u7C7B\u578B\n({1}) @@ -2230,6 +2238,8 @@ compiler.misc.cant.resolve.modules=\u65E0\u6CD5\u89E3\u6790\u6A21\u5757 +compiler.misc.bad.requires.flag=\u9519\u8BEF\u7684\u8BF7\u6C42\u6807\u8BB0\uFF1A{0} + # 0: string compiler.err.invalid.module.specifier=\u4E0D\u5141\u8BB8\u6A21\u5757\u8BF4\u660E\u7B26: {0} diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -637,19 +637,43 @@ print("/*public static final*/ "); print(tree.name); if (tree.init != null) { - if (sourceOutput && tree.init.hasTag(NEWCLASS)) { - print(" /*enum*/ "); + if (tree.init.hasTag(NEWCLASS)) { JCNewClass init = (JCNewClass) tree.init; - if (init.args != null && init.args.nonEmpty()) { + if (sourceOutput) { + print(" /*enum*/ "); + if (init.args != null && init.args.nonEmpty()) { + print("("); + print(init.args); + print(")"); + } + if (init.def != null && init.def.defs != null) { + print(" "); + printBlock(init.def.defs); + } + return; + }else { + print(" /* = "); + print("new "); + if (init.def != null && init.def.mods.annotations.nonEmpty()) { + printTypeAnnotations(init.def.mods.annotations); + } + printExpr(init.clazz); print("("); - print(init.args); + printExprs(init.args); print(")"); + print(" */"); + print(" /*enum*/ "); + if (init.args != null && init.args.nonEmpty()) { + print("("); + printExprs(init.args); + print(")"); + } + if (init.def != null && init.def.defs != null) { + print(" "); + printBlock(init.def.defs); + } + return; } - if (init.def != null && init.def.defs != null) { - print(" "); - printBlock(init.def.defs); - } - return; } print(" /* = "); printExpr(tree.init); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java --- a/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -547,6 +547,11 @@ /** * Signs a file into an {@link OutputStream}. This method will not close * {@code file} or {@code os}. + *

+ * If an I/O error or signing error occurs during the signing, then it may + * do so after some bytes have been written. Consequently, the output + * stream may be in an inconsistent state. It is strongly recommended that + * it be promptly closed in this case. * * @param file the file to sign. * @param os the output stream. diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java Sat Feb 10 09:25:35 2018 +0100 @@ -26,6 +26,7 @@ package sun.security.tools.jarsigner; import java.io.*; +import java.net.UnknownHostException; import java.security.cert.CertPathValidatorException; import java.security.cert.PKIXBuilderParameters; import java.util.*; @@ -1400,13 +1401,6 @@ error(rb.getString("unable.to.open.jar.file.")+jarName, ioe); } - FileOutputStream fos = null; - try { - fos = new FileOutputStream(signedJarFile); - } catch (IOException ioe) { - error(rb.getString("unable.to.create.")+tmpJarName, ioe); - } - CertPath cp = CertificateFactory.getInstance("X.509") .generateCertPath(Arrays.asList(certChain)); JarSigner.Builder builder = new JarSigner.Builder(privateKey, cp); @@ -1473,24 +1467,42 @@ builder.setProperty("sectionsOnly", Boolean.toString(!signManifest)); builder.setProperty("internalSF", Boolean.toString(!externalSF)); + FileOutputStream fos = null; + try { + fos = new FileOutputStream(signedJarFile); + } catch (IOException ioe) { + error(rb.getString("unable.to.create.")+tmpJarName, ioe); + } + + Throwable failedCause = null; + String failedMessage = null; + try { builder.build().sign(zipFile, fos); } catch (JarSignerException e) { - Throwable cause = e.getCause(); - if (cause != null && cause instanceof SocketTimeoutException) { + failedCause = e.getCause(); + if (failedCause instanceof SocketTimeoutException + || failedCause instanceof UnknownHostException) { // Provide a helpful message when TSA is beyond a firewall - error(rb.getString("unable.to.sign.jar.") + + failedMessage = rb.getString("unable.to.sign.jar.") + rb.getString("no.response.from.the.Timestamping.Authority.") + "\n -J-Dhttp.proxyHost=" + "\n -J-Dhttp.proxyPort=\n" + rb.getString("or") + "\n -J-Dhttps.proxyHost= " + - "\n -J-Dhttps.proxyPort= ", e); + "\n -J-Dhttps.proxyPort= "; } else { - error(rb.getString("unable.to.sign.jar.")+e.getCause(), e.getCause()); + // JarSignerException might have a null cause + if (failedCause == null) { + failedCause = e; + } + failedMessage = rb.getString("unable.to.sign.jar.") + failedCause; } + } catch (Exception e) { + failedCause = e; + failedMessage = rb.getString("unable.to.sign.jar.") + failedCause; } finally { - // close the resouces + // close the resources if (zipFile != null) { zipFile.close(); zipFile = null; @@ -1499,6 +1511,12 @@ if (fos != null) { fos.close(); } + + } + + if (failedCause != null) { + signedJarFile.delete(); + error(failedMessage, failedCause); } // The JarSigner API always accepts the timestamp received. diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties --- a/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 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 @@ -40,7 +40,7 @@ error.create.dir={0} : impossible de cr\u00E9er le r\u00E9pertoire error.incorrect.length=longueur incorrecte lors du traitement de : {0} error.create.tempfile=Impossible de cr\u00E9er un fichier temporaire -error.hash.dep=Hachage des d\u00E9pendances du module {0}, module {1} introuvable sur le chemin de module +error.hash.dep=Hachage des d\u00E9pendances du module {0}, module {1} introuvable sur le chemin de modules error.module.options.without.info=Une des options --module-version ou --hash-modules sans module-info.class error.no.operative.descriptor=Aucun descripteur op\u00E9rationnel pour la version : {0} error.no.root.descriptor=Aucun descripteur de module racine, indiquer --release diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotatedType.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotatedType.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotatedType.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -41,7 +41,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface AnnotatedType extends Type { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationDesc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationDesc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationDesc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -38,7 +38,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface AnnotationDesc { /** @@ -77,7 +78,7 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ - @Deprecated + @Deprecated(since="9", forRemoval=true) public interface ElementValuePair { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationTypeDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationTypeDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationTypeDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -37,7 +37,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface AnnotationTypeDoc extends ClassDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -37,7 +37,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface AnnotationTypeElementDoc extends MethodDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationValue.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationValue.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/AnnotationValue.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -37,7 +37,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface AnnotationValue { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ClassDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ClassDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ClassDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -46,7 +46,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ClassDoc extends ProgramElementDoc, Type { /** @@ -341,7 +342,7 @@ * should not be exposed here. In addition, not all imported * classes are imported through single-type-import declarations. */ - @Deprecated + @Deprecated(since="9", forRemoval=true) ClassDoc[] importedClasses(); /** @@ -356,6 +357,6 @@ * return type does not allow for all type-import-on-demand * declarations to be returned. */ - @Deprecated + @Deprecated(since="9", forRemoval=true) PackageDoc[] importedPackages(); } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ConstructorDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ConstructorDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ConstructorDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -36,6 +36,7 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ConstructorDoc extends ExecutableMemberDoc { } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/Doc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/Doc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/Doc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -43,7 +43,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface Doc extends Comparable { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/DocErrorReporter.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/DocErrorReporter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/DocErrorReporter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -36,7 +36,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface DocErrorReporter { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/Doclet.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/Doclet.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/Doclet.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -53,7 +53,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public abstract class Doclet { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ExecutableMemberDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ExecutableMemberDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ExecutableMemberDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -36,7 +36,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ExecutableMemberDoc extends MemberDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/FieldDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/FieldDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/FieldDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -38,7 +38,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface FieldDoc extends MemberDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/LanguageVersion.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/LanguageVersion.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/LanguageVersion.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -42,7 +42,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public enum LanguageVersion { /** 1.1 added nested classes and interfaces. */ diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/MemberDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/MemberDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/MemberDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -43,7 +43,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface MemberDoc extends ProgramElementDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/MethodDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/MethodDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/MethodDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -36,7 +36,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface MethodDoc extends ExecutableMemberDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/PackageDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/PackageDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/PackageDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -42,7 +42,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface PackageDoc extends Doc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ParamTag.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ParamTag.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ParamTag.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -38,7 +38,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ParamTag extends Tag { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/Parameter.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/Parameter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/Parameter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -36,7 +36,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface Parameter { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ParameterizedType.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ParameterizedType.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ParameterizedType.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -48,7 +48,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ParameterizedType extends Type { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ProgramElementDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ProgramElementDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ProgramElementDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -41,7 +41,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ProgramElementDoc extends Doc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/RootDoc.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/RootDoc.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/RootDoc.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -40,7 +40,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface RootDoc extends Doc, DocErrorReporter { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/SeeTag.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/SeeTag.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/SeeTag.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -46,7 +46,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface SeeTag extends Tag { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/SerialFieldTag.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/SerialFieldTag.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/SerialFieldTag.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -48,7 +48,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface SerialFieldTag extends Tag, Comparable { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/SourcePosition.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/SourcePosition.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/SourcePosition.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -39,7 +39,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface SourcePosition { /** The source file. Returns null if no file information is * available. diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -49,7 +49,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface Tag { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/ThrowsTag.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/ThrowsTag.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/ThrowsTag.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -39,7 +39,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface ThrowsTag extends Tag { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/Type.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/Type.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/Type.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -41,7 +41,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface Type { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/TypeVariable.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/TypeVariable.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/TypeVariable.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -41,7 +41,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface TypeVariable extends Type { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/javadoc/WildcardType.java --- a/src/jdk.javadoc/share/classes/com/sun/javadoc/WildcardType.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/javadoc/WildcardType.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -44,7 +44,8 @@ * in the package {@code jdk.javadoc.doclet}. * For more information, see the Migration Guide in the documentation for that package. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public interface WildcardType extends Type { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -25,9 +25,6 @@ package com.sun.tools.doclets.standard; -import com.sun.javadoc.ClassDoc; -import com.sun.javadoc.DocErrorReporter; -import com.sun.javadoc.PackageDoc; import com.sun.javadoc.RootDoc; /** @@ -35,8 +32,9 @@ * @deprecated The doclet has been superseded by its replacement, * {@link jdk.javadoc.doclet.StandardDoclet}. */ -@Deprecated(forRemoval=true, since="9") -@SuppressWarnings("deprecation") +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") + public class Standard { public static boolean start(RootDoc root) { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -48,7 +48,8 @@ * * @since 1.4 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class Main { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AbstractTypeImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AbstractTypeImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AbstractTypeImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -43,7 +43,8 @@ * @author Scott Seligman * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") abstract class AbstractTypeImpl implements com.sun.javadoc.Type { protected final DocEnv env; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotatedTypeImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotatedTypeImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotatedTypeImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -37,7 +37,8 @@ * @author Mahmood Ali * @since 1.8 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class AnnotatedTypeImpl extends AbstractTypeImpl implements AnnotatedType { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationDescImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationDescImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationDescImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -48,7 +48,8 @@ * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class AnnotationDescImpl implements AnnotationDesc { private final DocEnv env; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationTypeDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationTypeDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationTypeDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -48,7 +48,8 @@ * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class AnnotationTypeDocImpl extends ClassDocImpl implements AnnotationTypeDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationTypeElementDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationTypeElementDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationTypeElementDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -42,7 +42,8 @@ * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class AnnotationTypeElementDocImpl extends MethodDocImpl implements AnnotationTypeElementDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationValueImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationValueImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/AnnotationValueImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -43,7 +43,8 @@ * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class AnnotationValueImpl implements AnnotationValue { private final DocEnv env; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -86,7 +86,8 @@ * @author Scott Seligman (generics, enums, annotations) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc { public final ClassType type; // protected->public for debugging @@ -1091,7 +1092,7 @@ * should not be exposed here. In addition, not all imported * classes are imported through single-type-import declarations. */ - @Deprecated + @Deprecated(since="9", forRemoval=true) public ClassDoc[] importedClasses() { // information is not available for binary classfiles if (tsym.sourcefile == null) return new ClassDoc[0]; @@ -1129,7 +1130,7 @@ * return type does not allow for all type-import-on-demand * declarations to be returned. */ - @Deprecated + @Deprecated(since="9", forRemoval=true) public PackageDoc[] importedPackages() { // information is not available for binary classfiles if (tsym.sourcefile == null) return new PackageDoc[0]; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Comment.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Comment.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Comment.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -45,7 +45,8 @@ * @author Atul M Dambalkar * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class Comment { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ConstructorDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ConstructorDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ConstructorDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -44,7 +44,8 @@ * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class ConstructorDocImpl extends ExecutableMemberDocImpl implements ConstructorDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -72,7 +72,8 @@ * @author Neal Gafter (rewrite) * @author Scott Seligman (generics) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class DocEnv { protected static final Context.Key docEnvKey = new Context.Key<>(); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -56,7 +56,8 @@ * @author Atul M Dambalkar * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public abstract class DocImpl implements Doc, Comparable { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocLocale.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocLocale.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocLocale.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -40,7 +40,8 @@ * @since 1.4 * @author Robert Field */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class DocLocale { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -55,7 +55,8 @@ * * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class DocletInvoker { private final Class docletClass; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ExecutableMemberDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ExecutableMemberDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ExecutableMemberDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -51,7 +51,8 @@ * @author Scott Seligman (generics, annotations) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public abstract class ExecutableMemberDocImpl extends MemberDocImpl implements ExecutableMemberDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/FieldDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/FieldDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/FieldDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -51,7 +51,8 @@ * @author Neal Gafter (rewrite) * @author Scott Seligman (generics, enums, annotations) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class FieldDocImpl extends MemberDocImpl implements FieldDoc { protected final VarSymbol sym; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavaScriptScanner.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavaScriptScanner.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavaScriptScanner.java Sat Feb 10 09:25:35 2018 +0100 @@ -39,7 +39,8 @@ /** * Parser to detect use of JavaScript in documentation comments. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class JavaScriptScanner { public static interface Reporter { void report(); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocClassFinder.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocClassFinder.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocClassFinder.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -42,7 +42,8 @@ * * @author Neal Gafter */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class JavadocClassFinder extends ClassFinder { public static JavadocClassFinder instance(Context context) { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocEnter.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocEnter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocEnter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -49,7 +49,8 @@ * * @author Neal Gafter */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class JavadocEnter extends Enter { public static JavadocEnter instance(Context context) { Enter instance = context.get(enterKey); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocMemberEnter.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocMemberEnter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocMemberEnter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -47,7 +47,8 @@ * * @author Neal Gafter */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class JavadocMemberEnter extends MemberEnter { public static JavadocMemberEnter instance0(Context context) { MemberEnter instance = context.get(memberEnterKey); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTodo.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTodo.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTodo.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -40,7 +40,8 @@ * * @author Neal Gafter */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class JavadocTodo extends Todo { public static void preRegister(Context context) { context.put(todoKey, (Factory)JavadocTodo::new); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTool.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTool.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTool.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -70,7 +70,8 @@ * * @author Neal Gafter */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class JavadocTool extends com.sun.tools.javac.main.JavaCompiler { DocEnv docenv; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/MemberDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/MemberDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/MemberDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -49,7 +49,8 @@ * @author Neal Gafter */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public abstract class MemberDocImpl extends ProgramElementDocImpl implements MemberDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -53,7 +53,8 @@ * @see java.text.MessageFormat * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class Messager extends Log implements DocErrorReporter { public static final SourcePosition NOPOS = null; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/MethodDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/MethodDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/MethodDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -47,7 +47,8 @@ * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class MethodDocImpl extends ExecutableMemberDocImpl implements MethodDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ModifierFilter.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ModifierFilter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ModifierFilter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -42,7 +42,8 @@ * @author Robert Field */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class ModifierFilter { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/PackageDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/PackageDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/PackageDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -62,7 +62,8 @@ * @author Scott Seligman (package-info.java) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class PackageDocImpl extends DocImpl implements PackageDoc { public final PackageSymbol sym; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParamTagImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParamTagImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParamTagImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -41,7 +41,8 @@ * @author Robert Field * */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class ParamTagImpl extends TagImpl implements ParamTag { private static final Pattern typeParamRE = Pattern.compile("<([^<>]+)>"); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParameterImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParameterImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParameterImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -43,7 +43,8 @@ * @author Robert Field (rewrite) * @author Scott Seligman (generics, annotations) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class ParameterImpl implements Parameter { private final DocEnv env; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParameterizedTypeImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParameterizedTypeImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ParameterizedTypeImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -46,7 +46,8 @@ * @author Scott Seligman * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class ParameterizedTypeImpl extends AbstractTypeImpl implements ParameterizedType { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/PrimitiveType.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/PrimitiveType.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/PrimitiveType.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -33,7 +33,8 @@ * This code and its internal interfaces are subject to change or * deletion without notice. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class PrimitiveType implements com.sun.javadoc.Type { private final String name; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ProgramElementDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ProgramElementDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ProgramElementDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -55,7 +55,8 @@ * @author Neal Gafter (rewrite) * @author Scott Seligman (generics, enums, annotations) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public abstract class ProgramElementDocImpl extends DocImpl implements ProgramElementDoc { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/RootDocImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/RootDocImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/RootDocImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -55,7 +55,8 @@ * @author Atul M Dambalkar * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class RootDocImpl extends DocImpl implements RootDoc { /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SeeTagImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SeeTagImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SeeTagImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -50,7 +50,8 @@ * @author Atul M Dambalkar * */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class SeeTagImpl extends TagImpl implements SeeTag, LayoutCharacters { //### TODO: Searching for classes, fields, and methods diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SerialFieldTagImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SerialFieldTagImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SerialFieldTagImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -51,7 +51,8 @@ * * @see java.io.ObjectStreamField */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class SerialFieldTagImpl extends TagImpl implements SerialFieldTag, Comparable diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SerializedForm.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SerializedForm.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SerializedForm.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -66,7 +66,8 @@ * @author Joe Fialli * @author Neal Gafter (rewrite but not too proud) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class SerializedForm { ListBuffer methods = new ListBuffer<>(); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SourcePositionImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SourcePositionImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/SourcePositionImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -31,6 +31,7 @@ import com.sun.javadoc.SourcePosition; import com.sun.tools.javac.util.Position; + /** * A source position: filename, line number, and column number. * @@ -43,7 +44,8 @@ * @author Neal M Gafter * @author Michael Van De Vanter (position representation changed to char offsets) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class SourcePositionImpl implements SourcePosition { FileObject filename; int position; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -71,7 +71,8 @@ * @author Robert Field * @author Neal Gafter (rewrite) */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class Start extends ToolOption.Helper { /** Context for this invocation. */ private final Context context; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TagImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TagImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TagImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -48,7 +48,8 @@ * @see Doc#tags() * */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class TagImpl implements Tag { protected final String text; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ThrowsTagImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ThrowsTagImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ThrowsTagImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -43,7 +43,8 @@ * @see ExecutableMemberDocImpl#throwsTags() * */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") class ThrowsTagImpl extends TagImpl implements ThrowsTag { private final String exceptionName; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java Sat Feb 10 09:25:35 2018 +0100 @@ -45,7 +45,8 @@ * This code and its internal interfaces are subject to change or * deletion without notice. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public enum ToolOption { // ----- options for underlying compiler ----- diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -42,7 +42,8 @@ * This code and its internal interfaces are subject to change or * deletion without notice. */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class TypeMaker { public static com.sun.javadoc.Type getType(DocEnv env, Type t) { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -52,7 +52,8 @@ * @author Scott Seligman * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class TypeVariableImpl extends AbstractTypeImpl implements TypeVariable { TypeVariableImpl(DocEnv env, TypeVar type) { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/WildcardTypeImpl.java --- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/WildcardTypeImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/WildcardTypeImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -44,7 +44,8 @@ * @author Scott Seligman * @since 1.5 */ -@Deprecated +@Deprecated(since="9", forRemoval=true) +@SuppressWarnings("removal") public class WildcardTypeImpl extends AbstractTypeImpl implements WildcardType { WildcardTypeImpl(DocEnv env, Type.WildcardType type) { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -37,7 +37,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter; import jdk.javadoc.internal.doclets.toolkit.Content; @@ -70,23 +69,15 @@ protected TypeElement annotationType; - protected TypeMirror prev; - - protected TypeMirror next; - /** * @param configuration the configuration * @param annotationType the annotation type being documented. - * @param prevType the previous class that was documented. - * @param nextType the next class being documented. */ public AnnotationTypeWriterImpl(HtmlConfiguration configuration, - TypeElement annotationType, TypeMirror prevType, TypeMirror nextType) { - super(configuration, DocPath.forClass(configuration.utils, annotationType)); + TypeElement annotationType) { + super(configuration, configuration.docPaths.forClass(annotationType)); this.annotationType = annotationType; configuration.currentTypeElement = annotationType; - this.prev = prevType; - this.next = nextType; } /** @@ -139,44 +130,6 @@ } /** - * Get link to previous class. - * - * @return a content tree for the previous class link - */ - @Override - public Content getNavLinkPrevious() { - Content li; - if (prev != null) { - Content prevLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, utils.asTypeElement(prev)) - .label(contents.prevClassLabel).strong(true)); - li = HtmlTree.LI(prevLink); - } - else - li = HtmlTree.LI(contents.prevClassLabel); - return li; - } - - /** - * Get link to next class. - * - * @return a content tree for the next class link - */ - @Override - public Content getNavLinkNext() { - Content li; - if (next != null) { - Content nextLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, utils.asTypeElement(next)) - .label(contents.nextClassLabel).strong(true)); - li = HtmlTree.LI(nextLink); - } - else - li = HtmlTree.LI(contents.nextClassLabel); - return li; - } - - /** * {@inheritDoc} */ @Override diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -233,9 +233,9 @@ public static void generate(HtmlConfiguration configuration, ClassUseMapper mapper, TypeElement typeElement) throws DocFileIOException { ClassUseWriter clsgen; - DocPath path = DocPath.forPackage(configuration.utils, typeElement) + DocPath path = configuration.docPaths.forPackage(typeElement) .resolve(DocPaths.CLASS_USE) - .resolve(DocPath.forName(configuration.utils, typeElement)); + .resolve(configuration.docPaths.forName( typeElement)); clsgen = new ClassUseWriter(configuration, mapper, path, typeElement); clsgen.generateClassUseFile(); } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -40,7 +40,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.ClassWriter; import jdk.javadoc.internal.doclets.toolkit.Content; @@ -79,25 +78,17 @@ protected final ClassTree classtree; - protected final TypeElement prev; - - protected final TypeElement next; - /** * @param configuration the configuration data for the doclet * @param typeElement the class being documented. - * @param prevClass the previous class that was documented. - * @param nextClass the next class being documented. * @param classTree the class tree for the given class. */ public ClassWriterImpl(HtmlConfiguration configuration, TypeElement typeElement, - TypeElement prevClass, TypeElement nextClass, ClassTree classTree) { - super(configuration, DocPath.forClass(configuration.utils, typeElement)); + ClassTree classTree) { + super(configuration, configuration.docPaths.forClass(typeElement)); this.typeElement = typeElement; configuration.currentTypeElement = typeElement; this.classtree = classTree; - this.prev = prevClass; - this.next = nextClass; } /** @@ -150,44 +141,6 @@ } /** - * Get link to previous class. - * - * @return a content tree for the previous class link - */ - @Override - public Content getNavLinkPrevious() { - Content li; - if (prev != null) { - Content prevLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, prev) - .label(contents.prevClassLabel).strong(true)); - li = HtmlTree.LI(prevLink); - } - else - li = HtmlTree.LI(contents.prevClassLabel); - return li; - } - - /** - * Get link to next class. - * - * @return a content tree for the next class link - */ - @Override - public Content getNavLinkNext() { - Content li; - if (next != null) { - Content nextLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, next) - .label(contents.nextClassLabel).strong(true)); - li = HtmlTree.LI(nextLink); - } - else - li = HtmlTree.LI(contents.nextClassLabel); - return li; - } - - /** * {@inheritDoc} */ @Override diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java Sat Feb 10 09:25:35 2018 +0100 @@ -140,11 +140,6 @@ public final Content navServices; public final Content nestedClassSummary; public final Content newPage; - public final Content nextClassLabel; - public final Content nextLabel; - public final Content nextLetter; - public final Content nextModuleLabel; - public final Content nextPackageLabel; public final Content noFramesLabel; public final Content noScriptMessage; public final Content openModuleLabel; @@ -155,11 +150,6 @@ public final Content packageLabel; public final Content package_; public final Content packagesLabel; - public final Content prevClassLabel; - public final Content prevLabel; - public final Content prevLetter; - public final Content prevModuleLabel; - public final Content prevPackageLabel; public final Content properties; public final Content propertyLabel; public final Content propertyDetailsLabel; @@ -275,11 +265,6 @@ navServices = getContent("doclet.navServices"); nestedClassSummary = getContent("doclet.Nested_Class_Summary"); newPage = new Comment(resources.getText("doclet.New_Page")); - nextClassLabel = getNonBreakContent("doclet.Next_Class"); - nextLabel = getNonBreakContent("doclet.Next"); - nextLetter = getContent("doclet.Next_Letter"); - nextModuleLabel = getNonBreakContent("doclet.Next_Module"); - nextPackageLabel = getNonBreakContent("doclet.Next_Package"); noFramesLabel = getNonBreakContent("doclet.No_Frames"); noScriptMessage = getContent("doclet.No_Script_Message"); openedTo = getContent("doclet.OpenedTo"); @@ -290,11 +275,6 @@ packageLabel = getContent("doclet.Package"); package_ = getContent("doclet.package"); packagesLabel = getContent("doclet.Packages"); - prevClassLabel = getNonBreakContent("doclet.Prev_Class"); - prevLabel = getContent("doclet.Prev"); - prevLetter = getContent("doclet.Prev_Letter"); - prevModuleLabel = getNonBreakContent("doclet.Prev_Module"); - prevPackageLabel = getNonBreakContent("doclet.Prev_Package"); properties = getContent("doclet.Properties"); propertyLabel = getContent("doclet.Property"); propertyDetailsLabel = getContent("doclet.Property_Detail"); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -74,12 +74,18 @@ switch (element.getKind()) { case MODULE: - location = configuration.utils.getLocationForModule((ModuleElement)element); + ModuleElement mdle = (ModuleElement)element; + location = configuration.utils.getLocationForModule(mdle); source = DocPaths.DOC_FILES; break; case PACKAGE: - location = configuration.utils.getLocationForPackage((PackageElement)element); - source = DocPath.forPackage((PackageElement)element).resolve(DocPaths.DOC_FILES); + PackageElement pkg = (PackageElement)element; + location = configuration.utils.getLocationForPackage(pkg); + // Note, given that we have a module-specific location, + // we want a module-relative path for the source, and not the + // standard path that may include the module directory + source = DocPath.create(pkg.getQualifiedName().toString().replace('.', '/')) + .resolve(DocPaths.DOC_FILES); break; default: throw new AssertionError("unsupported element " + element); @@ -103,10 +109,10 @@ DocPath path = null; switch (this.element.getKind()) { case MODULE: - path = DocPath.forModule((ModuleElement)this.element); + path = DocPaths.forModule((ModuleElement)this.element); break; case PACKAGE: - path = DocPath.forPackage((PackageElement)this.element); + path = configuration.docPaths.forPackage((PackageElement)this.element); break; default: throw new AssertionError("unknown kind:" + this.element.getKind()); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -113,12 +113,13 @@ * @param contentTree the content tree to which the help file contents will be added */ protected void addHelpFileContents(Content contentTree) { + // Heading Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title, - contents.getContent("doclet.Help_line_1")); + contents.getContent("doclet.help.main_heading")); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - Content line2 = HtmlTree.DIV(HtmlStyle.subTitle, - contents.getContent("doclet.Help_line_2")); - div.addContent(line2); + Content intro = HtmlTree.DIV(HtmlStyle.subTitle, + contents.getContent("doclet.help.intro")); + div.addContent(intro); if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(div); } else { @@ -127,16 +128,18 @@ HtmlTree htmlTree; HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setStyle(HtmlStyle.blockList); + + // Overview if (configuration.createoverview) { Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.overviewLabel); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(overviewHeading) : HtmlTree.LI(HtmlStyle.blockList, overviewHeading); - Content line3 = contents.getContent("doclet.Help_line_3", + Content overviewBody = contents.getContent("doclet.help.overview.body", links.createLink(DocPaths.overviewSummary(configuration.frames), - configuration.getText("doclet.Overview"))); - Content overviewPara = HtmlTree.P(line3); + resources.getText("doclet.Overview"))); + Content overviewPara = HtmlTree.P(overviewBody); htmlTree.addContent(overviewPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); @@ -144,54 +147,46 @@ ul.addContent(htmlTree); } } + + // Package Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.packageLabel); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(packageHead) : HtmlTree.LI(HtmlStyle.blockList, packageHead); - Content line4 = contents.getContent("doclet.Help_line_4"); - Content packagePara = HtmlTree.P(line4); + Content packageIntro = contents.getContent("doclet.help.package.intro"); + Content packagePara = HtmlTree.P(packageIntro); htmlTree.addContent(packagePara); HtmlTree ulPackage = new HtmlTree(HtmlTag.UL); - ulPackage.addContent(HtmlTree.LI( - contents.interfacesItalic)); - ulPackage.addContent(HtmlTree.LI( - contents.classes)); - ulPackage.addContent(HtmlTree.LI( - contents.enums)); - ulPackage.addContent(HtmlTree.LI( - contents.exceptions)); - ulPackage.addContent(HtmlTree.LI( - contents.errors)); - ulPackage.addContent(HtmlTree.LI( - contents.annotationTypes)); + ulPackage.addContent(HtmlTree.LI(contents.interfacesItalic)); + ulPackage.addContent(HtmlTree.LI(contents.classes)); + ulPackage.addContent(HtmlTree.LI(contents.enums)); + ulPackage.addContent(HtmlTree.LI(contents.exceptions)); + ulPackage.addContent(HtmlTree.LI(contents.errors)); + ulPackage.addContent(HtmlTree.LI(contents.annotationTypes)); htmlTree.addContent(ulPackage); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } + + // Class/interface Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.Help_line_5")); + contents.getContent("doclet.help.class_interface.head")); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(classHead) : HtmlTree.LI(HtmlStyle.blockList, classHead); - Content line6 = contents.getContent("doclet.Help_line_6"); - Content classPara = HtmlTree.P(line6); + Content classIntro = contents.getContent("doclet.help.class_interface.intro"); + Content classPara = HtmlTree.P(classIntro); htmlTree.addContent(classPara); HtmlTree ul1 = new HtmlTree(HtmlTag.UL); - ul1.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_7"))); - ul1.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_8"))); - ul1.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_9"))); - ul1.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_10"))); - ul1.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_11"))); - ul1.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_12"))); + ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.inheritance_diagram"))); + ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subclasses"))); + ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subinterfaces"))); + ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.implementations"))); + ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration"))); + ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.description"))); htmlTree.addContent(ul1); HtmlTree ul2 = new HtmlTree(HtmlTag.UL); ul2.addContent(HtmlTree.LI(contents.nestedClassSummary)); @@ -204,72 +199,66 @@ ul3.addContent(HtmlTree.LI(contents.constructorDetailsLabel)); ul3.addContent(HtmlTree.LI(contents.methodDetailLabel)); htmlTree.addContent(ul3); - Content line13 = contents.getContent("doclet.Help_line_13"); - Content para = HtmlTree.P(line13); + Content classSummary = contents.getContent("doclet.help.class_interface.summary"); + Content para = HtmlTree.P(classSummary); htmlTree.addContent(para); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } - //Annotation Types + + // Annotation Types Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.annotationType); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(aHead) : HtmlTree.LI(HtmlStyle.blockList, aHead); - Content aline1 = contents.getContent("doclet.Help_annotation_type_line_1"); - Content aPara = HtmlTree.P(aline1); + Content aIntro = contents.getContent("doclet.help.annotation_type.intro"); + Content aPara = HtmlTree.P(aIntro); htmlTree.addContent(aPara); HtmlTree aul = new HtmlTree(HtmlTag.UL); - aul.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_annotation_type_line_2"))); - aul.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_annotation_type_line_3"))); - aul.addContent(HtmlTree.LI( - contents.annotateTypeRequiredMemberSummaryLabel)); - aul.addContent(HtmlTree.LI( - contents.annotateTypeOptionalMemberSummaryLabel)); - aul.addContent(HtmlTree.LI( - contents.annotationTypeMemberDetail)); + aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.declaration"))); + aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.description"))); + aul.addContent(HtmlTree.LI(contents.annotateTypeRequiredMemberSummaryLabel)); + aul.addContent(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel)); + aul.addContent(HtmlTree.LI(contents.annotationTypeMemberDetail)); htmlTree.addContent(aul); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } - //Enums - Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.enum_); + + // Enums + Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(enumHead) : HtmlTree.LI(HtmlStyle.blockList, enumHead); - Content eline1 = contents.getContent("doclet.Help_enum_line_1"); - Content enumPara = HtmlTree.P(eline1); + Content eIntro = contents.getContent("doclet.help.enum.intro"); + Content enumPara = HtmlTree.P(eIntro); htmlTree.addContent(enumPara); HtmlTree eul = new HtmlTree(HtmlTag.UL); - eul.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_enum_line_2"))); - eul.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_enum_line_3"))); - eul.addContent(HtmlTree.LI( - contents.enumConstantSummary)); - eul.addContent(HtmlTree.LI( - contents.enumConstantDetailLabel)); + eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.declaration"))); + eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.definition"))); + eul.addContent(HtmlTree.LI(contents.enumConstantSummary)); + eul.addContent(HtmlTree.LI(contents.enumConstantDetailLabel)); htmlTree.addContent(eul); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } + + // Class Use if (configuration.classuse) { Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.Help_line_14")); + contents.getContent("doclet.help.use.head")); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(useHead) : HtmlTree.LI(HtmlStyle.blockList, useHead); - Content line15 = contents.getContent("doclet.Help_line_15"); - Content usePara = HtmlTree.P(line15); + Content useBody = contents.getContent("doclet.help.use.body"); + Content usePara = HtmlTree.P(useBody); htmlTree.addContent(usePara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); @@ -277,23 +266,23 @@ ul.addContent(htmlTree); } } + + // Tree if (configuration.createtree) { Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.Help_line_16")); + contents.getContent("doclet.help.tree.head")); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(treeHead) : HtmlTree.LI(HtmlStyle.blockList, treeHead); - Content line17 = contents.getContent("doclet.Help_line_17_with_tree_link", + Content treeIntro = contents.getContent("doclet.help.tree.intro", links.createLink(DocPaths.OVERVIEW_TREE, configuration.getText("doclet.Class_Hierarchy")), HtmlTree.CODE(new StringContent("java.lang.Object"))); - Content treePara = HtmlTree.P(line17); + Content treePara = HtmlTree.P(treeIntro); htmlTree.addContent(treePara); HtmlTree tul = new HtmlTree(HtmlTag.UL); - tul.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_18"))); - tul.addContent(HtmlTree.LI( - contents.getContent("doclet.Help_line_19"))); + tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.overview"))); + tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.package"))); htmlTree.addContent(tul); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); @@ -301,17 +290,18 @@ ul.addContent(htmlTree); } } - if (!(configuration.nodeprecatedlist || - configuration.nodeprecated)) { + + // Deprecated + if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) { Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.deprecatedAPI); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(dHead) : HtmlTree.LI(HtmlStyle.blockList, dHead); - Content line20 = contents.getContent("doclet.Help_line_20_with_deprecated_api_link", + Content deprBody = contents.getContent("doclet.help.deprecated.body", links.createLink(DocPaths.DEPRECATED_LIST, configuration.getText("doclet.Deprecated_API"))); - Content dPara = HtmlTree.P(line20); + Content dPara = HtmlTree.P(deprBody); htmlTree.addContent(dPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); @@ -319,6 +309,8 @@ ul.addContent(htmlTree); } } + + // Index if (configuration.createindex) { Content indexlink; if (configuration.splitindex) { @@ -329,12 +321,12 @@ configuration.getText("doclet.Index")); } Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.Help_line_21")); + contents.getContent("doclet.help.index.head")); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(indexHead) : HtmlTree.LI(HtmlStyle.blockList, indexHead); - Content line22 = contents.getContent("doclet.Help_line_22", indexlink); - Content indexPara = HtmlTree.P(line22); + Content indexBody = contents.getContent("doclet.help.index.body", indexlink); + Content indexPara = HtmlTree.P(indexBody); htmlTree.addContent(indexPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); @@ -342,13 +334,15 @@ ul.addContent(htmlTree); } } + + // Prev/Next Content prevHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.Help_line_23")); + contents.getContent("doclet.help.prev_next.head")); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(prevHead) : HtmlTree.LI(HtmlStyle.blockList, prevHead); - Content line24 = contents.getContent("doclet.Help_line_24"); - Content prevPara = HtmlTree.P(line24); + Content prevBody = contents.getContent("doclet.help.prev_next.body"); + Content prevPara = HtmlTree.P(prevBody); htmlTree.addContent(prevPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); @@ -356,14 +350,15 @@ ul.addContent(htmlTree); } + // Frames if (configuration.frames) { Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.Help_line_25")); + contents.getContent("doclet.help.frames.head")); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(frameHead) : HtmlTree.LI(HtmlStyle.blockList, frameHead); - Content line26 = contents.getContent("doclet.Help_line_26"); - Content framePara = HtmlTree.P(line26); + Content framesBody = contents.getContent("doclet.help.frames.body"); + Content framePara = HtmlTree.P(framesBody); htmlTree.addContent(framePara); } @@ -373,51 +368,58 @@ ul.addContent(htmlTree); } + // All Classes Content allclassesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.allClassesLabel); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(allclassesHead) : HtmlTree.LI(HtmlStyle.blockList, allclassesHead); - Content line27 = contents.getContent("doclet.Help_line_27", + Content allClassesBody = contents.getContent("doclet.help.all_classes.body", links.createLink(DocPaths.AllClasses(configuration.frames), resources.getText("doclet.All_Classes"))); - Content allclassesPara = HtmlTree.P(line27); + Content allclassesPara = HtmlTree.P(allClassesBody); htmlTree.addContent(allclassesPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } + + // Serialized Form Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.serializedForm); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(sHead) : HtmlTree.LI(HtmlStyle.blockList, sHead); - Content line28 = contents.getContent("doclet.Help_line_28"); - Content serialPara = HtmlTree.P(line28); + Content serialBody = contents.getContent("doclet.help.serial_form.body"); + Content serialPara = HtmlTree.P(serialBody); htmlTree.addContent(serialPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } + + // Constant Field Values Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.constantsSummaryTitle); htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(constHead) : HtmlTree.LI(HtmlStyle.blockList, constHead); - Content line29 = contents.getContent("doclet.Help_line_29", + Content constantsBody = contents.getContent("doclet.help.constants.body", links.createLink(DocPaths.CONSTANT_VALUES, resources.getText("doclet.Constants_Summary"))); - Content constPara = HtmlTree.P(line29); + Content constPara = HtmlTree.P(constantsBody); htmlTree.addContent(constPara); if (configuration.allowTag(HtmlTag.SECTION)) { ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } else { ul.addContent(htmlTree); } + Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); - Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, contents.getContent("doclet.Help_line_30")); + Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, + contents.getContent("doclet.help.footnote")); divContent.addContent(line30); if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(divContent); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Sat Feb 10 09:25:35 2018 +0100 @@ -210,6 +210,12 @@ public HtmlVersion htmlVersion = null; /** + * Flag to enable/disable use of module directories when generating docs for modules + * Default: on (module directories are enabled). + */ + public boolean useModuleDirectories = true; + + /** * Collected set of doclint options */ public Map doclintOpts = new LinkedHashMap<>(); @@ -245,6 +251,8 @@ protected final Messages messages; + protected DocPaths docPaths; + /** * Creates an object to hold the configuration for a doclet. * @@ -357,6 +365,7 @@ } } } + docPaths = new DocPaths(utils, useModuleDirectories); setCreateOverview(); setTopFile(docEnv); workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(), @@ -406,15 +415,15 @@ topFile = DocPaths.overviewSummary(frames); } else { if (showModules) { - topFile = DocPath.empty.resolve(DocPaths.moduleSummary(modules.first())); + topFile = DocPath.empty.resolve(docPaths.moduleSummary(modules.first())); } else if (packages.size() == 1 && packages.first().isUnnamed()) { List classes = new ArrayList<>(getIncludedTypeElements()); if (!classes.isEmpty()) { TypeElement te = getValidClass(classes); - topFile = DocPath.forClass(utils, te); + topFile = docPaths.forClass(te); } } else if (!packages.isEmpty()) { - topFile = DocPath.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY); + topFile = docPaths.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY); } } } @@ -837,6 +846,13 @@ } return true; } + }, + new XOption(resources, "--no-module-directories") { + @Override + public boolean process(String option, List args) { + useModuleDirectories = false; + return true; + } } }; Set oset = new TreeSet<>(); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Sat Feb 10 09:25:35 2018 +0100 @@ -241,29 +241,19 @@ throws DocletException { List list = new ArrayList<>(arr); ListIterator iterator = list.listIterator(); - TypeElement klass = null; - while (iterator.hasNext()) { - TypeElement prev = iterator.hasPrevious() ? klass : null; - klass = iterator.next(); - TypeElement next = iterator.nextIndex() == list.size() - ? null : list.get(iterator.nextIndex()); - + for (TypeElement klass : list) { if (utils.isHidden(klass) || !(configuration.isGeneratedDoc(klass) && utils.isIncluded(klass))) { continue; } - if (utils.isAnnotationType(klass)) { AbstractBuilder annotationTypeBuilder = configuration.getBuilderFactory() - .getAnnotationTypeBuilder(klass, - prev == null ? null : prev.asType(), - next == null ? null : next.asType()); + .getAnnotationTypeBuilder(klass); annotationTypeBuilder.build(); } else { AbstractBuilder classBuilder = - configuration.getBuilderFactory().getClassBuilder(klass, - prev, next, classtree); + configuration.getBuilderFactory().getClassBuilder(klass, classtree); classBuilder.build(); } } @@ -278,7 +268,6 @@ if (configuration.frames && configuration.modules.size() > 1) { ModuleIndexFrameWriter.generate(configuration); } - ModuleElement prevModule = null, nextModule; List mdles = new ArrayList<>(configuration.modulePackages.keySet()); int i = 0; for (ModuleElement mdle : mdles) { @@ -286,12 +275,9 @@ ModulePackageIndexFrameWriter.generate(configuration, mdle); ModuleFrameWriter.generate(configuration, mdle); } - nextModule = (i + 1 < mdles.size()) ? mdles.get(i + 1) : null; AbstractBuilder moduleSummaryBuilder = - configuration.getBuilderFactory().getModuleSummaryBuilder( - mdle, prevModule, nextModule); + configuration.getBuilderFactory().getModuleSummaryBuilder(mdle); moduleSummaryBuilder.build(); - prevModule = mdle; i++; } } @@ -317,7 +303,6 @@ PackageIndexFrameWriter.generate(configuration); } List pList = new ArrayList<>(packages); - PackageElement prev = null; for (int i = 0 ; i < pList.size() ; i++) { // if -nodeprecated option is set and the package is marked as // deprecated, do not generate the package-summary.html, package-frame.html @@ -327,24 +312,12 @@ if (configuration.frames) { PackageFrameWriter.generate(configuration, pkg); } - int nexti = i + 1; - PackageElement next = null; - if (nexti < pList.size()) { - next = pList.get(nexti); - // If the next package is unnamed package, skip 2 ahead if possible - if (next.isUnnamed() && ++nexti < pList.size()) { - next = pList.get(nexti); - } - } AbstractBuilder packageSummaryBuilder = - configuration.getBuilderFactory().getPackageSummaryBuilder( - pkg, prev, next); + configuration.getBuilderFactory().getPackageSummaryBuilder(pkg); packageSummaryBuilder.build(); if (configuration.createtree) { - PackageTreeWriter.generate(configuration, pkg, prev, next, - configuration.nodeprecated); + PackageTreeWriter.generate(configuration, pkg, configuration.nodeprecated); } - prev = pkg; } } } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -155,6 +155,8 @@ protected final Links links; + protected final DocPaths docPaths; + /** * To check whether annotation heading is printed or not. */ @@ -202,6 +204,7 @@ this.path = path; this.pathToRoot = path.parent().invert(); this.filename = path.basename(); + this.docPaths = configuration.docPaths; messages.notice("doclet.Generating_0", DocFile.createFileForOutput(configuration, path).getPath()); @@ -399,7 +402,7 @@ */ public Content getTargetModuleLink(String target, Content label, ModuleElement mdle) { return links.createLink(pathToRoot.resolve( - DocPaths.moduleSummary(mdle)), label, "", target); + docPaths.moduleSummary(mdle)), label, "", target); } /** @@ -572,8 +575,8 @@ } else { tree.addContent(navDiv); } - Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious(), getNavLinkNext()); - Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav); + HtmlTree subDiv = new HtmlTree(HtmlTag.DIV); + subDiv.setStyle(HtmlStyle.subNav); if (configuration.frames) { Content ulFrames = HtmlTree.UL(HtmlStyle.navList, getNavShowLists(), getNavHideLists(filename)); @@ -620,26 +623,6 @@ } /** - * Get the word "NEXT" to indicate that no link is available. Override - * this method to customize next link. - * - * @return a content tree for the link - */ - protected Content getNavLinkNext() { - return getNavLinkNext(null); - } - - /** - * Get the word "PREV" to indicate that no link is available. Override - * this method to customize prev link. - * - * @return a content tree for the link - */ - protected Content getNavLinkPrevious() { - return getNavLinkPrevious(null); - } - - /** * Do nothing. This is the default method. */ protected void addSummaryDetailLinks(Content navDiv) { @@ -712,39 +695,6 @@ } /** - * Get link for previous file. - * - * @param prev File name for the prev link - * @return a content tree for the link - */ - public Content getNavLinkPrevious(DocPath prev) { - Content li; - if (prev != null) { - li = HtmlTree.LI(links.createLink(prev, contents.prevLabel, "", "")); - } - else - li = HtmlTree.LI(contents.prevLabel); - return li; - } - - /** - * Get link for next file. If next is null, just print the label - * without linking it anywhere. - * - * @param next File name for the next link - * @return a content tree for the link - */ - public Content getNavLinkNext(DocPath next) { - Content li; - if (next != null) { - li = HtmlTree.LI(links.createLink(next, contents.nextLabel, "", "")); - } - else - li = HtmlTree.LI(contents.nextLabel); - return li; - } - - /** * Get "FRAMES" link, to switch to the frame version of the output. * * @param link File to be linked, "index.html" @@ -949,7 +899,7 @@ * @param name File name, to which path string is. */ protected DocPath pathString(PackageElement packageElement, DocPath name) { - return pathToRoot.resolve(DocPath.forPackage(packageElement).resolve(name)); + return pathToRoot.resolve(docPaths.forPackage(packageElement).resolve(name)); } /** @@ -1021,7 +971,7 @@ public Content getModuleLink(ModuleElement mdle, Content label) { boolean included = utils.isIncluded(mdle); return (included) - ? links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "") + ? links.createLink(pathToRoot.resolve(docPaths.moduleSummary(mdle)), label, "", "") : label; } @@ -1050,7 +1000,7 @@ } DocPath href = pathToRoot .resolve(DocPaths.SOURCE_OUTPUT) - .resolve(DocPath.forClass(utils, te)); + .resolve(docPaths.forClass(te)); Content linkContent = links.createLink(href .fragment(SourceToHTMLConverter.getAnchorName(utils, typeElement)), label, "", ""); htmltree.addContent(linkContent); @@ -1139,7 +1089,7 @@ public DocLink getCrossModuleLink(String mdleName) { return configuration.extern.getExternalLink(mdleName, pathToRoot, - DocPaths.moduleSummary(mdleName).getPath()); + docPaths.moduleSummary(mdleName).getPath()); } /** @@ -1998,22 +1948,22 @@ DocPath redirectPathFromRoot = new SimpleElementVisitor9() { @Override public DocPath visitType(TypeElement e, Void p) { - return DocPath.forPackage(utils.containingPackage(e)); + return docPaths.forPackage(utils.containingPackage(e)); } @Override public DocPath visitPackage(PackageElement e, Void p) { - return DocPath.forPackage(e); + return docPaths.forPackage(e); } @Override public DocPath visitVariable(VariableElement e, Void p) { - return DocPath.forPackage(utils.containingPackage(e)); + return docPaths.forPackage(utils.containingPackage(e)); } @Override public DocPath visitExecutable(ExecutableElement e, Void p) { - return DocPath.forPackage(utils.containingPackage(e)); + return docPaths.forPackage(utils.containingPackage(e)); } @Override diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -35,8 +35,9 @@ import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; import jdk.javadoc.internal.doclets.toolkit.Content; +import jdk.javadoc.internal.doclets.toolkit.Resources; import jdk.javadoc.internal.doclets.toolkit.util.DocPath; -import jdk.javadoc.internal.doclets.toolkit.util.Utils; +import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; import jdk.javadoc.internal.doclets.toolkit.util.links.LinkFactory; import jdk.javadoc.internal.doclets.toolkit.util.links.LinkInfo; @@ -53,9 +54,12 @@ public class LinkFactoryImpl extends LinkFactory { private final HtmlDocletWriter m_writer; + private final DocPaths docPaths; public LinkFactoryImpl(HtmlDocletWriter writer) { + super(writer.configuration.utils); m_writer = writer; + docPaths = writer.configuration.docPaths; } /** @@ -72,7 +76,6 @@ @Override protected Content getClassLink(LinkInfo linkInfo) { BaseConfiguration configuration = m_writer.configuration; - Utils utils = configuration.utils; LinkInfoImpl classLinkInfo = (LinkInfoImpl) linkInfo; boolean noLabel = linkInfo.label == null || linkInfo.label.isEmpty(); TypeElement typeElement = classLinkInfo.typeElement; @@ -84,14 +87,14 @@ utils.isTypeVariable(utils.getComponentType(classLinkInfo.type)); title = getClassToolTip(typeElement, isTypeLink); } - Content label = classLinkInfo.getClassLinkLabel(m_writer.configuration); + Content label = classLinkInfo.getClassLinkLabel(configuration); Content link = new ContentBuilder(); if (utils.isIncluded(typeElement)) { if (configuration.isGeneratedDoc(typeElement)) { DocPath filename = getPath(classLinkInfo); if (linkInfo.linkToSelf || - !(DocPath.forName(utils, typeElement)).equals(m_writer.filename)) { + !(docPaths.forName(typeElement)).equals(m_writer.filename)) { link.addContent(m_writer.links.createLink( filename.fragment(classLinkInfo.where), label, @@ -140,7 +143,6 @@ @Override public Content getTypeAnnotationLinks(LinkInfo linkInfo) { - Utils utils = ((LinkInfoImpl)linkInfo).utils; ContentBuilder links = new ContentBuilder(); List annotations; if (utils.isAnnotated(linkInfo.type)) { @@ -191,22 +193,21 @@ * @return the tool tip for the appropriate class. */ private String getClassToolTip(TypeElement typeElement, boolean isTypeLink) { - BaseConfiguration configuration = m_writer.configuration; - Utils utils = configuration.utils; + Resources resources = m_writer.configuration.getResources(); if (isTypeLink) { - return configuration.getText("doclet.Href_Type_Param_Title", + return resources.getText("doclet.Href_Type_Param_Title", utils.getSimpleName(typeElement)); } else if (utils.isInterface(typeElement)){ - return configuration.getText("doclet.Href_Interface_Title", + return resources.getText("doclet.Href_Interface_Title", utils.getPackageName(utils.containingPackage(typeElement))); } else if (utils.isAnnotationType(typeElement)) { - return configuration.getText("doclet.Href_Annotation_Title", + return resources.getText("doclet.Href_Annotation_Title", utils.getPackageName(utils.containingPackage(typeElement))); } else if (utils.isEnum(typeElement)) { - return configuration.getText("doclet.Href_Enum_Title", + return resources.getText("doclet.Href_Enum_Title", utils.getPackageName(utils.containingPackage(typeElement))); } else { - return configuration.getText("doclet.Href_Class_Title", + return resources.getText("doclet.Href_Class_Title", utils.getPackageName(utils.containingPackage(typeElement))); } } @@ -223,8 +224,8 @@ if (linkInfo.context == LinkInfoImpl.Kind.PACKAGE_FRAME) { //Not really necessary to do this but we want to be consistent //with 1.4.2 output. - return DocPath.forName(linkInfo.utils, linkInfo.typeElement); + return docPaths.forName(linkInfo.typeElement); } - return m_writer.pathToRoot.resolve(DocPath.forClass(linkInfo.utils, linkInfo.typeElement)); + return m_writer.pathToRoot.resolve(docPaths.forClass(linkInfo.typeElement)); } } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -76,7 +76,7 @@ * @param moduleElement moduleElement under consideration. */ public ModuleFrameWriter(HtmlConfiguration configuration, ModuleElement moduleElement) { - super(configuration, DocPaths.moduleTypeFrame(moduleElement)); + super(configuration, configuration.docPaths.moduleTypeFrame(moduleElement)); this.mdle = moduleElement; if (configuration.getSpecifiedPackageElements().isEmpty()) { documentedClasses = new TreeSet<>(utils.makeGeneralPurposeComparator()); @@ -101,7 +101,7 @@ ? HtmlTree.MAIN() : body; Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, - mdlgen.links.createLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame")); + mdlgen.links.createLink(configuration.docPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame")); htmlTree.addContent(heading); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.setStyle(HtmlStyle.indexContainer); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -114,9 +114,9 @@ } private Content getModuleFramesHyperLink(ModuleElement mdle, Content label, String target) { - DocLink mdlLink = new DocLink(DocPaths.moduleFrame(mdle)); - DocLink mtFrameLink = new DocLink(DocPaths.moduleTypeFrame(mdle)); - DocLink cFrameLink = new DocLink(DocPaths.moduleSummary(mdle)); + DocLink mdlLink = new DocLink(docPaths.moduleFrame(mdle)); + DocLink mtFrameLink = new DocLink(docPaths.moduleTypeFrame(mdle)); + DocLink cFrameLink = new DocLink(docPaths.moduleSummary(mdle)); HtmlTree anchor = HtmlTree.A(mdlLink.toString(), label); String onclickStr = "updateModuleFrame('" + mtFrameLink + "','" + cFrameLink + "');"; anchor.addAttr(HtmlAttr.TARGET, target); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -76,7 +76,7 @@ * @param mdle the module being documented */ public static void generate(HtmlConfiguration configuration, ModuleElement mdle) throws DocFileIOException { - DocPath filename = DocPaths.moduleFrame(mdle); + DocPath filename = configuration.docPaths.moduleFrame(mdle); ModulePackageIndexFrameWriter modpackgen = new ModulePackageIndexFrameWriter(configuration, filename); modpackgen.buildModulePackagesIndexFile("doclet.Window_Overview", false, mdle); } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -50,7 +50,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml; import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.Content; @@ -74,16 +73,6 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryWriter { /** - * The prev module name in the alpha-order list. - */ - protected ModuleElement prevModule; - - /** - * The next module name in the alpha-order list. - */ - protected ModuleElement nextModule; - - /** * The module being documented. */ protected ModuleElement mdle; @@ -187,14 +176,9 @@ * * @param configuration the configuration of the doclet. * @param mdle Module under consideration. - * @param prevModule Previous module in the sorted array. - * @param nextModule Next module in the sorted array. */ - public ModuleWriterImpl(HtmlConfiguration configuration, - ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) { - super(configuration, DocPaths.moduleSummary(mdle)); - this.prevModule = prevModule; - this.nextModule = nextModule; + public ModuleWriterImpl(HtmlConfiguration configuration, ModuleElement mdle) { + super(configuration, configuration.docPaths.moduleSummary(mdle)); this.mdle = mdle; this.moduleMode = configuration.docEnv.getModuleMode(); computeModulesData(); @@ -1044,38 +1028,4 @@ Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.moduleLabel); return li; } - - /** - * Get "PREV MODULE" link in the navigation bar. - * - * @return a content tree for the previous link - */ - @Override - public Content getNavLinkPrevious() { - Content li; - if (prevModule == null) { - li = HtmlTree.LI(contents.prevModuleLabel); - } else { - li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary( - prevModule)), contents.prevModuleLabel, "", "")); - } - return li; - } - - /** - * Get "NEXT MODULE" link in the navigation bar. - * - * @return a content tree for the next link - */ - @Override - public Content getNavLinkNext() { - Content li; - if (nextModule == null) { - li = HtmlTree.LI(contents.nextModuleLabel); - } else { - li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary( - nextModule)), contents.nextModuleLabel, "", "")); - } - return li; - } } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -38,7 +38,6 @@ import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; -import jdk.javadoc.internal.doclets.toolkit.util.DocPath; import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; /** @@ -79,7 +78,8 @@ * @param packageElement PackageElement under consideration. */ public PackageFrameWriter(HtmlConfiguration configuration, PackageElement packageElement) { - super(configuration, DocPath.forPackage(packageElement).resolve(DocPaths.PACKAGE_FRAME)); + super(configuration, + configuration.docPaths.forPackage(packageElement).resolve(DocPaths.PACKAGE_FRAME)); this.packageElement = packageElement; if (configuration.getSpecifiedPackageElements().isEmpty()) { documentedClasses = new TreeSet<>(utils.makeGeneralPurposeComparator()); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -31,7 +31,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; @@ -59,32 +58,15 @@ protected PackageElement packageElement; /** - * The previous package name in the alpha-order list. - */ - protected PackageElement prev; - - /** - * The next package name in the alpha-order list. - */ - protected PackageElement next; - - /** * Constructor. * @param configuration the configuration * @param path the docpath to generate files into * @param packageElement the current package - * @param prev the previous package - * @param next the next package */ - public PackageTreeWriter(HtmlConfiguration configuration, - DocPath path, - PackageElement packageElement, - PackageElement prev, PackageElement next) { + public PackageTreeWriter(HtmlConfiguration configuration, DocPath path, PackageElement packageElement) { super(configuration, path, new ClassTree(configuration.typeElementCatalog.allClasses(packageElement), configuration)); this.packageElement = packageElement; - this.prev = prev; - this.next = next; } /** @@ -93,18 +75,15 @@ * * @param configuration the configuration for this run. * @param pkg Package for which tree file is to be generated. - * @param prev Previous package in the alpha-ordered list. - * @param next Next package in the alpha-ordered list. * @param noDeprecated If true, do not generate any information for * deprecated classe or interfaces. * @throws DocFileIOException if there is a problem generating the package tree page */ public static void generate(HtmlConfiguration configuration, - PackageElement pkg, PackageElement prev, - PackageElement next, boolean noDeprecated) + PackageElement pkg, boolean noDeprecated) throws DocFileIOException { - DocPath path = DocPath.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE); - PackageTreeWriter packgen = new PackageTreeWriter(configuration, path, pkg, prev, next); + DocPath path = configuration.docPaths.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE); + PackageTreeWriter packgen = new PackageTreeWriter(configuration, path, pkg); packgen.generatePackageTreeFile(); } @@ -183,36 +162,6 @@ } /** - * Get link for the previous package tree file. - * - * @return a content tree for the link - */ - @Override - protected Content getNavLinkPrevious() { - if (prev == null) { - return getNavLinkPrevious(null); - } else { - DocPath path = DocPath.relativePath(packageElement, prev); - return getNavLinkPrevious(path.resolve(DocPaths.PACKAGE_TREE)); - } - } - - /** - * Get link for the next package tree file. - * - * @return a content tree for the link - */ - @Override - protected Content getNavLinkNext() { - if (next == null) { - return getNavLinkNext(null); - } else { - DocPath path = DocPath.relativePath(packageElement, next); - return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE)); - } - } - - /** * Get the module link. * * @return a content tree for the module link diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -75,7 +75,7 @@ public PackageUseWriter(HtmlConfiguration configuration, ClassUseMapper mapper, DocPath filename, PackageElement pkgElement) { - super(configuration, DocPath.forPackage(pkgElement).resolve(filename)); + super(configuration, configuration.docPaths.forPackage(pkgElement).resolve(filename)); this.packageElement = pkgElement; // by examining all classes in this package, find what packages @@ -221,7 +221,7 @@ .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); for (TypeElement te : usingPackageToUsedClasses.get(packageName)) { DocPath dp = pathString(te, - DocPaths.CLASS_USE.resolve(DocPath.forName(utils, te))); + DocPaths.CLASS_USE.resolve(docPaths.forName(te))); Content stringContent = new StringContent(utils.getSimpleName(te)); Content typeContent = links.createLink(dp.fragment(getPackageAnchorName(usingPackage)), stringContent); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -40,7 +40,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter; @@ -66,16 +65,6 @@ implements PackageSummaryWriter { /** - * The prev package name in the alpha-order list. - */ - protected PackageElement prev; - - /** - * The next package name in the alpha-order list. - */ - protected PackageElement next; - - /** * The package being documented. */ protected PackageElement packageElement; @@ -100,16 +89,11 @@ * * @param configuration the configuration of the doclet. * @param packageElement PackageElement under consideration. - * @param prev Previous package in the sorted array. - * @param next Next package in the sorted array. */ - public PackageWriterImpl(HtmlConfiguration configuration, - PackageElement packageElement, PackageElement prev, PackageElement next) { - super(configuration, DocPath - .forPackage(packageElement) + public PackageWriterImpl(HtmlConfiguration configuration, PackageElement packageElement) { + super(configuration, + configuration.docPaths.forPackage(packageElement) .resolve(DocPaths.PACKAGE_SUMMARY)); - this.prev = prev; - this.next = next; this.packageElement = packageElement; } @@ -392,42 +376,6 @@ } /** - * Get "PREV PACKAGE" link in the navigation bar. - * - * @return a content tree for the previous link - */ - @Override - public Content getNavLinkPrevious() { - Content li; - if (prev == null) { - li = HtmlTree.LI(contents.prevPackageLabel); - } else { - DocPath p = DocPath.relativePath(packageElement, prev); - li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY), - contents.prevPackageLabel, "", "")); - } - return li; - } - - /** - * Get "NEXT PACKAGE" link in the navigation bar. - * - * @return a content tree for the next link - */ - @Override - public Content getNavLinkNext() { - Content li; - if (next == null) { - li = HtmlTree.LI(contents.nextPackageLabel); - } else { - DocPath p = DocPath.relativePath(packageElement, next); - li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY), - contents.nextPackageLabel, "", "")); - } - return li; - } - - /** * Get "Tree" link in the navigation bar. This will be link to the package * tree file. * diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -182,7 +182,7 @@ int lineno = 1; String line; relativePath = DocPaths.SOURCE_OUTPUT - .resolve(DocPath.forPackage(utils, te)) + .resolve(configuration.docPaths.forPackage(te)) .invert(); Content body = getHeader(); Content pre = new HtmlTree(HtmlTag.PRE); @@ -196,7 +196,7 @@ addBlankLines(pre); Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div); - writeToFile(body, outputdir.resolve(DocPath.forClass(utils, te))); + writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te))); } catch (IOException e) { String message = resources.getText("doclet.exception.read.file", fo.getName()); throw new SimpleDocletException(message, e); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Sat Feb 10 09:25:35 2018 +0100 @@ -35,7 +35,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; @@ -60,16 +59,6 @@ */ public class SplitIndexWriter extends AbstractIndexWriter { - /** - * Previous unicode character index in the built index. - */ - protected int prev; - - /** - * Next unicode character in the built index. - */ - protected int next; - private final List indexElements; /** @@ -80,18 +69,13 @@ * @param path Path to the file which is getting generated. * @param indexbuilder Unicode based Index from {@link IndexBuilder} * @param elements the collection of characters for which to generate index files - * @param prev the previous character that was indexed - * @param next the next character to be indexed */ public SplitIndexWriter(HtmlConfiguration configuration, DocPath path, IndexBuilder indexbuilder, - Collection elements, - int prev, int next) { + Collection elements) { super(configuration, path, indexbuilder); this.indexElements = new ArrayList<>(elements); - this.prev = prev; - this.next = next; } /** @@ -117,7 +101,7 @@ DocPath filename = DocPaths.indexN(li.nextIndex()); SplitIndexWriter indexgen = new SplitIndexWriter(configuration, path.resolve(filename), - indexbuilder, keys, prev, next); + indexbuilder, keys); indexgen.generateIndexFile((Character) ch); if (!li.hasNext()) { indexgen.createSearchIndexFiles(); @@ -182,40 +166,4 @@ contentTree.addContent(Contents.SPACE); } } - - /** - * Get link to the previous unicode character. - * - * @return a content tree for the link - */ - @Override - public Content getNavLinkPrevious() { - Content prevletterLabel = contents.prevLetter; - if (prev == -1) { - return HtmlTree.LI(prevletterLabel); - } - else { - Content prevLink = links.createLink(DocPaths.indexN(prev), - prevletterLabel); - return HtmlTree.LI(prevLink); - } - } - - /** - * Get link to the next unicode character. - * - * @return a content tree for the link - */ - @Override - public Content getNavLinkNext() { - Content nextletterLabel = contents.nextLetter; - if (next == -1) { - return HtmlTree.LI(nextletterLabel); - } - else { - Content nextLink = links.createLink(DocPaths.indexN(next), - nextletterLabel); - return HtmlTree.LI(nextLink); - } - } } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -112,17 +112,18 @@ SearchIndexItem si = new SearchIndexItem(); si.setLabel(tagText); si.setDescription(desc); + DocPaths docPaths = configuration.docPaths; new SimpleElementVisitor9() { @Override public Void visitModule(ModuleElement e, Void p) { - si.setUrl(DocPaths.moduleSummary(e).getPath() + "#" + anchorName); + si.setUrl(docPaths.moduleSummary(e).getPath() + "#" + anchorName); si.setHolder(utils.getFullyQualifiedName(element)); return null; } @Override public Void visitPackage(PackageElement e, Void p) { - si.setUrl(DocPath.forPackage(e).getPath() + si.setUrl(docPaths.forPackage(e).getPath() + "/" + DocPaths.PACKAGE_SUMMARY.getPath() + "#" + anchorName); si.setHolder(utils.getSimpleName(element)); return null; @@ -130,7 +131,7 @@ @Override public Void visitType(TypeElement e, Void p) { - si.setUrl(DocPath.forClass(utils, e).getPath() + "#" + anchorName); + si.setUrl(docPaths.forClass(e).getPath() + "#" + anchorName); si.setHolder(utils.getFullyQualifiedName(e)); return null; } @@ -138,7 +139,7 @@ @Override public Void visitVariable(VariableElement e, Void p) { TypeElement te = utils.getEnclosingTypeElement(e); - si.setUrl(DocPath.forClass(utils, te).getPath() + "#" + anchorName); + si.setUrl(docPaths.forClass(te).getPath() + "#" + anchorName); si.setHolder(utils.getFullyQualifiedName(e) + "." + utils.getSimpleName(e)); return null; } @@ -146,7 +147,7 @@ @Override protected Void defaultAction(Element e, Void p) { TypeElement te = utils.getEnclosingTypeElement(e); - si.setUrl(DocPath.forClass(utils, te).getPath() + "#" + anchorName); + si.setUrl(docPaths.forClass(te).getPath() + "#" + anchorName); si.setHolder(utils.getFullyQualifiedName(e)); return null; } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java Sat Feb 10 09:25:35 2018 +0100 @@ -76,36 +76,31 @@ * {@inheritDoc} */ @Override - public PackageSummaryWriter getPackageSummaryWriter(PackageElement packageElement, - PackageElement prevPkg, PackageElement nextPkg) { - return new PackageWriterImpl(configuration, packageElement, prevPkg, nextPkg); + public PackageSummaryWriter getPackageSummaryWriter(PackageElement packageElement) { + return new PackageWriterImpl(configuration, packageElement); } /** * {@inheritDoc} */ - public ModuleSummaryWriter getModuleSummaryWriter(ModuleElement mdle, - ModuleElement prevModule, ModuleElement nextModule) { - return new ModuleWriterImpl(configuration, mdle, - prevModule, nextModule); + public ModuleSummaryWriter getModuleSummaryWriter(ModuleElement mdle) { + return new ModuleWriterImpl(configuration, mdle); } /** * {@inheritDoc} */ @Override - public ClassWriter getClassWriter(TypeElement typeElement, TypeElement prevClass, - TypeElement nextClass, ClassTree classTree) { - return new ClassWriterImpl(configuration, typeElement, prevClass, nextClass, classTree); + public ClassWriter getClassWriter(TypeElement typeElement, ClassTree classTree) { + return new ClassWriterImpl(configuration, typeElement, classTree); } /** * {@inheritDoc} */ @Override - public AnnotationTypeWriter getAnnotationTypeWriter(TypeElement annotationType, - TypeMirror prevType, TypeMirror nextType) { - return new AnnotationTypeWriterImpl(configuration, annotationType, prevType, nextType); + public AnnotationTypeWriter getAnnotationTypeWriter(TypeElement annotationType) { + return new AnnotationTypeWriterImpl(configuration, annotationType); } /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties Sat Feb 10 09:25:35 2018 +0100 @@ -16,16 +16,6 @@ doclet.Interface_Hierarchy=Interface Hierarchy doclet.Enum_Hierarchy=Enum Hierarchy doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy -doclet.Prev=Prev -doclet.Next=Next -doclet.Prev_Class=Prev Class -doclet.Next_Class=Next Class -doclet.Prev_Package=Prev Package -doclet.Next_Package=Next Package -doclet.Prev_Module=Prev Module -doclet.Next_Module=Next Module -doclet.Prev_Letter=Prev Letter -doclet.Next_Letter=Next Letter doclet.Href_Class_Title=class in {0} doclet.Href_Interface_Title=interface in {0} doclet.Href_Annotation_Title=annotation in {0} @@ -89,7 +79,9 @@ doclet.Subinterfaces=All Known Subinterfaces: doclet.Implementing_Classes=All Known Implementing Classes: doclet.Functional_Interface=Functional Interface: -doclet.Functional_Interface_Message=This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference. +doclet.Functional_Interface_Message=\ + This is a functional interface and can therefore be used as the assignment target for a lambda \ + expression or method reference. doclet.also=also doclet.Frames=Frames doclet.No_Frames=No Frames @@ -105,42 +97,102 @@ doclet.Enclosing_Interface=Enclosing interface: doclet.Window_Source_title=Source code doclet.Window_Help_title=API Help -doclet.Help_line_1=How This API Document Is Organized -doclet.Help_line_2=This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows. -doclet.Help_line_3=The {0} page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages. -doclet.Help_line_4=Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories: -doclet.Help_line_5=Class/Interface -doclet.Help_line_6=Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions: -doclet.Help_line_7=Class inheritance diagram -doclet.Help_line_8=Direct Subclasses -doclet.Help_line_9=All Known Subinterfaces -doclet.Help_line_10=All Known Implementing Classes -doclet.Help_line_11=Class/interface declaration -doclet.Help_line_12=Class/interface description -doclet.Help_line_13=Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer. -doclet.Help_line_14=Use -doclet.Help_line_15=Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar. -doclet.Help_line_16=Tree (Class Hierarchy) -doclet.Help_line_17_with_tree_link=There is a {0} page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with {1}. The interfaces do not inherit from {1}. -doclet.Help_line_18=When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. -doclet.Help_line_19=When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package. -doclet.Help_line_20_with_deprecated_api_link=The {0} page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations. -doclet.Help_line_21=Index -doclet.Help_line_22=The {0} contains an alphabetic list of all classes, interfaces, constructors, methods, and fields. -doclet.Help_line_23=Prev/Next -doclet.Help_line_24=These links take you to the next or previous class, interface, package, or related page. -doclet.Help_line_25=Frames/No Frames -doclet.Help_line_26=These links show and hide the HTML frames. All pages are available with or without frames. -doclet.Help_line_27=The {0} link shows all classes and interfaces except non-static nested types. -doclet.Help_line_28=Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -doclet.Help_line_29=The {0} page lists the static final fields and their values. -doclet.Help_line_30=This help file applies to API documentation generated using the standard doclet. -doclet.Help_enum_line_1=Each enum has its own separate page with the following sections: -doclet.Help_enum_line_2=Enum declaration -doclet.Help_enum_line_3=Enum description -doclet.Help_annotation_type_line_1=Each annotation type has its own separate page with the following sections: -doclet.Help_annotation_type_line_2=Annotation Type declaration -doclet.Help_annotation_type_line_3=Annotation Type description + +doclet.help.main_heading=\ + How This API Document Is Organized +doclet.help.intro=\ + This API (Application Programming Interface) document has pages corresponding to the items in \ + the navigation bar, described as follows. +doclet.help.overview.body=\ + The {0} page is the front page of this API document and provides a list of all packages with a \ + summary for each. This page can also contain an overall description of the set of packages. +doclet.help.package.intro=\ + Each package has a page that contains a list of its classes and interfaces, with a summary for \ + each. This page can contain six categories: +doclet.help.class_interface.head=\ + Class/Interface +doclet.help.class_interface.intro=\ + Each class, interface, nested class and nested interface has its own separate page. Each of \ + these pages has three sections consisting of a class/interface description, summary tables, \ + and detailed member descriptions: +doclet.help.class_interface.inheritance_diagram=\ + Class inheritance diagram +doclet.help.class_interface.subclasses=\ + Direct Subclasses +doclet.help.class_interface.subinterfaces=\ + All Known Subinterfaces +doclet.help.class_interface.implementations=\ + All Known Implementing Classes +doclet.help.class_interface.declaration=\ + Class/interface declaration +doclet.help.class_interface.description=\ + Class/interface description +doclet.help.class_interface.summary=\ + Each summary entry contains the first sentence from the detailed description for that item. \ + The summary entries are alphabetical, while the detailed descriptions are in the order they \ + appear in the source code. This preserves the logical groupings established by the programmer. +doclet.help.use.head=\ + Use +doclet.help.use.body=\ + Each documented package, class and interface has its own Use page. This page describes what \ + packages, classes, methods, constructors and fields use any part of the given class or \ + package. Given a class or interface A, its Use page includes subclasses of A, fields declared \ + as A, methods that return A, and methods and constructors with parameters of type A. \ + You can access this page by first going to the package, class or interface, then clicking on \ + the "Use" link in the navigation bar. +doclet.help.tree.head=\ + Tree (Class Hierarchy) +doclet.help.tree.intro=\ + There is a {0} page for all packages, plus a hierarchy for each package. Each hierarchy page \ + contains a list of classes and a list of interfaces. The classes are organized by inheritance \ + structure starting with {1}. The interfaces do not inherit from {1}. +doclet.help.tree.overview=\ + When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. +doclet.help.tree.package=\ + When viewing a particular package, class or interface page, clicking "Tree" displays the \ + hierarchy for only that package. +doclet.help.deprecated.body=\ + The {0} page lists all of the API that have been deprecated. A deprecated API is not \ + recommended for use, generally due to improvements, and a replacement API is usually given. \ + Deprecated APIs may be removed in future implementations. +doclet.help.index.head=\ + Index +doclet.help.index.body=\ + The {0} contains an alphabetic list of all classes, interfaces, constructors, methods, \ + and fields. +doclet.help.prev_next.head=\ + Prev/Next +doclet.help.prev_next.body=\ + These links take you to the next or previous class, interface, package, or related page. +doclet.help.frames.head=\ + Frames/No Frames +doclet.help.frames.body=\ + These links show and hide the HTML frames. All pages are available with or without frames. +doclet.help.all_classes.body=\ + The {0} link shows all classes and interfaces except non-static nested types. +doclet.help.serial_form.body=\ + Each serializable or externalizable class has a description of its serialization fields and \ + methods. This information is of interest to re-implementors, not to developers using the API. \ + While there is no link in the navigation bar, you can get to this information by going to any \ + serialized class and clicking "Serialized Form" in the "See also" section of the class \ + description. +doclet.help.constants.body=\ + The {0} page lists the static final fields and their values. +doclet.help.footnote=\ + This help file applies to API documentation generated using the standard doclet. +doclet.help.enum.intro=\ + Each enum has its own separate page with the following sections: +doclet.help.enum.declaration=\ + Enum declaration +doclet.help.enum.definition=\ + Enum description +doclet.help.annotation_type.intro=\ + Each annotation type has its own separate page with the following sections: +doclet.help.annotation_type.declaration=\ + Annotation Type declaration +doclet.help.annotation_type.description=\ + Annotation Type description + doclet.ClassUse_Packages.that.use.0=Packages that use {0} doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1} doclet.ClassUse_Classes.in.0.used.by.1=Classes in {0} used by {1} @@ -152,7 +204,8 @@ doclet.ClassUse_FieldAnnotations=Fields in {1} with annotations of type {0} doclet.ClassUse_MethodAnnotations=Methods in {1} with annotations of type {0} doclet.ClassUse_MethodParameterAnnotations=Method parameters in {1} with annotations of type {0} -doclet.ClassUse_MethodReturnTypeParameter=Methods in {1} that return types with arguments of type {0} +doclet.ClassUse_MethodReturnTypeParameter=\ + Methods in {1} that return types with arguments of type {0} doclet.ClassUse_Subclass=Subclasses of {0} in {1} doclet.ClassUse_Subinterface=Subinterfaces of {0} in {1} doclet.ClassUse_ImplementingClass=Classes in {1} that implement {0} @@ -162,9 +215,11 @@ doclet.ClassUse_MethodArgsTypeParameters=Method parameters in {1} with type arguments of type {0} doclet.ClassUse_MethodThrows=Methods in {1} that throw {0} doclet.ClassUse_ConstructorAnnotations=Constructors in {1} with annotations of type {0} -doclet.ClassUse_ConstructorParameterAnnotations=Constructor parameters in {1} with annotations of type {0} +doclet.ClassUse_ConstructorParameterAnnotations=\ + Constructor parameters in {1} with annotations of type {0} doclet.ClassUse_ConstructorArgs=Constructors in {1} with parameters of type {0} -doclet.ClassUse_ConstructorArgsTypeParameters=Constructor parameters in {1} with type arguments of type {0} +doclet.ClassUse_ConstructorArgsTypeParameters=\ + Constructor parameters in {1} with type arguments of type {0} doclet.ClassUse_ConstructorThrows=Constructors in {1} that throw {0} doclet.ClassUse_No.usage.of.0=No usage of {0} doclet.Window_ClassUse_Header=Uses of {0} {1} @@ -280,6 +335,10 @@ doclet.usage.nodeprecatedlist.description=\ Do not generate deprecated list +doclet.usage.no-module-directories.description=\ + Do not group files for module documentation into \n\ + module-specific directories + doclet.usage.notree.description=\ Do not generate class hierarchy @@ -315,7 +374,7 @@ Charset for cross-platform viewing of generated documentation doclet.usage.javafx.description=\ - Enable javafx functionality + Enable JavaFX functionality doclet.usage.helpfile.parameters=\ diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties Sat Feb 10 09:25:35 2018 +0100 @@ -301,3 +301,6 @@ doclet.usage.xdoclint-package.parameters=([-]) doclet.usage.xdoclint-package.description=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\u306F\n\u30AB\u30F3\u30DE\u3067\u533A\u5207\u3089\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\n\u6307\u5B9A\u5B50\u306F\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\n\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B.*\u3092\u6307\u5B9A(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\n\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u524D\u306B-\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\n\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002 + +# L10N: do not localize the option names -html4 and -html5 +doclet.HTML_version_not_specified=\u4F7F\u7528\u3059\u308BHTML\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\n\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u73FE\u5728HTML 4.01\u3067\u3059\u304C\u3001\u3053\u308C\u306F\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067HTML5\u306B\n\u5909\u66F4\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u8B66\u544A\u3092\u8868\u793A\u3057\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u306B\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8\n\u3067\u4F7F\u7528\u3055\u308C\u3066\u3044\u3066\u3001\u3053\u306E\u30C9\u30C3\u30AF\u30EC\u30C3\u30C8\u3067-html4\u307E\u305F\u306F-html5\uFF11\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\n\u751F\u6210\u3055\u308C\u308BHTML\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties Sat Feb 10 09:25:35 2018 +0100 @@ -301,3 +301,6 @@ doclet.usage.xdoclint-package.parameters=([-]) doclet.usage.xdoclint-package.description=\u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\u68C0\u67E5\u3002<\u7A0B\u5E8F\u5305>\n\u662F\u9017\u53F7\u5206\u9694\u7684\u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u5217\u8868\u3002\u7A0B\u5E8F\u5305\n\u8BF4\u660E\u7B26\u662F\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\u540D\u79F0\u6216\u7A0B\u5E8F\u5305\u540D\u79F0\n\u524D\u7F00\u540E\u8DDF .*, \u5B83\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\u6240\u6709\n\u5B50\u7A0B\u5E8F\u5305\u3002\u5728\u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u524D\u9762\u52A0\u4E0A - \u53EF\u4EE5\n\u4E3A\u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002 + +# L10N: do not localize the option names -html4 and -html5 +doclet.HTML_version_not_specified=\u672A\u6307\u5B9A\u8981\u4F7F\u7528\u7684 HTML \u7248\u672C\u3002\n\u9ED8\u8BA4\u503C\u5F53\u524D\u4E3A HTML 4.01\uFF0C\u4F46\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\n\u5C06\u66F4\u6539\u4E3A HTML5\u3002\u8981\u9690\u85CF\u6B64\u8B66\u544A\uFF0C\u8BF7\u4F7F\u7528 -html4 \n\u6216 -html5 \u9009\u9879\uFF0C\u6307\u5B9A\u8981\u7531\u6B64 doclet \u751F\u6210\u7684\u3001\n\u5728\u6587\u6863\u6CE8\u91CA\u4E2D\u4F7F\u7528\u7684 HTML \u7248\u672C\u3002 diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -65,8 +65,7 @@ /** * Configure the output based on the options. Doclets should sub-class * BaseConfiguration, to configure and add their own options. This class contains - * all user options which are supported by the 1.1 doclet and the standard - * doclet. + * all user options which are supported by the standard doclet. *

*

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java Sat Feb 10 09:25:35 2018 +0100 @@ -59,50 +59,38 @@ * Return the writer for the package summary. * * @param packageElement the package being documented. - * @param prevPkg the previous package that was documented. - * @param nextPkg the next package being documented. * @return the writer for the package summary. Return null if this * writer is not supported by the doclet. */ - public abstract PackageSummaryWriter getPackageSummaryWriter(PackageElement - packageElement, PackageElement prevPkg, PackageElement nextPkg); + public abstract PackageSummaryWriter getPackageSummaryWriter(PackageElement packageElement); /** * Return the writer for the module summary. * * @param mdle the module being documented. - * @param prevModule the previous module that was documented. - * @param nextModule the next module being documented. * @return the writer for the module summary. Return null if this * writer is not supported by the doclet. */ - public abstract ModuleSummaryWriter getModuleSummaryWriter( - ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule); + public abstract ModuleSummaryWriter getModuleSummaryWriter(ModuleElement mdle); /** * Return the writer for a class. * * @param typeElement the class being documented. - * @param prevClass the previous class that was documented. - * @param nextClass the next class being documented. * @param classTree the class tree. * @return the writer for the class. Return null if this * writer is not supported by the doclet. */ - public abstract ClassWriter getClassWriter(TypeElement typeElement, - TypeElement prevClass, TypeElement nextClass, ClassTree classTree); + public abstract ClassWriter getClassWriter(TypeElement typeElement, ClassTree classTree); /** * Return the writer for an annotation type. * * @param annotationType the type being documented. - * @param prevType the previous type that was documented. - * @param nextType the next type being documented. * @return the writer for the annotation type. Return null if this * writer is not supported by the doclet. */ - public abstract AnnotationTypeWriter getAnnotationTypeWriter( - TypeElement annotationType, TypeMirror prevType, TypeMirror nextType); + public abstract AnnotationTypeWriter getAnnotationTypeWriter(TypeElement annotationType); /** * Return the method writer for a given class. diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java Sat Feb 10 09:25:35 2018 +0100 @@ -88,59 +88,47 @@ * Return the builder that builds the package summary. * * @param pkg the package being documented. - * @param prevPkg the previous package being documented. - * @param nextPkg the next package being documented. * @return the builder that builds the package summary. */ - public AbstractBuilder getPackageSummaryBuilder(PackageElement pkg, PackageElement prevPkg, - PackageElement nextPkg) { + public AbstractBuilder getPackageSummaryBuilder(PackageElement pkg) { return PackageSummaryBuilder.getInstance(context, pkg, - writerFactory.getPackageSummaryWriter(pkg, prevPkg, nextPkg)); + writerFactory.getPackageSummaryWriter(pkg)); } /** * Return the builder that builds the module summary. * * @param mdle the module being documented. - * @param prevModule the previous module being documented. - * @param nextModule the next module being documented. * @return the builder that builds the module summary. */ - public AbstractBuilder getModuleSummaryBuilder(ModuleElement mdle, ModuleElement prevModule, - ModuleElement nextModule) { + public AbstractBuilder getModuleSummaryBuilder(ModuleElement mdle) { return ModuleSummaryBuilder.getInstance(context, mdle, - writerFactory.getModuleSummaryWriter(mdle, prevModule, nextModule)); + writerFactory.getModuleSummaryWriter(mdle)); } /** * Return the builder for the class. * * @param typeElement the class being documented. - * @param prevClass the previous class that was documented. - * @param nextClass the next class being documented. * @param classTree the class tree. * @return the writer for the class. Return null if this * writer is not supported by the doclet. */ - public AbstractBuilder getClassBuilder(TypeElement typeElement, - TypeElement prevClass, TypeElement nextClass, ClassTree classTree) { + public AbstractBuilder getClassBuilder(TypeElement typeElement, ClassTree classTree) { return ClassBuilder.getInstance(context, typeElement, - writerFactory.getClassWriter(typeElement, prevClass, nextClass, classTree)); + writerFactory.getClassWriter(typeElement, classTree)); } /** * Return the builder for the annotation type. * * @param annotationType the annotation type being documented. - * @param prevType the previous type that was documented. - * @param nextType the next type being documented. * @return the writer for the annotation type. Return null if this * writer is not supported by the doclet. */ - public AbstractBuilder getAnnotationTypeBuilder( - TypeElement annotationType, TypeMirror prevType, TypeMirror nextType) { + public AbstractBuilder getAnnotationTypeBuilder(TypeElement annotationType) { return AnnotationTypeBuilder.getInstance(context, annotationType, - writerFactory.getAnnotationTypeWriter(annotationType, prevType, nextType)); + writerFactory.getAnnotationTypeWriter(annotationType)); } /** diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassUseMapper.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassUseMapper.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassUseMapper.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -46,7 +46,7 @@ import javax.lang.model.util.Types; import jdk.javadoc.doclet.DocletEnvironment; -import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration; +import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind; /** @@ -192,7 +192,7 @@ private final Types typeUtils; private final Utils utils; - public ClassUseMapper(HtmlConfiguration configuration, ClassTree classtree) { + public ClassUseMapper(BaseConfiguration configuration, ClassTree classtree) { docEnv = configuration.docEnv; elementUtils = docEnv.getElementUtils(); typeUtils = docEnv.getTypeUtils(); @@ -414,11 +414,11 @@ } } - private List refList(Map> map, Element element) { + private List refList(Map> map, TypeElement element) { List list = map.get(element); if (list == null) { list = new ArrayList<>(); - map.put((TypeElement) element, list); + map.put(element, list); } return list; } @@ -570,7 +570,7 @@ @Override public Void visitPackage(PackageElement e, Void p) { for (AnnotationMirror a : e.getAnnotationMirrors()) { - refList(map, a.getAnnotationType().asElement()).add(holder); + refList(map, (TypeElement) a.getAnnotationType().asElement()).add(holder); } return null; } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java Sat Feb 10 09:25:35 2018 +0100 @@ -61,94 +61,6 @@ return (p == null) || p.isEmpty() ? empty : new DocPath(p); } - /** - * Returns the path for a class. - * For example, if the class is java.lang.Object, - * the path is java/lang/Object.html. - * @param utils utility class for handling type elements - * @param typeElement the type element - * @return the path - */ - public static DocPath forClass(Utils utils, TypeElement typeElement) { - return (typeElement == null) - ? empty - : forPackage(utils.containingPackage(typeElement)).resolve(forName(utils, typeElement)); - } - - /** - * Returns the path for the simple name of a class. - * For example, if the class is java.lang.Object, - * the path is Object.html. - * @param utils utility class for handling type elements - * @param typeElement the type element - * @return the path - */ - public static DocPath forName(Utils utils, TypeElement typeElement) { - return (typeElement == null) ? empty : new DocPath(utils.getSimpleName(typeElement) + ".html"); - } - - /** - * Returns the path for the name of a module. - * For example, if the module is java.base, - * the path is java.base. - * @param mdle the module element - * @return the path - */ - public static DocPath forModule(ModuleElement mdle) { - return mdle == null || mdle.isUnnamed() - ? empty - : DocPath.create(mdle.getQualifiedName().toString()); - } - - /** - * Returns the path for the package of a class. - * For example, if the class is java.lang.Object, - * the path is java/lang. - * @param utils utility class for handling type elements - * @param typeElement the type element - * @return the path - */ - public static DocPath forPackage(Utils utils, TypeElement typeElement) { - return (typeElement == null) ? empty : forPackage(utils.containingPackage(typeElement)); - } - - /** - * Returns the path for a package. - * For example, if the package is java.lang, - * the path is java/lang. - * @param pkgElement the package element - * @return the path - */ - public static DocPath forPackage(PackageElement pkgElement) { - return pkgElement == null || pkgElement.isUnnamed() - ? empty - : DocPath.create(pkgElement.getQualifiedName().toString().replace('.', '/')); - } - - /** - * Returns the inverse path for a package. - * For example, if the package is java.lang, - * the inverse path is ../... - * @param pkgElement the package element - * @return the path - */ - public static DocPath forRoot(PackageElement pkgElement) { - String name = (pkgElement == null || pkgElement.isUnnamed()) - ? "" - : pkgElement.getQualifiedName().toString(); - return new DocPath(name.replace('.', '/').replaceAll("[^/]+", "..")); - } - - /** - * Returns the relative path from one package to another. - * @param from the initial package - * @param to the target package - * @return the path - */ - public static DocPath relativePath(PackageElement from, PackageElement to) { - return forRoot(from).resolve(forPackage(to)); - } - protected DocPath(String p) { path = (p.endsWith("/") ? p.substring(0, p.length() - 1) : p); } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -26,6 +26,8 @@ package jdk.javadoc.internal.doclets.toolkit.util; import javax.lang.model.element.ModuleElement; +import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; /** * Standard DocPath objects. @@ -37,6 +39,16 @@ * */ public class DocPaths { + private final boolean useModuleDirectories; + private final String moduleSeparator; + private final Utils utils; + + public DocPaths(Utils utils, boolean useModuleDirectories) { + this.utils = utils; + this.useModuleDirectories = useModuleDirectories; + moduleSeparator = useModuleDirectories ? "/module-" : "-"; + } + /** The name of the file for all classes, without using frames, when --no-frames is specified. */ public static final DocPath ALLCLASSES = DocPath.create("allclasses.html"); @@ -80,7 +92,11 @@ /** The name of the directory for the split index files. */ public static final DocPath INDEX_FILES = DocPath.create("index-files"); - /** Generate the name of one of the files in the split index. */ + /** + * Generate the name of one of the files in the split index. + * @param n the position in the index + * @return the path + */ public static DocPath indexN(int n) { return DocPath.create("index-" + n + ".html"); } @@ -173,29 +189,153 @@ /** The name of the file for the package usage info. */ public static final DocPath PACKAGE_USE = DocPath.create("package-use.html"); - /** The name of the output directory for module documentation files. */ - public static DocPath moduleDocFiles(ModuleElement mdle) { - return DocPath.create(mdle.getQualifiedName() + "-doc-files"); + /** + * Returns the path for a type element. + * For example, if the type element is {@code java.lang.Object}, + * the path is {@code java/lang/Object.html}. + * + * @param typeElement the type element + * @return the path + */ + public DocPath forClass(TypeElement typeElement) { + return (typeElement == null) + ? DocPath.empty + : forPackage(utils.containingPackage(typeElement)).resolve(forName(typeElement)); + } + + /** + * Returns the path for the simple name of a type element. + * For example, if the type element is {@code java.lang.Object}, + * the path is {@code Object.html}. + * + * @param typeElement the type element + * @return the path + */ + public DocPath forName(TypeElement typeElement) { + return (typeElement == null) + ? DocPath.empty + : new DocPath(utils.getSimpleName(typeElement) + ".html"); + } + + public static DocPath forModule(ModuleElement mdle) { + return mdle == null || mdle.isUnnamed() + ? DocPath.empty + : DocPath.create(mdle.getQualifiedName().toString()); } - /** The name of the file for the module frame. */ - public static DocPath moduleFrame(ModuleElement mdle) { - return DocPath.create(mdle.getQualifiedName() + "-frame.html"); + /** + * Returns the path for the package of a type element. + * For example, if the type element is {@code java.lang.Object}, + * the path is {@code java/lang}. + * + * @param typeElement the type element + * @return the path + */ + public DocPath forPackage(TypeElement typeElement) { + return (typeElement == null) + ? DocPath.empty + : forPackage(utils.containingPackage(typeElement)); + } + + /** + * Returns the path for a package. + * For example, if the package is {@code java.lang}, + * the path is {@code java/lang}. + * + * @param pkgElement the package element + * @return the path + */ + public DocPath forPackage(PackageElement pkgElement) { + if (pkgElement == null || pkgElement.isUnnamed()) { + return DocPath.empty; + } + + DocPath pkgPath = DocPath.create(pkgElement.getQualifiedName().toString().replace('.', '/')); + if (useModuleDirectories) { + ModuleElement mdle = (ModuleElement) pkgElement.getEnclosingElement(); + return forModule(mdle).resolve(pkgPath); + } else { + return pkgPath; + } } - /** The name of the file for the module summary. */ - public static DocPath moduleSummary(ModuleElement mdle) { - return DocPaths.moduleSummary(mdle.getQualifiedName().toString()); + /** + * Returns the inverse path for a package. + * For example, if the package is {@code java.lang}, + * the inverse path is {@code ../..}. + * + * @param pkgElement the package element + * @return the path + */ + public static DocPath forRoot(PackageElement pkgElement) { + String name = (pkgElement == null || pkgElement.isUnnamed()) + ? "" + : pkgElement.getQualifiedName().toString(); + return new DocPath(name.replace('.', '/').replaceAll("[^/]+", "..")); + } + + /** + * Returns a relative path from one package to another. + * + * @param from the origin of the relative path + * @param to the destination of the relative path + * @return the path + */ + public DocPath relativePath(PackageElement from, PackageElement to) { + return forRoot(from).resolve(forPackage(to)); + } + + /** + * The path for the output directory for module documentation files. + * @param mdle the module + * @return the path + */ + public DocPath moduleDocFiles(ModuleElement mdle) { + return createModulePath(mdle, "doc-files"); } - /** The name of the file for the module summary. */ - public static DocPath moduleSummary(String mdleName) { - return DocPath.create(mdleName + "-summary.html"); + /** + * The path for the file for a module's frame page. + * @param mdle the module + * @return the path + */ + public DocPath moduleFrame(ModuleElement mdle) { + return createModulePath(mdle, "frame.html"); + } + + /** + * The path for the file for a module's summary page. + * @param mdle the module + * @return the path + */ + public DocPath moduleSummary(ModuleElement mdle) { + return createModulePath(mdle, "summary.html"); } - /** The name of the file for the module frame. */ - public static DocPath moduleTypeFrame(ModuleElement mdle) { - return DocPath.create(mdle.getQualifiedName() + "-type-frame.html"); + /** + * The path for the file for a module's summary page. + * @param mdleName the module + * @return the path + */ + public DocPath moduleSummary(String mdleName) { + return createModulePath(mdleName, "summary.html"); + } + + /** + * The path for the file for a module's type frame page. + * @param mdle the module + * @return the path + */ + public DocPath moduleTypeFrame(ModuleElement mdle) { + return createModulePath(mdle, "type-frame.html"); + } + + private DocPath createModulePath(ModuleElement mdle, String path) { + return DocPath.create(mdle.getQualifiedName() + moduleSeparator + path); + } + + private DocPath createModulePath(String moduleName, String path) { + return DocPath.create(moduleName + moduleSeparator + path); } /** The name of the file for the module overview frame. */ diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -82,7 +82,6 @@ import com.sun.source.util.SimpleDocTreeVisitor; import com.sun.source.util.TreePath; import com.sun.tools.javac.model.JavacTypes; -import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration; import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; import jdk.javadoc.internal.doclets.toolkit.CommentUtils.DocCommentDuo; import jdk.javadoc.internal.doclets.toolkit.Messages; diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.List; -import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeParameterElement; @@ -39,7 +38,6 @@ import javax.lang.model.type.WildcardType; import javax.lang.model.util.SimpleTypeVisitor9; -import jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.util.Utils; @@ -54,6 +52,11 @@ * @author Jamie Ho */ public abstract class LinkFactory { + protected final Utils utils; + + protected LinkFactory(Utils utils) { + this.utils = utils; + } /** * Return an empty instance of a content object. @@ -69,7 +72,6 @@ * @return the output of the link. */ public Content getLink(LinkInfo linkInfo) { - Utils utils = ((LinkInfoImpl) linkInfo).configuration.utils; if (linkInfo.type != null) { SimpleTypeVisitor9 linkVisitor = new SimpleTypeVisitor9() { @@ -207,26 +209,27 @@ } /** - * Return the link to the given class. + * Returns a link to the given class. * - * @param linkInfo the information about the link to construct. + * @param linkInfo the information about the link to construct * * @return the link for the given class. */ protected abstract Content getClassLink(LinkInfo linkInfo); /** - * Return the link to the given type parameter. + * Returns a link to the given type parameter. * - * @param linkInfo the information about the link to construct. - * @param typeParam the type parameter to link to. + * @param linkInfo the information about the link to construct + * @param typeParam the type parameter to link to + * @return the link */ protected abstract Content getTypeParameterLink(LinkInfo linkInfo, TypeMirror typeParam); /** - * Return the links to the type parameters. + * Returns links to the type parameters. * - * @param linkInfo the information about the link to construct. + * @param linkInfo the information about the link to construct * @return the links to the type parameters. */ public Content getTypeParameterLinks(LinkInfo linkInfo) { @@ -234,15 +237,14 @@ } /** - * Return the links to the type parameters. + * Returns links to the type parameters. * - * @param linkInfo the information about the link to construct. - * @param isClassLabel true if this is a class label. False if it is - * the type parameters portion of the link. - * @return the links to the type parameters. + * @param linkInfo the information about the link to construct + * @param isClassLabel true if this is a class label, or false if it is + * the type parameters portion of the link + * @return the links to the type parameters */ public Content getTypeParameterLinks(LinkInfo linkInfo, boolean isClassLabel) { - Utils utils = ((LinkInfoImpl)linkInfo).utils; Content links = newContent(); List vars = new ArrayList<>(); TypeMirror ctype = linkInfo.type != null diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -359,7 +359,7 @@ return begin(opts, fileObjects).isOK(); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") private Result begin(List options, Iterable fileObjects) { fileManager = context.get(JavaFileManager.class); if (fileManager == null) { diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c --- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -228,6 +228,7 @@ // it looks up "localhost" and returns 127.0.0.1 if lookup // fails. struct addrinfo hints, *res = NULL; + uint32_t addr; int err; // Use portable way to initialize the structure @@ -241,7 +242,9 @@ // getaddrinfo might return more than one address // but we are using first one only - return ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr; + addr = ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr; + freeaddrinfo(res); + return addr; } static int @@ -300,7 +303,7 @@ char *buf; char *hostname; uint32_t addr; - + int ai; buf = (*callback->alloc)((int)strlen(address) + 1); if (buf == NULL) { RETURN_ERROR(JDWPTRANSPORT_ERROR_OUT_OF_MEMORY, "out of memory"); @@ -315,16 +318,25 @@ */ addr = dbgsysInetAddr(hostname); if (addr == 0xffffffff) { - struct hostent *hp = dbgsysGetHostByName(hostname); - if (hp == NULL) { + struct addrinfo hints; + struct addrinfo *results = NULL; + memset (&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + + ai = dbgsysGetAddrInfo(hostname, NULL, &hints, &results); + + if (ai != 0) { /* don't use RETURN_IO_ERROR as unknown host is normal */ - setLastError(0, "gethostbyname: unknown host"); + setLastError(0, "getaddrinfo: unknown host"); (*callback->free)(buf); return JDWPTRANSPORT_ERROR_IO_ERROR; } /* lookup was successful */ - memcpy(&(sa->sin_addr), hp->h_addr_list[0], hp->h_length); + sa->sin_addr = ((struct sockaddr_in *)results->ai_addr)->sin_addr; + freeaddrinfo(results); } else { sa->sin_addr.s_addr = addr; } diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jdwp.agent/share/native/libdt_socket/sysSocket.h --- a/src/jdk.jdwp.agent/share/native/libdt_socket/sysSocket.h Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jdwp.agent/share/native/libdt_socket/sysSocket.h Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -47,7 +47,7 @@ int dbgsysListen(int fd, int backlog); int dbgsysRecv(int fd, char *buf, size_t nBytes, int flags); int dbgsysSend(int fd, char *buf, size_t nBytes, int flags); -struct hostent *dbgsysGetHostByName(char *hostname); +int dbgsysGetAddrInfo(char *hostname, char *service, struct addrinfo *hints, struct addrinfo **results); int dbgsysSocket(int domain, int type, int protocol); int dbgsysBind(int fd, struct sockaddr *name, socklen_t namelen); int dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value); diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c --- a/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -126,9 +126,11 @@ return rv; } -struct hostent * -dbgsysGetHostByName(char *hostname) { - return gethostbyname(hostname); +int +dbgsysGetAddrInfo(char *hostname, char *service, + struct addrinfo *hints, + struct addrinfo **results) { + return getaddrinfo(hostname, service, hints, results); } unsigned short diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c --- a/src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -24,6 +24,7 @@ */ #include #include +#include #include "sysSocket.h" #include "socketTransport.h" @@ -197,9 +198,11 @@ return send(fd, buf, (int)nBytes, flags); } -struct hostent * -dbgsysGetHostByName(char *hostname) { - return gethostbyname(hostname); +int +dbgsysGetAddrInfo(char *hostname, char *service, + struct addrinfo *hints, + struct addrinfo **result) { + return getaddrinfo(hostname, service, hints, result); } unsigned short @@ -223,7 +226,7 @@ if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) { if (l.l_onoff == 0) { - WSASendDisconnect(fd, NULL); + shutdown(fd, SD_SEND); } } return closesocket(fd); @@ -239,7 +242,11 @@ uint32_t dbgsysInetAddr(const char* cp) { - return (uint32_t)inet_addr(cp); + uint32_t addr; + if (inet_pton(AF_INET, cp, &addr) < 1) { + return -1; + } + return addr; } uint32_t diff -r 67aa88701d46 -r c8a33db795b6 src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties Sat Feb 10 09:48:51 2018 +0000 +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties Sat Feb 10 09:25:35 2018 +0100 @@ -172,138 +172,142 @@ jshell.fix.wrong.shortcut =[Shift]-[Tab]\u306E\u5F8C\u306E\u6587\u5B57\u304C\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57\u3067\u3059\u3002\n\u81EA\u52D5\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u306F"i"\u3001\u5909\u6570\u306E\u4F5C\u6210\u306B\u306F"v"\u3001\u30E1\u30BD\u30C3\u30C9\u306E\u4F5C\u6210\u306B\u306F"m"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u8A73\u7D30\u306F\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n/help shortcuts -help.usage = \u4F7F\u7528\u65B9\u6CD5: jshell

  • Prev Letter
  • \n" + "
  • Next Letter
  • "); - checkOutput("index-files/index-1.html", !found, + checkOutput("index-files/index-1.html", found, "
  • Prev Letter
  • \n" + "
  • Next Letter
  • "); - checkOutput("index-files/index-5.html", !found, + checkOutput("index-files/index-5.html", found, "
  • Prev Letter
  • \n" + "
  • Next Letter
  • "); } diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModuleDirs/TestModuleDirs.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModuleDirs/TestModuleDirs.java Sat Feb 10 09:25:35 2018 +0100 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2017, 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8195795 + * @summary test the use of module directories in output, + * and the --no-module-directories option + * @modules jdk.javadoc/jdk.javadoc.internal.api + * jdk.javadoc/jdk.javadoc.internal.tool + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * @library ../lib /tools/lib + * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester + * @run main TestModuleDirs + */ + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import toolbox.ModuleBuilder; +import toolbox.ToolBox; + +public class TestModuleDirs extends JavadocTester { + + public final ToolBox tb; + public static void main(String... args) throws Exception { + TestModuleDirs tester = new TestModuleDirs(); + tester.runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + public TestModuleDirs() { + tb = new ToolBox(); + } + + @Test + public void testNoModules(Path base) throws IOException { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, "package p; public class C { }"); + + javadoc("-d", base.resolve("api").toString(), + "-sourcepath", src.toString(), + "-quiet", + "p"); + + checkExit(Exit.OK); + checkFiles(true, "p/package-summary.html"); + } + + @Test + public void testNoModuleDirs(Path base) throws IOException { + Path src = base.resolve("src"); + new ModuleBuilder(tb, "m") + .classes("package p; public class A {}") + .exports("p") + .write(src); + + javadoc("-d", base.resolve("api").toString(), + "-quiet", + "--module-source-path", src.toString(), + "--no-module-directories", + "--module", "m"); + + checkExit(Exit.OK); + checkFiles(true, + "m-summary.html", + "p/package-summary.html"); + checkFiles(false, + "m/module-summary.html", + "m/p/package-summary.html"); + } + + @Test + public void testModuleDirs(Path base) throws IOException { + Path src = base.resolve("src"); + new ModuleBuilder(tb, "m") + .classes("package p; public class A {}") + .exports("p") + .write(src); + + javadoc("-d", base.resolve("api").toString(), + "-quiet", + "--module-source-path", src.toString(), + "--module", "m"); + + checkExit(Exit.OK); + checkFiles(false, + "m-summary.html", + "p/package-summary.html"); + checkFiles(true, + "m/module-summary.html", + "m/p/package-summary.html"); + } +} + diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java --- a/test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -64,7 +64,7 @@ "--module", "empty"); checkExit(Exit.OK); - checkOutput("empty-summary.html", true, + checkOutput("empty/module-summary.html", true, "module empty."); } diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java --- a/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -156,15 +156,15 @@ // In details mode all kinds of packages from java.base, // could be listed in the indirects section, so just // check for minimal expected strings. - checkOutput("a-summary.html", true, + checkOutput("a/module-summary.html", true, "Indirect Exports table", - "m\n" - + "exportsto\n" + "m\n" + + "exportsto\n" + "\n"); - checkOutput("a-summary.html", true, + checkOutput("a/module-summary.html", true, "Indirect Opens table", - "m\n" + "m\n" + "opensto\n" + "\n"); } @@ -183,11 +183,11 @@ // Avoid false positives, just check for primary string absence. if (!present) { - checkOutput("a-summary.html", false, typeString); + checkOutput("a/module-summary.html", false, typeString); return; } - checkOutput("a-summary.html", present, + checkOutput("a/module-summary.html", present, "\n" + "\n" + "\n" @@ -196,8 +196,8 @@ + "\n" + "\n" + "\n" - + "\n" - + "\n" + + "\n" + + "\n" + "\n" + "\n" + "
    " + typeString + " 
    mpmmpm
    \n"); diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java --- a/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -70,7 +70,7 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", false, + checkOutput("m/module-summary.html", false, "

    Packages

    \n" + ""); @@ -159,7 +159,7 @@ checkTableHead("m", ColKind.EXPORTED_TO); checkPackageRow("m", "p", "i0", "All Modules", null, " "); checkPackageRow("m", "q", "i1", - "other", null, " "); + "other", null, " "); } @Test @@ -247,11 +247,11 @@ checkPackageRow("m", "c", "i0", "None", "None", " "); checkPackageRow("m", "e.all", "i1", "All Modules", "None", " "); checkPackageRow("m", "e.other", "i2", - "other", "None", " "); + "other", "None", " "); checkPackageRow("m", "eo", "i3", "All Modules", "All Modules", " "); checkPackageRow("m", "o.all", "i4", "None", "All Modules", " "); checkPackageRow("m", "o.other", "i5", "None", - "other", " "); + "other", " "); } @Test @@ -367,7 +367,7 @@ checkTableHead("m", ColKind.OPENED_TO); checkPackageRow("m", "p", "i0", null, "All Modules", " "); checkPackageRow("m", "q", "i1", null, - "other", " "); + "other", " "); } @Test @@ -443,7 +443,7 @@ + ""; } - checkOutput(moduleName + "-summary.html", true, expect); + checkOutput(moduleName + "/module-summary.html", true, expect); } @@ -461,7 +461,7 @@ sb.append("\n" + ""); - checkOutput(moduleName + "-summary.html", true, sb.toString()); + checkOutput(moduleName + "/module-summary.html", true, sb.toString()); } private void checkPackageRow(String moduleName, String packageName, @@ -481,7 +481,7 @@ } sb.append(""); - checkOutput(moduleName + "-summary.html", true, sb.toString()); + checkOutput(moduleName + "/module-summary.html", true, sb.toString()); } } diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java --- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -124,31 +124,31 @@ "moduleServiceUserNoDescription/pkgServiceUserNoDescription"); checkExit(Exit.OK); - checkOutput("moduleServiceProvider-summary.html", true, + checkOutput("moduleServiceProvider/module-summary.html", true, "\n" - + "\n" + "\n" + ""); - checkOutput("moduleServiceUser-summary.html", true, + checkOutput("moduleServiceUser/module-summary.html", true, "\n" - + "\n" + + "\n" + "\n" + ""); - checkOutput("moduleServiceUserNoDescription-summary.html", true, + checkOutput("moduleServiceUserNoDescription/module-summary.html", true, "\n" - + "\n" + + "\n" + "\n" + ""); - checkOutput("moduleServiceProvider-summary.html", false, + checkOutput("moduleServiceProvider/module-summary.html", false, "A service Interface for service providers."); - checkOutput("moduleServiceUser-summary.html", false, + checkOutput("moduleServiceUser/module-summary.html", false, "A service Interface for service providers."); } @@ -169,7 +169,7 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", false, + checkOutput("m/module-summary.html", false, "

    Services

    "); } @@ -190,10 +190,10 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "

    Services

    "); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "
    Description
    " + desc + "
    Service\n" + "
    Provides a service whose name is ServiceProvider.
    \n" + "
    ServiceService\n" + "
    If no other provider is found, a default internal implementation will be used.
    \n" + "
    ServiceService\n" + "
    A service Interface for service providers.
    \n" + "
    \n" + "\n" + "\n" + @@ -230,10 +230,10 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "

    Services

    "); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "
    Uses 
    \n" + "\n" + "\n" + @@ -270,7 +270,7 @@ checkExit(Exit.OK); - checkOutput("m-summary.html", false, + checkOutput("m/module-summary.html", false, "

    Services

    "); } @@ -296,10 +296,10 @@ checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "

    Services

    "); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "
    Uses 
    \n" + "\n" + "\n" + @@ -339,10 +339,10 @@ checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "

    Services

    "); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "
    Provides 
    \n" + "\n" + "\n" + @@ -381,10 +381,10 @@ checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "

    Services

    "); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "
    Provides 
    \n" + "\n" + "\n" + diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java --- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java Sat Feb 10 09:25:35 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -68,7 +68,7 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "Description |" + " Modules |" + " Packages |" @@ -92,7 +92,7 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "Description |" + " Modules |" + " Packages |" @@ -114,7 +114,7 @@ "--module", "m"); checkExit(Exit.OK); - checkOutput("m-summary.html", true, + checkOutput("m/module-summary.html", true, "Description | Modules |" + " Packages |" + " Services"); diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testModules/TestModules.java --- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java Sat Feb 10 09:25:35 2018 +0100 @@ -444,14 +444,14 @@ } void checkDescription(boolean found) { - checkOutput("moduleA-summary.html", found, + checkOutput("moduleA/module-summary.html", found, "\n" + "\n" + "\n" + "\n" + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    "); - checkOutput("moduleB-summary.html", found, + checkOutput("moduleB/module-summary.html", found, "\n" + "\n" + "\n" @@ -478,14 +478,14 @@ } void checkNoDescription(boolean found) { - checkOutput("moduleA-summary.html", found, + checkOutput("moduleA/module-summary.html", found, "
    \n" + "
    \n" + "\n" - + "\n" + + "\n" + "\n" + ""); - checkOutput("moduleB-summary.html", true, + checkOutput("moduleB/module-summary.html", true, "
  • Description | Modules | " + "Packages | " + "Services
  • ", @@ -785,7 +785,7 @@ } void checkAggregatorModuleSummary() { - checkOutput("moduleT-summary.html", true, + checkOutput("moduleT/module-summary.html", true, "
    \n" + "

    Module moduleT

    \n" + "
    ", @@ -795,7 +795,7 @@ "\n" + "\n" + "\n" - + "\n" + + "\n" + "\n" + "\n" + "\n" - + "\n" + + "\n" + "\n" @@ -812,7 +812,7 @@ } void checkNegatedModuleSummary() { - checkOutput("moduleA-summary.html", false, + checkOutput("moduleA/module-summary.html", false, "\n" + "\n" + "\n" @@ -821,11 +821,11 @@ void checkModuleClickThroughLinks() { checkOutput("module-overview-frame.html", true, - "
  • moduleA
  • ", - "
  • moduleB
  • "); checkOutput("script.js", true, "function updateModuleFrame(pFrame, cFrame)\n" @@ -837,37 +837,37 @@ void checkModuleClickThrough(boolean found) { checkFiles(found, - "moduleA-type-frame.html", - "moduleB-type-frame.html"); + "moduleA/module-type-frame.html", + "moduleB/module-type-frame.html"); } void checkModuleFilesAndLinks(boolean found) { - checkFileAndOutput("testpkgmdlA/package-summary.html", found, - "
  • Module
  • ", + checkFileAndOutput("moduleA/testpkgmdlA/package-summary.html", found, + "
  • Module
  • ", "
    Module " - + "moduleA
    "); - checkFileAndOutput("testpkgmdlA/TestClassInModuleA.html", found, - "
  • Module
  • ", + + "moduleA"); + checkFileAndOutput("moduleA/testpkgmdlA/TestClassInModuleA.html", found, + "
  • Module
  • ", "
    Module " - + "moduleA
    "); - checkFileAndOutput("testpkgmdlB/AnnotationType.html", found, + + "moduleA"); + checkFileAndOutput("moduleB/testpkgmdlB/AnnotationType.html", found, "
    Module " - + "moduleB
    ", + + "moduleB", "
    " + "Package testpkgmdlB
    "); checkFiles(found, - "moduleA-frame.html", - "moduleA-summary.html", + "moduleA/module-frame.html", + "moduleA/module-summary.html", "module-overview-frame.html"); } void checkModuleFrameFiles(boolean found) { checkFiles(found, - "moduleC-frame.html", - "moduleC-type-frame.html", + "moduleC/module-frame.html", + "moduleC/module-type-frame.html", "module-overview-frame.html"); checkFiles(true, - "moduleC-summary.html", + "moduleC/module-summary.html", "allclasses-frame.html", "allclasses-noframe.html"); } @@ -880,74 +880,74 @@ void checkModulesInSearch(boolean found) { checkOutput("index-all.html", found, "
    \n" - + "
    moduleA - module moduleA
    \n" + + "
    moduleA - module moduleA
    \n" + "
    \n" + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    \n" + "
    \n" - + "
    moduleB - module moduleB
    \n" + + "
    moduleB - module moduleB
    \n" + "
    \n" + "
    This is a test description for the moduleB module.
    \n" + "
    \n" + "
    ", "
    \n" - + "
    " + + "
    " + "search phrase - Search tag in moduleA
    \n" + "
    with description
    \n" - + "
    " + + "
    " + "search_word - Search tag in moduleB
    \n" + "
     
    \n" + "
    "); checkOutput("index-all.html", false, - "
    " + "
    " + "search phrase - Search tag in moduleA
    \n" + "
    with description
    \n" - + "
    " + + "
    " + "search phrase - Search tag in moduleA
    \n" + "
    with description
    "); } void checkModuleModeCommon() { checkOutput("overview-summary.html", true, - "\n" + "\n" + "", - "\n" + "\n" + "", - "\n" + "\n" + ""); - checkOutput("moduleA-summary.html", true, + checkOutput("moduleA/module-summary.html", true, "
  • Description | " + "Modules | Packages | Services
  • ", - "\n" - + "\n"); - checkOutput("moduleB-summary.html", true, + "\n" + + "\n"); + checkOutput("moduleB/module-summary.html", true, "\n" + "\n"); - checkOutput("moduletags-summary.html", true, + checkOutput("moduletags/module-summary.html", true, "
  • Description | Modules" + " | Packages | Services
  • ", "
    Provides 
    transitivemoduleBmoduleB\n" + "
    This is a test description for the moduleB module.
    \n" + "
    transitivemoduleAmoduleA\n" + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    \n" @@ -803,7 +803,7 @@ + "
    transitivemoduleBmoduleB\n" + "
    This is a test description for the moduleB module.
    \n" + "
    moduleAmoduleA\n" + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    \n" + "
    moduleBmoduleB\n" + "
    This is a test description for the moduleB module.
    \n" + "
    moduletagsmoduletags\n" + "
    This is a test description for the moduletags module.
    \n" - + " Type Link: TestClassInModuleTags.
    \n" - + " Member Link: testMethod(String).
    \n" - + " Package Link: testpkgmdltags.
    \n" + + " Type Link: TestClassInModuleTags.
    \n" + + " Member Link: testMethod(String).
    \n" + + " Package Link: testpkgmdltags.
    \n" + "
    moduleBtestpkgmdlBmoduleBtestpkgmdlBTestClassInModuleB\n" + "
    With a test description for uses.
    \n
    \n" + "", "\n" - + "\n" + + "\n" + "", "
    Indirect Requires 
    transitivemoduleBmoduleB\n" + "
    This is a test description for the moduleB module.
    \n" + "
    \n" + "", "\n" - + "\n" + + "\n" + "\n" + "\n" + "\n", - "\n" - + "\n"); + "\n" + + "\n"); } void checkModuleModeApi(boolean found) { - checkOutput("moduleA-summary.html", found, + checkOutput("moduleA/module-summary.html", found, "\n" + ""); - checkOutput("moduleB-summary.html", found, + checkOutput("moduleB/module-summary.html", found, "
  • Description | Modules | " + "Packages | Services
  • ", "\n" @@ -996,23 +996,23 @@ + "\n" + "\n" + "
    Indirect Exports 
    transitive staticmoduleAmoduleA\n" + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    \n" @@ -970,15 +970,15 @@ + "
    FromPackages
    moduleBtestpkgmdlBmoduleBtestpkgmdlBtestpkgmdlA testpkgmdlB
    "); - checkOutput("moduletags-summary.html", true, + checkOutput("moduletags/module-summary.html", true, "testpkgmdltags\n" + " "); } void checkModuleModeAll(boolean found) { - checkOutput("moduleA-summary.html", found, + checkOutput("moduleA/module-summary.html", found, " \n" + "java.base\n" + " ", " \n" - + "moduleC\n" + + "moduleC\n" + "\n" + "
    This is a test description for the moduleC module.
    \n" + "", - "moduleC\n" - + "testpkgmdlC", + "moduleC\n" + + "testpkgmdlC", "testpkgmdlA\n" + "All Modules\n" + " ", @@ -1023,7 +1023,7 @@ "concealedpkgmdlA\n" + "None\n" + " "); - checkOutput("moduleB-summary.html", found, + checkOutput("moduleB/module-summary.html", found, "
  • Description | " + "Modules | Packages | Services
  • ", "testpkgmdlB\n" @@ -1044,20 +1044,20 @@ "All Packages " + "Exports " + "Opens "); - checkOutput("moduleC-summary.html", found, + checkOutput("moduleC/module-summary.html", found, "Exports \n" + "\n" + "Package\n" + "Exported To Modules\n" + "Description\n" + ""); - checkOutput("moduletags-summary.html", true, + checkOutput("moduletags/module-summary.html", true, "testpkgmdltags\n" + " "); } void checkModuleDeprecation(boolean found) { - checkOutput("moduleA-summary.html", found, + checkOutput("moduleA/module-summary.html", found, "
    Deprecated, for removal:" + " This API element is subject to removal in a future version.\n" + "
    This module is deprecated.
    \n" @@ -1068,26 +1068,26 @@ + "
  • Modules
  • \n" + "", "\n" - + "moduleA\n" + + "moduleA\n" + "\n" + "
    This module is deprecated.
    \n" + "\n" + ""); - checkOutput("moduleB-summary.html", !found, + checkOutput("moduleB/module-summary.html", !found, "
    Deprecated.\n" + "
    This module is deprecated using just the javadoc tag.
    \n"); - checkOutput("moduletags-summary.html", found, + checkOutput("moduletags/module-summary.html", found, "

    @Deprecated\n" + "

    ", "
    Deprecated.
    "); } void checkModuleAnnotation() { - checkOutput("moduleB-summary.html", true, + checkOutput("moduleB/module-summary.html", true, "

    @AnnotationType(optional=\"Module Annotation\",\n" + " required=2016)\n" + "

    "); - checkOutput("moduleB-summary.html", false, + checkOutput("moduleB/module-summary.html", false, "@AnnotationTypeUndocumented"); } @@ -1099,7 +1099,7 @@ } void checkModuleSummaryNoExported(boolean found) { - checkOutput("moduleNoExport-summary.html", found, + checkOutput("moduleNoExport/module-summary.html", found, "\n" + "\n" + "\n" @@ -1194,30 +1194,30 @@ } void checkModuleName(boolean found) { - checkOutput("test.moduleFullName-summary.html", found, + checkOutput("test.moduleFullName/module-summary.html", found, "
    \n" + "

    Module test.moduleFullName

    \n" + "
    "); checkOutput("index-all.html", found, "

    T

    \n" + "
    \n" - + "
    test.moduleFullName - module test.moduleFullName
    \n" + + "
    test.moduleFullName - module test.moduleFullName
    \n" + "
    \n" + "
    This is a test description for the test.moduleFullName.
    \n" + "
    "); checkOutput("module-overview-frame.html", found, "

    Modules

    \n" + ""); - checkOutput("test.moduleFullName-summary.html", !found, + checkOutput("test.moduleFullName/module-summary.html", !found, "
    \n" + "

    Module moduleFullName

    \n" + "
    "); checkOutput("index-all.html", !found, "
    \n" - + "
    moduleFullName - module moduleFullName
    \n" + + "
    moduleFullName - module moduleFullName
    \n" + "
    \n" + "
    This is a test description for the test.moduleFullName.
    \n" + "
    \n" @@ -1225,14 +1225,14 @@ } void checkLinkOffline() { - checkOutput("testpkg3mdlB/package-summary.html", true, + checkOutput("moduleB/testpkg3mdlB/package-summary.html", true, "Link to String Class"); - checkOutput("testpkg3mdlB/package-summary.html", true, + checkOutput("moduleB/testpkg3mdlB/package-summary.html", true, "Link to java.lang package"); - checkOutput("testpkg3mdlB/package-summary.html", true, - "Link to java.base module"); } } diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testNavigation/TestModuleNavigation.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestModuleNavigation.java Sat Feb 10 09:25:35 2018 +0100 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8196027 + * @summary test navigation links + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.javadoc/jdk.javadoc.internal.api + * jdk.javadoc/jdk.javadoc.internal.tool + * @library ../lib /tools/lib + * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester + * @run main TestModuleNavigation + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import toolbox.*; + +public class TestModuleNavigation extends JavadocTester { + + public final ToolBox tb; + public static void main(String... args) throws Exception { + TestModuleNavigation tester = new TestModuleNavigation (); + tester.runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + public TestModuleNavigation () { + tb = new ToolBox(); + } + + @Test + public void checkNavbar(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + ModuleBuilder mb = new ModuleBuilder(tb, "m") + .comment("module m.\n@uses p1.A") + .uses("p1.A") + .uses("p1.B") + .exports("p1") + .classes("package p1; public class A {}") + .classes("package p1; public class B {}"); + mb.write(src); + ModuleBuilder mb1 = new ModuleBuilder(tb, "m2") + .comment("module m2.\n@uses m2p1.Am2") + .uses("m2p1.Am2") + .uses("m2p1.Bm2") + .exports("m2p1") + .classes("package m2p1; public class Am2 {}") + .classes("package m2p1; public class Bm2 {}"); + mb1.write(src); + + javadoc("-d", base.resolve("out").toString(), "-use", + "-quiet", + "--module-source-path", src.toString(), + "--module", "m,m2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", false, + "Prev", + "Next"); + + checkOutput("m/module-summary.html", false, + "Prev Module", + "Next Module"); + + checkOutput("m2/m2p1/package-summary.html", false, + "Prev Package", + "Next Package"); + + checkOutput("m2/m2p1/Am2.html", false, + "Prev Class", + "Next Class"); + + checkOutput("m2/m2p1/class-use/Am2.html", false, + "Prev", + "Next"); + + checkOutput("m2/m2p1/package-tree.html", false, + "Prev", + "Next"); + + checkOutput("deprecated-list.html", false, + "Prev", + "Next"); + + checkOutput("index-all.html", false, + "Prev", + "Next"); + } +} diff -r 67aa88701d46 -r c8a33db795b6 test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java --- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java Sat Feb 10 09:48:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java Sat Feb 10 09:25:35 2018 +0100 @@ -23,7 +23,7 @@ /* * @test - * @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 + * @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 * @summary Make sure the Next/Prev Class links iterate through all types. * Make sure the navagation is 2 columns, not 3. * @author jamieh @@ -48,23 +48,18 @@ checkExit(Exit.OK); checkOutput("pkg/A.html", true, - "
  • Prev Class
  • ", - "Next Class", + "