# HG changeset patch # User herrick # Date 1548895698 18000 # Node ID 1e4dceb0da58fbd477cabb957eb2db29afa4cf16 # Parent 8041f62342f0f7e9aa5240c92156d9d8ade8869c# Parent 6121eee15c231d0afc718888403e8679d2ff09d4 Merge diff -r 8041f62342f0 -r 1e4dceb0da58 make/autoconf/compare.sh.in --- a/make/autoconf/compare.sh.in Wed Jan 30 19:25:22 2019 -0500 +++ b/make/autoconf/compare.sh.in Wed Jan 30 19:48:18 2019 -0500 @@ -76,12 +76,15 @@ if [ "@COMPILE_TYPE@" != "cross" ]; then export JAVAP="@FIXPATH@ $OUTPUTDIR/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@" export JIMAGE="@FIXPATH@ $OUTPUTDIR/jdk/bin/jimage" + export JMOD="@FIXPATH@ $OUTPUTDIR/jdk/bin/jmod" elif [ "@CREATE_BUILDJDK@" = "true" ]; then export JAVAP="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@" export JIMAGE="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jimage" + export JMOD="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jmod" else export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@" export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage" + export JMOD="@FIXPATH@ @BUILD_JDK@/bin/jmod" fi if [ "$OPENJDK_TARGET_OS" = "windows" ]; then diff -r 8041f62342f0 -r 1e4dceb0da58 make/autoconf/lib-freetype.m4 --- a/make/autoconf/lib-freetype.m4 Wed Jan 30 19:25:22 2019 -0500 +++ b/make/autoconf/lib-freetype.m4 Wed Jan 30 19:48:18 2019 -0500 @@ -102,7 +102,7 @@ if (test "x$with_freetype_include" = "x" && test "x$with_freetype_lib" != "x") || \ (test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" = "x"); then - AC_MSG_ERROR(['must specify both or neither of --with_freetype_include and --with_freetype_lib]) + AC_MSG_ERROR(['must specify both or neither of --with-freetype-include and --with-freetype-lib]) fi FREETYPE_TO_USE=bundled @@ -115,7 +115,7 @@ elif (test "x$with_freetype" = "xbundled"); then FREETYPE_TO_USE=bundled if (test "x$with_freetype_include" != "x" || test "x$with_freetype_lib" != "x"); then - AC_MSG_ERROR(['bundled' cannot be specified with --with_freetype_include and --with_freetype_lib]) + AC_MSG_ERROR(['bundled' cannot be specified with --with-freetype-include and --with-freetype-lib]) fi else AC_MSG_ERROR(['valid values for --with-freetype are 'system' and 'bundled']) diff -r 8041f62342f0 -r 1e4dceb0da58 make/conf/jib-profiles.js --- a/make/conf/jib-profiles.js Wed Jan 30 19:25:22 2019 -0500 +++ b/make/conf/jib-profiles.js Wed Jan 30 19:48:18 2019 -0500 @@ -861,13 +861,13 @@ var getJibProfilesDependencies = function (input, common) { var devkit_platform_revisions = { - linux_x64: "gcc7.3.0-OEL6.4+1.1", + linux_x64: "gcc7.3.0-OEL6.4+1.2", macosx_x64: "Xcode9.4-MacOSX10.13+1.0", solaris_x64: "SS12u4-Solaris11u1+1.0", solaris_sparcv9: "SS12u6-Solaris11u3+1.0", windows_x64: "VS2017-15.5.5+1.0", - linux_aarch64: "gcc7.3.0-Fedora27+1.1", - linux_arm: "gcc7.3.0-Fedora27+1.1" + linux_aarch64: "gcc7.3.0-Fedora27+1.2", + linux_arm: "gcc7.3.0-Fedora27+1.2" }; var devkit_platform = (input.target_cpu == "x86" diff -r 8041f62342f0 -r 1e4dceb0da58 make/devkit/Tools.gmk --- a/make/devkit/Tools.gmk Wed Jan 30 19:25:22 2019 -0500 +++ b/make/devkit/Tools.gmk Wed Jan 30 19:48:18 2019 -0500 @@ -103,7 +103,7 @@ 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 +MPFR := https://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2 GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2 MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz @@ -355,6 +355,7 @@ $(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS)) # Makefile creation. Simply run configure in build dir. +# Setting CFLAGS to -O2 generates a much faster ld. $(bfdmakes) \ $(BUILDDIR)/$(binutils_ver)/Makefile \ : $(BINUTILS_CFG) @@ -362,7 +363,7 @@ @mkdir -p $(@D) ( \ cd $(@D) ; \ - $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ + $(PATHPRE) $(ENVS) CFLAGS="-O2 $(CFLAGS)" \ $(BINUTILS_CFG) \ $(CONFIG) \ --with-sysroot=$(SYSROOT) \ @@ -370,6 +371,7 @@ --program-prefix=$(TARGET)- \ --enable-multilib \ --enable-gold \ + --enable-threads \ --enable-plugins \ ) > $(@D)/log.config 2>&1 @echo 'done' diff -r 8041f62342f0 -r 1e4dceb0da58 make/jdk/src/classes/build/tools/cldrconverter/CalendarType.java --- a/make/jdk/src/classes/build/tools/cldrconverter/CalendarType.java Wed Jan 30 19:25:22 2019 -0500 +++ b/make/jdk/src/classes/build/tools/cldrconverter/CalendarType.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ {0, 2}, // generic {0, 2}, // gregorian {0, 1}, // buddhist - {232, 4}, // japanese (eras from Meiji) + {232, 5}, // japanese (eras from Meiji) {0, 2}, // roc (Minguo) {0, 1}, // islamic (Hijrah) {0, 1}, // islamic-civil (same as islamic) diff -r 8041f62342f0 -r 1e4dceb0da58 make/scripts/compare.sh --- a/make/scripts/compare.sh Wed Jan 30 19:25:22 2019 -0500 +++ b/make/scripts/compare.sh Wed Jan 30 19:48:18 2019 -0500 @@ -340,7 +340,9 @@ echo -n File types... found="" - for f in `cd $OTHER_DIR && $FIND . ! -type d` + # The file command does not know about jmod files and this sometimes results + # in different types being detected more or less randomly. + for f in $(cd $OTHER_DIR && $FIND . ! -type d -a ! -name "*.jmod") do if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi if [ ! -f ${THIS_DIR}/$f ]; then continue; fi @@ -494,7 +496,7 @@ $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR $MKDIR -p $THIS_UNZIPDIR $MKDIR -p $OTHER_UNZIPDIR - if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" -o "$TYPE" = "jmod" ] + if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" ] then (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) @@ -502,6 +504,10 @@ then (cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -) (cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -) + elif [ "$TYPE" = "jmod" ] + then + (cd $THIS_UNZIPDIR && $JMOD extract $THIS_ZIP) + (cd $OTHER_UNZIPDIR && $JMOD extract $OTHER_ZIP) else (cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP) (cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP) @@ -559,16 +565,16 @@ return_value=1 fi - if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then - DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \ - | $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \ - | $SED "s|$OTHER_UNZIPDIR/||g") - else - DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \ - | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") - fi + if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then + if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then + DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \ + | $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \ + | $SED "s|$OTHER_UNZIPDIR/||g") + else + DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \ + | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") + fi - if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then $RM -f $WORK_DIR/$ZIP_FILE.diffs for file in $DIFFING_FILES; do if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then @@ -600,6 +606,48 @@ return $return_value } +################################################################################ +# Compare jmod file + +compare_jmod_file() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + JMOD_FILE=$4 + + THIS_JMOD=$THIS_DIR/$JMOD_FILE + OTHER_JMOD=$OTHER_DIR/$JMOD_FILE + + if $CMP $OTHER_JMOD $THIS_JMOD > /dev/null; then + return 0 + fi + + THIS_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.this + OTHER_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.other + mkdir -p $(dirname $THIS_JMOD_LIST) $(dirname $OTHER_JMOD_LIST) + + $JMOD list $THIS_JMOD | sort > $THIS_JMOD_LIST + $JMOD list $OTHER_JMOD | sort > $OTHER_JMOD_LIST + JMOD_LIST_DIFF_FILE=$WORK_DIR/$JMOD_FILE.list.diff + LC_ALL=C $DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE + + ONLY_THIS=$($GREP "^<" $JMOD_LIST_DIFF_FILE) + ONLY_OTHER=$($GREP "^>" $JMOD_LIST_DIFF_FILE) + + if [ -n "$ONLY_OTHER" ]; then + echo " Only OTHER $JMOD_FILE contains:" + echo "$ONLY_OTHER" | sed "s|^>| |"g | sed 's|: |/|g' + return_value=1 + fi + + if [ -n "$ONLY_THIS" ]; then + echo " Only THIS $JMOD_FILE contains:" + echo "$ONLY_THIS" | sed "s|^<| |"g | sed 's|: |/|g' + return_value=1 + fi + + return $return_value +} ################################################################################ # Compare all zip files @@ -631,6 +679,34 @@ } ################################################################################ +# Compare all jmod files + +compare_all_jmod_files() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + JMODS=$(cd $THIS_DIR && $FIND . -type f -name "*.jmod" | $SORT | $FILTER ) + + if [ -n "$JMODS" ]; then + echo Jmod files... + + return_value=0 + for f in $JMODS; do + if [ -f "$OTHER_DIR/$f" ]; then + compare_jmod_file $THIS_DIR $OTHER_DIR $WORK_DIR $f + if [ "$?" != "0" ]; then + return_value=1 + REGRESSIONS=true + fi + fi + done + fi + + return $return_value +} + +################################################################################ # Compare all jar files compare_all_jar_files() { @@ -1141,6 +1217,7 @@ echo "-zips Compare the contents of all zip files and files in them" echo "-zips-names Compare the file names inside all zip files" echo "-jars Compare the contents of all jar files" + echo "-jmods Compare the listings of all jmod files" echo "-libs Compare all native libraries" echo "-execs Compare all executables" echo "-v Verbose output, does not hide known differences" @@ -1169,6 +1246,7 @@ CMP_ZIPS=false CMP_ZIPS_CONTENTS=true CMP_JARS=false +CMP_JMODS=false CMP_LIBS=false CMP_EXECS=false @@ -1194,6 +1272,7 @@ CMP_GENERAL=true CMP_ZIPS=true CMP_JARS=true + CMP_JMODS=true CMP_LIBS=true CMP_EXECS=true ;; @@ -1220,6 +1299,9 @@ -jars) CMP_JARS=true ;; + -jmods) + CMP_JMODS=true + ;; -libs) CMP_LIBS=true ;; @@ -1264,6 +1346,7 @@ CMP_TYPES=false CMP_ZIPS=true CMP_JARS=true + CMP_JMODS=true CMP_LIBS=true CMP_EXECS=true @@ -1317,13 +1400,22 @@ exit fi -if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then +if [ "$CMP_NAMES" = "false" ] \ + && [ "$CMP_TYPES" = "false" ] \ + && [ "$CMP_PERMS" = "false" ] \ + && [ "$CMP_GENERAL" = "false" ] \ + && [ "$CMP_ZIPS" = "false" ] \ + && [ "$CMP_JARS" = "false" ] \ + && [ "$CMP_JMODS" = "false" ] \ + && [ "$CMP_LIBS" = "false" ] \ + && [ "$CMP_EXECS" = "false" ]; then CMP_NAMES=true CMP_PERMS=true CMP_TYPES=true CMP_GENERAL=true CMP_ZIPS=true CMP_JARS=true + CMP_JMODS=true CMP_LIBS=true CMP_EXECS=true fi @@ -1373,6 +1465,7 @@ OTHER_JDK="$OTHER/images/jdk" # Rewrite the path to tools that are used from the build JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")" + JMOD="$(echo "$JMOD" | $SED "s|$OLD_THIS|$THIS|g")" JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")" else echo "No common images found." @@ -1613,6 +1706,15 @@ fi fi +if [ "$CMP_JMODS" = "true" ]; then + if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then + compare_all_jmod_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk + fi + if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then + compare_all_jmod_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir + fi +fi + if [ "$CMP_PERMS" = "true" ]; then if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then echo -n "JDK " diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/cpu/x86/x86.ad --- a/src/hotspot/cpu/x86/x86.ad Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/cpu/x86/x86.ad Wed Jan 30 19:48:18 2019 -0500 @@ -1685,26 +1685,24 @@ case Op_VecS: // copy whole register case Op_VecD: case Op_VecX: -#ifndef LP64 +#ifndef _LP64 __ movdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo])); #else if ((UseAVX < 3) || VM_Version::supports_avx512vl()) { __ movdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo])); } else { - __ vpxor(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), 2); - __ vinserti32x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0); + __ vextractf32x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0); } #endif break; case Op_VecY: -#ifndef LP64 +#ifndef _LP64 __ vmovdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo])); #else if ((UseAVX < 3) || VM_Version::supports_avx512vl()) { __ vmovdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo])); } else { - __ vpxor(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), 2); - __ vinserti64x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0); + __ vextractf64x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0); } #endif break; @@ -1758,26 +1756,26 @@ __ movq(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset)); break; case Op_VecX: -#ifndef LP64 +#ifndef _LP64 __ movdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset)); #else if ((UseAVX < 3) || VM_Version::supports_avx512vl()) { __ movdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset)); } else { - __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2); - __ vinserti32x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0); + __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2); + __ vinsertf32x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0); } #endif break; case Op_VecY: -#ifndef LP64 +#ifndef _LP64 __ vmovdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset)); #else if ((UseAVX < 3) || VM_Version::supports_avx512vl()) { __ vmovdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset)); } else { - __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2); - __ vinserti64x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0); + __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2); + __ vinsertf64x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0); } #endif break; @@ -1796,26 +1794,26 @@ __ movq(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg])); break; case Op_VecX: -#ifndef LP64 +#ifndef _LP64 __ movdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg])); #else if ((UseAVX < 3) || VM_Version::supports_avx512vl()) { __ movdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg])); } else { - __ vextracti32x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 0x0); + __ vextractf32x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), 0x0); } #endif break; case Op_VecY: -#ifndef LP64 +#ifndef _LP64 __ vmovdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg])); #else if ((UseAVX < 3) || VM_Version::supports_avx512vl()) { __ vmovdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg])); } else { - __ vextracti64x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 0x0); + __ vextractf64x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), 0x0); } #endif break; diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/os/linux/os_linux.cpp --- a/src/hotspot/os/linux/os_linux.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/os/linux/os_linux.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1856,6 +1856,36 @@ return true; } +#if defined(S390) +// keywords_to_match - NULL terminated array of keywords +static bool print_matching_lines_from_sysinfo_file(outputStream* st, const char* keywords_to_match[]) { + const char* filename = "/proc/sysinfo"; + char* line = NULL; + size_t length = 0; + FILE* fp = fopen(filename, "r"); + if (fp == NULL) { + return false; + } + + st->print_cr("Virtualization information:"); + while (getline(&line, &length, fp) != -1) { + int i = 0; + while (keywords_to_match[i] != NULL) { + if (strncmp(line, keywords_to_match[i], strlen(keywords_to_match[i])) == 0) { + st->print("%s", line); + break; + } + i++; + } + } + + free(line); + fclose(fp); + + return true; +} +#endif + void os::print_dll_info(outputStream *st) { st->print_cr("Dynamic libraries:"); @@ -1939,6 +1969,8 @@ os::Linux::print_ld_preload_file(st); os::Linux::print_container_info(st); + + os::Linux::print_virtualization_info(st); } // Try to identify popular distros. @@ -2152,6 +2184,20 @@ st->cr(); } +void os::Linux::print_virtualization_info(outputStream* st) { +#if defined(S390) + // /proc/sysinfo contains interesting information about + // - LPAR + // - whole "Box" (CPUs ) + // - z/VM / KVM (VM); this is not available in an LPAR-only setup + const char* kw[] = { "LPAR", "CPUs", "VM", NULL }; + + if (! print_matching_lines_from_sysinfo_file(st, kw)) { + st->print_cr(" "); + } +#endif +} + void os::print_memory_info(outputStream* st) { st->print("Memory:"); diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/os/linux/os_linux.hpp --- a/src/hotspot/os/linux/os_linux.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/os/linux/os_linux.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -110,6 +110,7 @@ static void print_full_memory_info(outputStream* st); static void print_container_info(outputStream* st); + static void print_virtualization_info(outputStream* st); static void print_distro_info(outputStream* st); static void print_libversion_info(outputStream* st); static void print_proc_sys_info(outputStream* st); diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/code/codeHeapState.cpp --- a/src/hotspot/share/code/codeHeapState.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/code/codeHeapState.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -78,43 +78,134 @@ // - direct output into an argument-passed outputStream and // - buffered output into a bufferedStream with subsequent flush // of the filled buffer to the outputStream. -#define USE_STRINGSTREAM -#define HEX32_FORMAT "0x%x" // just a helper format string used below multiple times -// +#define USE_BUFFEREDSTREAM + +// There are instances when composing an output line or a small set of +// output lines out of many tty->print() calls creates significant overhead. // Writing to a bufferedStream buffer first has a significant advantage: -// It uses noticeably less cpu cycles and reduces (when wirting to a -// network file) the required bandwidth by at least a factor of ten. +// It uses noticeably less cpu cycles and reduces (when writing to a +// network file) the required bandwidth by at least a factor of ten. Observed on MacOS. // That clearly makes up for the increased code complexity. -#if defined(USE_STRINGSTREAM) -#define STRINGSTREAM_DECL(_anyst, _outst) \ - /* _anyst name of the stream as used in the code */ \ - /* _outst stream where final output will go to */ \ - ResourceMark rm; \ - bufferedStream _sstobj = bufferedStream(4*K); \ - bufferedStream* _sstbuf = &_sstobj; \ - outputStream* _outbuf = _outst; \ - bufferedStream* _anyst = &_sstobj; /* any stream. Use this to just print - no buffer flush. */ +// +// Conversion of existing code is easy and straightforward, if the code already +// uses a parameterized output destination, e.g. "outputStream st". +// - rename the formal parameter to any other name, e.g. out_st. +// - at a suitable place in your code, insert +// BUFFEREDSTEAM_DECL(buf_st, out_st) +// This will provide all the declarations necessary. After that, all +// buf_st->print() (and the like) calls will be directed to a bufferedStream object. +// Once a block of output (a line or a small set of lines) is composed, insert +// BUFFEREDSTREAM_FLUSH(termstring) +// to flush the bufferedStream to the final destination out_st. termstring is just +// an arbitrary string (e.g. "\n") which is appended to the bufferedStream before +// being written to out_st. Be aware that the last character written MUST be a '\n'. +// Otherwise, buf_st->position() does not correspond to out_st->position() any longer. +// BUFFEREDSTREAM_FLUSH_LOCKED(termstring) +// does the same thing, protected by the ttyLocker lock. +// BUFFEREDSTREAM_FLUSH_IF(termstring, remSize) +// does a flush only if the remaining buffer space is less than remSize. +// +// To activate, #define USE_BUFFERED_STREAM before including this header. +// If not activated, output will directly go to the originally used outputStream +// with no additional overhead. +// +#if defined(USE_BUFFEREDSTREAM) +// All necessary declarations to print via a bufferedStream +// This macro must be placed before any other BUFFEREDSTREAM* +// macro in the function. +#define BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, _capa) \ + ResourceMark _rm; \ + /* _anyst name of the stream as used in the code */ \ + /* _outst stream where final output will go to */ \ + /* _capa allocated capacity of stream buffer */ \ + size_t _nflush = 0; \ + size_t _nforcedflush = 0; \ + size_t _nsavedflush = 0; \ + size_t _nlockedflush = 0; \ + size_t _nflush_bytes = 0; \ + size_t _capacity = _capa; \ + bufferedStream _sstobj = bufferedStream(_capa); \ + bufferedStream* _sstbuf = &_sstobj; \ + outputStream* _outbuf = _outst; \ + bufferedStream* _anyst = &_sstobj; /* any stream. Use this to just print - no buffer flush. */ + +// Same as above, but with fixed buffer size. +#define BUFFEREDSTREAM_DECL(_anyst, _outst) \ + BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, 4*K); -#define STRINGSTREAM_FLUSH(termString) \ - _sstbuf->print("%s", termString); \ - _outbuf->print("%s", _sstbuf->as_string()); \ - _sstbuf->reset(); +// Flush the buffer contents unconditionally. +// No action if the buffer is empty. +#define BUFFEREDSTREAM_FLUSH(_termString) \ + if (((_termString) != NULL) && (strlen(_termString) > 0)){\ + _sstbuf->print("%s", _termString); \ + } \ + if (_sstbuf != _outbuf) { \ + if (_sstbuf->size() != 0) { \ + _nforcedflush++; _nflush_bytes += _sstbuf->size(); \ + _outbuf->print("%s", _sstbuf->as_string()); \ + _sstbuf->reset(); \ + } \ + } -#define STRINGSTREAM_FLUSH_LOCKED(termString) \ - { ttyLocker ttyl;/* keep this output block together */\ - STRINGSTREAM_FLUSH(termString) \ +// Flush the buffer contents if the remaining capacity is +// less than the given threshold. +#define BUFFEREDSTREAM_FLUSH_IF(_termString, _remSize) \ + if (((_termString) != NULL) && (strlen(_termString) > 0)){\ + _sstbuf->print("%s", _termString); \ + } \ + if (_sstbuf != _outbuf) { \ + if ((_capacity - _sstbuf->size()) < (size_t)(_remSize)){\ + _nflush++; _nforcedflush--; \ + BUFFEREDSTREAM_FLUSH("") \ + } else { \ + _nsavedflush++; \ + } \ } + +// Flush the buffer contents if the remaining capacity is less +// than the calculated threshold (256 bytes + capacity/16) +// That should suffice for all reasonably sized output lines. +#define BUFFEREDSTREAM_FLUSH_AUTO(_termString) \ + BUFFEREDSTREAM_FLUSH_IF(_termString, 256+(_capacity>>4)) + +#define BUFFEREDSTREAM_FLUSH_LOCKED(_termString) \ + { ttyLocker ttyl;/* keep this output block together */ \ + _nlockedflush++; \ + BUFFEREDSTREAM_FLUSH(_termString) \ + } + +// #define BUFFEREDSTREAM_FLUSH_STAT() \ +// if (_sstbuf != _outbuf) { \ +// _outbuf->print_cr("%ld flushes (buffer full), %ld forced, %ld locked, %ld bytes total, %ld flushes saved", _nflush, _nforcedflush, _nlockedflush, _nflush_bytes, _nsavedflush); \ +// } + +#define BUFFEREDSTREAM_FLUSH_STAT() #else -#define STRINGSTREAM_DECL(_anyst, _outst) \ - outputStream* _outbuf = _outst; \ +#define BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, _capa) \ + size_t _capacity = _capa; \ + outputStream* _outbuf = _outst; \ outputStream* _anyst = _outst; /* any stream. Use this to just print - no buffer flush. */ -#define STRINGSTREAM_FLUSH(termString) \ - _outbuf->print("%s", termString); +#define BUFFEREDSTREAM_DECL(_anyst, _outst) \ + BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, 4*K) + +#define BUFFEREDSTREAM_FLUSH(_termString) \ + if (((_termString) != NULL) && (strlen(_termString) > 0)){\ + _outbuf->print("%s", _termString); \ + } -#define STRINGSTREAM_FLUSH_LOCKED(termString) \ - _outbuf->print("%s", termString); +#define BUFFEREDSTREAM_FLUSH_IF(_termString, _remSize) \ + BUFFEREDSTREAM_FLUSH(_termString) + +#define BUFFEREDSTREAM_FLUSH_AUTO(_termString) \ + BUFFEREDSTREAM_FLUSH(_termString) + +#define BUFFEREDSTREAM_FLUSH_LOCKED(_termString) \ + BUFFEREDSTREAM_FLUSH(_termString) + +#define BUFFEREDSTREAM_FLUSH_STAT() #endif +#define HEX32_FORMAT "0x%x" // just a helper format string used below multiple times const char blobTypeChar[] = {' ', 'C', 'N', 'I', 'X', 'Z', 'U', 'R', '?', 'D', 'T', 'E', 'S', 'A', 'M', 'B', 'L' }; const char* blobTypeName[] = {"noType" @@ -461,7 +552,7 @@ // results in StatArray size of 24M (= max_granules * 48 Bytes per element) // For a 1GB CodeHeap, the granule size must be at least 2kB to not violate the max_granles limit. const char* heapName = get_heapName(heap); - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) if (!initialization_complete) { memset(CodeHeapStatArray, 0, sizeof(CodeHeapStatArray)); @@ -477,7 +568,7 @@ " to help them understand and solve issues in customer systems.\n" " It is not intended for use and interpretation by other persons.\n" " \n"); - STRINGSTREAM_FLUSH("") + BUFFEREDSTREAM_FLUSH("") } get_HeapStatGlobals(out, heapName); @@ -493,13 +584,13 @@ if (seg_size == 0) { printBox(ast, '-', "Heap not fully initialized yet, segment size is zero for segment ", heapName); - STRINGSTREAM_FLUSH("") + BUFFEREDSTREAM_FLUSH("") return; } if (!CodeCache_lock->owned_by_self()) { printBox(ast, '-', "aggregate function called without holding the CodeCache_lock for ", heapName); - STRINGSTREAM_FLUSH("") + BUFFEREDSTREAM_FLUSH("") return; } @@ -555,7 +646,7 @@ ast->print_cr(" CodeHeap (committed part) is mapped to " SIZE_FORMAT " granules of size " SIZE_FORMAT " bytes.", granules, granularity); ast->print_cr(" Each granule takes " SIZE_FORMAT " bytes of C heap, that is " SIZE_FORMAT "K in total for statistics data.", sizeof(StatElement), (sizeof(StatElement)*granules)/(size_t)K); ast->print_cr(" The number of granules is limited to %dk, requiring a granules size of at least %d bytes for a 1GB heap.", (unsigned int)(max_granules/K), (unsigned int)(G/max_granules)); - STRINGSTREAM_FLUSH("\n") + BUFFEREDSTREAM_FLUSH("\n") while (!done) { @@ -644,7 +735,7 @@ insane = true; ast->print_cr("Sanity check: end index (%d) lower than begin index (%d)", ix_end, ix_beg); } if (insane) { - STRINGSTREAM_FLUSH("") + BUFFEREDSTREAM_FLUSH("") continue; } @@ -1033,7 +1124,7 @@ avgTemp = 0; ast->print_cr("No hotness data available"); } - STRINGSTREAM_FLUSH("\n") + BUFFEREDSTREAM_FLUSH("\n") // This loop is intentionally printing directly to "out". // It should not print anything, anyway. @@ -1115,7 +1206,7 @@ " Subsequent print functions create their output based on this snapshot.\n"); ast->print_cr(" Free space in %s is distributed over %d free blocks.", heapName, nBlocks_free); ast->print_cr(" Each free block takes " SIZE_FORMAT " bytes of C heap for statistics data, that is " SIZE_FORMAT "K in total.", sizeof(FreeBlk), (sizeof(FreeBlk)*nBlocks_free)/K); - STRINGSTREAM_FLUSH("\n") + BUFFEREDSTREAM_FLUSH("\n") //---------------------------------------- //-- Prepare the FreeArray of FreeBlks -- @@ -1151,7 +1242,7 @@ if (ix != alloc_freeBlocks) { ast->print_cr("Free block count mismatch. Expected %d free blocks, but found %d.", alloc_freeBlocks, ix); ast->print_cr("I will update the counter and retry data collection"); - STRINGSTREAM_FLUSH("\n") + BUFFEREDSTREAM_FLUSH("\n") nBlocks_free = ix; continue; } @@ -1165,7 +1256,7 @@ ast->print_cr("Free block count mismatch could not be resolved."); ast->print_cr("Try to run \"aggregate\" function to update counters"); } - STRINGSTREAM_FLUSH("") + BUFFEREDSTREAM_FLUSH("") //---< discard old array and update global values >--- discard_FreeArray(out); @@ -1199,7 +1290,7 @@ set_HeapStatGlobals(out, heapName); printBox(ast, '=', "C O D E H E A P A N A L Y S I S C O M P L E T E for segment ", heapName); - STRINGSTREAM_FLUSH("\n") + BUFFEREDSTREAM_FLUSH("\n") } @@ -1214,7 +1305,7 @@ if ((StatArray == NULL) || (TopSizeArray == NULL) || (used_topSizeBlocks == 0)) { return; } - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) { printBox(ast, '=', "U S E D S P A C E S T A T I S T I C S for ", heapName); @@ -1226,7 +1317,7 @@ " is not continuously held, the displayed name might be wrong or no name\n" " might be found at all. The likelihood for that to happen increases\n" " over time passed between analysis and print step.\n", used_topSizeBlocks); - STRINGSTREAM_FLUSH_LOCKED("\n") + BUFFEREDSTREAM_FLUSH_LOCKED("\n") } //---------------------------- @@ -1246,7 +1337,7 @@ ast->fill_to(66); ast->print_cr("%6s", "method"); ast->print_cr("%18s %13s %17s %4s %9s %5s %s", "Addr(module) ", "offset", "size", "type", " type lvl", " temp", "Name"); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") //---< print Top Ten Used Blocks >--- if (used_topSizeBlocks > 0) { @@ -1324,17 +1415,17 @@ ast->fill_to(67+6); ast->print("%s", blob_name); } - STRINGSTREAM_FLUSH_LOCKED("\n") + ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } if (used_topSizeBlocks != printed_topSizeBlocks) { ast->print_cr("used blocks: %d, printed blocks: %d", used_topSizeBlocks, printed_topSizeBlocks); - STRINGSTREAM_FLUSH("") for (unsigned int i = 0; i < alloc_topSizeBlocks; i++) { ast->print_cr(" TopSizeArray[%d].index = %d, len = %d", i, TopSizeArray[i].index, TopSizeArray[i].len); - STRINGSTREAM_FLUSH("") + BUFFEREDSTREAM_FLUSH_AUTO("") } } - STRINGSTREAM_FLUSH_LOCKED("\n\n") + BUFFEREDSTREAM_FLUSH("\n\n") } } @@ -1359,7 +1450,7 @@ " %ld characters are printed per percentage point.\n", pctFactor/100); ast->print_cr("total size of all blocks: %7ldM", (total_size<print_cr("total number of all blocks: %7ld\n", total_count); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") ast->print_cr("[Size Range)------avg.-size-+----count-+"); for (unsigned int i = 0; i < nSizeDistElements; i++) { @@ -1388,9 +1479,10 @@ ast->print("%c", (j%((pctFactor/100)*10) == 0) ? ('0'+j/(((unsigned int)pctFactor/100)*10)) : '*'); } ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } - ast->print_cr("----------------------------+----------+\n\n"); - STRINGSTREAM_FLUSH_LOCKED("\n") + ast->print_cr("----------------------------+----------+"); + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") printBox(ast, '-', "Contribution per size range to total size for ", heapName); ast->print_cr("Note: The histogram indicates how much space (as a percentage of all\n" @@ -1398,7 +1490,7 @@ " %ld characters are printed per percentage point.\n", pctFactor/100); ast->print_cr("total size of all blocks: %7ldM", (total_size<print_cr("total number of all blocks: %7ld\n", total_count); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") ast->print_cr("[Size Range)------avg.-size-+----count-+"); for (unsigned int i = 0; i < nSizeDistElements; i++) { @@ -1427,9 +1519,10 @@ ast->print("%c", (j%((pctFactor/100)*10) == 0) ? ('0'+j/(((unsigned int)pctFactor/100)*10)) : '*'); } ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } ast->print_cr("----------------------------+----------+"); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } } } @@ -1446,7 +1539,7 @@ if ((StatArray == NULL) || (FreeArray == NULL) || (alloc_granules == 0)) { return; } - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) { printBox(ast, '=', "F R E E S P A C E S T A T I S T I C S for ", heapName); @@ -1455,12 +1548,11 @@ " unoccupied, e.g. by class unloading. Then, the two adjacent free\n" " blocks, together with the now unoccupied space, form a new, large\n" " free block."); - STRINGSTREAM_FLUSH_LOCKED("\n") + BUFFEREDSTREAM_FLUSH_LOCKED("\n") } { printBox(ast, '-', "List of all Free Blocks in ", heapName); - STRINGSTREAM_FLUSH_LOCKED("") unsigned int ix = 0; for (ix = 0; ix < alloc_freeBlocks-1; ix++) { @@ -1472,10 +1564,11 @@ if (FreeArray[ix].stubs_in_gap) { ast->print(" !! permanent gap, contains stubs and/or blobs !!"); } - STRINGSTREAM_FLUSH_LOCKED("\n") + ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } ast->print_cr(INTPTR_FORMAT ": Len[%4d] = " HEX32_FORMAT, p2i(FreeArray[ix].start), ix, FreeArray[ix].len); - STRINGSTREAM_FLUSH_LOCKED("\n\n") + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n") } @@ -1519,7 +1612,7 @@ } } } - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_AUTO("") { printBox(ast, '-', "Top Ten Free Blocks in ", heapName); @@ -1536,9 +1629,10 @@ ast->print("#blocks (in gap) %d", FreeTopTen[iy]->n_gapBlocks); } ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } - STRINGSTREAM_FLUSH_LOCKED("\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n") //-------------------------------------------------------- @@ -1583,7 +1677,7 @@ } } } - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_AUTO("") { printBox(ast, '-', "Top Ten Free-Occupied-Free Triples in ", heapName); @@ -1601,9 +1695,10 @@ ast->fill_to(63); ast->print("#blocks (in gap) %d", FreeTopTenTriple[iy]->n_gapBlocks); ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } - STRINGSTREAM_FLUSH_LOCKED("\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n") } @@ -1618,7 +1713,7 @@ if ((StatArray == NULL) || (alloc_granules == 0)) { return; } - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) unsigned int granules_per_line = 32; char* low_bound = heap->low_boundary(); @@ -1634,13 +1729,12 @@ " Occupied granules show their BlobType character, see legend.\n"); print_blobType_legend(ast); } - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") } { if (segment_granules) { printBox(ast, '-', "Total (all types) count for granule size == segment size", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1649,7 +1743,6 @@ } } else { printBox(ast, '-', "Total (all tiers) count, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1659,13 +1752,12 @@ print_count_single(ast, count); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + BUFFEREDSTREAM_FLUSH_LOCKED("|\n\n\n") } { if (nBlocks_t1 > 0) { printBox(ast, '-', "Tier1 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1676,17 +1768,16 @@ print_count_single(ast, StatArray[ix].t1_count); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier1 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_t2 > 0) { printBox(ast, '-', "Tier2 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1697,17 +1788,16 @@ print_count_single(ast, StatArray[ix].t2_count); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier2 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_alive > 0) { printBox(ast, '-', "not_used/not_entrant/not_installed nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1718,17 +1808,16 @@ print_count_single(ast, StatArray[ix].tx_count); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No not_used/not_entrant nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_stub > 0) { printBox(ast, '-', "Stub & Blob count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1739,17 +1828,16 @@ print_count_single(ast, StatArray[ix].stub_count); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Stubs and Blobs found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_dead > 0) { printBox(ast, '-', "Dead nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1760,17 +1848,16 @@ print_count_single(ast, StatArray[ix].dead_count); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No dead nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (!segment_granules) { // Prevent totally redundant printouts printBox(ast, '-', "Count by tier (combined, no dead blocks): <#t1>:<#t2>:<#s>, 0x0..0xf. '*' indicates >= 16 blocks", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 24; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1787,7 +1874,7 @@ } ast->print(" "); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + BUFFEREDSTREAM_FLUSH_LOCKED("|\n\n\n") } } } @@ -1804,7 +1891,7 @@ if ((StatArray == NULL) || (alloc_granules == 0)) { return; } - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) unsigned int granules_per_line = 32; char* low_bound = heap->low_boundary(); @@ -1823,13 +1910,12 @@ ast->print_cr(" These digits represent a fill percentage range (see legend).\n"); print_space_legend(ast); } - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") } { if (segment_granules) { printBox(ast, '-', "Total (all types) space consumption for granule size == segment size", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1838,7 +1924,6 @@ } } else { printBox(ast, '-', "Total (all types) space consumption. ' ' indicates empty, '*' indicates full.", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1848,13 +1933,12 @@ print_space_single(ast, space); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + BUFFEREDSTREAM_FLUSH_LOCKED("|\n\n\n") } { if (nBlocks_t1 > 0) { printBox(ast, '-', "Tier1 space consumption. ' ' indicates empty, '*' indicates full", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1865,17 +1949,16 @@ print_space_single(ast, StatArray[ix].t1_space); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier1 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_t2 > 0) { printBox(ast, '-', "Tier2 space consumption. ' ' indicates empty, '*' indicates full", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1886,11 +1969,11 @@ print_space_single(ast, StatArray[ix].t2_space); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier2 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { @@ -1906,17 +1989,16 @@ print_space_single(ast, StatArray[ix].tx_space); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier2 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_stub > 0) { printBox(ast, '-', "Stub and Blob space consumption. ' ' indicates empty, '*' indicates full", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1927,34 +2009,32 @@ print_space_single(ast, StatArray[ix].stub_space); } } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Stubs and Blobs found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_dead > 0) { printBox(ast, '-', "Dead space consumption. ' ' indicates empty, '*' indicates full", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { print_line_delim(out, ast, low_bound, ix, granules_per_line); print_space_single(ast, StatArray[ix].dead_space); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No dead nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (!segment_granules) { // Prevent totally redundant printouts printBox(ast, '-', "Space consumption by tier (combined): ::. ' ' indicates empty, '*' indicates full", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 24; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -1979,7 +2059,8 @@ } ast->print(" "); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } } } @@ -1995,7 +2076,7 @@ if ((StatArray == NULL) || (alloc_granules == 0)) { return; } - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) unsigned int granules_per_line = 32; char* low_bound = heap->low_boundary(); @@ -2009,12 +2090,11 @@ " Information for the youngest method (highest ID) in the granule is printed.\n" " Refer to the legend to learn how method age is mapped to the displayed digit."); print_age_legend(ast); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") } { printBox(ast, '-', "Age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -2026,64 +2106,61 @@ age = age > agex ? age : agex; print_age_single(ast, age); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_t1 > 0) { printBox(ast, '-', "Tier1 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { print_line_delim(out, ast, low_bound, ix, granules_per_line); print_age_single(ast, StatArray[ix].t1_age); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier1 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_t2 > 0) { printBox(ast, '-', "Tier2 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { print_line_delim(out, ast, low_bound, ix, granules_per_line); print_age_single(ast, StatArray[ix].t2_age); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier2 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (nBlocks_alive > 0) { printBox(ast, '-', "not_used/not_entrant/not_installed age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { print_line_delim(out, ast, low_bound, ix, granules_per_line); print_age_single(ast, StatArray[ix].tx_age); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); } else { ast->print("No Tier2 nMethods found in CodeHeap."); - STRINGSTREAM_FLUSH_LOCKED("\n\n\n") } + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } { if (!segment_granules) { // Prevent totally redundant printouts printBox(ast, '-', "age distribution by tier :. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); - STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 32; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -2093,7 +2170,8 @@ print_age_single(ast, StatArray[ix].t2_age); ast->print(" "); } - STRINGSTREAM_FLUSH_LOCKED("|\n\n\n") + ast->print("|"); + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n") } } } @@ -2110,7 +2188,7 @@ if ((StatArray == NULL) || (alloc_granules == 0)) { return; } - STRINGSTREAM_DECL(ast, out) + BUFFEREDSTREAM_DECL(ast, out) unsigned int granules_per_line = 128; char* low_bound = heap->low_boundary(); @@ -2129,7 +2207,7 @@ " is not continuously held, the displayed name might be wrong or no name\n" " might be found at all. The likelihood for that to happen increases\n" " over time passed between aggregtion and print steps.\n"); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_LOCKED("") for (unsigned int ix = 0; ix < alloc_granules; ix++) { //---< print a new blob on a new line >--- @@ -2144,7 +2222,7 @@ ast->print_cr("--------------------------------------------------------------------"); ast->print_cr("Address range [" INTPTR_FORMAT "," INTPTR_FORMAT "), " SIZE_FORMAT "k", p2i(low_bound+ix*granule_size), p2i(low_bound + end_ix*granule_size), (end_ix - ix)*granule_size/(size_t)K); ast->print_cr("--------------------------------------------------------------------"); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_AUTO("") } // Only check granule if it contains at least one blob. unsigned int nBlobs = StatArray[ix].t1_count + StatArray[ix].t2_count + StatArray[ix].tx_count + @@ -2192,7 +2270,7 @@ ast->fill_to(61); ast->print_cr("%6s", "method"); ast->print_cr("%18s %13s %17s %9s %5s %18s %s", "Addr(module) ", "offset", "size", " type lvl", " temp", "blobType ", "Name"); - STRINGSTREAM_FLUSH_LOCKED("") + BUFFEREDSTREAM_FLUSH_AUTO("") } //---< print line prefix (address and offset from CodeHeap start) >--- @@ -2248,15 +2326,15 @@ ast->fill_to(62+6); ast->print(""); } - STRINGSTREAM_FLUSH_LOCKED("\n") + ast->cr(); + BUFFEREDSTREAM_FLUSH_AUTO("") } else if (!blob_is_safe && (this_blob != last_blob) && (this_blob != NULL)) { last_blob = this_blob; - STRINGSTREAM_FLUSH_LOCKED("\n") } } } // nBlobs > 0 } - STRINGSTREAM_FLUSH_LOCKED("\n\n") + BUFFEREDSTREAM_FLUSH_LOCKED("\n\n") } @@ -2393,7 +2471,11 @@ } ast->cr(); - { // can't use STRINGSTREAM_FLUSH_LOCKED("") here. + // can't use BUFFEREDSTREAM_FLUSH_IF("", 512) here. + // can't use this expression. bufferedStream::capacity() does not exist. + // if ((ast->capacity() - ast->size()) < 512) { + // Assume instead that default bufferedStream capacity (4K) was used. + if (ast->size() > 3*K) { ttyLocker ttyl; out->print("%s", ast->as_string()); ast->reset(); diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/gc/shared/owstTaskTerminator.cpp --- a/src/hotspot/share/gc/shared/owstTaskTerminator.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/gc/shared/owstTaskTerminator.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -65,6 +65,13 @@ return true; } else { _blocker->lock_without_safepoint_check(); + // There is possibility that termination is reached between dropping the lock + // before returning from do_spin_master_work() and acquiring lock above. + if (_offered_termination == _n_threads) { + _blocker->unlock(); + assert(!peek_in_queue_set(), "Precondition"); + return true; + } } } else { _blocker->wait(true, WorkStealingSleepMillis); diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -45,7 +45,6 @@ f(scan_roots, " Scan Roots") \ f(scan_thread_roots, " S: Thread Roots") \ f(scan_code_roots, " S: Code Cache Roots") \ - f(scan_string_table_roots, " S: String Table Roots") \ f(scan_universe_roots, " S: Universe Roots") \ f(scan_jni_roots, " S: JNI Roots") \ f(scan_jni_weak_roots, " S: JNI Weak Roots") \ @@ -67,7 +66,6 @@ f(update_roots, " Update Roots") \ f(update_thread_roots, " U: Thread Roots") \ f(update_code_roots, " U: Code Cache Roots") \ - f(update_string_table_roots, " U: String Table Roots") \ f(update_universe_roots, " U: Universe Roots") \ f(update_jni_roots, " U: JNI Roots") \ f(update_jni_weak_roots, " U: JNI Weak Roots") \ @@ -97,7 +95,6 @@ f(init_evac, " Initial Evacuation") \ f(evac_thread_roots, " E: Thread Roots") \ f(evac_code_roots, " E: Code Cache Roots") \ - f(evac_string_table_roots, " E: String Table Roots") \ f(evac_universe_roots, " E: Universe Roots") \ f(evac_jni_roots, " E: JNI Roots") \ f(evac_jni_weak_roots, " E: JNI Weak Roots") \ @@ -124,7 +121,6 @@ f(final_update_refs_roots, " Update Roots") \ f(final_update_refs_thread_roots, " UR: Thread Roots") \ f(final_update_refs_code_roots, " UR: Code Cache Roots") \ - f(final_update_refs_string_table_roots, " UR: String Table Roots") \ f(final_update_refs_universe_roots, " UR: Universe Roots") \ f(final_update_refs_jni_roots, " UR: JNI Roots") \ f(final_update_refs_jni_weak_roots, " UR: JNI Weak Roots") \ @@ -146,7 +142,6 @@ f(degen_gc_update_roots, " Degen Update Roots") \ f(degen_gc_update_thread_roots, " DU: Thread Roots") \ f(degen_gc_update_code_roots, " DU: Code Cache Roots") \ - f(degen_gc_update_string_table_roots, " DU: String Table Roots") \ f(degen_gc_update_universe_roots, " DU: Universe Roots") \ f(degen_gc_update_jni_roots, " DU: JNI Roots") \ f(degen_gc_update_jni_weak_roots, " DU: JNI Weak Roots") \ @@ -169,7 +164,6 @@ f(init_traversal_gc_work, " Work") \ f(init_traversal_gc_thread_roots, " TI: Thread Roots") \ f(init_traversal_gc_code_roots, " TI: Code Cache Roots") \ - f(init_traversal_gc_string_table_roots, " TI: String Table Roots") \ f(init_traversal_gc_universe_roots, " TI: Universe Roots") \ f(init_traversal_gc_jni_roots, " TI: JNI Roots") \ f(init_traversal_gc_jni_weak_roots, " TI: JNI Weak Roots") \ @@ -189,7 +183,6 @@ f(final_traversal_gc_work, " Work") \ f(final_traversal_gc_thread_roots, " TF: Thread Roots") \ f(final_traversal_gc_code_roots, " TF: Code Cache Roots") \ - f(final_traversal_gc_string_table_roots, " TF: String Table Roots") \ f(final_traversal_gc_universe_roots, " TF: Universe Roots") \ f(final_traversal_gc_jni_roots, " TF: JNI Roots") \ f(final_traversal_gc_jni_weak_roots, " TF: JNI Weak Roots") \ @@ -207,7 +200,6 @@ f(final_traversal_update_roots, " Update Roots") \ f(final_traversal_update_thread_roots, " TU: Thread Roots") \ f(final_traversal_update_code_roots, " TU: Code Cache Roots") \ - f(final_traversal_update_string_table_roots, " TU: String Table Roots") \ f(final_traversal_update_universe_roots, " TU: Universe Roots") \ f(final_traversal_update_jni_roots, " TU: JNI Roots") \ f(final_traversal_update_jni_weak_roots, " TU: JNI Weak Roots") \ @@ -231,7 +223,6 @@ f(full_gc_roots, " Roots") \ f(full_gc_thread_roots, " F: Thread Roots") \ f(full_gc_code_roots, " F: Code Cache Roots") \ - f(full_gc_string_table_roots, " F: String Table Roots") \ f(full_gc_universe_roots, " F: Universe Roots") \ f(full_gc_jni_roots, " F: JNI Roots") \ f(full_gc_jni_weak_roots, " F: JNI Weak Roots") \ @@ -286,7 +277,6 @@ #define SHENANDOAH_GC_PAR_PHASE_DO(f) \ f(ThreadRoots, "Thread Roots (ms):") \ f(CodeCacheRoots, "CodeCache Roots (ms):") \ - f(StringTableRoots, "StringTable Roots (ms):") \ f(UniverseRoots, "Universe Roots (ms):") \ f(JNIRoots, "JNI Handles Roots (ms):") \ f(JNIWeakRoots, "JNI Weak Roots (ms):") \ diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/interpreter/invocationCounter.cpp --- a/src/hotspot/share/interpreter/invocationCounter.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/interpreter/invocationCounter.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -79,6 +79,10 @@ int InvocationCounter::_init [InvocationCounter::number_of_states]; InvocationCounter::Action InvocationCounter::_action[InvocationCounter::number_of_states]; +#ifdef CC_INTERP +int InvocationCounter::InterpreterInvocationLimit; +int InvocationCounter::InterpreterBackwardBranchLimit; +#endif const char* InvocationCounter::state_as_string(State state) { switch (state) { @@ -132,6 +136,22 @@ guarantee((int)number_of_states <= (int)state_limit, "adjust number_of_state_bits"); def(wait_for_nothing, 0, do_nothing); def(wait_for_compile, 0, do_decay); + +#ifdef CC_INTERP + InterpreterInvocationLimit = CompileThreshold << number_of_noncount_bits; + + // When methodData is collected, the backward branch limit is compared against a + // methodData counter, rather than an InvocationCounter. In the former case, we + // don't need the shift by number_of_noncount_bits, but we do need to adjust + // the factor by which we scale the threshold. + if (ProfileInterpreter) { + InterpreterBackwardBranchLimit = (int)((int64_t)CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage) / 100); + } else { + InterpreterBackwardBranchLimit = (int)(((int64_t)CompileThreshold * OnStackReplacePercentage / 100) << number_of_noncount_bits); + } + + assert(0 <= InterpreterBackwardBranchLimit, "OSR threshold should be non-negative"); +#endif } void invocationCounter_init() { diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/interpreter/invocationCounter.hpp --- a/src/hotspot/share/interpreter/invocationCounter.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/interpreter/invocationCounter.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -92,6 +92,9 @@ int count() const { return _counter >> number_of_noncount_bits; } #ifdef CC_INTERP + static int InterpreterInvocationLimit; // CompileThreshold scaled for interpreter use + static int InterpreterBackwardBranchLimit; // A separate threshold for on stack replacement + // Test counter using scaled limits like the asm interpreter would do rather than doing // the shifts to normalize the counter. // Checks sum of invocation_counter and backedge_counter as the template interpreter does. @@ -103,11 +106,6 @@ return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= (unsigned int) InterpreterBackwardBranchLimit; } - // Do this just like asm interpreter does for max speed. - bool reached_ProfileLimit(InvocationCounter *back_edge_count) const { - return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= - (unsigned int) InterpreterProfileLimit; - } #endif // CC_INTERP void increment() { _counter += count_increment; } diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/oops/constantPool.cpp --- a/src/hotspot/share/oops/constantPool.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/oops/constantPool.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -448,6 +448,7 @@ Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which, bool save_resolution_error, TRAPS) { assert(THREAD->is_Java_thread(), "must be a Java thread"); + JavaThread* javaThread = (JavaThread*)THREAD; // A resolved constantPool entry will contain a Klass*, otherwise a Symbol*. // It is not safe to rely on the tag bit's here, since we don't have a lock, and @@ -480,7 +481,14 @@ Symbol* name = this_cp->symbol_at(name_index); Handle loader (THREAD, this_cp->pool_holder()->class_loader()); Handle protection_domain (THREAD, this_cp->pool_holder()->protection_domain()); - Klass* k = SystemDictionary::resolve_or_fail(name, loader, protection_domain, true, THREAD); + + Klass* k; + { + // Turn off the single stepping while doing class resolution + JvmtiHideSingleStepping jhss(javaThread); + k = SystemDictionary::resolve_or_fail(name, loader, protection_domain, true, THREAD); + } // JvmtiHideSingleStepping jhss(javaThread); + if (!HAS_PENDING_EXCEPTION) { // preserve the resolved klass from unloading mirror_handle = Handle(THREAD, k->java_mirror()); @@ -817,9 +825,9 @@ constantTag tag = tag_at(which); if (tag.is_dynamic_constant() || tag.is_dynamic_constant_in_error()) { - // have to look at the signature for this one - Symbol* constant_type = uncached_signature_ref_at(which); - return constantTag::ofBasicType(FieldType::basic_type(constant_type)); + BasicType bt = basic_type_for_constant_at(which); + // dynamic constant could return an array, treat as object + return constantTag::ofBasicType(is_reference_type(bt) ? T_OBJECT : bt); } return tag; } diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/prims/jvmtiExport.cpp --- a/src/hotspot/share/prims/jvmtiExport.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/prims/jvmtiExport.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2426,7 +2426,7 @@ Handle h(thread, object); EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTER, - ("[%s] montior contended enter event triggered", + ("[%s] monitor contended enter event triggered", JvmtiTrace::safe_get_thread_name(thread))); JvmtiEnvThreadStateIterator it(state); @@ -2457,7 +2457,7 @@ Handle h(thread, object); EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, - ("[%s] montior contended entered event triggered", + ("[%s] monitor contended entered event triggered", JvmtiTrace::safe_get_thread_name(thread))); JvmtiEnvThreadStateIterator it(state); @@ -2488,7 +2488,7 @@ Handle h(thread, object); EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_WAIT, - ("[%s] montior wait event triggered", + ("[%s] monitor wait event triggered", JvmtiTrace::safe_get_thread_name(thread))); JvmtiEnvThreadStateIterator it(state); @@ -2520,7 +2520,7 @@ Handle h(thread, object); EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_WAITED, - ("[%s] montior waited event triggered", + ("[%s] monitor waited event triggered", JvmtiTrace::safe_get_thread_name(thread))); JvmtiEnvThreadStateIterator it(state); diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/basicLock.cpp --- a/src/hotspot/share/runtime/basicLock.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/basicLock.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,7 +74,5 @@ // store-before-CAS avoidance in fast_lock/compiler_lock_object // we can find any flavor mark in the displaced mark. } -// [RGV] The next line appears to do nothing! - intptr_t dh = (intptr_t) displaced_header(); dest->set_displaced_header(displaced_header()); } diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/objectMonitor.cpp --- a/src/hotspot/share/runtime/objectMonitor.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/objectMonitor.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1884,8 +1884,9 @@ // One-shot global initialization for the sync subsystem. // We could also defer initialization and initialize on-demand -// the first time we call inflate(). Initialization would -// be protected - like so many things - by the MonitorCache_lock. +// the first time we call ObjectSynchronizer::inflate(). +// Initialization would be protected - like so many things - by +// the MonitorCache_lock. void ObjectMonitor::Initialize() { assert(!InitDone, "invariant"); diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/objectMonitor.hpp --- a/src/hotspot/share/runtime/objectMonitor.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/objectMonitor.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -164,7 +164,7 @@ volatile int _SpinDuration; volatile jint _count; // reference count to prevent reclamation/deflation - // at stop-the-world time. See deflate_idle_monitors(). + // at stop-the-world time. See ObjectSynchronizer::deflate_monitor(). // _count is approximately |_WaitSet| + |_EntryList| protected: ObjectWaiter * volatile _WaitSet; // LL of threads wait()ing on the monitor diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/objectMonitor.inline.hpp --- a/src/hotspot/share/runtime/objectMonitor.inline.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/objectMonitor.inline.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -58,18 +58,17 @@ } inline void ObjectMonitor::clear() { - assert(_header, "Fatal logic error in ObjectMonitor header!"); + assert(_header != NULL, "Fatal logic error in ObjectMonitor header!"); assert(_count == 0, "Fatal logic error in ObjectMonitor count!"); assert(_waiters == 0, "Fatal logic error in ObjectMonitor waiters!"); assert(_recursions == 0, "Fatal logic error in ObjectMonitor recursions!"); assert(_object != NULL, "Fatal logic error in ObjectMonitor object!"); - assert(_owner == 0, "Fatal logic error in ObjectMonitor owner!"); + assert(_owner == NULL, "Fatal logic error in ObjectMonitor owner!"); _header = NULL; _object = NULL; } - inline void* ObjectMonitor::object() const { return _object; } @@ -95,7 +94,6 @@ return true; } - // return number of threads contending for this monitor inline jint ObjectMonitor::contentions() const { return _count; @@ -109,5 +107,4 @@ _recursions = 0; } - #endif // SHARE_RUNTIME_OBJECTMONITOR_INLINE_HPP diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/os.cpp --- a/src/hotspot/share/runtime/os.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/os.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -885,11 +885,15 @@ address p = start; st->print(PTR_FORMAT ": ", p2i(start)); while (p < end) { - switch (unitsize) { - case 1: st->print("%02x", *(u1*)p); break; - case 2: st->print("%04x", *(u2*)p); break; - case 4: st->print("%08x", *(u4*)p); break; - case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break; + if (is_readable_pointer(p)) { + switch (unitsize) { + case 1: st->print("%02x", *(u1*)p); break; + case 2: st->print("%04x", *(u2*)p); break; + case 4: st->print("%08x", *(u4*)p); break; + case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break; + } + } else { + st->print("%*.*s", 2*unitsize, 2*unitsize, "????????????????"); } p += unitsize; cols++; diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/synchronizer.cpp --- a/src/hotspot/share/runtime/synchronizer.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/synchronizer.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -326,9 +326,7 @@ } // We have to take the slow-path of possible inflation and then exit. - ObjectSynchronizer::inflate(THREAD, - object, - inflate_cause_vm_internal)->exit(true, THREAD); + inflate(THREAD, object, inflate_cause_vm_internal)->exit(true, THREAD); } // ----------------------------------------------------------------------------- @@ -361,9 +359,7 @@ // must be non-zero to avoid looking like a re-entrant lock, // and must not look locked either. lock->set_displaced_header(markOopDesc::unused_mark()); - ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_monitor_enter)->enter(THREAD); + inflate(THREAD, obj(), inflate_cause_monitor_enter)->enter(THREAD); } // This routine is used to handle interpreter/compiler slow case @@ -392,9 +388,7 @@ assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_vm_internal); + ObjectMonitor* monitor = inflate(THREAD, obj(), inflate_cause_vm_internal); return monitor->complete_exit(THREAD); } @@ -406,9 +400,7 @@ assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_vm_internal); + ObjectMonitor* monitor = inflate(THREAD, obj(), inflate_cause_vm_internal); monitor->reenter(recursion, THREAD); } @@ -422,7 +414,7 @@ assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } THREAD->set_current_pending_monitor_is_from_java(false); - ObjectSynchronizer::inflate(THREAD, obj(), inflate_cause_jni_enter)->enter(THREAD); + inflate(THREAD, obj(), inflate_cause_jni_enter)->enter(THREAD); THREAD->set_current_pending_monitor_is_from_java(true); } @@ -435,9 +427,7 @@ } assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, - obj, - inflate_cause_jni_exit); + ObjectMonitor* monitor = inflate(THREAD, obj, inflate_cause_jni_exit); // If this thread has locked the object, exit the monitor. Note: can't use // monitor->check(CHECK); must exit even if an exception is pending. if (monitor->check(THREAD)) { @@ -477,9 +467,7 @@ if (millis < 0) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_wait); + ObjectMonitor* monitor = inflate(THREAD, obj(), inflate_cause_wait); DTRACE_MONITOR_WAIT_PROBE(monitor, obj(), THREAD, millis); monitor->wait(millis, true, THREAD); @@ -499,9 +487,7 @@ if (millis < 0) { THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } - ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_wait)->wait(millis, false, THREAD); + inflate(THREAD, obj(), inflate_cause_wait)->wait(millis, false, THREAD); } void ObjectSynchronizer::notify(Handle obj, TRAPS) { @@ -514,9 +500,7 @@ if (mark->has_locker() && THREAD->is_lock_owned((address)mark->locker())) { return; } - ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_notify)->notify(THREAD); + inflate(THREAD, obj(), inflate_cause_notify)->notify(THREAD); } // NOTE: see comment of notify() @@ -530,9 +514,7 @@ if (mark->has_locker() && THREAD->is_lock_owned((address)mark->locker())) { return; } - ObjectSynchronizer::inflate(THREAD, - obj(), - inflate_cause_notify)->notifyAll(THREAD); + inflate(THREAD, obj(), inflate_cause_notify)->notifyAll(THREAD); } // ----------------------------------------------------------------------------- @@ -736,7 +718,7 @@ if (mark->is_neutral()) { hash = mark->hash(); // this is a normal header - if (hash) { // if it has hash, just return it + if (hash != 0) { // if it has hash, just return it return hash; } hash = get_next_hash(Self, obj); // allocate a new hash code @@ -752,17 +734,17 @@ } else if (mark->has_monitor()) { monitor = mark->monitor(); temp = monitor->header(); - assert(temp->is_neutral(), "invariant"); + assert(temp->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)temp)); hash = temp->hash(); - if (hash) { + if (hash != 0) { return hash; } // Skip to the following code to reduce code size } else if (Self->is_lock_owned((address)mark->locker())) { temp = mark->displaced_mark_helper(); // this is a lightweight monitor owned - assert(temp->is_neutral(), "invariant"); + assert(temp->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)temp)); hash = temp->hash(); // by current thread, check if the displaced - if (hash) { // header contains hash code + if (hash != 0) { // header contains hash code return hash; } // WARNING: @@ -777,22 +759,22 @@ } // Inflate the monitor to set hash code - monitor = ObjectSynchronizer::inflate(Self, obj, inflate_cause_hash_code); + monitor = inflate(Self, obj, inflate_cause_hash_code); // Load displaced header and check it has hash code mark = monitor->header(); - assert(mark->is_neutral(), "invariant"); + assert(mark->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)mark)); hash = mark->hash(); if (hash == 0) { hash = get_next_hash(Self, obj); temp = mark->copy_set_hash(hash); // merge hash code into header - assert(temp->is_neutral(), "invariant"); + assert(temp->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)temp)); test = Atomic::cmpxchg(temp, monitor->header_addr(), mark); if (test != mark) { // The only update to the header in the monitor (outside GC) // is install the hash code. If someone add new usage of // displaced header, please update this code hash = test->hash(); - assert(test->is_neutral(), "invariant"); + assert(test->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)test)); assert(hash != 0, "Trivial unexpected object/monitor header usage."); } } @@ -864,7 +846,7 @@ owner_self : owner_other; } - // CASE: inflated. Mark (tagged pointer) points to an objectMonitor. + // CASE: inflated. Mark (tagged pointer) points to an ObjectMonitor. // The Object:ObjectMonitor relationship is stable as long as we're // not at a safepoint. if (mark->has_monitor()) { @@ -901,7 +883,7 @@ } // Contended case, header points to ObjectMonitor (tagged pointer) - if (mark->has_monitor()) { + else if (mark->has_monitor()) { ObjectMonitor* monitor = mark->monitor(); assert(monitor != NULL, "monitor should be non-null"); owner = (address) monitor->owner(); @@ -1076,7 +1058,7 @@ // Reprovision the thread's omFreeList. // Use bulk transfers to reduce the allocation rate and heat // on various locks. - Thread::muxAcquire(&gListLock, "omAlloc"); + Thread::muxAcquire(&gListLock, "omAlloc(1)"); for (int i = Self->omFreeProvision; --i >= 0 && gFreeList != NULL;) { gMonitorFreeCount--; ObjectMonitor * take = gFreeList; @@ -1150,7 +1132,7 @@ // Acquire the gListLock to manipulate gBlockList and gFreeList. // An Oyama-Taura-Yonezawa scheme might be more efficient. - Thread::muxAcquire(&gListLock, "omAlloc [2]"); + Thread::muxAcquire(&gListLock, "omAlloc(2)"); gMonitorPopulation += _BLOCKSIZE-1; gMonitorFreeCount += _BLOCKSIZE-1; @@ -1178,10 +1160,11 @@ // // Key constraint: all ObjectMonitors on a thread's free list and the global // free list must have their object field set to null. This prevents the -// scavenger -- deflate_idle_monitors -- from reclaiming them. +// scavenger -- deflate_monitor_list() -- from reclaiming them. void ObjectSynchronizer::omRelease(Thread * Self, ObjectMonitor * m, bool fromPerThreadAlloc) { + guarantee(m->header() == NULL, "invariant"); guarantee(m->object() == NULL, "invariant"); guarantee(((m->is_busy()|m->_recursions) == 0), "freeing in-use monitor"); // Remove from omInUseList @@ -1223,16 +1206,15 @@ // // We currently call omFlush() from Threads::remove() _before the thread // has been excised from the thread list and is no longer a mutator. -// This means that omFlush() can not run concurrently with a safepoint and -// interleave with the scavenge operator. In particular, this ensures that -// the thread's monitors are scanned by a GC safepoint, either via -// Thread::oops_do() (if safepoint happens before omFlush()) or via +// This means that omFlush() cannot run concurrently with a safepoint and +// interleave with the deflate_idle_monitors scavenge operator. In particular, +// this ensures that the thread's monitors are scanned by a GC safepoint, +// either via Thread::oops_do() (if safepoint happens before omFlush()) or via // ObjectSynchronizer::oops_do() (if it happens after omFlush() and the thread's // monitors have been transferred to the global in-use list). void ObjectSynchronizer::omFlush(Thread * Self) { ObjectMonitor * list = Self->omFreeList; // Null-terminated SLL - Self->omFreeList = NULL; ObjectMonitor * tail = NULL; int tally = 0; if (list != NULL) { @@ -1248,14 +1230,16 @@ guarantee(!s->is_busy(), "invariant"); s->set_owner(NULL); // redundant but good hygiene } - guarantee(tail != NULL && list != NULL, "invariant"); + guarantee(tail != NULL, "invariant"); + assert(Self->omFreeCount == tally, "free-count off"); + Self->omFreeList = NULL; + Self->omFreeCount = 0; } ObjectMonitor * inUseList = Self->omInUseList; ObjectMonitor * inUseTail = NULL; int inUseTally = 0; if (inUseList != NULL) { - Self->omInUseList = NULL; ObjectMonitor *cur_om; // The thread is going away, however the omInUseList inflated // monitors may still be in-use by other threads. @@ -1265,9 +1249,10 @@ inUseTail = cur_om; inUseTally++; } + guarantee(inUseTail != NULL, "invariant"); assert(Self->omInUseCount == inUseTally, "in-use count off"); + Self->omInUseList = NULL; Self->omInUseCount = 0; - guarantee(inUseTail != NULL && inUseList != NULL, "invariant"); } Thread::muxAcquire(&gListLock, "omFlush"); @@ -1275,8 +1260,6 @@ tail->FreeNext = gFreeList; gFreeList = list; gMonitorFreeCount += tally; - assert(Self->omFreeCount == tally, "free-count off"); - Self->omFreeCount = 0; } if (inUseTail != NULL) { @@ -1300,22 +1283,19 @@ } // Fast path code shared by multiple functions -ObjectMonitor* ObjectSynchronizer::inflate_helper(oop obj) { +void ObjectSynchronizer::inflate_helper(oop obj) { markOop mark = obj->mark(); if (mark->has_monitor()) { assert(ObjectSynchronizer::verify_objmon_isinpool(mark->monitor()), "monitor is invalid"); assert(mark->monitor()->header()->is_neutral(), "monitor must record a good object header"); - return mark->monitor(); + return; } - return ObjectSynchronizer::inflate(Thread::current(), - obj, - inflate_cause_vm_internal); + inflate(Thread::current(), obj, inflate_cause_vm_internal); } ObjectMonitor* ObjectSynchronizer::inflate(Thread * Self, - oop object, - const InflateCause cause) { - + oop object, + const InflateCause cause) { // Inflate mutates the heap ... // Relaxing assertion for bug 6320749. assert(Universe::verify_in_progress() || @@ -1337,7 +1317,8 @@ // CASE: inflated if (mark->has_monitor()) { ObjectMonitor * inf = mark->monitor(); - assert(inf->header()->is_neutral(), "invariant"); + markOop dmw = inf->header(); + assert(dmw->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)dmw)); assert(oopDesc::equals((oop) inf->object(), object), "invariant"); assert(ObjectSynchronizer::verify_objmon_isinpool(inf), "monitor is invalid"); return inf; @@ -1444,8 +1425,9 @@ OM_PERFDATA_OP(Inflations, inc()); if (log_is_enabled(Debug, monitorinflation)) { if (object->is_instance()) { - ResourceMark rm; - log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", + ResourceMark rm(Self); + log_debug(monitorinflation)("inflate(has_locker): " + "object=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT ", type='%s'", p2i(object), p2i(object->mark()), object->klass()->external_name()); } @@ -1478,8 +1460,8 @@ m->_SpinDuration = ObjectMonitor::Knob_SpinLimit; // consider: keep metastats by type/class if (object->cas_set_mark(markOopDesc::encode(m), mark) != mark) { + m->set_header(NULL); m->set_object(NULL); - m->set_owner(NULL); m->Recycle(); omRelease(Self, m, true); m = NULL; @@ -1494,8 +1476,9 @@ OM_PERFDATA_OP(Inflations, inc()); if (log_is_enabled(Debug, monitorinflation)) { if (object->is_instance()) { - ResourceMark rm; - log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", + ResourceMark rm(Self); + log_debug(monitorinflation)("inflate(neutral): " + "object=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT ", type='%s'", p2i(object), p2i(object->mark()), object->klass()->external_name()); } @@ -1549,8 +1532,8 @@ if (log_is_enabled(Debug, monitorinflation)) { if (obj->is_instance()) { ResourceMark rm; - log_debug(monitorinflation)("Deflating object " INTPTR_FORMAT " , " - "mark " INTPTR_FORMAT " , type %s", + log_debug(monitorinflation)("deflate_monitor: " + "object=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT ", type='%s'", p2i(obj), p2i(obj->mark()), obj->klass()->external_name()); } @@ -1577,7 +1560,7 @@ // Walk a given monitor list, and deflate idle monitors // The given list could be a per-thread list or a global list -// Caller acquires gListLock. +// Caller acquires gListLock as needed. // // In the case of parallel processing of thread local monitor lists, // work is done by Threads::parallel_threads_do() which ensures that @@ -1621,7 +1604,7 @@ void ObjectSynchronizer::prepare_deflate_idle_monitors(DeflateMonitorCounters* counters) { counters->nInuse = 0; // currently associated with objects counters->nInCirculation = 0; // extant - counters->nScavenged = 0; // reclaimed + counters->nScavenged = 0; // reclaimed (global and per-thread) counters->perThreadTimes = 0.0; // per-thread scavenge times } @@ -1635,7 +1618,7 @@ // Prevent omFlush from changing mids in Thread dtor's during deflation // And in case the vm thread is acquiring a lock during a safepoint // See e.g. 6320749 - Thread::muxAcquire(&gListLock, "scavenge - return"); + Thread::muxAcquire(&gListLock, "deflate_idle_monitors"); // Note: the thread-local monitors lists get deflated in // a separate pass. See deflate_thread_local_monitors(). @@ -1700,7 +1683,7 @@ timer.stop(); - Thread::muxAcquire(&gListLock, "scavenge - return"); + Thread::muxAcquire(&gListLock, "deflate_thread_local_monitors"); // Adjust counters counters->nInCirculation += thread->omInUseCount; diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/synchronizer.hpp --- a/src/hotspot/share/runtime/synchronizer.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/synchronizer.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -37,7 +37,7 @@ struct DeflateMonitorCounters { int nInuse; // currently associated with objects int nInCirculation; // extant - int nScavenged; // reclaimed + int nScavenged; // reclaimed (global and per-thread) double perThreadTimes; // per-thread scavenge times }; @@ -114,7 +114,7 @@ // Inflate light weight monitor to heavy weight monitor static ObjectMonitor* inflate(Thread * Self, oop obj, const InflateCause cause); // This version is only for internal use - static ObjectMonitor* inflate_helper(oop obj); + static void inflate_helper(oop obj); static const char* inflate_cause_name(const InflateCause cause); // Returns the identity hash value for an oop diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/runtime/thread.hpp --- a/src/hotspot/share/runtime/thread.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/runtime/thread.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -647,7 +647,7 @@ // uses an atomic instruction to set the current threads parity to // "collection_parity", if it is not already. Returns "true" iff the // calling thread does the update, this indicates that the calling thread - // has claimed the thread's stack as a root groop in the current + // has claimed the thread's stack as a root group in the current // collection. bool claim_oops_do(bool is_par, int collection_parity) { if (!is_par) { @@ -2250,7 +2250,7 @@ // The "thread claim parity" provides a way for threads to be claimed // by parallel worker tasks. // - // Each thread contains a a "parity" field. A task will claim the + // Each thread contains a "parity" field. A task will claim the // thread only if its parity field is the same as the global parity, // which is updated by calling change_thread_claim_parity(). // @@ -2259,7 +2259,7 @@ // that should claim threads. // // New threads get their parity set to 0 and change_thread_claim_parity() - // never set the global parity to 0. + // never sets the global parity to 0. static int thread_claim_parity() { return _thread_claim_parity; } static void change_thread_claim_parity(); static void assert_all_threads_claimed() NOT_DEBUG_RETURN; diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/utilities/concurrentHashTable.hpp --- a/src/hotspot/share/utilities/concurrentHashTable.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/utilities/concurrentHashTable.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -403,10 +403,6 @@ bool get(Thread* thread, LOOKUP_FUNC& lookup_f, FOUND_FUNC& foundf, bool* grow_hint = NULL); - // Return a copy of an item found with LOOKUP_FUNC. - template - VALUE get_copy(Thread* thread, LOOKUP_FUNC& lookup_f, bool* grow_hint = NULL); - // Returns true true if the item was inserted, duplicates are found with // LOOKUP_FUNC. template @@ -475,10 +471,6 @@ static uintx get_hash(const VALUE& value, bool* dead) { return CONFIG::get_hash(value, dead); } - // On get_copy if no value is found then this value is returned. - static const VALUE& notfound() { - return CONFIG::notfound(); - } // Default node allocation. static void* allocate_node(size_t size, const VALUE& value); // Default node reclamation. diff -r 8041f62342f0 -r 1e4dceb0da58 src/hotspot/share/utilities/concurrentHashTable.inline.hpp --- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp Wed Jan 30 19:25:22 2019 -0500 +++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp Wed Jan 30 19:48:18 2019 -0500 @@ -1066,16 +1066,6 @@ } template -template -inline VALUE ConcurrentHashTable:: - get_copy(Thread* thread, LOOKUP_FUNC& lookup_f, bool* grow_hint) -{ - ScopedCS cs(thread, this); - VALUE* val = internal_get(thread, lookup_f, grow_hint); - return val != NULL ? *val : CONFIG::notfound(); -} - -template inline bool ConcurrentHashTable:: unsafe_insert(const VALUE& value) { bool dead_hash = false; diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/LiveStackFrame.java --- a/src/java.base/share/classes/java/lang/LiveStackFrame.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/LiveStackFrame.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,7 +166,7 @@ * @param options stack walk {@link StackWalker.Option options} * * @throws SecurityException if the security manager is present and - * it denies access to {@code RuntimePermission("liveStackFrames")}; or + * it denies access to {@code RuntimePermission("liveStackFrames")}; * or if the given {@code options} contains * {@link StackWalker.Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE} * and it denies access to {@code RuntimePermission("getStackWalkerWithClassReference")}. diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/Object.java --- a/src/java.base/share/classes/java/lang/Object.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/Object.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -430,7 +430,7 @@ * } * * @param timeoutMillis the maximum time to wait, in milliseconds - * @param nanos additional time, in nanoseconds, in the range range 0-999999 inclusive + * @param nanos additional time, in nanoseconds, in the range 0-999999 inclusive * @throws IllegalArgumentException if {@code timeoutMillis} is negative, * or if the value of {@code nanos} is out of range * @throws IllegalMonitorStateException if the current thread is not diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/String.java --- a/src/java.base/share/classes/java/lang/String.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/String.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2698,7 +2698,7 @@ *

* Otherwise, returns a substring of this string beginning with the first * code point that is not a {@link Character#isWhitespace(int) white space} - * up to to and including the last code point of this string. + * up to and including the last code point of this string. *

* This method may be used to trim * {@link Character#isWhitespace(int) white space} from diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/invoke/MethodHandle.java --- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1083,7 +1083,7 @@ * else if (makeVarargs) * return asVarargsCollector(type().lastParameterType()); * else - * return return asFixedArity(); + * return asFixedArity(); * } * @param makeVarargs true if the return method handle should have variable arity behavior * @return a method handle of the same type, with possibly adjusted variable arity behavior diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -434,7 +434,7 @@ * completely in the linker method. * As a corner case, if N==255, no appendix is possible. * In this case, the method returned must be custom-generated to - * to perform any needed type checking. + * perform any needed type checking. *

* If the JVM does not reify a method at a call site, but instead * calls {@code linkMethod}, the corresponding call represented diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/invoke/VarHandle.java --- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java Wed Jan 30 19:48:18 2019 -0500 @@ -2160,7 +2160,7 @@ * Construct a {@linkplain VarHandleDesc} given a kind, name, and declaring * class. * - * @param kind the kind of of the var handle + * @param kind the kind of the var handle * @param name the unqualified name of the field, for field var handles; otherwise ignored * @param declaringClass a {@link ClassDesc} describing the declaring class, * for field var handles @@ -2217,7 +2217,7 @@ /** * Returns a {@linkplain VarHandleDesc} corresponding to a {@link VarHandle} - * for for an array type. + * for an array type. * * @param arrayClass a {@link ClassDesc} describing the type of the array * @return the {@linkplain VarHandleDesc} diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/lang/module/Resolver.java --- a/src/java.base/share/classes/java/lang/module/Resolver.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/lang/module/Resolver.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -659,7 +659,7 @@ * Checks the readability graph to ensure that *

    *
  1. A module does not read two or more modules with the same name. - * This includes the case where a module reads another another with the + * This includes the case where a module reads another module with the * same name as itself.

  2. *
  3. Two or more modules in the configuration don't export the same * package to a module that reads both. This includes the case where a diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/security/cert/Extension.java --- a/src/java.base/share/classes/java/security/cert/Extension.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/java/security/cert/Extension.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ *

    * Each extension contains an object identifier, a criticality setting * indicating whether it is a critical or a non-critical extension, and - * and an ASN.1 DER-encoded value. Its ASN.1 definition is: + * an ASN.1 DER-encoded value. Its ASN.1 definition is: * *

      *
    diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/util/SimpleTimeZone.java
    --- a/src/java.base/share/classes/java/util/SimpleTimeZone.java	Wed Jan 30 19:25:22 2019 -0500
    +++ b/src/java.base/share/classes/java/util/SimpleTimeZone.java	Wed Jan 30 19:48:18 2019 -0500
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -310,7 +310,7 @@
          *                        See the class description for the special cases of this parameter.
          * @param endDayOfWeek    The daylight saving time ending day-of-week.
          *                        See the class description for the special cases of this parameter.
    -     * @param endTime         The daylight saving ending time in time time mode
    +     * @param endTime         The daylight saving ending time in time mode
          *                        specified by endTimeMode.
          * @param endTimeMode     The mode of the end time specified by endTime
          * @param dstSavings      The amount of time in milliseconds saved during
    diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/java/util/stream/WhileOps.java
    --- a/src/java.base/share/classes/java/util/stream/WhileOps.java	Wed Jan 30 19:25:22 2019 -0500
    +++ b/src/java.base/share/classes/java/util/stream/WhileOps.java	Wed Jan 30 19:48:18 2019 -0500
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -658,7 +658,7 @@
             // True if no splitting should be performed, if true then
             // this spliterator may be used for an underlying spliterator whose
             // covered elements have an encounter order
    -        // See use in stream take/dropWhile default default methods
    +        // See use in stream take/dropWhile default methods
             final boolean noSplitting;
             // True when operations are cancelled for all related spliterators
             // For taking, spliterators cannot split or traversed
    diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java
    --- a/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java	Wed Jan 30 19:25:22 2019 -0500
    +++ b/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java	Wed Jan 30 19:48:18 2019 -0500
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -57,7 +57,7 @@
          * {@code SubjectDomainCombiner}.
          *
          * @param subject the {@code Subject} to be associated with
    -     *          with this {@code SubjectDomainCombiner}.
    +     *          this {@code SubjectDomainCombiner}.
          */
         public SubjectDomainCombiner(Subject subject) {
             this.subject = subject;
    diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java
    --- a/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java	Wed Jan 30 19:25:22 2019 -0500
    +++ b/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java	Wed Jan 30 19:48:18 2019 -0500
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -58,7 +58,7 @@
         public static final int YES_NO_OPTION               = 0;
     
         /**
    -     * YES/NO/CANCEL confirmation confirmation option.
    +     * YES/NO/CANCEL confirmation option.
          *
          * 

    An underlying security service specifies this as the * {@code optionType} to a {@code ConfirmationCallback} @@ -68,7 +68,7 @@ public static final int YES_NO_CANCEL_OPTION = 1; /** - * OK/CANCEL confirmation confirmation option. + * OK/CANCEL confirmation option. * *

    An underlying security service specifies this as the * {@code optionType} to a {@code ConfirmationCallback} diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/jdk/internal/access/SharedSecrets.java --- a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ public static JavaUtilJarAccess javaUtilJarAccess() { if (javaUtilJarAccess == null) { - // Ensure JarFile is initialized; we know that that class + // Ensure JarFile is initialized; we know that this class // provides the shared secret unsafe.ensureClassInitialized(JarFile.class); } diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java --- a/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ private ServicesCatalog() { } /** - * Creates a ServicesCatalog that supports concurrent registration and + * Creates a ServicesCatalog that supports concurrent registration * and lookup */ public static ServicesCatalog create() { diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/jdk/internal/platform/Metrics.java --- a/src/java.base/share/classes/jdk/internal/platform/Metrics.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/jdk/internal/platform/Metrics.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -278,7 +278,7 @@ * operating system tries to satisfy a memory request for any * process in the current Isolation Group when no free memory is * readily available. Use {@link #isCpuSetMemoryPressureEnabled()} to - * to determine if this support is enabled. + * determine if this support is enabled. * * @return Memory pressure or 0 if not enabled or metric is not * available. @@ -322,7 +322,7 @@ * Returns the largest amount of physical memory, in bytes, that * have been allocated in the Isolation Group. * - * @return The largest amount of memory in bytes or or 0 if this + * @return The largest amount of memory in bytes or 0 if this * metric is not available. * */ @@ -362,7 +362,7 @@ * Returns the largest amount of kernel physical memory, in bytes, that * have been allocated in the Isolation Group. * - * @return The largest amount of memory in bytes or or 0 if this + * @return The largest amount of memory in bytes or 0 if this * metric is not available. * */ @@ -402,7 +402,7 @@ * Returns the largest amount of networking physical memory, in bytes, * that have been allocated in the Isolation Group. * - * @return The largest amount of memory in bytes or or 0 if this + * @return The largest amount of memory in bytes or 0 if this * metric is not available. * */ @@ -442,7 +442,7 @@ * Returns the largest amount of physical memory and swap space, * in bytes, that have been allocated in the Isolation Group. * - * @return The largest amount of memory in bytes or or 0 if this + * @return The largest amount of memory in bytes or 0 if this * metric is not available. * */ diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/net/www/http/HttpClient.java --- a/src/java.base/share/classes/sun/net/www/http/HttpClient.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/net/www/http/HttpClient.java Wed Jan 30 19:48:18 2019 -0500 @@ -216,7 +216,7 @@ } /* This package-only CTOR should only be used for FTP piggy-backed on HTTP - * HTTP URL's that use this won't take advantage of keep-alive. + * URL's that use this won't take advantage of keep-alive. * Additionally, this constructor may be used as a last resort when the * first HttpClient gotten through New() failed (probably b/c of a * Keep-Alive mismatch). diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/ssl/HandshakeHash.java --- a/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -246,7 +246,7 @@ try { baos.writeTo(result.baos); } catch (IOException ex) { - throw new RuntimeException("unable to to clone hash state"); + throw new RuntimeException("unable to clone hash state"); } return result; } diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java --- a/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,7 +145,7 @@ if (!chc.conContext.isNegotiated) { if (chc.activeCipherSuites.contains( CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { - // Using the the TLS_EMPTY_RENEGOTIATION_INFO_SCSV instead. + // Using the TLS_EMPTY_RENEGOTIATION_INFO_SCSV instead. return null; } diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java --- a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -266,7 +266,8 @@ // ignore: unknown or unsupported ciphersuite } - if (cipherSuite != null) { + if (cipherSuite != null && + cipherSuite != CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV) { return decompose(cipherSuite.keyExchange, cipherSuite.bulkCipher, cipherSuite.macAlg, diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/ssl/SSLTransport.java --- a/src/java.base/share/classes/sun/security/ssl/SSLTransport.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/ssl/SSLTransport.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,7 @@ * destination application data buffers. * * For SSL/TLS connections, if no source data, the network data may be - * received from the underlying underlying SSL/TLS input stream. + * received from the underlying SSL/TLS input stream. * * @param context the transportation context * @param srcs an array of {@code ByteBuffers} containing the diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java --- a/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -331,7 +331,7 @@ } /** - * Load the the KeyStore as described in the specified descriptor. + * Load the KeyStore as described in the specified descriptor. */ private static KeyStore loadKeyStore( TrustStoreDescriptor descriptor) throws Exception { diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/util/ConstraintsParameters.java --- a/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,8 +36,8 @@ /** * This class contains parameters for checking against constraints that extend * past the publicly available parameters in java.security.AlgorithmConstraints. - - * This is currently on passed between between PKIX, AlgorithmChecker, + * + * This is currently passed between PKIX, AlgorithmChecker, * and DisabledAlgorithmConstraints. */ public class ConstraintsParameters { diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.base/share/classes/sun/security/util/math/SmallValue.java --- a/src/java.base/share/classes/sun/security/util/math/SmallValue.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.base/share/classes/sun/security/util/math/SmallValue.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ /** * A "small" value that can be used with the field arithmetic library. This * interface enables optimizations based on the fact that certain values are - * known to be small, where the definition of small is specific to the the + * known to be small, where the definition of small is specific to the * arithmetic implementation. */ diff -r 8041f62342f0 -r 1e4dceb0da58 src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java --- a/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java Wed Jan 30 19:48:18 2019 -0500 @@ -468,6 +468,7 @@ if (unfurledChoice.isMouseInListArea(e)) { int newIdx = helper.getSelectedIndex(); if (newIdx >= 0) { + int currentItem = ((Choice)target).getSelectedIndex(); // Update the selected item in the target now that // the mouse selection is complete. if (newIdx != dragStartIdx) { @@ -484,7 +485,7 @@ * LeftMouseButton used */ if (e.getButton() == MouseEvent.BUTTON1 && (!firstPress || wasDragged ) && - ((Choice)target).getSelectedIndex() != newIdx) + (newIdx != currentItem)) { ((Choice)target).select(newIdx); postEvent(new ItemEvent((Choice)target, diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Wed Jan 30 19:48:18 2019 -0500 @@ -158,7 +158,7 @@ } }, - DOCLINT_FORMAT("--doclint-format", "opt.doclint.format", EXTENDED, BASIC, ONEOF, "html4", "html5"), + DOCLINT_FORMAT("--doclint-format", "opt.doclint.format", EXTENDED, BASIC, ONEOF, "html5"), // -nowarn is retained for command-line backward compatibility NOWARN("-nowarn", "opt.nowarn", STANDARD, BASIC) { diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -407,19 +407,16 @@ * * @param mems list of program elements for which the use information will be added * @param heading the section heading - * @param tableSummary the summary for the use table * @param contentTree the content tree to which the use information will be added */ - protected void addUseInfo(List mems, - Content heading, String tableSummary, Content contentTree) { + protected void addUseInfo(List mems, Content heading, Content contentTree) { if (mems == null || mems.isEmpty()) { return; } List members = mems; boolean printedUseTableHeader = false; if (members.size() > 0) { - Table useTable = new Table(configuration.htmlVersion, HtmlStyle.useSummary) - .setSummary(tableSummary) + Table useTable = new Table(HtmlStyle.useSummary) .setCaption(heading) .setRowScopeColumn(1) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -131,13 +131,13 @@ protected void buildModuleIndexFile(String title, boolean includeScript) throws DocFileIOException { String windowOverview = resources.getText(title); Content body = getBody(includeScript, getWindowTitle(windowOverview)); - Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new); + Content header = HtmlTree.HEADER(); addNavigationBarHeader(header); - Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new); + Content main = HtmlTree.MAIN(); addOverviewHeader(main); addIndex(header, main); addOverview(main); - Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new); + Content footer = HtmlTree.FOOTER(); addNavigationBarFooter(footer); body.addContent(header); body.addContent(main); @@ -160,13 +160,13 @@ boolean includeScript, ModuleElement mdle) throws DocFileIOException { String windowOverview = resources.getText(title); Content body = getBody(includeScript, getWindowTitle(windowOverview)); - Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new); + Content header = HtmlTree.HEADER(); addNavigationBarHeader(header); - Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new); + Content main = HtmlTree.MAIN(); addOverviewHeader(main); addModulePackagesIndex(header, main, mdle); addOverview(main); - Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new); + Content footer = HtmlTree.FOOTER(); addNavigationBarFooter(footer); body.addContent(header); body.addContent(main); @@ -221,7 +221,7 @@ */ protected void addIndexContents(Collection modules, String text, String tableSummary, Content header, Content main) { - HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV)); + HtmlTree htmlTree = HtmlTree.NAV(); htmlTree.setStyle(HtmlStyle.indexNav); HtmlTree ul = new HtmlTree(HtmlTag.UL); addAllClassesLink(ul); @@ -243,7 +243,7 @@ */ protected void addModulePackagesIndexContents(String text, String tableSummary, Content header, Content main, ModuleElement mdle) { - HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV)); + HtmlTree htmlTree = HtmlTree.NAV(); htmlTree.setStyle(HtmlStyle.indexNav); HtmlTree ul = new HtmlTree(HtmlTag.UL); addAllClassesLink(ul); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -116,13 +116,13 @@ protected void buildPackageIndexFile(String title, boolean includeScript) throws DocFileIOException { String windowOverview = resources.getText(title); Content body = getBody(includeScript, getWindowTitle(windowOverview)); - Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new); + Content header = HtmlTree.HEADER(); addNavigationBarHeader(header); - Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new); + Content main = HtmlTree.MAIN(); addOverviewHeader(main); addIndex(header, main); addOverview(main); - Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new); + Content footer = HtmlTree.FOOTER(); addNavigationBarFooter(footer); body.addContent(header); body.addContent(main); @@ -157,7 +157,7 @@ */ protected void addIndexContents(Content header, Content main) { if (!packages.isEmpty()) { - HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV)); + HtmlTree htmlTree = HtmlTree.NAV(); htmlTree.setStyle(HtmlStyle.indexNav); HtmlTree ul = new HtmlTree(HtmlTag.UL); addAllClassesLink(ul); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -119,18 +119,10 @@ Content headingContent = contents.getContent(heading); Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, headingContent); - HtmlTree htmlTree; - if (configuration.allowTag(HtmlTag.SECTION)) { - htmlTree = HtmlTree.SECTION(sectionHeading); - } else { - div.addContent(sectionHeading); - htmlTree = div; - } + HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading); addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null, sset, isEnums, htmlTree); - if (configuration.allowTag(HtmlTag.SECTION)) { - div.addContent(htmlTree); - } + div.addContent(htmlTree); } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -112,7 +112,7 @@ protected void buildAllClassesFile(boolean wantFrames) throws DocFileIOException { String label = resources.getText("doclet.All_Classes"); Content body = getBody(false, getWindowTitle(label)); - Content htmlTree = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new); + Content htmlTree = HtmlTree.MAIN(); Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, contents.allClassesLabel); htmlTree.addContent(heading); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -103,32 +103,20 @@ protected void buildAllClassesFile() throws DocFileIOException { String label = resources.getText("doclet.All_Classes"); HtmlTree bodyTree = getBody(true, getWindowTitle(label)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); + HtmlTree header = HtmlTree.HEADER(); + addTop(header); navBar.setUserHeader(getUserHeaderFooter(true)); - htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + header.addContent(navBar.getContent(true)); + bodyTree.addContent(header); Content allClassesContent = new ContentBuilder(); addContents(allClassesContent); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(allClassesContent); - bodyTree.addContent(mainTree); - } else { - bodyTree.addContent(allClassesContent); - } - Content tree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : bodyTree; + mainTree.addContent(allClassesContent); + bodyTree.addContent(mainTree); + Content footer = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); - tree.addContent(navBar.getContent(false)); - addBottom(tree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - bodyTree.addContent(tree); - } + footer.addContent(navBar.getContent(false)); + addBottom(footer); + bodyTree.addContent(footer); printHtmlDocument(null, true, bodyTree); } @@ -138,8 +126,7 @@ * @param content HtmlTree content to which the links will be added */ protected void addContents(Content content) { - Table table = new Table(configuration.htmlVersion, HtmlStyle.typeSummary) - .setSummary(resources.classTableSummary) + Table table = new Table(HtmlStyle.typeSummary) .setHeader(new TableHeader(contents.classLabel, contents.descriptionLabel)) .setRowScopeColumn(1) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -85,15 +85,11 @@ protected void buildAllPackagesFile() throws DocFileIOException { String label = resources.getText("doclet.All_Packages"); HtmlTree bodyTree = getBody(true, getWindowTitle(label)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); + HtmlTree header = HtmlTree.HEADER(); + addTop(header); navBar.setUserHeader(getUserHeaderFooter(true)); - htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + header.addContent(navBar.getContent(true)); + bodyTree.addContent(header); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.setStyle(HtmlStyle.allPackagesContainer); addPackages(div); @@ -101,23 +97,14 @@ Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, HtmlStyle.title, titleContent); Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(headerDiv); - mainTree.addContent(div); - bodyTree.addContent(mainTree); - } else { - bodyTree.addContent(headerDiv); - bodyTree.addContent(div); - } - Content tree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : bodyTree; + mainTree.addContent(headerDiv); + mainTree.addContent(div); + bodyTree.addContent(mainTree); + Content footer = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); - tree.addContent(navBar.getContent(false)); - addBottom(tree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - bodyTree.addContent(tree); - } + footer.addContent(navBar.getContent(false)); + addBottom(footer); + bodyTree.addContent(footer); printHtmlDocument(null, true, bodyTree); } @@ -127,8 +114,7 @@ * @param content HtmlTree content to which the links will be added */ protected void addPackages(Content content) { - Table table = new Table(configuration.htmlVersion, HtmlStyle.packagesSummary) - .setSummary(resources.packageTableSummary) + Table table = new Table(HtmlStyle.packagesSummary) .setCaption(getTableCaption(new StringContent(resources.packageSummary))) .setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -173,11 +173,7 @@ * {@inheritDoc} */ public Content getAnnotationDetails(Content annotationDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); - return htmlTree; - } - return getMemberTree(annotationDetailsTree); + return HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); } /** @@ -208,16 +204,12 @@ @Override protected Table createSummaryTable() { - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Field_Summary"), - resources.getText("doclet.fields")); Content caption = contents.getContent("doclet.Fields"); TableHeader header = new TableHeader(contents.modifierAndTypeLabel, contents.fields, contents.descriptionLabel); - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setCaption(caption) .setHeader(header) .setRowScopeColumn(1) diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -121,16 +121,6 @@ * {@inheritDoc} */ @Override - protected String getTableSummary() { - return resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Annotation_Type_Optional_Member_Summary"), - resources.getText("doclet.annotation_type_optional_members")); - } - - /** - * {@inheritDoc} - */ - @Override protected Content getCaption() { return contents.getContent("doclet.Annotation_Type_Optional_Members"); } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -178,11 +178,7 @@ * {@inheritDoc} */ public Content getAnnotationDetails(Content annotationDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); - return htmlTree; - } - return getMemberTree(annotationDetailsTree); + return HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); } /** @@ -203,18 +199,6 @@ } /** - * Get the summary for the member summary table. - * - * @return a string for the table summary - */ - // Overridden by AnnotationTypeOptionalMemberWriterImpl - protected String getTableSummary() { - return resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Annotation_Type_Required_Member_Summary"), - resources.getText("doclet.annotation_type_required_members")); - } - - /** * Get the caption for the summary table. * @return the caption */ @@ -237,8 +221,7 @@ */ @Override protected Table createSummaryTable() { - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(getTableSummary()) + return new Table(HtmlStyle.memberSummary) .setCaption(getCaption()) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -86,9 +86,7 @@ @Override public Content getHeader(String header) { HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getSimpleName(annotationType))); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType), contents.moduleLabel); @@ -96,9 +94,7 @@ navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.setStyle(HtmlStyle.header); @@ -126,11 +122,7 @@ HtmlStyle.title, headerContent); heading.addContent(getTypeParameterLinks(linkInfo)); div.addContent(heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } @@ -148,15 +140,11 @@ @Override public void addFooter(Content contentTree) { contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; + Content htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -99,14 +99,6 @@ final ConstructorWriterImpl constrSubWriter; final FieldWriterImpl fieldSubWriter; final NestedClassWriterImpl classSubWriter; - // Summary for various use tables. - final String classUseTableSummary; - final String subclassUseTableSummary; - final String subinterfaceUseTableSummary; - final String fieldUseTableSummary; - final String methodUseTableSummary; - final String constructorUseTableSummary; - final String packageUseTableSummary; private final Navigation navBar; /** @@ -164,22 +156,6 @@ constrSubWriter = new ConstructorWriterImpl(this); fieldSubWriter = new FieldWriterImpl(this); classSubWriter = new NestedClassWriterImpl(this); - - String useTableSummary = resources.getText("doclet.Use_Table_Summary"); - classUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.classes")); - subclassUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.subclasses")); - subinterfaceUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.subinterfaces")); - fieldUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.fields")); - methodUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.methods")); - constructorUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.constructors")); - packageUseTableSummary = MessageFormat.format(useTableSummary, - resources.getText("doclet.packages")); this.navBar = new Navigation(typeElement, configuration, fixedNavDiv, PageMode.USE, path); } @@ -258,21 +234,13 @@ div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getFullyQualifiedName(typeElement))); } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - body.addContent(mainTree); - } else { - body.addContent(div); - } - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; + mainTree.addContent(div); + body.addContent(mainTree); + HtmlTree footer = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.addContent(navBar.getContent(false)); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } + footer.addContent(navBar.getContent(false)); + addBottom(footer); + body.addContent(footer); printHtmlDocument(null, true, body); } @@ -302,8 +270,7 @@ "doclet.ClassUse_Packages.that.use.0", getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); - Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary) - .setSummary(packageUseTableSummary) + Table table = new Table(HtmlStyle.useSummary) .setCaption(caption) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -330,8 +297,7 @@ getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); - Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary) - .setSummary(packageUseTableSummary) + Table table = new Table(HtmlStyle.useSummary) .setCaption(caption) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -354,9 +320,7 @@ ul.setStyle(HtmlStyle.blockList); for (PackageElement pkg : pkgSet) { Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(markerAnchor) - : HtmlTree.LI(HtmlStyle.blockList, markerAnchor); + HtmlTree htmlTree = HtmlTree.SECTION(markerAnchor); Content link = contents.getContent("doclet.ClassUse_Uses.of.0.in.1", getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)), @@ -364,11 +328,7 @@ Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); htmlTree.addContent(heading); addClassUse(pkg, htmlTree); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } Content li = HtmlTree.LI(HtmlStyle.blockList, ul); contentTree.addContent(li); @@ -400,67 +360,67 @@ Content pkgLink = getPackageLink(pkg, utils.getPackageName(pkg)); classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg), contents.getContent("doclet.ClassUse_Annotation", classLink, - pkgLink), classUseTableSummary, contentTree); + pkgLink), contentTree); classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg), contents.getContent("doclet.ClassUse_TypeParameter", classLink, - pkgLink), classUseTableSummary, contentTree); + pkgLink), contentTree); classSubWriter.addUseInfo(pkgToSubclass.get(pkg), contents.getContent("doclet.ClassUse_Subclass", classLink, - pkgLink), subclassUseTableSummary, contentTree); + pkgLink), contentTree); classSubWriter.addUseInfo(pkgToSubinterface.get(pkg), contents.getContent("doclet.ClassUse_Subinterface", classLink, - pkgLink), subinterfaceUseTableSummary, contentTree); + pkgLink), contentTree); classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg), contents.getContent("doclet.ClassUse_ImplementingClass", classLink, - pkgLink), classUseTableSummary, contentTree); + pkgLink), contentTree); fieldSubWriter.addUseInfo(pkgToField.get(pkg), contents.getContent("doclet.ClassUse_Field", classLink, - pkgLink), fieldUseTableSummary, contentTree); + pkgLink), contentTree); fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg), contents.getContent("doclet.ClassUse_FieldAnnotations", classLink, - pkgLink), fieldUseTableSummary, contentTree); + pkgLink), contentTree); fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg), contents.getContent("doclet.ClassUse_FieldTypeParameter", classLink, - pkgLink), fieldUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg), contents.getContent("doclet.ClassUse_MethodAnnotations", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg), contents.getContent("doclet.ClassUse_MethodParameterAnnotations", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg), contents.getContent("doclet.ClassUse_MethodTypeParameter", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg), contents.getContent("doclet.ClassUse_MethodReturn", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg), contents.getContent("doclet.ClassUse_MethodReturnTypeParameter", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg), contents.getContent("doclet.ClassUse_MethodArgs", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg), contents.getContent("doclet.ClassUse_MethodArgsTypeParameters", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg), contents.getContent("doclet.ClassUse_MethodThrows", classLink, - pkgLink), methodUseTableSummary, contentTree); + pkgLink), contentTree); constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg), contents.getContent("doclet.ClassUse_ConstructorAnnotations", classLink, - pkgLink), constructorUseTableSummary, contentTree); + pkgLink), contentTree); constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg), contents.getContent("doclet.ClassUse_ConstructorParameterAnnotations", classLink, - pkgLink), constructorUseTableSummary, contentTree); + pkgLink), contentTree); constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg), contents.getContent("doclet.ClassUse_ConstructorArgs", classLink, - pkgLink), constructorUseTableSummary, contentTree); + pkgLink), contentTree); constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg), contents.getContent("doclet.ClassUse_ConstructorArgsTypeParameters", classLink, - pkgLink), constructorUseTableSummary, contentTree); + pkgLink), contentTree); constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg), contents.getContent("doclet.ClassUse_ConstructorThrows", classLink, - pkgLink), constructorUseTableSummary, contentTree); + pkgLink), contentTree); } /** @@ -476,9 +436,7 @@ String title = resources.getText("doclet.Window_ClassUse_Header", cltype, clname); HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), contents.moduleLabel); @@ -489,9 +447,7 @@ navBar.setNavLinkClass(classLinkContent); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); ContentBuilder headContent = new ContentBuilder(); headContent.addContent(contents.getContent("doclet.ClassUse_Title", cltype)); headContent.addContent(new HtmlTree(HtmlTag.BR)); @@ -499,11 +455,7 @@ Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, HtmlStyle.title, headContent); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } } diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -107,9 +107,7 @@ @Override public Content getHeader(String header) { HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getSimpleName(typeElement))); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), contents.moduleLabel); @@ -117,9 +115,7 @@ navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.setStyle(HtmlStyle.header); @@ -151,11 +147,7 @@ HtmlStyle.title, headerContent); heading.addContent(getTypeParameterLinks(linkInfo)); div.addContent(heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } @@ -173,15 +165,11 @@ @Override public void addFooter(Content contentTree) { contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; + Content htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -73,8 +73,6 @@ */ private TypeElement currentTypeElement; - private final String constantsTableSummary; - private final TableHeader constantsTableHeader; /** @@ -97,8 +95,6 @@ public ConstantsSummaryWriterImpl(HtmlConfiguration configuration) { super(configuration, DocPaths.CONSTANT_VALUES); this.configuration = configuration; - constantsTableSummary = resources.getText("doclet.Constants_Table_Summary", - resources.getText("doclet.Constants_Summary")); constantsTableHeader = new TableHeader( contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel); this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.CONSTANTVALUES, path); @@ -111,15 +107,11 @@ public Content getHeader() { String label = resources.getText("doclet.Constants_Summary"); HtmlTree bodyTree = getBody(true, getWindowTitle(label)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); return bodyTree; } @@ -166,16 +158,10 @@ Content headingContent = contents.contentsHeading; Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, headingContent); - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree section = HtmlTree.SECTION(heading); - section.addContent(contentListTree); - div.addContent(section); - mainTree.addContent(div); - } else { - div.addContent(heading); - div.addContent(contentListTree); - contentTree.addContent(div); - } + HtmlTree section = HtmlTree.SECTION(heading); + section.addContent(contentListTree); + div.addContent(section); + mainTree.addContent(div); } /** @@ -194,7 +180,7 @@ @Override public void addPackageName(PackageElement pkg, Content summariesTree, boolean first) { Content pkgNameContent; - if (!first && configuration.allowTag(HtmlTag.SECTION)) { + if (!first) { summariesTree.addContent(summaryTree); } if (pkg.isUnnamed()) { @@ -209,11 +195,7 @@ Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, pkgNameContent); heading.addContent(headingContent); - if (configuration.allowTag(HtmlTag.SECTION)) { - summaryTree = HtmlTree.SECTION(heading); - } else { - summariesTree.addContent(heading); - } + summaryTree = HtmlTree.SECTION(heading); } /** @@ -231,11 +213,7 @@ */ @Override public void addClassConstant(Content summariesTree, Content classConstantTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - summaryTree.addContent(classConstantTree); - } else { - summariesTree.addContent(classConstantTree); - } + summaryTree.addContent(classConstantTree); } /** @@ -260,8 +238,7 @@ } caption.addContent(classlink); - Table table = new Table(configuration.htmlVersion, HtmlStyle.constantsSummary) - .setSummary(constantsTableSummary) + Table table = new Table(HtmlStyle.constantsSummary) .setCaption(caption) .setHeader(constantsTableHeader) .setRowScopeColumn(1) @@ -327,15 +304,11 @@ */ @Override public void addConstantSummaries(Content contentTree, Content summariesTree) { - if (configuration.allowTag(HtmlTag.SECTION) && summaryTree != null) { + if (summaryTree != null) { summariesTree.addContent(summaryTree); } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(summariesTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(summariesTree); - } + mainTree.addContent(summariesTree); + contentTree.addContent(mainTree); } /** @@ -343,15 +316,11 @@ */ @Override public void addFooter(Content contentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; + Content htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -196,11 +196,7 @@ */ @Override public Content getConstructorDetails(Content constructorDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(constructorDetailsTree)); - return htmlTree; - } - return getMemberTree(constructorDetailsTree); + return HtmlTree.SECTION(getMemberTree(constructorDetailsTree)); } /** @@ -259,12 +255,7 @@ rowScopeColumn = 0; } - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Constructor_Summary"), - resources.getText("doclet.constructors")); - - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setCaption(contents.constructors) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(rowScopeColumn) diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -284,9 +284,7 @@ protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) throws DocFileIOException { HtmlTree body = getHeader(); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; + HtmlTree htmlTree = HtmlTree.MAIN(); htmlTree.addContent(getContentsList(deprapi)); String memberTableSummary; HtmlTree div = new HtmlTree(HtmlTag.DIV); @@ -303,21 +301,13 @@ getHeadingKey(kind), memberTableSummary, memberTableHeader, div); } } - if (configuration.allowTag(HtmlTag.MAIN)) { - htmlTree.addContent(div); - body.addContent(htmlTree); - } else { - body.addContent(div); - } - htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; + htmlTree.addContent(div); + body.addContent(htmlTree); + htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); printHtmlDocument(null, true, body); } @@ -380,15 +370,11 @@ public HtmlTree getHeader() { String title = resources.getText("doclet.Window_Deprecated_List"); HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); return bodyTree; } @@ -405,8 +391,7 @@ String tableSummary, TableHeader tableHeader, Content contentTree) { if (deprList.size() > 0) { Content caption = contents.getContent(headingKey); - Table table = new Table(configuration.htmlVersion, HtmlStyle.deprecatedSummary) - .setSummary(tableSummary) + Table table = new Table(HtmlStyle.deprecatedSummary) .setCaption(caption) .setHeader(tableHeader) .setColumnStyles(HtmlStyle.colDeprecatedItemName, HtmlStyle.colLast); diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -181,25 +181,19 @@ Content pkgLinkContent = docletWriter.getPackageLink(pkg, docletWriter.contents.packageLabel); navBar.setNavLinkPackage(pkgLinkContent); navBar.setUserHeader(docletWriter.getUserHeaderFooter(true)); - Content header = docletWriter.createTagIfAllowed( - jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag.HEADER, HtmlTree::HEADER, - ContentBuilder::new); + Content header = HtmlTree.HEADER(); header.addContent(navBar.getContent(true)); htmlContent.addContent(header); List fullBody = utils.getFullBody(dfElement); Content bodyContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false); docletWriter.addTagsInfo(dfElement, bodyContent); - Content main = docletWriter.createTagIfAllowed( - jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag.MAIN, HtmlTree::MAIN, - ContentBuilder::new); + Content main = HtmlTree.MAIN(); main.addContent(bodyContent); htmlContent.addContent(main); navBar.setUserFooter(docletWriter.getUserHeaderFooter(false)); - Content footer = docletWriter.createTagIfAllowed( - jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag.FOOTER, HtmlTree::FOOTER, - ContentBuilder::new); + Content footer = HtmlTree.FOOTER(); footer.addContent(navBar.getContent(false)); docletWriter.addBottom(footer); htmlContent.addContent(footer); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -165,11 +165,7 @@ */ @Override public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree)); - return htmlTree; - } - return getMemberTree(enumConstantsDetailsTree); + return HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree)); } /** @@ -204,12 +200,7 @@ */ @Override protected Table createSummaryTable() { - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Enum_Constant_Summary"), - resources.getText("doclet.enum_constants")); - - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setCaption(contents.getContent("doclet.Enum_Constants")) .setHeader(getSummaryTableHeader(typeElement)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -169,11 +169,7 @@ */ @Override public Content getFieldDetails(Content fieldDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(fieldDetailsTree)); - return htmlTree; - } - return getMemberTree(fieldDetailsTree); + return HtmlTree.SECTION(getMemberTree(fieldDetailsTree)); } /** @@ -206,15 +202,10 @@ @Override protected Table createSummaryTable() { - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Field_Summary"), - resources.getText("doclet.fields")); - List bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setCaption(contents.fields) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -106,12 +106,8 @@ body.addContent(script.asContent()); Content noScript = HtmlTree.NOSCRIPT(contents.noScriptMessage); body.addContent(noScript); - if (configuration.allowTag(HtmlTag.MAIN)) { - HtmlTree main = HtmlTree.MAIN(frame); - body.addContent(main); - } else { - body.addContent(frame); - } + HtmlTree main = HtmlTree.MAIN(frame); + body.addContent(main); if (configuration.windowtitle.length() > 0) { printFramesDocument(configuration.windowtitle, body); } else { @@ -128,9 +124,8 @@ * @throws DocFileIOException if there is an error writing the frames document */ private void printFramesDocument(String title, HtmlTree body) throws DocFileIOException { - DocType htmlDocType = DocType.forVersion(configuration.htmlVersion); Content htmlComment = contents.newPage; - Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion) + Head head = new Head(path, configuration.docletVersion) .setTimestamp(!configuration.notimestamp) .setTitle(title) .setCharset(configuration.charset) @@ -139,7 +134,7 @@ .addScript(getFramesScript()); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); - HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree); + HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree); htmlDocument.write(DocFile.createFileForOutput(configuration, path)); } diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -89,25 +89,17 @@ protected void generateHelpFile() throws DocFileIOException { String title = resources.getText("doclet.Window_Help_title"); HtmlTree body = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); addHelpFileContents(body); - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } + htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); printHtmlDocument(null, true, body); } @@ -127,11 +119,7 @@ Content intro = HtmlTree.DIV(HtmlStyle.subTitle, contents.getContent("doclet.help.intro")); div.addContent(intro); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - contentTree.addContent(div); - } + mainTree.addContent(div); HtmlTree htmlTree; HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setStyle(HtmlStyle.blockList); @@ -140,9 +128,7 @@ 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); + htmlTree = HtmlTree.SECTION(overviewHeading); String overviewKey = configuration.showModules ? "doclet.help.overview.modules.body" : "doclet.help.overview.packages.body"; @@ -152,20 +138,14 @@ Content overviewBody = contents.getContent(overviewKey, overviewLink); Content overviewPara = HtmlTree.P(overviewBody); htmlTree.addContent(overviewPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } // Module if (configuration.showModules) { Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.moduleLabel); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(moduleHead) - : HtmlTree.LI(HtmlStyle.blockList, moduleHead); + htmlTree = HtmlTree.SECTION(moduleHead); Content moduleIntro = contents.getContent("doclet.help.module.intro"); Content modulePara = HtmlTree.P(moduleIntro); htmlTree.addContent(modulePara); @@ -174,20 +154,13 @@ ulModule.addContent(HtmlTree.LI(contents.modulesLabel)); ulModule.addContent(HtmlTree.LI(contents.servicesLabel)); htmlTree.addContent(ulModule); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } // Package Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.packageLabel); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(packageHead) - : HtmlTree.LI(HtmlStyle.blockList, packageHead); + htmlTree = HtmlTree.SECTION(packageHead); Content packageIntro = contents.getContent("doclet.help.package.intro"); Content packagePara = HtmlTree.P(packageIntro); htmlTree.addContent(packagePara); @@ -199,18 +172,12 @@ 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); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); // Class/interface Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.getContent("doclet.help.class_interface.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(classHead) - : HtmlTree.LI(HtmlStyle.blockList, classHead); + htmlTree = HtmlTree.SECTION(classHead); Content classIntro = contents.getContent("doclet.help.class_interface.intro"); Content classPara = HtmlTree.P(classIntro); htmlTree.addContent(classPara); @@ -240,18 +207,12 @@ 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); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); // Annotation Types Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.annotationType); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(aHead) - : HtmlTree.LI(HtmlStyle.blockList, aHead); + htmlTree = HtmlTree.SECTION(aHead); Content aIntro = contents.getContent("doclet.help.annotation_type.intro"); Content aPara = HtmlTree.P(aIntro); htmlTree.addContent(aPara); @@ -262,17 +223,11 @@ 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); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); // Enums Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(enumHead) - : HtmlTree.LI(HtmlStyle.blockList, enumHead); + htmlTree = HtmlTree.SECTION(enumHead); Content eIntro = contents.getContent("doclet.help.enum.intro"); Content enumPara = HtmlTree.P(eIntro); htmlTree.addContent(enumPara); @@ -282,36 +237,24 @@ 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); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); // Class Use if (configuration.classuse) { Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.getContent("doclet.help.use.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(useHead) - : HtmlTree.LI(HtmlStyle.blockList, useHead); + htmlTree = HtmlTree.SECTION(useHead); 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)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } // Tree if (configuration.createtree) { Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.getContent("doclet.help.tree.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(treeHead) - : HtmlTree.LI(HtmlStyle.blockList, treeHead); + htmlTree = HtmlTree.SECTION(treeHead); Content treeIntro = contents.getContent("doclet.help.tree.intro", links.createLink(DocPaths.OVERVIEW_TREE, resources.getText("doclet.Class_Hierarchy")), @@ -322,30 +265,20 @@ 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)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } // 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); + htmlTree = HtmlTree.SECTION(dHead); Content deprBody = contents.getContent("doclet.help.deprecated.body", links.createLink(DocPaths.DEPRECATED_LIST, resources.getText("doclet.Deprecated_API"))); Content dPara = HtmlTree.P(deprBody); htmlTree.addContent(dPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } // Index @@ -360,94 +293,60 @@ } Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.getContent("doclet.help.index.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(indexHead) - : HtmlTree.LI(HtmlStyle.blockList, indexHead); + htmlTree = HtmlTree.SECTION(indexHead); 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)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); } // Frames if (configuration.frames) { Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.getContent("doclet.help.frames.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(frameHead) - : HtmlTree.LI(HtmlStyle.blockList, frameHead); + htmlTree = HtmlTree.SECTION(frameHead); Content framesBody = contents.getContent("doclet.help.frames.body"); Content framePara = HtmlTree.P(framesBody); htmlTree.addContent(framePara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, 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); + htmlTree = HtmlTree.SECTION(sHead); 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); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, 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); + htmlTree = HtmlTree.SECTION(constHead); Content constantsBody = contents.getContent("doclet.help.constants.body", links.createLink(DocPaths.CONSTANT_VALUES, resources.getText("doclet.Constants_Summary"))); Content constPara = HtmlTree.P(constantsBody); htmlTree.addContent(constPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); // Search Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.getContent("doclet.help.search.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(searchHead) - : HtmlTree.LI(HtmlStyle.blockList, searchHead); + htmlTree = HtmlTree.SECTION(searchHead); Content searchBody = contents.getContent("doclet.help.search.body"); Content searchPara = HtmlTree.P(searchBody); htmlTree.addContent(searchPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); divContent.addContent(new HtmlTree(HtmlTag.HR)); Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, contents.getContent("doclet.help.footnote")); divContent.addContent(footnote); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(divContent); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(divContent); - } + mainTree.addContent(divContent); + contentTree.addContent(mainTree); } } diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Wed Jan 30 19:48:18 2019 -0500 @@ -203,12 +203,6 @@ public boolean frames = false; /** - * This is the HTML version of the generated pages. - * The default value is determined later. - */ - public HtmlVersion htmlVersion = null; - - /** * Collected set of doclint options */ public Map doclintOpts = new LinkedHashMap<>(); @@ -303,10 +297,6 @@ return false; } - if (htmlVersion == null) { - htmlVersion = HtmlVersion.HTML5; - } - // check if helpfile exists if (!helpfile.isEmpty()) { DocFile help = DocFile.createFileForInput(this, helpfile); @@ -365,25 +355,11 @@ setCreateOverview(); setTopFile(docEnv); workArounds.initDocLint(doclintOpts.values(), tagletManager.getAllTagletNames(), - Utils.toLowerCase(htmlVersion.name())); + Utils.toLowerCase(HtmlVersion.HTML5.name())); return true; } /** - * Return true if the generated output is HTML5. - */ - public boolean isOutputHtml5() { - return htmlVersion == HtmlVersion.HTML5; - } - - /** - * Return true if the tag is allowed for this specific version of HTML. - */ - public boolean allowTag(HtmlTag htmlTag) { - return htmlTag.allowTag(this.htmlVersion); - } - - /** * Decide the page which will appear first in the right-hand frame. It will * be "overview-summary.html" if "-overview" option is used or no * "-overview" but the number of packages is more than one. It will be @@ -588,18 +564,9 @@ return true; } }, - new Option(resources, "-html4") { - @Override - public boolean process(String opt, List args) { - reporter.print(WARNING, resources.getText("doclet.HTML_4_specified", helpfile)); - htmlVersion = HtmlVersion.HTML4; - return true; - } - }, new Option(resources, "-html5") { @Override public boolean process(String opt, List args) { - htmlVersion = HtmlVersion.HTML5; return true; } }, diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -196,7 +196,7 @@ this.contents = configuration.contents; this.messages = configuration.messages; this.resources = configuration.resources; - this.links = new Links(path, configuration.htmlVersion); + this.links = new Links(path); this.utils = configuration.utils; this.path = path; this.pathToRoot = path.parent().invert(); @@ -445,9 +445,8 @@ */ public void printHtmlDocument(List metakeywords, boolean includeScript, Content extraContent, Content body) throws DocFileIOException { - DocType htmlDocType = DocType.forVersion(configuration.htmlVersion); Content htmlComment = contents.newPage; - Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion) + Head head = new Head(path, configuration.docletVersion) .setTimestamp(!configuration.notimestamp) .setTitle(winTitle) .setCharset(configuration.charset) @@ -458,7 +457,7 @@ .addContent(extraContent); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); - HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree); + HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree); htmlDocument.write(DocFile.createFileForOutput(configuration, path)); } @@ -1004,8 +1003,7 @@ } public String anchorName(Element member) { - if (member.getKind() == ElementKind.CONSTRUCTOR - && configuration.isOutputHtml5()) { + if (member.getKind() == ElementKind.CONSTRUCTOR) { return ""; } else { return utils.getSimpleName(member); @@ -2160,20 +2158,4 @@ Script getMainBodyScript() { return mainBodyScript; } - - /** - * Creates the HTML tag if the tag is supported by this specific HTML version - * otherwise return the Content instance provided by Supplier ifNotSupported. - * @param tag the HTML tag - * @param ifSupported create this instance if HTML tag is supported - * @param ifNotSupported create this instance if HTML tag is not supported - * @return - */ - protected Content createTagIfAllowed(HtmlTag tag, Supplier ifSupported, Supplier ifNotSupported) { - if (configuration.allowTag(tag)) { - return ifSupported.get(); - } else { - return ifNotSupported.get(); - } - } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -76,9 +76,8 @@ * @throws DocFileIOException if there is a problem generating the file */ private void generateIndexFile() throws DocFileIOException { - DocType htmlDocType = DocType.forVersion(configuration.htmlVersion); Content htmlComment = contents.newPage; - Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion) + Head head = new Head(path, configuration.docletVersion) .setTimestamp(true) .setStylesheets(configuration.getMainStylesheet(), Collections.emptyList()) // avoid reference to default stylesheet .addDefaultScript(false); @@ -98,9 +97,7 @@ HtmlTree metaRefresh = new HtmlTree(HtmlTag.META) .addAttr(HtmlAttr.HTTP_EQUIV, "Refresh") .addAttr(HtmlAttr.CONTENT, "0;" + targetPath); - head.addContent( - script.asContent(), - configuration.isOutputHtml5() ? HtmlTree.NOSCRIPT(metaRefresh) : metaRefresh); + head.addContent(script.asContent(), HtmlTree.NOSCRIPT(metaRefresh)); ContentBuilder bodyContent = new ContentBuilder(); bodyContent.addContent(HtmlTree.NOSCRIPT( @@ -109,15 +106,11 @@ bodyContent.addContent(HtmlTree.P(HtmlTree.A(targetPath, new StringContent(targetPath)))); Content body = new HtmlTree(HtmlTag.BODY); - if (configuration.allowTag(HtmlTag.MAIN)) { - HtmlTree main = HtmlTree.MAIN(bodyContent); - body.addContent(main); - } else { - body.addContent(bodyContent); - } + HtmlTree main = HtmlTree.MAIN(bodyContent); + body.addContent(main); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); - HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree); + HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree); htmlDocument.write(DocFile.createFileForOutput(configuration, path)); } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -212,11 +212,7 @@ */ @Override public Content getMethodDetails(Content methodDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(methodDetailsTree)); - return htmlTree; - } - return getMemberTree(methodDetailsTree); + return HtmlTree.SECTION(getMemberTree(methodDetailsTree)); } /** @@ -249,12 +245,7 @@ @Override protected Table createSummaryTable() { - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Method_Summary"), - resources.getText("doclet.methods")); - - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast) diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -98,9 +98,7 @@ String mdlName = moduleElement.getQualifiedName().toString(); Content mdlLabel = new StringContent(mdlName); HtmlTree body = mdlgen.getBody(false, mdlgen.getWindowTitle(mdlName)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; + HtmlTree htmlTree = HtmlTree.MAIN(); DocPath moduleSummary = configuration.useModuleDirectories ? DocPaths.DOT_DOT.resolve(configuration.docPaths.moduleSummary(moduleElement)) : configuration.docPaths.moduleSummary(moduleElement); @@ -111,9 +109,7 @@ div.setStyle(HtmlStyle.indexContainer); mdlgen.addClassListing(div); htmlTree.addContent(div); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); mdlgen.printHtmlDocument( configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body); } @@ -163,9 +159,7 @@ SortedSet tset = utils.filterOutPrivateClasses(list, configuration.javafx); if (!tset.isEmpty()) { boolean printedHeader = false; - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION() - : contentTree; + HtmlTree htmlTree = HtmlTree.SECTION(); HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(labelContent); for (TypeElement typeElement : tset) { @@ -191,9 +185,7 @@ ul.addContent(li); } htmlTree.addContent(ul); - if (configuration.allowTag(HtmlTag.SECTION)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -95,7 +95,7 @@ * @param main the document tree to which the modules list will be added */ protected void addIndexContents(Content header, Content main) { - HtmlTree htmltree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV)); + HtmlTree htmltree = HtmlTree.NAV(); htmltree.setStyle(HtmlStyle.indexNav); HtmlTree ul = new HtmlTree(HtmlTag.UL); addAllClassesLink(ul); @@ -121,8 +121,7 @@ String tableSummary = resources.getText("doclet.Member_Table_Summary", resources.getText("doclet.Module_Summary"), resources.getText("doclet.modules")); TableHeader header = new TableHeader(contents.moduleLabel, contents.descriptionLabel); - Table table = new Table(configuration.htmlVersion, HtmlStyle.overviewSummary) - .setSummary(tableSummary) + Table table = new Table(HtmlStyle.overviewSummary) .setHeader(header) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) .setDefaultTab(resources.getText("doclet.All_Modules")) diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -113,9 +113,7 @@ getTargetModuleLink("classFrame", moduleNameContent, mdle)); heading.addContent(Contents.SPACE); heading.addContent(contents.packagesLabel); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN(HtmlStyle.indexContainer, heading) - : HtmlTree.DIV(HtmlStyle.indexContainer, heading); + HtmlTree htmlTree = HtmlTree.MAIN(HtmlStyle.indexContainer, heading); HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(contents.packagesLabel); Set modulePackages = configuration.modulePackages.get(mdle); diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -196,9 +196,7 @@ @Override public Content getModuleHeader(String heading) { HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString())); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment); navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules)); @@ -207,9 +205,7 @@ navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees)); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.setStyle(HtmlStyle.header); Content annotationContent = new HtmlTree(HtmlTag.P); @@ -223,11 +219,7 @@ Content moduleHead = new RawHtml(heading); tHeading.addContent(moduleHead); div.addContent(tHeading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } @@ -476,15 +468,13 @@ * Get a table, with two columns. * * @param caption the table caption - * @param tableSummary the summary for the table * @param tableStyle the table style * @param tableHeader the table header * @return a content object */ - private Table getTable2(Content caption, String tableSummary, HtmlStyle tableStyle, + private Table getTable2(Content caption, HtmlStyle tableStyle, TableHeader tableHeader) { - return new Table(configuration.htmlVersion, tableStyle) - .setSummary(tableSummary) + return new Table(tableStyle) .setCaption(caption) .setHeader(tableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -501,8 +491,7 @@ */ private Table getTable3(Content caption, String tableSummary, HtmlStyle tableStyle, TableHeader tableHeader) { - return new Table(configuration.htmlVersion, tableStyle) - .setSummary(tableSummary) + return new Table(tableStyle) .setCaption(caption) .setHeader(tableHeader) .setRowScopeColumn(1) @@ -575,32 +564,21 @@ addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES, contents.navPackages, li); if (display(packages)) { - String tableSummary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Packages_Summary"), - resources.getText("doclet.packages")); - addPackageSummary(tableSummary, li); + addPackageSummary(li); } TableHeader indirectPackagesHeader = new TableHeader(contents.fromLabel, contents.packagesLabel); if (display(indirectPackages)) { String aepText = resources.getText("doclet.Indirect_Exports_Summary"); - String aepTableSummary = resources.getText("doclet.Indirect_Packages_Table_Summary", - aepText, - resources.getText("doclet.modules"), - resources.getText("doclet.packages")); - Table aepTable = getTable2(new StringContent(aepText), aepTableSummary, + Table aepTable = getTable2(new StringContent(aepText), HtmlStyle.packagesSummary, indirectPackagesHeader); addIndirectPackages(aepTable, indirectPackages); li.addContent(aepTable.toContent()); } if (display(indirectOpenPackages)) { String aopText = resources.getText("doclet.Indirect_Opens_Summary"); - String aopTableSummary = resources.getText("doclet.Indirect_Packages_Table_Summary", - aopText, - resources.getText("doclet.modules"), - resources.getText("doclet.packages")); - Table aopTable = getTable2(new StringContent(aopText), aopTableSummary, - HtmlStyle.packagesSummary, indirectPackagesHeader); + Table aopTable = getTable2(new StringContent(aopText), HtmlStyle.packagesSummary, + indirectPackagesHeader); addIndirectPackages(aopTable, indirectOpenPackages); li.addContent(aopTable.toContent()); } @@ -612,12 +590,10 @@ /** * Add the package summary for the module. * - * @param tableSummary * @param li */ - public void addPackageSummary(String tableSummary, HtmlTree li) { - Table table = new Table(configuration.htmlVersion, HtmlStyle.packagesSummary) - .setSummary(tableSummary) + public void addPackageSummary(HtmlTree li) { + Table table = new Table(HtmlStyle.packagesSummary) .setDefaultTab(resources.getText("doclet.All_Packages")) .addTab(resources.getText("doclet.Exported_Packages_Summary"), this::isExported) .addTab(resources.getText("doclet.Opened_Packages_Summary"), this::isOpened) @@ -770,10 +746,7 @@ new TableHeader(contents.typeLabel, contents.descriptionLabel); if (haveProvides) { String label = resources.getText("doclet.Provides_Summary"); - String tableSummary = resources.getText("doclet.Member_Table_Summary", - label, - resources.getText("doclet.types")); - Table table = getTable2(new StringContent(label), tableSummary, HtmlStyle.providesSummary, + Table table = getTable2(new StringContent(label), HtmlStyle.providesSummary, usesProvidesTableHeader); addProvidesList(table); if (!table.isEmpty()) { @@ -782,10 +755,7 @@ } if (haveUses){ String label = resources.getText("doclet.Uses_Summary"); - String tableSummary = resources.getText("doclet.Member_Table_Summary", - label, - resources.getText("doclet.types")); - Table table = getTable2(new StringContent(label), tableSummary, HtmlStyle.usesSummary, + Table table = getTable2(new StringContent(label), HtmlStyle.usesSummary, usesProvidesTableHeader); addUsesList(table); if (!table.isEmpty()) { @@ -897,14 +867,12 @@ @Override public void addModuleDescription(Content moduleContentTree) { if (!utils.getFullBody(mdle).isEmpty()) { - Content tree = configuration.allowTag(HtmlTag.SECTION) ? HtmlTree.SECTION() : moduleContentTree; + Content tree = HtmlTree.SECTION(); addDeprecationInfo(tree); tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION); tree.addContent(links.createAnchor(SectionName.MODULE_DESCRIPTION)); addInlineComment(mdle, tree); - if (configuration.allowTag(HtmlTag.SECTION)) { - moduleContentTree.addContent(tree); - } + moduleContentTree.addContent(tree); } } @@ -913,13 +881,9 @@ */ @Override public void addModuleTags(Content moduleContentTree) { - Content tree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION() - : moduleContentTree; + Content tree = HtmlTree.SECTION(); addTagsInfo(mdle, tree); - if (configuration.allowTag(HtmlTag.SECTION)) { - moduleContentTree.addContent(tree); - } + moduleContentTree.addContent(tree); } /** @@ -927,12 +891,8 @@ */ @Override public void addModuleContent(Content contentTree, Content moduleContentTree) { - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(moduleContentTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(moduleContentTree); - } + mainTree.addContent(moduleContentTree); + contentTree.addContent(mainTree); } /** @@ -940,15 +900,11 @@ */ @Override public void addModuleFooter(Content contentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; + Content htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -109,15 +109,10 @@ @Override protected Table createSummaryTable() { - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Nested_Class_Summary"), - resources.getText("doclet.nested_classes")); - List bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setCaption(contents.getContent("doclet.Nested_Classes")) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -101,9 +101,7 @@ String pkgName = configuration.utils.getPackageName(packageElement); HtmlTree body = packgen.getBody(false, packgen.getWindowTitle(pkgName)); Content pkgNameContent = new StringContent(pkgName); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; + HtmlTree htmlTree = HtmlTree.MAIN(); Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, packgen.getTargetPackageLink(packageElement, "classFrame", pkgNameContent)); htmlTree.addContent(heading); @@ -111,9 +109,7 @@ div.setStyle(HtmlStyle.indexContainer); packgen.addClassListing(div); htmlTree.addContent(div); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); packgen.printHtmlDocument( configuration.metakeywords.getMetaKeywords(packageElement), false, body); } @@ -168,9 +164,7 @@ SortedSet tset = utils.filterOutPrivateClasses(list, configuration.javafx); if(!tset.isEmpty()) { boolean printedHeader = false; - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION() - : contentTree; + HtmlTree htmlTree = HtmlTree.SECTION(); HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(labelContent); for (TypeElement typeElement : tset) { @@ -195,9 +189,7 @@ ul.addContent(li); } htmlTree.addContent(ul); - if (configuration.allowTag(HtmlTag.SECTION)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -102,10 +102,7 @@ = configuration.group.groupPackages(packages); if (!groupPackageMap.keySet().isEmpty()) { - String tableSummary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Package_Summary"), resources.getText("doclet.packages")); - Table table = new Table(configuration.htmlVersion, HtmlStyle.overviewSummary) - .setSummary(tableSummary) + Table table = new Table(HtmlStyle.overviewSummary) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) .setDefaultTab(resources.getText("doclet.All_Packages")) diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -98,9 +98,7 @@ */ protected void generatePackageTreeFile() throws DocFileIOException { HtmlTree body = getPackageTreeHeader(); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; + HtmlTree mainTree = HtmlTree.MAIN(); Content headContent = contents.getContent("doclet.Hierarchy_For_Package", utils.getPackageName(packageElement)); Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, @@ -109,26 +107,20 @@ if (configuration.packages.size() > 1) { addLinkToMainTree(div); } - htmlTree.addContent(div); + mainTree.addContent(div); HtmlTree divTree = new HtmlTree(HtmlTag.DIV); divTree.setStyle(HtmlStyle.contentContainer); addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree); addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree); addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true); - htmlTree.addContent(divTree); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } - HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; + mainTree.addContent(divTree); + body.addContent(mainTree); + HtmlTree footer = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); - tree.addContent(navBar.getContent(false)); - addBottom(tree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(tree); - } + footer.addContent(navBar.getContent(false)); + addBottom(footer); + body.addContent(footer); printHtmlDocument(null, true, body); } @@ -141,18 +133,14 @@ String packageName = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement); String title = packageName + " " + resources.getText("doclet.Window_Class_Hierarchy"); HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), contents.moduleLabel); navBar.setNavLinkModule(linkContent); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); return bodyTree; } diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -134,21 +134,13 @@ } else { addPackageUse(div); } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - body.addContent(mainTree); - } else { - body.addContent(div); - } - HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; + mainTree.addContent(div); + body.addContent(mainTree); + HtmlTree footer = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); - tree.addContent(navBar.getContent(false)); - addBottom(tree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(tree); - } + footer.addContent(navBar.getContent(false)); + addBottom(footer); + body.addContent(footer); printHtmlDocument(null, true, body); } @@ -176,8 +168,7 @@ Content caption = contents.getContent( "doclet.ClassUse_Packages.that.use.0", getPackageLink(packageElement, utils.getPackageName(packageElement))); - Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary) - .setSummary(packageUseTableSummary) + Table table = new Table(HtmlStyle.useSummary) .setCaption(caption) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -216,8 +207,7 @@ "doclet.ClassUse_Classes.in.0.used.by.1", getPackageLink(packageElement, utils.getPackageName(packageElement)), getPackageLink(usingPackage, utils.getPackageName(usingPackage))); - Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary) - .setSummary(tableSummary) + Table table = new Table(HtmlStyle.useSummary) .setCaption(caption) .setHeader(classTableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -247,18 +237,14 @@ String name = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement); String title = resources.getText("doclet.Window_ClassUse_Header", packageText, name); HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), contents.moduleLabel); navBar.setNavLinkModule(linkContent); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); ContentBuilder headContent = new ContentBuilder(); headContent.addContent(contents.getContent("doclet.ClassUse_Title", packageText)); headContent.addContent(new HtmlTree(HtmlTag.BR)); @@ -266,11 +252,7 @@ Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, HtmlStyle.title, headContent); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } } diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -107,18 +107,14 @@ @Override public Content getPackageHeader(String heading) { HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageElement))); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), contents.moduleLabel); navBar.setNavLinkModule(linkContent); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.setStyle(HtmlStyle.header); if (configuration.showModules) { @@ -139,11 +135,7 @@ Content packageHead = new StringContent(heading); tHeading.addContent(packageHead); div.addContent(tHeading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } @@ -196,8 +188,7 @@ @Override public void addInterfaceSummary(SortedSet interfaces, Content summaryContentTree) { TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel); - addClassesSummary(interfaces, resources.interfaceSummary, resources.interfaceTableSummary, - tableHeader, summaryContentTree); + addClassesSummary(interfaces, resources.interfaceSummary, tableHeader, summaryContentTree); } /** @@ -206,8 +197,7 @@ @Override public void addClassSummary(SortedSet classes, Content summaryContentTree) { TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel); - addClassesSummary(classes, resources.classSummary, resources.classTableSummary, - tableHeader, summaryContentTree); + addClassesSummary(classes, resources.classSummary, tableHeader, summaryContentTree); } /** @@ -216,8 +206,7 @@ @Override public void addEnumSummary(SortedSet enums, Content summaryContentTree) { TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel); - addClassesSummary(enums, resources.enumSummary, resources.enumTableSummary, - tableHeader, summaryContentTree); + addClassesSummary(enums, resources.enumSummary, tableHeader, summaryContentTree); } /** @@ -226,8 +215,7 @@ @Override public void addExceptionSummary(SortedSet exceptions, Content summaryContentTree) { TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel); - addClassesSummary(exceptions, resources.exceptionSummary, resources.exceptionTableSummary, - tableHeader, summaryContentTree); + addClassesSummary(exceptions, resources.exceptionSummary, tableHeader, summaryContentTree); } /** @@ -236,8 +224,7 @@ @Override public void addErrorSummary(SortedSet errors, Content summaryContentTree) { TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel); - addClassesSummary(errors, resources.errorSummary, resources.errorTableSummary, - tableHeader, summaryContentTree); + addClassesSummary(errors, resources.errorSummary, tableHeader, summaryContentTree); } /** @@ -246,15 +233,13 @@ @Override public void addAnnotationTypeSummary(SortedSet annoTypes, Content summaryContentTree) { TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel); - addClassesSummary(annoTypes, resources.annotationTypeSummary, resources.annotationTypeTableSummary, - tableHeader, summaryContentTree); + addClassesSummary(annoTypes, resources.annotationTypeSummary, tableHeader, summaryContentTree); } public void addClassesSummary(SortedSet classes, String label, - String tableSummary, TableHeader tableHeader, Content summaryContentTree) { + TableHeader tableHeader, Content summaryContentTree) { if(!classes.isEmpty()) { - Table table = new Table(configuration.htmlVersion, HtmlStyle.typeSummary) - .setSummary(tableSummary) + Table table = new Table(HtmlStyle.typeSummary) .setCaption(getTableCaption(new StringContent(label))) .setHeader(tableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -288,7 +273,7 @@ @Override public void addPackageDescription(Content packageContentTree) { if (!utils.getBody(packageElement).isEmpty()) { - Content tree = configuration.allowTag(HtmlTag.SECTION) ? sectionTree : packageContentTree; + Content tree = sectionTree; tree.addContent(links.createAnchor(SectionName.PACKAGE_DESCRIPTION)); addDeprecationInfo(tree); addInlineComment(packageElement, tree); @@ -300,13 +285,9 @@ */ @Override public void addPackageTags(Content packageContentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? sectionTree - : packageContentTree; + Content htmlTree = sectionTree; addTagsInfo(packageElement, htmlTree); - if (configuration.allowTag(HtmlTag.SECTION)) { - packageContentTree.addContent(sectionTree); - } + packageContentTree.addContent(sectionTree); } /** @@ -314,12 +295,8 @@ */ @Override public void addPackageContent(Content contentTree, Content packageContentTree) { - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(packageContentTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(packageContentTree); - } + mainTree.addContent(packageContentTree); + contentTree.addContent(mainTree); } /** @@ -327,15 +304,11 @@ */ @Override public void addPackageFooter(Content contentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; + Content htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } + contentTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -183,11 +183,7 @@ */ @Override public Content getPropertyDetails(Content propertyDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(propertyDetailsTree)); - return htmlTree; - } - return getMemberTree(propertyDetailsTree); + return HtmlTree.SECTION(getMemberTree(propertyDetailsTree)); } /** @@ -223,12 +219,7 @@ */ @Override protected Table createSummaryTable() { - String summary = resources.getText("doclet.Member_Table_Summary", - resources.getText("doclet.Property_Summary"), - resources.getText("doclet.properties")); - - return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) - .setSummary(summary) + return new Table(HtmlStyle.memberSummary) .setCaption(contents.properties) .setHeader(getSummaryTableHeader(typeElement)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast) diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java Wed Jan 30 19:48:18 2019 -0500 @@ -80,24 +80,16 @@ */ public Content getHeader(String header) { HtmlTree bodyTree = getBody(true, getWindowTitle(header)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); Content h1Content = new StringContent(header); Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, HtmlStyle.title, h1Content); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } + mainTree.addContent(div); return bodyTree; } @@ -118,14 +110,7 @@ * @return the package serialized form header tree */ public Content getPackageSerializedHeader() { - HtmlTree htmlTree; - if (configuration.allowTag(HtmlTag.SECTION)) { - htmlTree = HtmlTree.SECTION(); - } else { - htmlTree = new HtmlTree(HtmlTag.LI); - htmlTree.setStyle(HtmlStyle.blockList); - } - return htmlTree; + return HtmlTree.SECTION(); } /** @@ -240,12 +225,8 @@ public Content getSerializedContent(Content serializedTreeContent) { HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer, serializedTreeContent); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(divContent); - return mainTree; - } else { - return divContent; - } + mainTree.addContent(divContent); + return mainTree; } /** @@ -253,9 +234,7 @@ */ public void addPackageSerializedTree(Content serializedSummariesTree, Content packageSerializedTree) { - serializedSummariesTree.addContent((configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree) - : packageSerializedTree); + serializedSummariesTree.addContent(HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree)); } /** @@ -264,15 +243,11 @@ * @param serializedTree the serialized tree to be added */ public void addFooter(Content serializedTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : serializedTree; + Content htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - serializedTree.addContent(htmlTree); - } + serializedTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -93,15 +93,11 @@ protected void generateIndexFile() throws DocFileIOException { String title = resources.getText("doclet.Window_Single_Index"); HtmlTree body = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); HtmlTree divTree = new HtmlTree(HtmlTag.DIV); divTree.setStyle(HtmlStyle.contentContainer); elements = new TreeSet<>(indexbuilder.getIndexMap().keySet()); @@ -118,18 +114,12 @@ } } addLinksForIndexes(divTree); - body.addContent((configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN(divTree) - : divTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } + body.addContent(HtmlTree.MAIN(divTree)); + htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); createSearchIndexFiles(); printHtmlDocument(null, true, body); } diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Wed Jan 30 19:48:18 2019 -0500 @@ -195,7 +195,7 @@ } addBlankLines(pre); Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); - body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div); + body.addContent(HtmlTree.MAIN(div)); writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te))); } catch (IOException e) { String message = resources.getText("doclet.exception.read.file", fo.getName()); @@ -210,8 +210,7 @@ * @param path the path for the file. */ private void writeToFile(Content body, DocPath path) throws DocFileIOException { - DocType htmlDocType = DocType.forVersion(configuration.htmlVersion); - Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion) + Head head = new Head(path, configuration.docletVersion) // .setTimestamp(!configuration.notimestamp) // temporary: compatibility! .setTitle(resources.getText("doclet.Window_Source_title")) // .setCharset(configuration.charset) // temporary: compatibility! @@ -219,7 +218,7 @@ .setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets()); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); - HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlTree); + HtmlDocument htmlDocument = new HtmlDocument(htmlTree); messages.notice("doclet.Generating_0", path.getPath()); htmlDocument.write(DocFile.createFileForOutput(configuration, path)); } @@ -294,7 +293,7 @@ */ private void addLine(Content pre, String line, int currentLineNo) { if (line != null) { - Content anchor = HtmlTree.A(configuration.htmlVersion, + Content anchor = HtmlTree.A_ID( "line." + Integer.toString(currentLineNo), new StringContent(utils.replaceTabs(line))); pre.addContent(anchor); diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -121,15 +121,11 @@ String title = resources.getText("doclet.Window_Split_Index", unicode.toString()); HtmlTree body = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; - addTop(htmlTree); + HtmlTree header = HtmlTree.HEADER(); + addTop(header); navBar.setUserHeader(getUserHeaderFooter(true)); - htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } + header.addContent(navBar.getContent(true)); + body.addContent(header); HtmlTree divTree = new HtmlTree(HtmlTag.DIV); divTree.setStyle(HtmlStyle.contentContainer); addLinksForIndexes(divTree); @@ -142,16 +138,12 @@ configuration.tagSearchIndexMap.get(unicode), divTree); } addLinksForIndexes(divTree); - body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } + body.addContent(HtmlTree.MAIN(divTree)); + HtmlTree footer = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.addContent(navBar.getContent(false)); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } + footer.addContent(navBar.getContent(false)); + addBottom(footer); + body.addContent(footer); printHtmlDocument(null, true, body); } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -195,12 +195,8 @@ * @param classContentTree class content tree which will be added to the content tree */ public void addClassContentTree(Content contentTree, Content classContentTree) { - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(classContentTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(classContentTree); - } + mainTree.addContent(classContentTree); + contentTree.addContent(mainTree); } /** @@ -231,12 +227,8 @@ * @param memberTree the content tree representing the member */ public void addMemberTree(Content memberSummaryTree, Content memberTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree)); - memberSummaryTree.addContent(htmlTree); - } else { - memberSummaryTree.addContent(getMemberTree(memberTree)); - } + HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree)); + memberSummaryTree.addContent(htmlTree); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java Wed Jan 30 19:48:18 2019 -0500 @@ -112,9 +112,7 @@ HtmlStyle.title, headContent); Content div = HtmlTree.DIV(HtmlStyle.header, heading); addPackageTreeLinks(div); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; + HtmlTree htmlTree = HtmlTree.MAIN(); htmlTree.addContent(div); HtmlTree divTree = new HtmlTree(HtmlTag.DIV); divTree.setStyle(HtmlStyle.contentContainer); @@ -123,20 +121,12 @@ addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true); htmlTree.addContent(divTree); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } else { - htmlTree = body; - } + body.addContent(htmlTree); + htmlTree = HtmlTree.FOOTER(); navBar.setUserFooter(getUserHeaderFooter(false)); htmlTree.addContent(navBar.getContent(false)); addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } + body.addContent(htmlTree); printHtmlDocument(null, true, body); } @@ -187,15 +177,11 @@ protected HtmlTree getTreeHeader() { String title = resources.getText("doclet.Window_Class_Hierarchy"); HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; + HtmlTree htmlTree = HtmlTree.HEADER(); addTop(htmlTree); navBar.setUserHeader(getUserHeaderFooter(true)); htmlTree.addContent(navBar.getContent(true)); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } + bodyTree.addContent(htmlTree); return bodyTree; } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/DocType.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/DocType.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/DocType.java Wed Jan 30 19:48:18 2019 -0500 @@ -45,12 +45,4 @@ DocType(String text) { this.text = text; } - - public static DocType forVersion(HtmlVersion v) { - switch (v) { - case HTML4: return HTML4_TRANSITIONAL; - case HTML5: return HTML5; - default: throw new IllegalArgumentException(); - } - } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java Wed Jan 30 19:48:18 2019 -0500 @@ -51,7 +51,6 @@ * deletion without notice. */ public class Head { - private final HtmlVersion htmlVersion; private final String docletVersion; private final DocPath pathToRoot; private String title; @@ -77,11 +76,9 @@ * recording the time the file was created. * The doclet version should also be provided for recording in the file. * @param path the path for the file that will include this HEAD element - * @param htmlVersion the HTML version * @param docletVersion a string identifying the doclet version */ - public Head(DocPath path, HtmlVersion htmlVersion, String docletVersion) { - this.htmlVersion = htmlVersion; + public Head(DocPath path, String docletVersion) { this.docletVersion = docletVersion; pathToRoot = path.parent().invert(); keywords = new ArrayList<>(); @@ -245,9 +242,7 @@ if (showTimestamp) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - tree.addContent(HtmlTree.META( - (htmlVersion == HtmlVersion.HTML5) ? "dc.created" : "date", - dateFormat.format(now))); + tree.addContent(HtmlTree.META("dc.created", dateFormat.format(now))); } for (String k : keywords) { diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java Wed Jan 30 19:48:18 2019 -0500 @@ -46,29 +46,25 @@ * @author Bhavesh Patel */ public class HtmlDocument { - private final DocType docType; + private final DocType docType = DocType.HTML5; private final List docContent; /** * Constructor to construct an HTML document. * - * @param docType document type for the HTML document * @param docComment comment for the document * @param htmlTree HTML tree of the document */ - public HtmlDocument(DocType docType, Content docComment, Content htmlTree) { - this.docType = docType; + public HtmlDocument(Content docComment, Content htmlTree) { docContent = Arrays.asList(docComment, htmlTree); } /** * Constructor to construct an HTML document. * - * @param docType document type for the HTML document * @param htmlTree HTML tree of the document */ - public HtmlDocument(DocType docType, Content htmlTree) { - this.docType = docType; + public HtmlDocument(Content htmlTree) { docContent = Collections.singletonList(htmlTree); } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java Wed Jan 30 19:48:18 2019 -0500 @@ -299,24 +299,6 @@ } /** - * Generates an HTML anchor tag with an id or a name attribute and content. - * - * @param htmlVersion the version of the generated HTML - * @param attr name or id attribute for the anchor tag - * @param body content for the anchor tag - * @return an HtmlTree object - */ - public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.A); - htmltree.addAttr((htmlVersion == HtmlVersion.HTML4) - ? HtmlAttr.NAME - : HtmlAttr.ID, - nullCheck(attr)); - htmltree.addContent(nullCheck(body)); - return htmltree; - } - - /** * Generates an HTML anchor tag with id attribute and a body. * * @param id id for the anchor tag diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java Wed Jan 30 19:48:18 2019 -0500 @@ -47,7 +47,6 @@ public class Links { private final DocPath file; - private final HtmlVersion version; /** * Creates a {@code Links} object for a specific file, to be written in a specific HTML version. @@ -56,11 +55,9 @@ * to use an {@code id} or {@code name} attribute when creating anchors. * * @param file the file - * @param version the HTML version */ - public Links(DocPath file, HtmlVersion version) { + public Links(DocPath file) { this.file = file; - this.version = version; } /** @@ -107,7 +104,7 @@ * @return a content tree for the marker anchor */ public Content createAnchor(String name, Content content) { - return HtmlTree.A(version, name, (content == null ? EMPTY_COMMENT : content)); + return HtmlTree.A_ID(name, (content == null ? EMPTY_COMMENT : content)); } private static final Content EMPTY_COMMENT = new Comment(" "); @@ -319,59 +316,7 @@ * @return a valid HTML name */ public String getName(String name) { - /* The HTML 4 spec at http://www.w3.org/TR/html4/types.html#h-6.2 mentions - * that the name/id should begin with a letter followed by other valid characters. - * The HTML 5 spec (draft) is more permissive on names/ids where the only restriction - * is that it should be at least one character long and should not contain spaces. - * The spec draft is @ http://www.w3.org/html/wg/drafts/html/master/dom.html#the-id-attribute. - * - * For HTML 4, we need to check for non-characters at the beginning of the name and - * substitute it accordingly, "_" and "$" can appear at the beginning of a member name. - * The method substitutes "$" with "Z:Z:D" and will prefix "_" with "Z:Z". - */ - - if (version == HtmlVersion.HTML5) { - return name.replaceAll(" +", ""); - } - - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < name.length(); i++) { - char ch = name.charAt(i); - switch (ch) { - case '(': - case ')': - case '<': - case '>': - case ',': - sb.append('-'); - break; - case ' ': - case '[': - break; - case ']': - sb.append(":A"); - break; - // Any appearance of $ needs to be substituted with ":D" and not with hyphen - // since a field name "P$$ and a method P(), both valid member names, can end - // up as "P--". A member name beginning with $ needs to be substituted with - // "Z:Z:D". - case '$': - if (i == 0) - sb.append("Z:Z"); - sb.append(":D"); - break; - // A member name beginning with _ needs to be prefixed with "Z:Z" since valid anchor - // names can only begin with a letter. - case '_': - if (i == 0) - sb.append("Z:Z"); - sb.append(ch); - break; - default: - sb.append(ch); - } - } - return sb.toString(); + return name.replaceAll(" +", ""); } } diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java Wed Jan 30 19:48:18 2019 -0500 @@ -145,7 +145,7 @@ this.documentedPage = page; this.path = path; this.pathToRoot = path.parent().invert(); - this.links = new Links(path, configuration.htmlVersion); + this.links = new Links(path); this.topBottomNavContents = new HashMap<>(); this.rowListTitle = configuration.getResources().getText("doclet.Navigation"); this.searchLabel = contents.getContent("doclet.search"); @@ -976,9 +976,7 @@ Content contentTree = new ContentBuilder(); if (!configuration.nonavbar) { Deque queue; - Content tree = (configuration.htmlVersion == HtmlVersion.HTML5) - ? HtmlTree.NAV() - : contentTree; + Content tree = HtmlTree.NAV(); HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); if (top) { queue = topBottomNavContents.get(Position.TOP); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java Wed Jan 30 19:48:18 2019 -0500 @@ -61,9 +61,7 @@ * deletion without notice. */ public class Table { - private final HtmlVersion version; private final HtmlStyle tableStyle; - private String summary; private Content caption; private Map> tabMap; private String defaultTab; @@ -84,32 +82,15 @@ /** * Creates a builder for an HTML table. * - * @param version the version of HTML, used to determine is a {@code summary} - * attribute is needed * @param style the style class for the {@code } tag */ - public Table(HtmlVersion version, HtmlStyle style) { - this.version = version; + public Table(HtmlStyle style) { this.tableStyle = style; bodyRows = new ArrayList<>(); bodyRowMasks = new ArrayList<>(); } /** - * Sets the summary for the table. - * This is ignored if the HTML version for the table is not {@link HtmlVersion#HTML4}. - * - * @param summary the summary - * @return this object - */ - public Table setSummary(String summary) { - if (version == HtmlVersion.HTML4) { - this.summary = summary; - } - return this; - } - - /** * Sets the caption for the table. * This is ignored if the table is configured to provide tabs to select * different subsets of rows within the table. @@ -418,9 +399,6 @@ HtmlTree mainDiv = new HtmlTree(HtmlTag.DIV); mainDiv.setStyle(tableStyle); HtmlTree table = new HtmlTree(HtmlTag.TABLE); - if (summary != null) { - table.addAttr(HtmlAttr.SUMMARY, summary); - } if (tabMap == null || tabs.size() == 1) { if (tabMap == null) { table.addContent(caption); diff -r 8041f62342f0 -r 1e4dceb0da58 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 Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties Wed Jan 30 19:48:18 2019 -0500 @@ -279,11 +279,8 @@ doclet.usage.header.description=\ Include header text for each page -doclet.usage.html4.description=\ - Generate HTML 4.01 output - doclet.usage.html5.description=\ - Generate HTML 5 output + Generate HTML 5 output. This option is no longer required. doclet.usage.footer.parameters=\ @@ -449,13 +446,6 @@ of the given package. Prefix the package specifier with - to\n\ disable checks for the specified packages. -# L10N: do not localize the option names -html4 and -html5 -doclet.HTML_4_specified=\ - You have specified the HTML version as HTML 4.01 by using the -html4 option.\n\ - The default is currently HTML5 and the support for HTML 4.01 will be removed\n\ - in a future release. To suppress this warning, please ensure that any HTML constructs\n\ - in your comments are valid in HTML5, and remove the -html4 option. - # L10N: do not localize the option names --frames doclet.Frames_specified=\ You have specified to generate frames, by using the --frames option.\n\ diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java Wed Jan 30 19:48:18 2019 -0500 @@ -40,22 +40,15 @@ */ public class Resources { public final String annotationTypeSummary; - public final String annotationTypeTableSummary; public final String classSummary; - public final String classTableSummary; private final BaseConfiguration configuration; private final String commonBundleName; private final String docletBundleName; public final String enumSummary; - public final String enumTableSummary; public final String errorSummary; - public final String errorTableSummary; public final String exceptionSummary; - public final String exceptionTableSummary; public final String interfaceSummary; - public final String interfaceTableSummary; public final String packageSummary; - public final String packageTableSummary; protected ResourceBundle commonBundle; protected ResourceBundle docletBundle; @@ -77,26 +70,12 @@ this.commonBundleName = commonBundleName; this.docletBundleName = docletBundleName; this.annotationTypeSummary = getText("doclet.Annotation_Types_Summary"); - this.annotationTypeTableSummary = getText("doclet.Member_Table_Summary", - this.annotationTypeSummary, getText("doclet.annotationtypes")); this.classSummary = getText("doclet.Class_Summary"); - this.classTableSummary = getText("doclet.Member_Table_Summary", - this.classSummary, getText("doclet.classes")); this.enumSummary = getText("doclet.Enum_Summary"); - this.enumTableSummary = getText("doclet.Member_Table_Summary", - this.enumSummary, getText("doclet.enums")); this.errorSummary = getText("doclet.Error_Summary"); - this.errorTableSummary = getText("doclet.Member_Table_Summary", - this.errorSummary, getText("doclet.errors")); this.exceptionSummary = getText("doclet.Exception_Summary"); - this.exceptionTableSummary = getText("doclet.Member_Table_Summary", - this.exceptionSummary, getText("doclet.exceptions")); this.interfaceSummary = getText("doclet.Interface_Summary"); - this.interfaceTableSummary = getText("doclet.Member_Table_Summary", - this.interfaceSummary, getText("doclet.interfaces")); this.packageSummary = getText("doclet.Package_Summary"); - this.packageTableSummary = getText("doclet.Member_Table_Summary", - this.packageSummary, getText("doclet.packages")); } /** diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Wed Jan 30 19:48:18 2019 -0500 @@ -94,7 +94,6 @@ doclet.Opened_Packages_Summary=Opens doclet.Concealed_Packages_Summary=Concealed doclet.From=From -doclet.Packages_Summary=Packages doclet.Uses_Summary=Uses doclet.Provides_Summary=Provides doclet.Module_Summary=Module Summary @@ -120,7 +119,6 @@ doclet.Classes=Classes doclet.packages=packages doclet.modules=modules -doclet.types=types doclet.All_Classes=All Classes doclet.All_Superinterfaces=All Superinterfaces: doclet.All_Implemented_Interfaces=All Implemented Interfaces: @@ -179,12 +177,9 @@ doclet.dest_dir_create=Creating destination directory: "{0}" doclet.in={0} in {1} doclet.Use_Table_Summary=Use table, listing {0}, and an explanation -doclet.Constants_Table_Summary={0} table, listing constant fields, and values doclet.Member_Table_Summary={0} table, listing {1}, and an explanation -doclet.Indirect_Packages_Table_Summary={0} table, listing {1}, and {2} doclet.fields=fields doclet.Fields=Fields -doclet.properties=properties doclet.Properties=Properties doclet.constructors=constructors doclet.Constructors=Constructors @@ -197,16 +192,11 @@ doclet.Concrete_Methods=Concrete Methods doclet.Default_Methods=Default Methods doclet.Deprecated_Methods=Deprecated Methods -doclet.annotation_type_optional_members=optional elements doclet.Annotation_Type_Optional_Members=Optional Elements -doclet.annotation_type_required_members=required elements doclet.Annotation_Type_Required_Members=Required Elements doclet.enum_constants=enum constants doclet.Enum_Constants=Enum Constants -doclet.nested_classes=nested classes doclet.Nested_Classes=Nested Classes -doclet.subclasses=subclasses -doclet.subinterfaces=subinterfaces doclet.Modifier=Modifier doclet.Type=Type doclet.Modifier_and_Type=Modifier and Type diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java Wed Jan 30 19:48:18 2019 -0500 @@ -24,11 +24,8 @@ */ package jdk.tools.jlink.internal; -import java.io.File; import java.io.IOException; import java.io.PrintWriter; -import java.lang.module.Configuration; -import java.lang.module.ModuleFinder; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -48,17 +45,16 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin; -import jdk.tools.jlink.plugin.Plugin; -import jdk.tools.jlink.plugin.Plugin.Category; import jdk.tools.jlink.builder.DefaultImageBuilder; import jdk.tools.jlink.builder.ImageBuilder; -import jdk.tools.jlink.plugin.PluginException; import jdk.tools.jlink.internal.Jlink.PluginsConfiguration; +import jdk.tools.jlink.internal.plugins.DefaultCompressPlugin; +import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin; import jdk.tools.jlink.internal.plugins.PluginsResourceBundle; -import jdk.tools.jlink.internal.plugins.DefaultCompressPlugin; import jdk.tools.jlink.internal.plugins.StripDebugPlugin; -import jdk.internal.module.ModulePath; +import jdk.tools.jlink.plugin.Plugin; +import jdk.tools.jlink.plugin.Plugin.Category; +import jdk.tools.jlink.plugin.PluginException; /** * @@ -240,17 +236,7 @@ private final List pluginsOptions = new ArrayList<>(); private final List mainOptions = new ArrayList<>(); - private PluginsHelper(String pp) throws BadArgs { - - if (pp != null) { - String[] dirs = pp.split(File.pathSeparator); - List paths = new ArrayList<>(dirs.length); - for (String dir : dirs) { - paths.add(Paths.get(dir)); - } - - pluginsLayer = createPluginsLayer(paths); - } + private PluginsHelper() throws BadArgs { plugins = PluginRepository.getPlugins(pluginsLayer); @@ -544,7 +530,7 @@ // Must extract it prior to do any option analysis. // Required to interpret custom plugin options. // Unit tests can call Task multiple time in same JVM. - pluginOptions = new PluginsHelper(null); + pluginOptions = new PluginsHelper(); // process options for (int i = 0; i < args.length; i++) { @@ -741,24 +727,6 @@ return System.getProperty("java.version"); } - static ModuleLayer createPluginsLayer(List paths) { - - Path[] dirs = paths.toArray(new Path[0]); - ModuleFinder finder = ModulePath.of(Runtime.version(), true, dirs); - Configuration bootConfiguration = ModuleLayer.boot().configuration(); - try { - Configuration cf = bootConfiguration - .resolveAndBind(ModuleFinder.of(), - finder, - Collections.emptySet()); - ClassLoader scl = ClassLoader.getSystemClassLoader(); - return ModuleLayer.boot().defineModulesWithOneLoader(cf, scl); - } catch (Exception ex) { - // Malformed plugin modules (e.g.: same package in multiple modules). - throw new PluginException("Invalid modules in the plugins path: " + ex); - } - } - // Display all plugins private static boolean showsPlugin(Plugin plugin) { return (!Utils.isDisabled(plugin) && plugin.getOption() != null); diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/ja.xml --- a/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/ja.xml Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/ja.xml Wed Jan 30 19:48:18 2019 -0500 @@ -3633,6 +3633,7 @@ 大正 昭和 平成 + 元号 大化 @@ -3871,6 +3872,7 @@ T S H + N diff -r 8041f62342f0 -r 1e4dceb0da58 src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/root.xml --- a/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/root.xml Wed Jan 30 19:25:22 2019 -0500 +++ b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/root.xml Wed Jan 30 19:48:18 2019 -0500 @@ -2030,6 +2030,7 @@ Taishō Shōwa Heisei + NewEra Taika (645–650) @@ -2268,6 +2269,7 @@ T S H + N diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/gtest/runtime/test_os.cpp --- a/test/hotspot/gtest/runtime/test_os.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/gtest/runtime/test_os.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -153,6 +153,30 @@ } #endif +TEST(os, test_print_hex_dump) { + ResourceMark rm; + stringStream ss; + outputStream* out = &ss; +// outputStream* out = tty; // enable for printout + + // Test dumping unreadable memory does not fail + os::print_hex_dump(out, (address)0, (address)100, 1); + os::print_hex_dump(out, (address)0, (address)100, 2); + os::print_hex_dump(out, (address)0, (address)100, 4); + os::print_hex_dump(out, (address)0, (address)100, 8); + + // Test dumping readable memory does not fail + char arr[100]; + for (int c = 0; c < 100; c++) { + arr[c] = c; + } + address addr = (address)&arr; + os::print_hex_dump(out, addr, addr + 100, 1); + os::print_hex_dump(out, addr, addr + 100, 2); + os::print_hex_dump(out, addr, addr + 100, 4); + os::print_hex_dump(out, addr, addr + 100, 8); +} + ////////////////////////////////////////////////////////////////////////////// // Test os::vsnprintf and friends. diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/gtest/utilities/test_concurrentHashtable.cpp --- a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,10 +46,6 @@ static uintx get_hash(const uintptr_t& value, bool* dead_hash) { return (uintx)value; } - static const uintptr_t& notfound() { - static uintptr_t notfound = 0; - return notfound; - } static void* allocate_node(size_t size, const uintptr_t& value) { return ::malloc(size); } @@ -69,18 +65,6 @@ } }; -static void cht_insert(Thread* thr) { - uintptr_t val = 0x2; - SimpleTestLookup stl(val); - SimpleTestTable* cht = new SimpleTestTable(); - EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed."; - EXPECT_EQ(cht->get_copy(thr, stl), val) << "Getting an existing value failed."; - EXPECT_TRUE(cht->remove(thr, stl)) << "Removing an existing value failed."; - EXPECT_FALSE(cht->remove(thr, stl)) << "Removing an already removed item succeeded."; - EXPECT_NE(cht->get_copy(thr, stl), val) << "Getting a removed value succeeded."; - delete cht; -} - struct ValueGet { uintptr_t _return; ValueGet() : _return(0) {} @@ -93,22 +77,35 @@ } }; -static void cht_get_helper(Thread* thr, SimpleTestTable* cht, uintptr_t val) { - { - SimpleTestLookup stl(val); - ValueGet vg; - EXPECT_EQ(cht->get(thr, stl, vg), true) << "Getting an old value failed."; - EXPECT_EQ(val, vg.get_value()) << "Getting an old value failed."; - } +static uintptr_t cht_get_copy(SimpleTestTable* cht, Thread* thr, SimpleTestLookup stl) { + ValueGet vg; + cht->get(thr, stl, vg); + return vg.get_value(); +} + +static void cht_find(Thread* thr, SimpleTestTable* cht, uintptr_t val) { + SimpleTestLookup stl(val); + ValueGet vg; + EXPECT_EQ(cht->get(thr, stl, vg), true) << "Getting an old value failed."; + EXPECT_EQ(val, vg.get_value()) << "Getting an old value failed."; } -static void cht_insert_helper(Thread* thr, SimpleTestTable* cht, uintptr_t val) { - { - SimpleTestLookup stl(val); - EXPECT_EQ(cht->insert(thr, stl, val), true) << "Inserting an unique value failed."; - } +static void cht_insert_and_find(Thread* thr, SimpleTestTable* cht, uintptr_t val) { + SimpleTestLookup stl(val); + EXPECT_EQ(cht->insert(thr, stl, val), true) << "Inserting an unique value failed."; + cht_find(thr, cht, val); +} - cht_get_helper(thr, cht, val); +static void cht_insert(Thread* thr) { + uintptr_t val = 0x2; + SimpleTestLookup stl(val); + SimpleTestTable* cht = new SimpleTestTable(); + EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed."; + EXPECT_EQ(cht_get_copy(cht, thr, stl), val) << "Getting an existing value failed."; + EXPECT_TRUE(cht->remove(thr, stl)) << "Removing an existing value failed."; + EXPECT_FALSE(cht->remove(thr, stl)) << "Removing an already removed item succeeded."; + EXPECT_NE(cht_get_copy(cht, thr, stl), val) << "Getting a removed value succeeded."; + delete cht; } static void cht_get_insert(Thread* thr) { @@ -118,15 +115,15 @@ { SCOPED_TRACE("First"); - cht_insert_helper(thr, cht, val); + cht_insert_and_find(thr, cht, val); } - EXPECT_EQ(cht->get_copy(thr, stl), val) << "Get an old value failed"; + EXPECT_EQ(cht_get_copy(cht, thr, stl), val) << "Get an old value failed"; EXPECT_TRUE(cht->remove(thr, stl)) << "Removing existing value failed."; - EXPECT_NE(cht->get_copy(thr, stl), val) << "Got an already removed item."; + EXPECT_NE(cht_get_copy(cht, thr, stl), val) << "Got an already removed item."; { SCOPED_TRACE("Second"); - cht_insert_helper(thr, cht, val); + cht_insert_and_find(thr, cht, val); } delete cht; @@ -145,10 +142,10 @@ bool verify_expect_get, bool verify_expect_inserted) { SimpleTestLookup stl(val); if (verify_expect_inserted) { - cht_insert_helper(thr, cht, val); + cht_insert_and_find(thr, cht, val); } if (verify_expect_get) { - cht_get_helper(thr, cht, val); + cht_find(thr, cht, val); } } @@ -169,17 +166,17 @@ cht_getinsert_bulkdelete_insert_verified(thr, cht, val2, false, true); // val2 should be inserted cht_getinsert_bulkdelete_insert_verified(thr, cht, val3, true, false); // val3 should be present - EXPECT_EQ(cht->get_copy(thr, stl1), val1) << "Get did not find value."; - EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Get did not find value."; - EXPECT_EQ(cht->get_copy(thr, stl3), val3) << "Get did not find value."; + EXPECT_EQ(cht_get_copy(cht, thr, stl1), val1) << "Get did not find value."; + EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Get did not find value."; + EXPECT_EQ(cht_get_copy(cht, thr, stl3), val3) << "Get did not find value."; // Removes all odd values. cht->bulk_delete(thr, getinsert_bulkdelete_eval, getinsert_bulkdelete_del); - EXPECT_EQ(cht->get_copy(thr, stl1), (uintptr_t)0) << "Odd value should not exist."; + EXPECT_EQ(cht_get_copy(cht, thr, stl1), (uintptr_t)0) << "Odd value should not exist."; EXPECT_FALSE(cht->remove(thr, stl1)) << "Odd value should not exist."; - EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Even value should not have been removed."; - EXPECT_EQ(cht->get_copy(thr, stl3), (uintptr_t)0) << "Add value should not exists."; + EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Even value should not have been removed."; + EXPECT_EQ(cht_get_copy(cht, thr, stl3), (uintptr_t)0) << "Add value should not exists."; EXPECT_FALSE(cht->remove(thr, stl3)) << "Odd value should not exists."; delete cht; @@ -202,9 +199,9 @@ cht_getinsert_bulkdelete_insert_verified(thr, cht, val2, false, true); // val2 should be inserted cht_getinsert_bulkdelete_insert_verified(thr, cht, val3, true, false); // val3 should be present - EXPECT_EQ(cht->get_copy(thr, stl1), val1) << "Get did not find value."; - EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Get did not find value."; - EXPECT_EQ(cht->get_copy(thr, stl3), val3) << "Get did not find value."; + EXPECT_EQ(cht_get_copy(cht, thr, stl1), val1) << "Get did not find value."; + EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Get did not find value."; + EXPECT_EQ(cht_get_copy(cht, thr, stl3), val3) << "Get did not find value."; // Removes all odd values. SimpleTestTable::BulkDeleteTask bdt(cht); @@ -216,10 +213,10 @@ bdt.done(thr); } - EXPECT_EQ(cht->get_copy(thr, stl1), (uintptr_t)0) << "Odd value should not exist."; + EXPECT_EQ(cht_get_copy(cht, thr, stl1), (uintptr_t)0) << "Odd value should not exist."; EXPECT_FALSE(cht->remove(thr, stl1)) << "Odd value should not exist."; - EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Even value should not have been removed."; - EXPECT_EQ(cht->get_copy(thr, stl3), (uintptr_t)0) << "Add value should not exists."; + EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Even value should not have been removed."; + EXPECT_EQ(cht_get_copy(cht, thr, stl3), (uintptr_t)0) << "Add value should not exists."; EXPECT_FALSE(cht->remove(thr, stl3)) << "Odd value should not exists."; delete cht; @@ -236,7 +233,7 @@ } // We do remove here to make sure the value-handle 'unlocked' the table when leaving the scope. EXPECT_TRUE(cht->remove(thr, stl)) << "Removing a pre-existing value failed."; - EXPECT_FALSE(cht->get_copy(thr, stl) == val) << "Got a removed value."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl) == val) << "Got a removed value."; delete cht; } @@ -259,7 +256,7 @@ EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed."; EXPECT_EQ(cht->try_scan(thr, scan), true) << "Scanning an non-growing/shrinking table should work."; EXPECT_TRUE(cht->remove(thr, stl)) << "Removing a pre-existing value failed."; - EXPECT_FALSE(cht->get_copy(thr, stl) == val) << "Got a removed value."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl) == val) << "Got a removed value."; delete cht; } @@ -292,9 +289,9 @@ ChtCountScan scan_new; EXPECT_TRUE(to_cht->try_scan(thr, scan_new)) << "Scanning table should work."; EXPECT_EQ(scan_new._count, (size_t)3) << "All items should be moved"; - EXPECT_TRUE(to_cht->get_copy(thr, stl1) == val1) << "Getting an inserted value should work."; - EXPECT_TRUE(to_cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work."; - EXPECT_TRUE(to_cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(to_cht, thr, stl1) == val1) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(to_cht, thr, stl2) == val2) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(to_cht, thr, stl3) == val3) << "Getting an inserted value should work."; } static void cht_grow(Thread* thr) { @@ -308,31 +305,31 @@ EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed."; EXPECT_TRUE(cht->insert(thr, stl3, val3)) << "Insert unique value failed."; EXPECT_FALSE(cht->insert(thr, stl3, val3)) << "Insert duplicate value should have failed."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work."; - EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work."; - EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work."; EXPECT_TRUE(cht->remove(thr, stl2)) << "Removing an inserted value should work."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work."; - EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value should have failed."; - EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value should have failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work."; EXPECT_TRUE(cht->grow(thr)) << "Growing uncontended should not fail."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after grow failed."; - EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value after grow should have failed."; - EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an item after grow failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after grow failed."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value after grow should have failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an item after grow failed."; EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed."; EXPECT_TRUE(cht->remove(thr, stl3)) << "Removing an inserted value should work."; EXPECT_TRUE(cht->shrink(thr)) << "Shrinking uncontended should not fail."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after shrink failed."; - EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an item after shrink failed."; - EXPECT_FALSE(cht->get_copy(thr, stl3) == val3) << "Getting a removed value after shrink should have failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after shrink failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an item after shrink failed."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl3) == val3) << "Getting a removed value after shrink should have failed."; delete cht; } @@ -348,33 +345,33 @@ EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed."; EXPECT_TRUE(cht->insert(thr, stl3, val3)) << "Insert unique value failed."; EXPECT_FALSE(cht->insert(thr, stl3, val3)) << "Insert duplicate value should have failed."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work."; - EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work."; - EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work."; EXPECT_TRUE(cht->remove(thr, stl2)) << "Removing an inserted value should work."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work."; - EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value should have failed."; - EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value should have failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work."; SimpleTestTable::GrowTask gt(cht); EXPECT_TRUE(gt.prepare(thr)) << "Growing uncontended should not fail."; while(gt.do_task(thr)) { /* grow */ } gt.done(thr); - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after grow failed."; - EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value after grow should have failed."; - EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an item after grow failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after grow failed."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value after grow should have failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an item after grow failed."; EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed."; EXPECT_TRUE(cht->remove(thr, stl3)) << "Removing an inserted value should work."; EXPECT_TRUE(cht->shrink(thr)) << "Shrinking uncontended should not fail."; - EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after shrink failed."; - EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an item after shrink failed."; - EXPECT_FALSE(cht->get_copy(thr, stl3) == val3) << "Getting a removed value after shrink should have failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after shrink failed."; + EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an item after shrink failed."; + EXPECT_FALSE(cht_get_copy(cht, thr, stl3) == val3) << "Getting a removed value after shrink should have failed."; delete cht; } @@ -427,10 +424,6 @@ static uintx get_hash(const uintptr_t& value, bool* dead_hash) { return (uintx)(value + 18446744073709551557ul) * 18446744073709551557ul; } - static const uintptr_t& notfound() { - static uintptr_t notfound = 0; - return notfound; - } }; struct TestLookup { @@ -444,6 +437,12 @@ } }; +static uintptr_t cht_get_copy(TestTable* cht, Thread* thr, TestLookup tl) { + ValueGet vg; + cht->get(thr, tl, vg); + return vg.get_value(); +} + class CHTTestThread : public JavaTestThread { public: uintptr_t _start; @@ -530,7 +529,7 @@ } for (uintptr_t v = _start; v <= _stop; v++) { TestLookup tl(v); - EXPECT_TRUE(_cht->get_copy(this, tl) == v) << "Getting an previously inserted value unsafe failed."; + EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) << "Getting an previously inserted value unsafe failed."; } for (uintptr_t v = _start; v <= _stop; v++) { TestLookup tl(v); @@ -538,7 +537,7 @@ } for (uintptr_t v = _start; v <= _stop; v++) { TestLookup tl(v); - EXPECT_TRUE(_cht->get_copy(this, tl) == TestInterface::notfound()) << "Got a removed value."; + EXPECT_TRUE(cht_get_copy(_cht, this, tl) == 0) << "Got a removed value."; } return true; } @@ -577,7 +576,7 @@ bool test_loop() { for (uintptr_t v = 0x500; v < 0x5FF; v++ ) { TestLookup tl(v); - EXPECT_TRUE(_cht->get_copy(this, tl) == v) << "Getting an previously inserted value unsafe failed.";; + EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) << "Getting an previously inserted value unsafe failed.";; } return true; } @@ -656,7 +655,7 @@ uintptr_t tv; if (v & 0x1) { TestLookup tl(v); - tv = _cht->get_copy(this, tl); + tv = cht_get_copy(_cht, this, tl); } else { TestLookup tl(v); TestGetHandle value_handle(this, _cht); @@ -712,7 +711,7 @@ } for (uintptr_t v = _start; v <= _stop; v++) { TestLookup tl(v); - EXPECT_TRUE(_cht->get_copy(this, tl) == v) << "Getting an previously inserted value unsafe failed."; + EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) << "Getting an previously inserted value unsafe failed."; } for (uintptr_t v = _start; v <= _stop; v++) { TestLookup tl(v); @@ -723,7 +722,7 @@ } for (uintptr_t v = _start; v <= _stop; v++) { TestLookup tl(v); - EXPECT_FALSE(_cht->get_copy(this, tl) == v) << "Getting a removed value should have failed."; + EXPECT_FALSE(cht_get_copy(_cht, this, tl) == v) << "Getting a removed value should have failed."; } if (!_shrink && _cht->get_size_log2(this) == END_SIZE) { _shrink = true; @@ -794,7 +793,7 @@ bool test_loop() { for (uintptr_t v = _start; v <= (_start + _range); v++ ) { TestLookup tl(v); - EXPECT_TRUE(_cht->get_copy(this, tl) == v) << "Getting an previously inserted value unsafe failed."; + EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) << "Getting an previously inserted value unsafe failed."; } return true; } @@ -930,9 +929,9 @@ for (uintptr_t v = _start; v <= (_start + _range); v++ ) { TestLookup tl(v); if (v & 0xF) { - _cht->get_copy(this, tl); + cht_get_copy(_cht, this, tl); } else { - EXPECT_EQ(_cht->get_copy(this, tl), v) << "Item ending with 0xX0 should never be removed."; + EXPECT_EQ(cht_get_copy(_cht, this, tl), v) << "Item ending with 0xX0 should never be removed."; } } return true; @@ -1009,7 +1008,7 @@ for (uintptr_t v = 1; v < 99999; v++ ) { TestLookup tl(v); - cht->get_copy(this, tl); + cht_get_copy(cht, this, tl); } for (int i = 0; i < 4; i++) { diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/TEST.ROOT --- a/test/hotspot/jtreg/TEST.ROOT Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/TEST.ROOT Wed Jan 30 19:48:18 2019 -0500 @@ -66,7 +66,8 @@ vm.graal.enabled \ vm.compiler1.enabled \ vm.compiler2.enabled \ - docker.support + docker.support \ + test.vm.gc.nvdimm # Minimum jtreg version requiredVersion=4.2 b13 diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/TEST.groups --- a/test/hotspot/jtreg/TEST.groups Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/TEST.groups Wed Jan 30 19:48:18 2019 -0500 @@ -59,7 +59,8 @@ -:hotspot_compiler \ -:hotspot_gc \ -:hotspot_runtime \ - -:hotspot_serviceability + -:hotspot_serviceability \ + -gc/nvdimm hotspot_native_sanity = \ native_sanity @@ -197,7 +198,7 @@ gc_epsilon = \ gc/epsilon/ \ gc/CriticalNativeArgs.java \ - gc/stress/CriticalNativeStress.java + gc/stress/CriticalNativeStress.java tier1_gc_gcold = \ gc/stress/gcold/TestGCOldWithG1.java \ @@ -210,7 +211,7 @@ gc/stress/gcbasher/TestGCBasherWithCMS.java \ gc/stress/gcbasher/TestGCBasherWithSerial.java \ gc/stress/gcbasher/TestGCBasherWithParallel.java - + tier1_gc_shenandoah = \ gc/shenandoah/options/ \ gc/shenandoah/compiler/ \ diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java --- a/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java Wed Jan 30 19:48:18 2019 -0500 @@ -27,6 +27,7 @@ * @key gc * @summary Test to check allocation of Java Heap with AllocateOldGenAt option * @requires vm.gc=="null" & os.family != "aix" + * @requires test.vm.gc.nvdimm * @library /test/lib * @modules java.base/jdk.internal.misc * @run main gc.nvdimm.TestAllocateOldGenAt diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java --- a/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java Wed Jan 30 19:48:18 2019 -0500 @@ -27,6 +27,7 @@ * @key gc * @summary Test to check correct handling of non-existent directory passed to AllocateOldGenAt option * @requires vm.gc=="null" & os.family != "aix" + * @requires test.vm.gc.nvdimm * @library /test/lib * @modules java.base/jdk.internal.misc * @run main gc.nvdimm.TestAllocateOldGenAtError diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java --- a/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java Wed Jan 30 19:48:18 2019 -0500 @@ -27,6 +27,7 @@ * @key gc * @summary Test to check allocation of Java Heap with AllocateOldGenAt option. Has multiple sub-tests to cover different code paths. * @requires vm.gc=="null" & os.family != "aix" + * @requires test.vm.gc.nvdimm * @library /test/lib * @modules java.base/jdk.internal.misc * @requires vm.bits == "64" diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java --- a/test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java Wed Jan 30 19:48:18 2019 -0500 @@ -28,6 +28,7 @@ * @summary Check that humongous objects reside in nv-dimm * @library /test/lib / * @requires vm.gc=="null" & os.family != "aix" + * @requires test.vm.gc.nvdimm * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main gc.nvdimm.TestHumongousObjectsOnNvdimm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java --- a/test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java Wed Jan 30 19:48:18 2019 -0500 @@ -27,6 +27,7 @@ * @test TestOldObjectsOnNvdimm * @summary Check that objects in old generation reside in dram. * @requires vm.gc=="null" & os.family != "aix" + * @requires test.vm.gc.nvdimm * @library /test/lib * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java --- a/test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java Wed Jan 30 19:48:18 2019 -0500 @@ -27,6 +27,7 @@ * @test TestYoungObjectsOnDram * @summary Check that objects in young generation reside in dram. * @requires vm.gc=="null" & os.family != "aix" + * @requires test.vm.gc.nvdimm * @library /test/lib * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java Wed Jan 30 19:48:18 2019 -0500 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8216970 + * @summary Ensure escape analysis can handle an ldc of a dynamic + * constant whose return type is an array of boolean. + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @compile TestEscapeThroughInvokeWithCondy$A.jasm + * @compile TestEscapeThroughInvokeWithCondy.jasm + * @compile TestEscapeCondy.java + * @run main/othervm TestEscapeCondy + */ + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.compiler.InMemoryJavaCompiler; + +public class TestEscapeCondy { + public static void main(String args[]) throws Throwable { + // 1. Test escape analysis of a method that contains + // a ldc instruction of a condy whose return type is an array of boolean + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:CompileCommand=dontinline,runtime.condy.TestEscapeThroughInvokeWithCondy::create", + "runtime.condy.TestEscapeThroughInvokeWithCondy"); + OutputAnalyzer oa = new OutputAnalyzer(pb.start()); + oa.shouldContain("Test has successfully analyzed ldc bytecode within method create"); + oa.shouldHaveExitValue(0); + } +} diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeThroughInvokeWithCondy$A.jasm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeThroughInvokeWithCondy$A.jasm Wed Jan 30 19:48:18 2019 -0500 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package runtime/condy; + +super class TestEscapeThroughInvokeWithCondy$A + version 55:0 +{ + +private Field saved:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + +public Method "":"(Ljava/lang/Integer;)V" + stack 1 locals 2 +{ + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; +} + +public Method saveInto:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;Ljava/lang/Integer;)V" + stack 2 locals 3 +{ + aload_1; + aload_0; + putfield Field saved:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + return; +} + +public Method check:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;)V" + stack 3 locals 2 +{ + aload_0; + getfield Field saved:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + aload_1; + if_acmpeq L18; + new class java/lang/RuntimeException; + dup; + ldc String "TEST FAILED: Objects not equal."; + invokespecial Method java/lang/RuntimeException."":"(Ljava/lang/String;)V"; + athrow; + L18: stack_frame_type same; + return; +} + +NestHost TestEscapeThroughInvokeWithCondy; +static InnerClass A=class TestEscapeThroughInvokeWithCondy$A of class TestEscapeThroughInvokeWithCondy; + +} // end Class TestEscapeThroughInvokeWithCondy$A diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeThroughInvokeWithCondy.jasm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeThroughInvokeWithCondy.jasm Wed Jan 30 19:48:18 2019 -0500 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + * + */ + +// The below .jasm code implements the same java code as test +// compiler/escapeAnalysis/TestEscapeThrowInvoke.java with the addition +// of an ldc bytecode of a dynamic constant whose return type is an array of boolean. +// The method bsmArray is the bootstrap method for the dynamic constant. +// The ldc has been added to the method create. + +package runtime/condy; + +super public class TestEscapeThroughInvokeWithCondy + version 55:0 +{ + +private Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + +public Method "":"()V" + stack 1 locals 1 +{ + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; +} + +public static Method main:"([Ljava/lang/String;)V" + stack 4 locals 3 +{ + new class TestEscapeThroughInvokeWithCondy; + dup; + invokespecial Method "":"()V"; + astore_1; + aload_1; + new class TestEscapeThroughInvokeWithCondy$A; + dup; + bipush 42; + invokestatic Method java/lang/Integer.valueOf:"(I)Ljava/lang/Integer;"; + invokespecial Method TestEscapeThroughInvokeWithCondy$A."":"(Ljava/lang/Integer;)V"; + putfield Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + iconst_0; + istore_2; + L26: stack_frame_type append; + locals_map class TestEscapeThroughInvokeWithCondy, int; + iload_2; + ldc int 100000; + if_icmpge L42; + aload_1; + invokevirtual Method run:"()V"; + iinc 2, 1; + goto L26; + L42: stack_frame_type chop1; + getstatic Field java/lang/System.out:"Ljava/io/PrintStream;"; + ldc String "Test has successfully analyzed ldc bytecode within method create"; + invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V"; + return; +} +public static Method bsmArray:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)[Z" + stack 5 locals 6 +{ + iconst_2; + newarray boolean; + astore_3; + aload_3; + iconst_0; + iconst_1; + bastore; + aload_3; + iconst_1; + iconst_1; + bastore; + aload_3; + areturn; +} + +private Method run:"()V" + stack 2 locals 2 +{ + new class java/lang/Object; + dup; + invokespecial Method java/lang/Object."":"()V"; + pop; + aload_0; + bipush 42; + invokestatic Method java/lang/Integer.valueOf:"(I)Ljava/lang/Integer;"; + invokevirtual Method create:"(Ljava/lang/Integer;)Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + astore_1; + aload_0; + getfield Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + aload_1; + invokevirtual Method TestEscapeThroughInvokeWithCondy$A.check:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;)V"; + return; +} + +private Method create:"(Ljava/lang/Integer;)Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;" + stack 5 locals 4 +{ + ldc Dynamic REF_invokeStatic:TestEscapeThroughInvokeWithCondy.bsmArray:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)[Z":name:"[Z"; + astore_2; + aload_2; + iconst_1; + iconst_1; + bastore; + new class TestEscapeThroughInvokeWithCondy$A; + dup; + aload_1; + invokespecial Method TestEscapeThroughInvokeWithCondy$A."":"(Ljava/lang/Integer;)V"; + astore_3; + aload_3; + aload_0; + getfield Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"; + aload_1; + invokevirtual Method TestEscapeThroughInvokeWithCondy$A.saveInto:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;Ljava/lang/Integer;)V"; + aload_3; + areturn; +} + +NestMembers TestEscapeThroughInvokeWithCondy$A; +static InnerClass A=class TestEscapeThroughInvokeWithCondy$A of class TestEscapeThroughInvokeWithCondy; + +} // end Class TestEscapeThroughInvokeWithCondy diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java --- a/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,8 +37,8 @@ public class MonitorInflationTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Inflating object"); - output.shouldContain("type MonitorInflationTest$Waiter"); + output.shouldContain("inflate(has_locker):"); + output.shouldContain("type='MonitorInflationTest$Waiter'"); output.shouldContain("I've been waiting."); output.shouldHaveExitValue(0); } diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java Wed Jan 30 19:48:18 2019 -0500 @@ -263,6 +263,8 @@ "-XX:-UseCounterDecay", "-XX:-ShowMessageBoxOnError", "-XX:+UnlockDiagnosticVMOptions", + // redirect VM output to cerr so it won't collide w/ ctw output + "-XX:+DisplayVMOutputToStderr", // define phase start "-DCompileTheWorldStartAt=" + classStart, "-DCompileTheWorldStopAt=" + classStop, diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,8 +69,7 @@ } if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*) - jni_env->GetByteArrayElements(classBytes, NULL)) - != NULL)) { + jni_env->GetByteArrayElements(classBytes, NULL)) != NULL)) { nsk_jvmti_setFailStatus(); return; } @@ -97,8 +96,7 @@ return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray) - jni->GetStaticObjectField(debugeeClass, field)) - != NULL)) + jni->GetStaticObjectField(debugeeClass, field)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL)) diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,8 +63,7 @@ return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray) - jni->GetStaticObjectField(debugeeClass, field)) - != NULL)) + jni->GetStaticObjectField(debugeeClass, field)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL)) @@ -91,8 +90,7 @@ return NSK_TRUE; if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*) - jni->GetByteArrayElements(classBytes, NULL)) - != NULL)) + jni->GetByteArrayElements(classBytes, NULL)) != NULL)) return NSK_TRUE; class_def.klass = testedClass; diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,8 +69,7 @@ } if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*) - jni_env->GetByteArrayElements(classBytes, NULL)) - != NULL)) { + jni_env->GetByteArrayElements(classBytes, NULL)) != NULL)) { nsk_jvmti_setFailStatus(); return; } @@ -97,8 +96,7 @@ return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray) - jni->GetStaticObjectField(debugeeClass, field)) - != NULL)) + jni->GetStaticObjectField(debugeeClass, field)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL)) diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,8 +63,7 @@ return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray) - jni->GetStaticObjectField(debugeeClass, field)) - != NULL)) + jni->GetStaticObjectField(debugeeClass, field)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL)) @@ -91,8 +90,7 @@ return NSK_TRUE; if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*) - jni->GetByteArrayElements(classBytes, NULL)) - != NULL)) + jni->GetByteArrayElements(classBytes, NULL)) != NULL)) return NSK_TRUE; class_def.klass = testedClass; diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/hs201t001.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/hs201t001.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/hs201t001.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -190,9 +190,7 @@ return; } - if (strcmp(className, EXPECTED_CLASS_SIGN) - == 0) { - + if (strcmp(className, EXPECTED_CLASS_SIGN) == 0) { NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className); NSK_DISPLAY0(", activating breakpoint\n"); setBreakPoint(jvmti_env, jni_env, klass); diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/hs201t002.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/hs201t002.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/hs201t002.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -190,9 +190,7 @@ return; } - if (strcmp(className, EXPECTED_CLASS_SIGN) - == 0) { - + if (strcmp(className, EXPECTED_CLASS_SIGN) == 0) { NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className); NSK_DISPLAY0(", activating breakpoint\n"); setBreakPoint(jvmti_env, jni_env, klass); diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -116,8 +116,7 @@ jlocation location) { jvmtiError err; err = JVMTI_ERROR_NONE; - if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL) - == NSK_TRUE) { + if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL) == NSK_TRUE) { nsk_printf(" Enabled.. notification event .."); } err= jvmti->SetEventNotificationMode(JVMTI_DISABLE, diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -155,10 +155,8 @@ nsk_printf("#error Agent :: while setting event callbacks.\n"); return JNI_ERR; } - if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) - == NSK_TRUE) && - (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL) - == NSK_TRUE)) { + if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) && + (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL) == NSK_TRUE)) { nsk_printf(" Agent :: Notifications are enabled.\n"); } else { nsk_printf("#error Agent :: Eanableing Notifications.\n"); diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -533,7 +533,7 @@ for (idx = 1; idx <= curr_local_idx; idx++) { loc = &locDesc[idx]; if (loc->frame_id == frame_id && - loc->slot == slot) { + loc->slot == slot) { if (first_followref) { /* Do this check on the first FollowReferences call only */ FrameDesc *fr = &frameDesc[frame_id]; diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -486,20 +486,15 @@ jstring stateName; jint state; - if (!NSK_VERIFY( - env->GetJavaVM(&vm) == 0)) { + if (!NSK_VERIFY(env->GetJavaVM(&vm) == 0)) { return NULL; } - if (!NSK_VERIFY( - vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1) - == JNI_OK)) { + if (!NSK_VERIFY(vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1) == JNI_OK)) { return NULL; } - if (!NSK_VERIFY( - jvmti->GetThreadState((jthread)thread, &state) - == JVMTI_ERROR_NONE)) { + if (!NSK_VERIFY(jvmti->GetThreadState((jthread)thread, &state) == JVMTI_ERROR_NONE)) { return NULL; } diff -r 8041f62342f0 -r 1e4dceb0da58 test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.cpp --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.cpp Wed Jan 30 19:25:22 2019 -0500 +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.cpp Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,7 +166,7 @@ return NULL; } if (!NSK_JNI_VERIFY(jni, - (threadConstructor = jni->GetMethodID(klass, "", "()V")) != NULL)) { + (threadConstructor = jni->GetMethodID(klass, "", "()V")) != NULL)) { NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n"); return NULL; } @@ -199,7 +199,7 @@ return NULL; } if (!NSK_JNI_VERIFY(jni, - (threadConstructor = jni->GetMethodID(klass, "", "(Ljava/lang/String;)V")) != NULL)) { + (threadConstructor = jni->GetMethodID(klass, "", "(Ljava/lang/String;)V")) != NULL)) { NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n"); return NULL; } diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/ProblemList.txt --- a/test/jdk/ProblemList.txt Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/ProblemList.txt Wed Jan 30 19:48:18 2019 -0500 @@ -254,7 +254,6 @@ java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,linux-all java/awt/Component/CreateImage/CreateImage.java 8198334 windows-all java/awt/Component/GetScreenLocTest/GetScreenLocTest.java 4753654 generic-all -java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html 8192929 windows-all,linux-all java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html 8017454 macosx-all java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all java/awt/Frame/MiscUndecorated/RepaintTest.java 8079267 windows-all,linux-all diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/com/sun/jdi/JdbStepTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/jdk/com/sun/jdi/JdbStepTest.java Wed Jan 30 19:48:18 2019 -0500 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8163127 + * @summary Debugger classExclusionFilter does not work correctly with method references + * + * @library /test/lib + * @compile -g JdbStepTest.java + * @run main/othervm JdbStepTest + */ + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jdk.test.lib.process.OutputAnalyzer; +import lib.jdb.JdbCommand; +import lib.jdb.JdbTest; + +class JdbStepTestTarg { + + public static void actualMethod(long[] input, long min, long max) { + Map> lookup = new HashMap<>(); //@2 breakpoint, just a marker, + // not a real breakpoint + long range = max - min + 1; + for (long number : input) { + lookup.compute(number / range, (key, list) -> list != null ? list : + new ArrayList<>()).add(number); + } + } + + interface Func { + void call(long[] input, long min, long max); + } + + public static void main(String args[]) { + Func methodRef = JdbStepTestTarg::actualMethod; + methodRef.call(new long[]{1, 2, 3, 4, 5, 6}, 1, 6); //@1 breakpoint + } + +} + +public class JdbStepTest extends JdbTest { + public static void main(String argv[]) { + new JdbStepTest().run(); + } + + private JdbStepTest() { + super(DEBUGGEE_CLASS); + } + + private static final String DEBUGGEE_CLASS = JdbStepTestTarg.class.getName(); + private static final String PATTERN_TEMPLATE = "^Step completed: \"thread=main\", " + + "JdbStepTestTarg\\.actualMethod\\(\\), line=%LINE_NUMBER.*\\R" + + "%LINE_NUMBER\\s+Map> lookup = new HashMap<>\\(\\);.*\\R"; + + @Override + protected void runCases() { + + setBreakpoints(jdb, DEBUGGEE_CLASS, System.getProperty("test.src") + + "/JdbStepTest.java", 1); + + int expectedLineToStopAfterStep = parseBreakpoints(getTestSourcePath("JdbStepTest.java"), + 2).get(0); + + jdb.command(JdbCommand.run()); + jdb.command(JdbCommand.step()); + + String pattern = PATTERN_TEMPLATE.replaceAll("%LINE_NUMBER", + String.valueOf(expectedLineToStopAfterStep)); + new OutputAnalyzer(jdb.getJdbOutput()).shouldMatch(pattern); + } +} diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java Wed Jan 30 19:48:18 2019 -0500 @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8215921 + @summary Test that selecting a different item does send an ItemEvent + @key headful + @run main SelectNewItemTest +*/ + +import java.awt.Choice; +import java.awt.Robot; +import java.awt.Frame; +import java.awt.BorderLayout; +import java.awt.AWTException; +import java.awt.Point; +import java.awt.Dimension; +import java.awt.event.InputEvent; +import java.awt.event.ItemListener; +import java.awt.event.WindowListener; +import java.awt.event.ItemEvent; +import java.awt.event.WindowEvent; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class SelectNewItemTest implements ItemListener, WindowListener { + //Declare things used in the test, like buttons and labels here + private Frame frame; + private Choice theChoice; + private Robot robot; + + private CountDownLatch latch = new CountDownLatch(1); + private volatile boolean passed = false; + + private void init() + { + try { + robot = new Robot(); + robot.setAutoDelay(500); + } catch (AWTException e) { + throw new RuntimeException("Unable to create Robot. Test fails."); + } + + frame = new Frame("SelectNewItemTest"); + frame.setLayout(new BorderLayout()); + theChoice = new Choice(); + for (int i = 0; i < 10; i++) { + theChoice.add(new String("Choice Item " + i)); + } + theChoice.addItemListener(this); + frame.add(theChoice); + frame.addWindowListener(this); + + frame.setLocation(1,20); + frame.setSize(200, 50); + robot.mouseMove(10, 30); + frame.pack(); + frame.setVisible(true); + } + + public static void main(String... args) { + SelectNewItemTest test = new SelectNewItemTest(); + test.init(); + try { + test.latch.await(12000, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) {} + test.robot.waitForIdle(); + + try { + if (!test.passed) { + throw new RuntimeException("TEST FAILED."); + } + } finally { + test.frame.dispose(); + } + } + + private void run() { + try { + Thread.sleep(1000); + + Point loc = theChoice.getLocationOnScreen(); + int selectedIndex = theChoice.getSelectedIndex(); + Dimension size = theChoice.getSize(); + + robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2); + + robot.setAutoDelay(250); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.delay(1000); + + //make sure that the mouse moves to a different item, so that + //itemStateChanged is called. + robot.mouseMove(loc.x + size.width / 2, loc.y + 3 * size.height); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + if (selectedIndex == theChoice.getSelectedIndex()) + throw new RuntimeException("Test case failed - expected to select" + + " a different item than " + selectedIndex); + + selectedIndex = theChoice.getSelectedIndex(); + //now click on the same item and make sure that item event is + //not generated. + robot.delay(1000); + robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2); + + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + //Make sure that the popup menu scrolls back to show the index from + //beginning, so that the second mouse click happens on the previously + //selected item. + //For example, on windows, it automatically scrolls the list to show + //the currently selected item just below the choice, which can + //throw off the test. + if (System.getProperty("os.name").toLowerCase().startsWith("win")) { + robot.mouseWheel(-100); + } + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.delay(1000); + robot.mouseMove(loc.x + size.width / 2, loc.y + 3 * size.height); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + if (selectedIndex != theChoice.getSelectedIndex()) + throw new RuntimeException("Test failed. Expected to select the same item " + + "located at: " + selectedIndex + " but got an item selected at: " + theChoice.getSelectedIndex()); + } catch(InterruptedException e) { + throw new RuntimeException(e.getCause()); + } finally { + latch.countDown(); + } + } + + @Override public void itemStateChanged(ItemEvent e) { + if (!passed) { + System.out.println("ItemEvent received. Test passes"); + passed = true; + } else { + System.out.println("ItemEvent received for second click. Test fails"); + passed = false; + } + } + + @Override public void windowOpened(WindowEvent e) { + System.out.println("windowActivated()"); + (new Thread(this::run)).start(); + } + + @Override public void windowActivated(WindowEvent e) {} + @Override public void windowDeactivated(WindowEvent e) {} + @Override public void windowClosed(WindowEvent e) {} + @Override public void windowClosing(WindowEvent e) {} + @Override public void windowIconified(WindowEvent e) {} + @Override public void windowDeiconified(WindowEvent e) {} +} diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/java/net/httpclient/ProxyServer.java --- a/test/jdk/java/net/httpclient/ProxyServer.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/java/net/httpclient/ProxyServer.java Wed Jan 30 19:48:18 2019 -0500 @@ -25,6 +25,7 @@ import java.io.*; import java.util.*; import java.security.*; +import java.util.concurrent.CopyOnWriteArrayList; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; @@ -90,12 +91,13 @@ this.credentials = credentials; setName("ProxyListener"); setDaemon(true); - connections = new LinkedList<>(); + connections = new CopyOnWriteArrayList(); start(); } public ProxyServer(String s) { credentials = null; + connections = new CopyOnWriteArrayList(); } /** @@ -110,15 +112,16 @@ * currently open */ public void close() throws IOException { - if (debug) System.out.println("Proxy: closing"); + if (debug) System.out.println("Proxy: closing server"); done = true; listener.close(); for (Connection c : connections) { c.close(); + c.awaitCompletion(); } } - List connections; + final CopyOnWriteArrayList connections; volatile boolean done; @@ -137,17 +140,20 @@ } public void execute() { + int id = 0; try { - while(!done) { + while (!done) { Socket s = listener.accept(); + id++; + Connection c = new Connection(s, id); if (debug) - System.out.println("Client: " + s); - Connection c = new Connection(s); + System.out.println("Proxy: accepted new connection: " + s); connections.add(c); + c.init(); } } catch(Throwable e) { if (debug && !done) { - System.out.println("Fatal error: Listener: " + e); + System.out.println("Proxy: Fatal error, listener got " + e); e.printStackTrace(); } } @@ -158,21 +164,20 @@ */ class Connection { + private final int id; Socket clientSocket, serverSocket; Thread out, in; volatile InputStream clientIn, serverIn; volatile OutputStream clientOut, serverOut; - boolean forwarding = false; - final static int CR = 13; final static int LF = 10; - Connection(Socket s) throws IOException { + Connection(Socket s, int id) throws IOException { + this.id = id; this.clientSocket= s; this.clientIn = new BufferedInputStream(s.getInputStream()); this.clientOut = s.getOutputStream(); - init(); } byte[] readHeaders(InputStream is) throws IOException { @@ -218,9 +223,21 @@ private volatile boolean closing; public synchronized void close() throws IOException { closing = true; - if (debug) System.out.println("Closing connection (proxy)"); - if (serverSocket != null) serverSocket.close(); - if (clientSocket != null) clientSocket.close(); + if (debug) + System.out.println("Proxy: closing connection {" + this + "}"); + if (serverSocket != null) + serverSocket.close(); + if (clientSocket != null) + clientSocket.close(); + } + + public void awaitCompletion() { + try { + if (in != null) + in.join(); + if (out!= null) + out.join(); + } catch (InterruptedException e) { } } int findCRLF(byte[] b) { @@ -274,6 +291,9 @@ while (true) { buf = readHeaders(clientIn); if (findCRLF(buf) == -1) { + if (debug) + System.out.println("Proxy: no CRLF closing, buf contains:[" + + new String(buf, UTF_8) + "]" ); close(); return; } @@ -302,7 +322,8 @@ } } catch (Throwable e) { if (debug) { - System.out.println (e); + System.out.println("Proxy: " + e); + e.printStackTrace(); } try {close(); } catch (IOException e1) {} } @@ -352,7 +373,8 @@ } else { port = Integer.parseInt(hostport[1]); } - if (debug) System.out.printf("Server: (%s/%d)\n", hostport[0], port); + if (debug) + System.out.printf("Proxy: connecting to (%s/%d)\n", hostport[0], port); serverSocket = new Socket(hostport[0], port); serverOut = serverSocket.getOutputStream(); @@ -372,8 +394,9 @@ serverSocket.close(); clientSocket.close(); } catch (IOException e) { - if (debug) { - System.out.println (e); + if (!closing && debug) { + System.out.println("Proxy: " + e); + e.printStackTrace(); } } }); @@ -388,8 +411,8 @@ serverSocket.close(); clientSocket.close(); } catch (IOException e) { - if (debug) { - System.out.println(e); + if (!closing && debug) { + System.out.println("Proxy: " + e); e.printStackTrace(); } } @@ -409,6 +432,11 @@ clientOut.write("HTTP/1.1 200 OK\r\n\r\n".getBytes()); proxyCommon(); } + + @Override + public String toString() { + return "Proxy connection " + id + ", client sock:" + clientSocket; + } } public static void main(String[] args) throws Exception { diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/java/net/httpclient/UnknownBodyLengthTest.java --- a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java Wed Jan 30 19:48:18 2019 -0500 @@ -35,6 +35,9 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + import jdk.test.lib.net.SimpleSSLContext; /** @@ -60,6 +63,7 @@ volatile String clientURL; volatile int port; final ServerSocket ss; + final List acceptedList = new CopyOnWriteArrayList<>(); UnknownBodyLengthTest(boolean useSSL) throws Exception { ctx = new SimpleSSLContext().get(); @@ -94,9 +98,16 @@ fillBuf(BUF); try { while (!stopped) { - try (Socket s = ss.accept()) { + try { + Socket s = ss.accept(); + acceptedList.add(s); s.setTcpNoDelay(true); - s.setSoLinger(true, 1); + // if we use linger=1 we still see some + // intermittent failures caused by IOException + // "Connection reset by peer". + // The client side is expecting EOF, but gets reset instead. + // 30 is a 'magic' value that may need to be adjusted again. + s.setSoLinger(true, 30); System.out.println("Accepted: " + s.getRemoteSocketAddress()); System.out.println("Accepted: " + s); OutputStream os = s.getOutputStream(); @@ -121,11 +132,13 @@ os.write(chdr.getBytes()); os.write("\r\n".getBytes()); os.write(BUF); - if (is.available() > 0) + if (is.available() > 0) { + System.out.println("Draining input: " + s); is.read(buf); + } os.flush(); - os.close(); s.shutdownOutput(); + System.out.println("Closed output: " + s); } catch(Exception e) { if (!stopped) { System.out.println("Unexpected server exception: " + e); @@ -136,7 +149,7 @@ } catch(final Throwable t) { if (!stopped) t.printStackTrace(); } finally { - try {stopped = true; ss.close(); } catch (Exception e) {} + stop(); } } @@ -182,5 +195,8 @@ public void stop() { stopped = true; try { ss.close(); } catch (Throwable t) { } + for (Socket s : acceptedList) { + try { s.close(); } catch (Throwable t) { } + } } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java --- a/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java Wed Jan 30 19:48:18 2019 -0500 @@ -52,6 +52,7 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static java.net.http.HttpClient.newBuilder; @@ -306,4 +307,9 @@ } } } + + @BeforeMethod + public void breakBetweenTests() { + System.out.println("\n-------\n"); + } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/java/util/Calendar/JapaneseEraNameTest.java --- a/test/jdk/java/util/Calendar/JapaneseEraNameTest.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/java/util/Calendar/JapaneseEraNameTest.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8202088 8207152 + * @bug 8202088 8207152 8217609 * @summary Test the localized Japanese new era name (May 1st. 2019-) * is retrieved no matter CLDR provider contains the name or not. * @modules jdk.localedata @@ -53,8 +53,8 @@ // type, locale, name { LONG, JAPAN, "\u5143\u53f7" }, // NewEra { LONG, US, "NewEra" }, - { SHORT, JAPAN, "N" }, - { SHORT, US, "N" }, + { SHORT, JAPAN, "\u5143\u53f7" }, + { SHORT, US, "NewEra" }, }; } diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java --- a/test/jdk/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,221 +23,180 @@ /* * @test - * @bug 4750141 4895631 + * @bug 4750141 4895631 8217579 * @summary Check enabled and supported ciphersuites are correct - * @ignore JSSE supported cipher suites are changed with CR 6916074, - * need to update this test case in JDK 7 soon + * @run main CheckCipherSuites default + * @run main/othervm CheckCipherSuites limited */ import java.util.*; - +import java.security.Security; import javax.net.ssl.*; -import javax.crypto.Cipher; -import javax.crypto.spec.*; - public class CheckCipherSuites { + // List of enabled cipher suites when the "crypto.policy" security + // property is set to "unlimited" (the default value). private final static String[] ENABLED_DEFAULT = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", + "TLS_AES_128_GCM_SHA256", + "TLS_AES_256_GCM_SHA384", + "TLS_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + "TLS_RSA_WITH_AES_256_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }; - private final static String[] ENABLED_UNLIMITED = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + // List of enabled cipher suites when the "crypto.policy" security + // property is set to "limited". + private final static String[] ENABLED_LIMITED = { + "TLS_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - - }; - - // supported ciphersuites using default JCE policy jurisdiction files - // AES/256 unavailable - private final static String[] SUPPORTED_DEFAULT = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - - "SSL_RSA_WITH_NULL_MD5", - "SSL_RSA_WITH_NULL_SHA", - "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "SSL_DH_anon_WITH_RC4_128_MD5", - "TLS_DH_anon_WITH_AES_128_CBC_SHA", - "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_WITH_DES_CBC_SHA", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "TLS_KRB5_WITH_RC4_128_SHA", - "TLS_KRB5_WITH_RC4_128_MD5", - "TLS_KRB5_WITH_3DES_EDE_CBC_SHA", - "TLS_KRB5_WITH_3DES_EDE_CBC_MD5", - "TLS_KRB5_WITH_DES_CBC_SHA", - "TLS_KRB5_WITH_DES_CBC_MD5", - "TLS_KRB5_EXPORT_WITH_RC4_40_SHA", - "TLS_KRB5_EXPORT_WITH_RC4_40_MD5", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", - + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }; - // supported ciphersuites using unlimited JCE policy jurisdiction files - // AES/256 available - private final static String[] SUPPORTED_UNLIMITED = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", + // List of enabled cipher suites when the "crypto.policy" security + // property is set to "unlimited" (the default value). + private final static String[] SUPPORTED_DEFAULT = { + "TLS_AES_128_GCM_SHA256", + "TLS_AES_256_GCM_SHA384", + "TLS_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + "TLS_RSA_WITH_AES_256_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" + }; - "SSL_RSA_WITH_NULL_MD5", - "SSL_RSA_WITH_NULL_SHA", - "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "SSL_DH_anon_WITH_RC4_128_MD5", - "TLS_DH_anon_WITH_AES_128_CBC_SHA", - "TLS_DH_anon_WITH_AES_256_CBC_SHA", - "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_WITH_DES_CBC_SHA", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "TLS_KRB5_WITH_RC4_128_SHA", - "TLS_KRB5_WITH_RC4_128_MD5", - "TLS_KRB5_WITH_3DES_EDE_CBC_SHA", - "TLS_KRB5_WITH_3DES_EDE_CBC_MD5", - "TLS_KRB5_WITH_DES_CBC_SHA", - "TLS_KRB5_WITH_DES_CBC_MD5", - "TLS_KRB5_EXPORT_WITH_RC4_40_SHA", - "TLS_KRB5_EXPORT_WITH_RC4_40_MD5", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", - + // List of supported cipher suites when the "crypto.policy" security + // property is set to "limited". + private final static String[] SUPPORTED_LIMITED = { + "TLS_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }; private static void showSuites(String[] suites) { @@ -252,19 +211,21 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); + if (args.length != 1) { + throw new Exception("One arg required"); + } + String[] ENABLED; String[] SUPPORTED; - try { - Cipher c = Cipher.getInstance("AES/CBC/NoPadding"); - SecretKeySpec key = new SecretKeySpec(new byte[32], "AES"); - c.init(Cipher.ENCRYPT_MODE, key); - System.out.println("AES/256 is available"); - ENABLED = ENABLED_UNLIMITED; - SUPPORTED = SUPPORTED_UNLIMITED; - } catch (Exception e) { - System.out.println("AES/256 is NOT available (" + e + ")"); + if (args[0].equals("default")) { ENABLED = ENABLED_DEFAULT; SUPPORTED = SUPPORTED_DEFAULT; + } else if (args[0].equals("limited")) { + Security.setProperty("crypto.policy", "limited"); + ENABLED = ENABLED_LIMITED; + SUPPORTED = SUPPORTED_LIMITED; + } else { + throw new Exception("Illegal argument"); } SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault(); diff -r 8041f62342f0 -r 1e4dceb0da58 test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java --- a/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java Wed Jan 30 19:48:18 2019 -0500 @@ -61,10 +61,9 @@ new TestVMCrash(), new TestUnhandledException(), new TestRuntimeHalt(), - // exclude until JDK-8217744 is fixed - // new TestSig("TERM"), - // new TestSig("HUP"), - // new TestSig("INT") + new TestSig("TERM"), + new TestSig("HUP"), + new TestSig("INT") }; public static void main(String[] args) throws Throwable { @@ -87,7 +86,8 @@ String.valueOf(subTestIndex)); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); - System.out.println("Exit code: " + output.getExitValue()); + int exitCode = output.getExitValue(); + System.out.println("Exit code: " + exitCode); String recordingName = output.firstMatch("emergency jfr file: (.*.jfr)", 1); if (recordingName == null) { @@ -102,7 +102,7 @@ Asserts.assertEquals(filteredEvents.size(), 1); RecordedEvent event = filteredEvents.get(0); - subTests[subTestIndex].verifyEvents(event); + subTests[subTestIndex].verifyEvents(event, exitCode); } @SuppressWarnings("unused") @@ -119,7 +119,7 @@ return true; } void runTest(); - void verifyEvents(RecordedEvent event); + void verifyEvents(RecordedEvent event, int exitCode); } // Basic stack trace validation, checking that the runTest method is part of the stack @@ -139,7 +139,7 @@ } @Override - public void verifyEvents(RecordedEvent event) { + public void verifyEvents(RecordedEvent event, int exitCode) { Events.assertField(event, "reason").equal("No remaining non-daemon Java threads"); } } @@ -152,7 +152,7 @@ } @Override - public void verifyEvents(RecordedEvent event) { + public void verifyEvents(RecordedEvent event, int exitCode) { Events.assertField(event, "reason").equal("Shutdown requested from Java"); validateStackTrace(event.getStackTrace()); } @@ -167,7 +167,7 @@ } @Override - public void verifyEvents(RecordedEvent event) { + public void verifyEvents(RecordedEvent event, int exitCode) { Events.assertField(event, "reason").equal("VM Error"); validateStackTrace(event.getStackTrace()); } @@ -180,7 +180,7 @@ } @Override - public void verifyEvents(RecordedEvent event) { + public void verifyEvents(RecordedEvent event, int exitCode) { Events.assertField(event, "reason").equal("No remaining non-daemon Java threads"); } } @@ -193,7 +193,7 @@ } @Override - public void verifyEvents(RecordedEvent event) { + public void verifyEvents(RecordedEvent event, int exitCode) { Events.assertField(event, "reason").equal("Shutdown requested from Java"); validateStackTrace(event.getStackTrace()); } @@ -229,11 +229,15 @@ } catch (IOException e) { e.printStackTrace(); } - Asserts.fail("Process survived the SIG" + signalName + " signal!"); + System.out.println("Process survived the SIG" + signalName + " signal!"); } @Override - public void verifyEvents(RecordedEvent event) { + public void verifyEvents(RecordedEvent event, int exitCode) { + if (exitCode == 0) { + System.out.println("Process exited normally with exit code 0, skipping the verification"); + return; + } Events.assertField(event, "reason").equal("Shutdown requested from Java"); Events.assertEventThread(event); Asserts.assertEquals(event.getThread().getJavaName(), "SIG" + signalName + " handler"); diff -r 8041f62342f0 -r 1e4dceb0da58 test/jtreg-ext/requires/VMProps.java --- a/test/jtreg-ext/requires/VMProps.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/jtreg-ext/requires/VMProps.java Wed Jan 30 19:48:18 2019 -0500 @@ -97,6 +97,7 @@ map.put("vm.compiler2.enabled", isCompiler2Enabled()); map.put("docker.support", dockerSupport()); map.put("release.implementor", implementor()); + map.put("test.vm.gc.nvdimm", isNvdimmTestEnabled()); vmGC(map); // vm.gc.X = true/false vmOptFinalFlags(map); @@ -469,6 +470,15 @@ return null; } + private String isNvdimmTestEnabled() { + String isEnbled = System.getenv("TEST_VM_GC_NVDIMM"); + if (isEnbled != null && isEnbled.toLowerCase().equals("true")) { + return "true"; + } + return "false"; + } + + /** * Dumps the map to the file if the file name is given as the property. diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java --- a/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,22 +63,4 @@ + "\n" + ""); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-html4", - "-sourcepath", testSrc, - "p1", "p2"); - checkExit(Exit.OK); - - // Testing only for the presence of - checkOutput("p1/C1.html", true, - "\n" - + "\n" - + "", - "\n" - + "\n" - + ""); - } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java --- a/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,17 +55,6 @@ checkSummary(false); } - @Test - public void testAccessSummary_html4() { - javadoc("-d", "out-html4", - "-html4", - "--frames", - "-sourcepath", testSrc, - "p1", "p2"); - checkExit(Exit.OK); - checkSummary(true); - } - void checkSummary(boolean found) { checkOutput("overview-summary.html", found, "summary=\"Package Summary table, listing packages, and an explanation\""); diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java --- a/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,36 +78,6 @@ checkMeta("dc.created", false); } - @Test - public void testStandard_html4() { - javadoc("-d", "out-1-html4", - "-html4", - "-sourcepath", testSrc, - "-keywords", - "--frames", - "-doctitle", "Sample Packages", - "p1", "p2"); - - checkExit(Exit.OK); - - checkMeta("date", true); - } - - @Test - public void testNoTimestamp_html4() { - javadoc("-d", "out-2-html4", - "-html4", - "-sourcepath", testSrc, - "-notimestamp", - "--frames", - "-doctitle", "Sample Packages", - "p1", "p2"); - checkExit(Exit.OK); - - // No keywords when -keywords is not used. - checkMeta("date", false); - } - void checkMeta(String metaNameDate, boolean found) { checkOutput("p1/C1.html", found, "", diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java --- a/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,24 +67,6 @@ checkValidHTML(HTML5); } - @Test - public void test_html4() { - // Test for all cases except the split index page - javadoc("-d", "out-html4", - "-html4", - "-doctitle", "Document Title", - "-windowtitle", "Window Title", - "-use", - "--frames", - "-overview", testSrc("overview.html"), - "-sourcepath", testSrc, - "p1", "p2"); - checkExit(Exit.OK); - String HTML4 = ""; - - checkValidHTML(HTML4); -} - void checkValidHTML(String doctype) { // Test the proper DOCTYPE element are present: checkOutput("index.html", true, doctype); diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java --- a/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,127 +52,6 @@ } @Test - public void testHtml4(Path ignore) { - setAutomaticCheckLinks(false); // @ignore JDK-8202622 - javadoc("-d", "out-html4", - "-html4", - "-sourcepath", testSrc, - "-source", "8", //so that '_' can be used as an identifier - "-use", - "pkg1"); - setAutomaticCheckLinks(true); // @ignore JDK-8202622 - checkExit(Exit.OK); - - // Test some section markers and links to these markers - checkOutput("pkg1/RegClass.html", true, - "", - "", - "", - "", - "", - "", - "", - "", - "", - ""); - - // Test some members and link to these members - checkOutput("pkg1/RegClass.html", true, - //The marker for this appears in the serialized-form.html which we will - //test below - ""); - - // Test some fields - checkOutput("pkg1/RegClass.html", true, - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - ""); - - checkOutput("pkg1/DeprMemClass.html", true, - "", - ""); - - // Test constructor - checkOutput("pkg1/RegClass.html", true, - "", - ""); - - // Test some methods - checkOutput("pkg1/RegClass.html", true, - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - ""); - - checkOutput("pkg1/DeprMemClass.html", true, - "", - ""); - - // Test enum - checkOutput("pkg1/RegClass.Te$t_Enum.html", true, - "", - ""); - - // Test nested class - checkOutput("pkg1/RegClass._NestedClas$.html", true, - "", - ""); - - // Test class use page - checkOutput("pkg1/class-use/DeprMemClass.html", true, - ""); - - // Test deprecated list page - checkOutput("deprecated-list.html", true, - "", - ""); - - // Test constant values page - checkOutput("constant-values.html", true, - ""); - - // Test serialized form page - checkOutput("serialized-form.html", true, - //This is the marker for the link that appears in the pkg1.RegClass.html page - ""); - - // Test member name index page - checkOutput("index-all.html", true, - "", - "$", - "_"); - - // The marker name conversion should only affect HTML anchors. It should not - // affect the labels. - checkOutput("pkg1/RegClass.html", false, - " Z:Z_", - " Z:Z:Dfield", - " Z:Z_field_In_Class", - " S_:D:D:D:D:DINT"); - } - - @Test public void testHtml5(Path ignore) { javadoc("-d", "out-html5", "-sourcepath", testSrc, diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java --- a/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,16 +52,4 @@ checkOutput("pkg/AnnotationOptional.html", true, ""); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-html4", - "-sourcepath", testSrc, - "pkg"); - checkExit(Exit.OK); - - checkOutput("pkg/AnnotationOptional.html", true, - ""); - } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java --- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,16 +117,4 @@ "public @interface AnnotationTypeField"); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-html4", - "-sourcepath", testSrc, - "pkg"); - checkExit(Exit.OK); - checkOutput("pkg/AnnotationType.html", true, - "
  4. ", - ""); } -} diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java --- a/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,20 +83,4 @@ "The code being documented uses modules but the packages defined" + " in http://docs.oracle.com/javase/8/docs/api/ are in the unnamed module"); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-source", "8", - "-html4", - "-Xdoclint:none", - "-sourcepath", testSrc, - "-linkoffline", uri, testSrc, - testSrc("C.java")); - checkExit(Exit.OK); - - checkOutput("C.html", true, - "Link to external member gcd"); } -} diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java --- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,25 +85,4 @@ checkOutput("p/IT2.html", true, "code>C3"); } - - @Test - public void test_html4() { - - javadoc("-d", "out-html4", - "-html4", - "-Xdoclint:none", - "-sourcepath", testSrc, - "-package", - "p"); - checkExit(Exit.OK); - - checkOutput("p/C1.html", true, - "C1()"); - - checkOutput("p/C2.html", true, - "C2()"); - - checkOutput("p/C3.html", true, - "C3()"); } -} diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java --- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,56 +90,4 @@ "Outer.Inner.NestedInner()", "Outer.Inner.NestedInner(int)"); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-html4", - "-sourcepath", testSrc, - "pkg1"); - checkExit(Exit.OK); - - checkOutput("pkg1/Outer.html", true, - "
    See Also:
    \n" - + "
    Inner(), \n" - + "Inner(int), \n" - + "NestedInner(), \n" - + "NestedInner(int), \n" - + "Outer(), \n" - + "Outer(int)", - "Link: Inner(), " - + "Outer(int), " - + "" - + "NestedInner(int)", - "Outer()", - "", - "Outer​(int i)", - ""); - - checkOutput("pkg1/Outer.Inner.html", true, - "Inner()", - "", - "Inner​(int i)", - ""); - - checkOutput("pkg1/Outer.Inner.NestedInner.html", true, - "NestedInner()", - "", - "NestedInner​(int i)", - ""); - - checkOutput("pkg1/Outer.Inner.html", false, - "Outer.Inner--", - "Outer.Inner-int-"); - - checkOutput("pkg1/Outer.Inner.NestedInner.html", false, - "Outer.Inner.NestedInner--", - "Outer.Inner.NestedInner-int-"); - - checkOutput("pkg1/Outer.html", false, - "Outer.Inner()", - "Outer.Inner(int)", - "Outer.Inner.NestedInner()", - "Outer.Inner.NestedInner(int)"); - } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java --- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -299,102 +299,4 @@ + "
  5. \n" + ""); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-html4", - "-sourcepath", testSrc, - "pkg"); - checkExit(Exit.OK); - - checkOutput("deprecated-list.html", true, - "", - "

    ", - "
    \n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "
    Exceptions 
    ExceptionsDescription
    pkg.TestException\n" - + "
    exception_test1 passes.
    \n" - + "
    \n" - + "
    ", - "
    \n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "
    Fields 
    FieldDescription
    pkg.DeprecatedClassByAnnotation.field
    pkg.TestAnnotationType.field\n" - + "
    annotation_test4 passes.
    \n" - + "
    pkg.TestClass.field\n" - + "
    class_test2 passes. This is the second sentence of deprecated description for a field.
    \n" - + "
    pkg.TestError.field\n" - + "
    error_test2 passes.
    \n" - + "
    pkg.TestException.field\n" - + "
    exception_test2 passes.
    \n" - + "
    pkg.TestInterface.field\n" - + "
    interface_test2 passes.
    \n" - + "
    \n" - + "
    "); - } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java --- a/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,28 +66,4 @@ + "title=\"class or interface in java.io\" class=\"externalLink\">DataInput
    " ); } - - @Test - public void test_html4() { - javadoc("-d", "out-html4", - "-source", "8", - "-html4", - "-sourcepath", testSrc, - "-linkoffline", uri, testSrc, - "pkg"); - checkExit(Exit.OK); - - checkOutput("pkg/XReader.html", true, - "
    Overrides:
    \n" - + "
    read in class " - + "FilterReader
    ", - "
    Specified by:
    \n" - + "
    readInt in interface " - + "DataInput
    " - ); - } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java --- a/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,6 @@ } enum HtmlKind { - HTML4("-html4"), HTML5("-html5"); HtmlKind(String... opts) { this.opts = Arrays.asList(opts); @@ -126,18 +125,16 @@ if (a != null) { for (FrameKind fk : FrameKind.values()) { for (OverviewKind ok : OverviewKind.values()) { - for (HtmlKind hk : HtmlKind.values()) { - try { - out.println("Running test " + m.getName() + " " + fk + " " + ok + " " + hk); - Path base = Paths.get(m.getName() + "_" + fk + "_" + ok + "_" + hk); - Files.createDirectories(base); - m.invoke(this, new Object[]{base, fk, ok, hk}); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - throw (cause instanceof Exception) ? ((Exception) cause) : e; - } - out.println(); + try { + out.println("Running test " + m.getName() + " " + fk + " " + ok); + Path base = Paths.get(m.getName() + "_" + fk + "_" + ok); + Files.createDirectories(base); + m.invoke(this, new Object[]{base, fk, ok}); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + throw (cause instanceof Exception) ? ((Exception)cause) : e; } + out.println(); } } } @@ -145,58 +142,56 @@ printSummary(); } - void javadoc(Path outDir, FrameKind fKind, OverviewKind oKind, HtmlKind hKind, String... rest) { + void javadoc(Path outDir, FrameKind fKind, OverviewKind oKind, String... rest) { List args = new ArrayList<>(); args.add("-d"); args.add(outDir.toString()); args.addAll(fKind.opts); args.addAll(oKind.opts); - args.addAll(hKind.opts); args.addAll(Arrays.asList(rest)); javadoc(args.toArray(new String[0])); checkExit(Exit.OK); } @Test - public void testClass(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws Exception { - javadoc(base, fKind, oKind, hKind, - gensrcPackages.resolve("p1/P1C1.java").toString()); + public void testClass(Path base, FrameKind fKind, OverviewKind oKind) throws Exception { + javadoc(base, fKind, oKind, gensrcPackages.resolve("p1/P1C1.java").toString()); - new Checker(fKind, oKind, hKind) + new Checker(fKind, oKind) .classes("p1.P1C1") .check(); } @Test - public void testClasses(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException { - javadoc(base, fKind, oKind, hKind, + public void testClasses(Path base, FrameKind fKind, OverviewKind oKind) throws IOException { + javadoc(base, fKind, oKind, gensrcPackages.resolve("p1/P1C1.java").toString(), gensrcPackages.resolve("p1/P1C2.java").toString(), gensrcPackages.resolve("p1/P1C3.java").toString()); - new Checker(fKind, oKind, hKind) + new Checker(fKind, oKind) .classes("p1.P1C1", "p1.P1C2", "p1.P1C3") .check(); } @Test - public void testPackage(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException { - javadoc(base, fKind, oKind, hKind, + public void testPackage(Path base, FrameKind fKind, OverviewKind oKind) throws IOException { + javadoc(base, fKind, oKind, "-sourcepath", gensrcPackages.toString(), "p1"); - new Checker(fKind, oKind, hKind) + new Checker(fKind, oKind) .classes("p1.P1C1", "p1.P1C2", "p1.P1C3") .check(); } @Test - public void testPackages(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException { - javadoc(base, fKind, oKind, hKind, + public void testPackages(Path base, FrameKind fKind, OverviewKind oKind) throws IOException { + javadoc(base, fKind, oKind, "-sourcepath", gensrcPackages.toString(), "p1", "p2", "p3"); - new Checker(fKind, oKind, hKind) + new Checker(fKind, oKind) .classes("p1.P1C1", "p1.P1C2", "p1.P1C3", "p2.P2C1", "p2.P2C2", "p2.P2C3", "p3.P3C1", "p3.P3C2", "p3.P3C3") @@ -204,12 +199,12 @@ } @Test - public void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException { - javadoc(base, fKind, oKind, hKind, + public void testModules(Path base, FrameKind fKind, OverviewKind oKind) throws IOException { + javadoc(base, fKind, oKind, "--module-source-path", gensrcModules.toString(), "--module", "m1,m2,m3"); - new Checker(fKind, oKind, hKind) + new Checker(fKind, oKind) .classes("m1/m1p1.M1P1C1", "m1/m1p1.M1P1C2", "m1/m1p1.M1P1C3", "m2/m2p1.M2P1C1", "m2/m2p1.M2P1C2", "m2/m2p1.M2P1C3", "m3/m3p1.M3P1C1", "m3/m3p1.M3P1C2", "m3/m3p1.M3P1C3") @@ -223,7 +218,6 @@ class Checker { private final FrameKind fKind; private final OverviewKind oKind; - private final HtmlKind hKind; List classes; private boolean frames; @@ -234,10 +228,9 @@ + "frames will be removed in a future release.\n" + "To suppress this warning, remove the --frames option and avoid the use of frames."; - Checker(FrameKind fKind, OverviewKind oKind, HtmlKind hKind) { + Checker(FrameKind fKind, OverviewKind oKind) { this.fKind = fKind; this.oKind = oKind; - this.hKind = hKind; } Checker classes(String... classes) { @@ -271,7 +264,7 @@ break; } - out.println("Checker: " + fKind + " " + oKind + " " + hKind + out.println("Checker: " + fKind + " " + oKind + ": frames:" + frames + " overview:" + overview); checkAllClassesFiles(); @@ -357,9 +350,8 @@ "window.location.replace("); - // the index.html file refresh should only use
  6. "); } - - void checkNoCommentNoDeprecated_html4(boolean expectFound) { - // Test with -nocomment and -nodeprecated options. The ClassDocs whould - // not display definition lists for any member details. - checkOutput("serialized-form.html", expectFound, - "
    boolean " +
    -                "undecorated
    \n" + - "
    " + - "Deprecated.\n" - + "
    As of JDK version 1.5, replaced by\n" - + " " - + "setUndecorated(boolean).
    \n" - + "
    \n" - + - "", - "" - + "Deprecated.\n" - + "
    As of JDK version" - + " 1.5, replaced by\n" - + " " - + "setUndecorated(boolean).
    \n" - + "\n" - + ""); - } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java --- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java Wed Jan 30 19:48:18 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,6 @@ // Generate the HTML output using the HTML document generation within doclet. public static String generateHtmlTree() { // Document type for the HTML document - DocType htmlDocType = DocType.HTML4_TRANSITIONAL; HtmlTree html = new HtmlTree(HtmlTag.HTML); HtmlTree head = new HtmlTree(HtmlTag.HEAD); HtmlTree title = new HtmlTree(HtmlTag.TITLE); @@ -144,7 +143,7 @@ HtmlTree hr = new HtmlTree(HtmlTag.HR); body.addContent(hr); html.addContent(body); - HtmlDocument htmlDoc = new HtmlDocument(htmlDocType, html); + HtmlDocument htmlDoc = new HtmlDocument(html); return htmlDoc.toString(); } } diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testHtmlDocument/testLink.html --- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testLink.html Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testLink.html Wed Jan 30 19:48:18 2019 -0500 @@ -1,4 +1,4 @@ - + Markup test diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testHtmlDocument/testMarkup.html --- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testMarkup.html Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testMarkup.html Wed Jan 30 19:48:18 2019 -0500 @@ -1,4 +1,4 @@ - + Markup test diff -r 8041f62342f0 -r 1e4dceb0da58 test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java --- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java Wed Jan 30 19:25:22 2019 -0500 +++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java Wed Jan 30 19:48:18 2019 -0500 @@ -105,42 +105,6 @@ } @Test - public void testModulesHtml4(Path base) throws Exception { - Path srcDir = base.resolve("src"); - createModules(srcDir); - - Path outDir = base.resolve("out2"); - javadoc("-d", outDir.toString(), - "-doctitle", "Document Title", - "-header", "Test Header", - "--frames", - "--module-source-path", srcDir.toString(), - "--module", "m1,m2", - "-html4"); - - checkExit(Exit.OK); - - checkOrder("module-overview-frame.html", - "

    Test Header

    \n" - + "
    ", - "
    \n" - + "

    Modules

    \n" - + "