This commit is contained in:
Phil Race 2018-03-08 10:18:28 -08:00
commit ff223cc1ee
120 changed files with 6533 additions and 6488 deletions

View File

@ -435,7 +435,7 @@ else # $(HAS_SPEC)=true
define PrepareCompareBuild
$(ECHO) "Preparing for comparison rebuild"
# Apply patch, if any
$(if $(COMPARE_BUILD_PATCH), $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
# Move the first build away temporarily
$(RM) -r $(topdir)/build/.compare-build-temp
$(MKDIR) -p $(topdir)/build/.compare-build-temp
@ -455,7 +455,7 @@ else # $(HAS_SPEC)=true
# Cleanup after a compare build
define CleanupCompareBuild
# If running with a COMPARE_BUILD patch, reverse-apply it
$(if $(COMPARE_BUILD_PATCH), $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
# Move this build away and restore the original build
$(MKDIR) -p $(topdir)/build/compare-build
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)

View File

@ -399,10 +399,13 @@ docs-zip:
update-build-docs:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
update-x11wrappers:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UpdateX11Wrappers.gmk)
ALL_TARGETS += docs-jdk-api-javadoc docs-jdk-api-modulegraph \
docs-javase-api-javadoc docs-javase-api-modulegraph \
docs-reference-api-javadoc docs-reference-api-modulegraph docs-jdk-specs \
docs-jdk-index docs-zip update-build-docs
docs-jdk-index docs-zip update-build-docs update-x11wrappers
################################################################################
# Cross compilation support
@ -724,9 +727,9 @@ else
# If not already set, set the JVM target so that the JVM will be built.
JVM_MAIN_TARGETS ?= hotspot
# Building java.base-jmod requires all of VM (ie hotspot) to be built.
java.base-jmod: $(JVM_MAIN_TARGETS)
java.base-jmod: $(JVM_MAIN_TARGETS)
# Declare dependencies from <module>-jmod to all other module targets
# When creating a BUILDJDK, the java compilation has already been done by the
@ -830,7 +833,7 @@ else
# If not already set, then set the JVM specific docs targets
JVM_DOCS_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc
# The gensrc steps for hotspot and jdk.jdi create html spec files.
docs-jdk-specs: $(JVM_DOCS_TARGETS) jdk.jdi-gensrc \
docs-jdk-index
@ -894,6 +897,8 @@ else
generate-summary: jmods buildtools-modules
update-x11wrappers: java.base-copy buildtools-jdk
endif
################################################################################

View File

@ -60,6 +60,18 @@ define SetTestOpt
endif
endef
# Setup _NT_SYMBOL_PATH on Windows
ifeq ($(OPENJDK_TARGET_OS), windows)
ifndef _NT_SYMBOL_PATH
# Can't use PathList here as it adds quotes around the value.
_NT_SYMBOL_PATH := \
$(subst $(SPACE),;, $(foreach p, $(sort $(dir $(wildcard \
$(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), $(call FixPath, $p)))
export _NT_SYMBOL_PATH
$(info _NT_SYMBOL_PATH $(_NT_SYMBOL_PATH))
endif
endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, RunTests.gmk))
@ -496,6 +508,11 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR
# Some tests needs to find a boot JDK using the JDK8_HOME variable.
$1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
# If running on Windows, propagate the _NT_SYMBOL_PATH to enable
# symbol lookup in hserr files
ifeq ($$(OPENJDK_TARGET_OS), windows)
$1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
endif
$1_JTREG_BASIC_OPTIONS += \
$$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \

View File

@ -113,6 +113,7 @@ $(eval $(call SetupVariable,JT_HOME))
# These can have default values based on the ones above
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols))
# Provide default values for tools that we need
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
@ -245,6 +246,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
JT_HOME := $(JT_HOME), \
JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
MAKE := $(MAKE), \
BASH := $(BASH), \
JIB_JAR := $(JIB_JAR), \

101
make/UpdateX11Wrappers.gmk Normal file
View File

@ -0,0 +1,101 @@
#
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include NativeCompilation.gmk
include ToolsJdk.gmk
################################################################################
# This file is responsible for extracting the x11 native struct offsets to
# the xawt Java library. The tool needs to be run on the os/arch that
# will host the final jvm, thus the tool cannot be used when cross compiling.
#
# Two versions of the generated offset file, sizes-32.txt and sizes-64.txt are
# committed into the source code repository. These are the ones used in
# GensrcX11Wrappers.gmk to generate the Java code during the build.
################################################################################
ifeq ($(COMPILE_TYPE), cross)
$(error It is not possible to update the x11wrappers when cross-compiling)
endif
X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen
BITS := $(OPENJDK_TARGET_CPU_BITS)
# Generate the C code for the program that will output the offset file.
$(X11WRAPPERS_OUTPUT)/src/data_generator.c: $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK)
$(call LogInfo, Generating X11 wrapper data generator source code)
$(call MakeDir, $(@D))
$(call ExecuteWithLog, $@, \
$(TOOL_WRAPPERGENERATOR) gen_c_source $@ $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS))
DATA_GENERATOR_INCLUDES := \
-I$(TOPDIR)/src/hotspot/share/include \
-I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
-I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
-I$(TOPDIR)/src/java.base/share/native/libjava \
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
#
# Compile the generated C code into an executable.
$(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
PROGRAM := data_generator, \
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
EXTRA_FILES := $(X11WRAPPERS_OUTPUT)/src/data_generator.c, \
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS_JDKEXE), \
LIBS := $(X_LIBS) -lc, \
OBJECT_DIR := $(X11WRAPPERS_OUTPUT)/objs, \
))
# Run the executable to create the data file.
$(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt: $(BUILD_DATA_GENERATOR_TARGET)
$(call LogInfo, Generating X11 wrapper data files)
$(call MakeDir, $(@D))
$(call ExecuteWithLog, $(X11WRAPPERS_OUTPUT)/generation, \
$(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $@)
$(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly
$(ECHO) need to be updated for both 32 and 64 bit platforms. You have now
$(ECHO) updated them for $(BITS) bit platforms only.
TARGETS += $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt
################################################################################
all: $(TARGETS)
.PHONY: all default

View File

@ -108,29 +108,19 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
[
# Debug symbols
if test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
CFLAGS_DEBUG_SYMBOLS="-g1"
else
CFLAGS_DEBUG_SYMBOLS="-g"
fi
CFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
CFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
CFLAGS_DEBUG_SYMBOLS="-g -xs"
# -g0 enables debug symbols without disabling inlining.
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
CFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
CFLAGS_DEBUG_SYMBOLS="-Zi"
fi
if test "x$CXXFLAGS_DEBUG_SYMBOLS" = x; then
# If we did not specify special flags for C++, use C version
CXXFLAGS_DEBUG_SYMBOLS="$CFLAGS_DEBUG_SYMBOLS"
fi
AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
# FIXME: This was never used in the old build. What to do with it?
if test "x$TOOLCHAIN_TYPE" = xgcc; then
@ -143,13 +133,7 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
# Debug symbols for JVM_CFLAGS
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs"
if test "x$DEBUG_LEVEL" = xslowdebug; then
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
else
# -g0 does not disable inlining, which -g does.
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0"
fi
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+"
else
@ -496,7 +480,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$DEBUG_LEVEL" != xrelease; then
DEBUG_OPTIONS_FLAGS_JDK="$CFLAGS_DEBUG_OPTIONS"
DEBUG_SYMBOLS_CFLAGS_JDK="$CFLAGS_DEBUG_SYMBOLS"
DEBUG_SYMBOLS_CXXFLAGS_JDK="$CXXFLAGS_DEBUG_SYMBOLS"
fi
#### TOOLCHAIN DEFINES
@ -556,6 +539,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
-library=stlport4 -mt -features=no%except"
if test "x$DEBUG_LEVEL" = xslowdebug; then
# Previously -g was used instead of -g0 for slowdebug; this is equivalent
# to setting +d.
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt" # add on both CFLAGS
TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \
@ -825,16 +814,16 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
$WARNING_CFLAGS $WARNING_CFLAGS_JDK"
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK"
# Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
# (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might
# change in the future.)
CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY $DEBUG_SYMBOLS_CFLAGS_JDK \
CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY \
$WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY $TOOLCHAIN_CFLAGS_JDK_CXXONLY \
$DEBUG_SYMBOLS_CXXFLAGS_JDK $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
$WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
$1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
$1_CFLAGS_JDK="${$1_DEFINES_CPU_JDK} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JDK} ${$1_TOOLCHAIN_CFLAGS}"

View File

@ -236,7 +236,10 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
if test "x$TOOLCHAIN_TYPE" = xxlc; then
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}"
elif test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
if test "x$OPENJDK_TARGET_CPU" != xaarch64 &&
test "x$OPENJDK_TARGET_CPU" != xarm; then
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
fi
fi
# FIXME: global flags are not used yet...

View File

@ -532,7 +532,6 @@ COPY_DEBUG_SYMBOLS := @COPY_DEBUG_SYMBOLS@
ZIP_EXTERNAL_DEBUG_SYMBOLS := @ZIP_EXTERNAL_DEBUG_SYMBOLS@
CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
#
# Compress (or not) jars

View File

@ -150,7 +150,7 @@ NATIVE_SOURCE_EXTENSIONS := %.s %.S %.c %.cpp %.cc %.m %.mm
define replace_with_obj_extension
$(strip \
$(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \
$(patsubst $(extension),%$(OBJ_SUFFIX),$(filter $(extension),$1))) \
$(patsubst $(extension),%$(OBJ_SUFFIX), $(filter $(extension), $1))) \
)
endef
@ -183,150 +183,167 @@ DEPENDENCY_TARGET_SED_PATTERN := \
-e 's/$$$$/ :/' \
#
define add_native_source
# param 1 = BUILD_MYPACKAGE
# parma 2 = the source file name (..../alfa.c or .../beta.cpp)
# param 3 = the bin dir that stores all .o (.obj) and .d files.
# param 4 = the c flags to the compiler
# param 5 = the c compiler
# param 6 = the c++ flags to the compiler
# param 7 = the c++ compiler
# param 8 = the flags to the assembler
# param 9 = set to disable THIS_FILE
################################################################################
# Create the recipe needed to compile a single native source file.
#
# Parameter 1 is the name of the rule, based on the name of the library/
# program being build and the name of the source code file, e.g.
# BUILD_LIBFOO_fooMain.cpp.
#
# Remaining parameters are named arguments:
# FILE - The full path of the source file to compiler
# BASE - The name of the rule for the entire binary to build ($1)
# DISABLE_THIS_FILE_DEFINE - Set to true to disable the THIS_FILE define.
#
SetupCompileNativeFile = $(NamedParamsMacroTemplate)
define SetupCompileNativeFileBody
$1_FILENAME := $$(notdir $$($1_FILE))
ifeq ($9, )
$1_$2_THIS_FILE = -DTHIS_FILE='"$$(<F)"'
endif
# The target file to be generated.
$1_OBJ := $$($$($1_BASE)_OBJECT_DIR)/$$(call replace_with_obj_extension, \
$$($1_FILENAME))
ifeq ($$($1_$(notdir $2)_OPTIMIZATION), )
$1_$(notdir $2)_OPT_CFLAGS := $$($1_OPT_CFLAGS)
$1_$(notdir $2)_OPT_CXXFLAGS := $$($1_OPT_CXXFLAGS)
else
ifeq (NONE, $$($1_$(notdir $2)_OPTIMIZATION))
$1_$(notdir $2)_OPT_CFLAGS := $(C_O_FLAG_NONE)
$1_$(notdir $2)_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
else ifeq (LOW, $$($1_$(notdir $2)_OPTIMIZATION))
$1_$(notdir $2)_OPT_CFLAGS := $(C_O_FLAG_NORM)
$1_$(notdir $2)_OPT_CXXFLAGS := $(CXX_O_FLAG_NORM)
else ifeq (HIGH, $$($1_$(notdir $2)_OPTIMIZATION))
$1_$(notdir $2)_OPT_CFLAGS := $(C_O_FLAG_HI)
$1_$(notdir $2)_OPT_CXXFLAGS := $(CXX_O_FLAG_HI)
else ifeq (HIGHEST, $$($1_$(notdir $2)_OPTIMIZATION))
$1_$(notdir $2)_OPT_CFLAGS := $(C_O_FLAG_HIGHEST)
$1_$(notdir $2)_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST)
else ifeq (HIGHEST_JVM, $$($1_$(notdir $2)_OPTIMIZATION))
$1_$(notdir $2)_OPT_CFLAGS := $(C_O_FLAG_HIGHEST_JVM)
$1_$(notdir $2)_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST_JVM)
else ifeq (SIZE, $$($1_$(notdir $2)_OPTIMIZATION))
$1_$(notdir $2)_OPT_CFLAGS := $(C_O_FLAG_SIZE)
$1_$(notdir $2)_OPT_CXXFLAGS := $(CXX_O_FLAG_SIZE)
# Only continue if this object file hasn't been processed already. This lets
# the first found source file override any other with the same name.
ifeq ($$(findstring $$($1_OBJ), $$($$($1_BASE)_OBJS_SO_FAR)), )
$$($1_BASE)_OBJS_SO_FAR += $$($1_OBJ)
# This is the definite source file to use for $1_FILENAME.
$1_SRC_FILE := $$($1_FILE)
ifneq ($$($1_DISABLE_THIS_FILE_DEFINE), true)
$1_THIS_FILE = -DTHIS_FILE='"$$(<F)"'
endif
ifeq ($$($1_OPTIMIZATION), )
$1_OPT_CFLAGS := $$($$($1_BASE)_OPT_CFLAGS)
$1_OPT_CXXFLAGS := $$($$($1_BASE)_OPT_CXXFLAGS)
else
$$(error Unknown value for OPTIMIZATION: $$($1_$(notdir $2)_OPTIMIZATION))
ifeq ($$($1_OPTIMIZATION), NONE)
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
else ifeq ($$($1_OPTIMIZATION), LOW)
$1_OPT_CFLAGS := $(C_O_FLAG_NORM)
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NORM)
else ifeq ($$($1_OPTIMIZATION), HIGH)
$1_OPT_CFLAGS := $(C_O_FLAG_HI)
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HI)
else ifeq ($$($1_OPTIMIZATION), HIGHEST)
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST)
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST)
else ifeq ($$($1_OPTIMIZATION), HIGHEST_JVM)
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST_JVM)
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST_JVM)
else ifeq ($$($1_OPTIMIZATION), SIZE)
$1_OPT_CFLAGS := $(C_O_FLAG_SIZE)
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_SIZE)
else
$$(error Unknown value for file OPTIMIZATION: $$($1_OPTIMIZATION))
endif
endif
endif
ifneq ($$($1_PRECOMPILED_HEADER), )
ifeq ($$(filter $$(notdir $2), $$($1_PRECOMPILED_HEADER_EXCLUDE)), )
$1_$2_USE_PCH_FLAGS := $$($1_USE_PCH_FLAGS)
ifneq ($$($$($1_BASE)_PRECOMPILED_HEADER), )
ifeq ($$(filter $$($1_FILENAME), $$($$($1_BASE)_PRECOMPILED_HEADER_EXCLUDE)), )
$1_USE_PCH_FLAGS := $$($$($1_BASE)_USE_PCH_FLAGS)
endif
endif
endif
ifneq ($$(filter %.c, $2), )
# Compile as a C file
$1_$2_FLAGS := $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
$$($1_$(notdir $2)_OPT_CFLAGS) \
$$($1_$(notdir $2)_CFLAGS) $$($1_$2_THIS_FILE) -c
$1_$2_COMP := $5
$1_$2_DEP_FLAG := $(C_FLAG_DEPS)
else ifneq ($$(filter %.m, $2), )
# Compile as an Objective-C file
$1_$2_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
$$($1_$(notdir $2)_OPT_CFLAGS) \
$$($1_$(notdir $2)_CFLAGS) $$($1_$2_THIS_FILE) -c
$1_$2_COMP := $5
$1_$2_DEP_FLAG := $(C_FLAG_DEPS)
else ifneq ($$(filter %.s %.S, $2), )
# Compile as assembler file
$1_$2_FLAGS := $8
$1_$2_COMP := $(AS)
$1_$2_DEP_FLAG :=
else ifneq ($$(filter %.cpp, $2)$$(filter %.cc, $2)$$(filter %.mm, $2), )
# Compile as a C++ or Objective-C++ file
$1_$2_FLAGS := $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $6 \
$$($1_$(notdir $2)_OPT_CXXFLAGS) \
$$($1_$(notdir $2)_CXXFLAGS) $$($1_$2_THIS_FILE) -c
$1_$2_COMP := $7
$1_$2_DEP_FLAG := $(CXX_FLAG_DEPS)
else
$$(error Internal error in NativeCompilation.gmk: no compiler for file $2)
endif
# Generate the .o (.obj) file name and place it in the bin dir.
$1_$2_OBJ := $3/$$(call replace_with_obj_extension, $$(notdir $2))
# Only continue if this object file hasn't been processed already. This lets the first found
# source file override any other with the same name.
ifeq ($$(findstring $$($1_$2_OBJ), $$($1_OBJS_SO_FAR)), )
$1_OBJS_SO_FAR += $$($1_$2_OBJ)
ifeq ($$(filter %.s %.S, $2), )
$1_BASE_CFLAGS := $$($$($1_BASE)_CFLAGS) $$($$($1_BASE)_EXTRA_CFLAGS) \
$$($$($1_BASE)_SYSROOT_CFLAGS)
$1_BASE_CXXFLAGS := $$($$($1_BASE)_CXXFLAGS) $$($$($1_BASE)_EXTRA_CXXFLAGS) \
$$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS)
ifneq ($$(filter %.c, $$($1_FILENAME)), )
# Compile as a C file
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CFLAGS) \
$$($1_OPT_CFLAGS) $$($1_CFLAGS) $$($1_THIS_FILE) -c
$1_COMPILER := $$($$($1_BASE)_CC)
$1_DEP_FLAG := $(C_FLAG_DEPS)
else ifneq ($$(filter %.m, $$($1_FILENAME)), )
# Compile as an Objective-C file
$1_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) \
$$($1_BASE_CFLAGS) $$($1_OPT_CFLAGS) $$($1_CFLAGS) $$($1_THIS_FILE) -c
$1_COMPILER := $$($$($1_BASE)_CC)
$1_DEP_FLAG := $(C_FLAG_DEPS)
else ifneq ($$(filter %.s %.S, $$($1_FILENAME)), )
# Compile as assembler file
$1_FLAGS := $$($$($1_BASE)_ASFLAGS)
$1_COMPILER := $(AS)
$1_DEP_FLAG :=
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
# Compile as a C++ or Objective-C++ file
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
$$($1_OPT_CXXFLAGS) $$($1_CXXFLAGS) $$($1_THIS_FILE) -c
$1_COMPILER := $$($$($1_BASE)_CXX)
$1_DEP_FLAG := $(CXX_FLAG_DEPS)
else
$$(error Internal error in NativeCompilation.gmk: no compiler for file $$($1_FILENAME))
endif
ifeq ($$(filter %.s %.S, $$($1_FILENAME)), )
# And this is the dependency file for this obj file.
$1_$2_DEP := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
# The dependency target file lists all dependencies as empty targets
# to avoid make error "No rule to make target" for removed files
$1_$2_DEP_TARGETS := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_$2_OBJ))
$1_DEP := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_OBJ))
# The dependency target file lists all dependencies as empty targets to
# avoid make error "No rule to make target" for removed files
$1_DEP_TARGETS := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_OBJ))
# Include previously generated dependency information. (if it exists)
-include $$($1_$2_DEP)
-include $$($1_$2_DEP_TARGETS)
-include $$($1_DEP)
-include $$($1_DEP_TARGETS)
ifeq ($(TOOLCHAIN_TYPE), microsoft)
# To avoid name clashes between pdbs for objects and libs/execs, put
# object pdbs in a separate subdir.
$1_$2_DEBUG_OUT_FLAGS := -Fd$$(strip $$(patsubst $$($1_OBJECT_DIR)/%, \
$$($1_OBJECT_DIR)/pdb/%, $$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ))))
$1_DEBUG_OUT_FLAGS := -Fd$$(strip $$(patsubst $$($$($1_BASE)_OBJECT_DIR)/%, \
$$($$($1_BASE)_OBJECT_DIR)/pdb/%, $$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_OBJ))))
endif
endif
ifneq ($$(strip $$($1_$(notdir $2)_CFLAGS) $$($1_$(notdir $2)_CXXFLAGS) \
$$($1_$(notdir $2)_OPTIMIZATION)), )
$1_$2_VARDEPS := $$($1_$(notdir $2)_CFLAGS) $$($1_$(notdir $2)_CXXFLAGS) \
$$($1_$(notdir $2)_OPT_CFLAGS) $$($1_$(notdir $2)_OPT_CXXFLAGS)
$1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, $$($1_$2_OBJ).vardeps)
ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), )
$1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPT_CFLAGS) \
$$($1_OPT_CXXFLAGS)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps)
endif
$$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) $$($1_$2_VARDEPS_FILE) | $$($1_BUILD_INFO)
$$(call LogInfo, Compiling $$(notdir $2) (for $$($1_BASENAME)))
$$($1_OBJ): $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
$$($1_VARDEPS_FILE) | $$($$($1_BASE)_BUILD_INFO)
$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
$$(call MakeDir, $$(@D) $$(@D)/pdb)
ifneq ($(TOOLCHAIN_TYPE), microsoft)
ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $2), solstudio)
# The Solaris studio compiler doesn't output the full path to the object file in the
# generated deps files. Fixing it with sed. If compiling assembly, don't try this.
ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $$($1_FILENAME)), solstudio)
# The Solaris studio compiler doesn't output the full path to the
# object file in the generated deps files. Fixing it with sed. If
# compiling assembly, don't try this.
$$(call ExecuteWithLog, $$@, \
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
$(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP)
$$($1_COMPILER) $$($1_FLAGS) $$($1_DEP_FLAG) $$($1_DEP).tmp \
$(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE))
$(SED) 's|^$$(@F):|$$@:|' $$($1_DEP).tmp > $$($1_DEP)
else
$$(call ExecuteWithLog, $$@, \
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
$$($1_COMPILER) $$($1_FLAGS) $$($1_DEP_FLAG) $$($1_DEP) \
$(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE))
endif
# Create a dependency target file from the dependency file.
# Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
ifneq ($$($1_$2_DEP), )
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
ifneq ($$($1_DEP), )
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEP) > $$($1_DEP_TARGETS)
endif
else
# The Visual Studio compiler lacks a feature for generating make dependencies, but by
# setting -showIncludes, all included files are printed. These are filtered out and
# parsed into make dependences.
# Keep as much as possible on one execution line for best performance on Windows.
# No need to save exit code from compilation since pipefail is always active on
# Windows.
# The Visual Studio compiler lacks a feature for generating make
# dependencies, but by setting -showIncludes, all included files are
# printed. These are filtered out and parsed into make dependences.
#
# Keep as much as possible on one execution line for best performance
# on Windows. No need to save exit code from compilation since
# pipefail is always active on Windows.
$$(call ExecuteWithLog, $$@, \
$$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
$(CC_OUT_OPTION)$$($1_$2_OBJ) $2) \
| $(GREP) -v -e "^Note: including file:" \
-e "^$(notdir $2)$$$$" || test "$$$$?" = "1" ; \
$(ECHO) $$@: \\ > $$($1_$2_DEP) ; \
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_OBJ).log \
| $(SORT) -u >> $$($1_$2_DEP) ; \
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
$$($1_COMPILER) $$($1_FLAGS) -showIncludes $$($1_DEBUG_OUT_FLAGS) \
$(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)) \
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
-e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \
$(ECHO) $$@: \\ > $$($1_DEP) ; \
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \
| $(SORT) -u >> $$($1_DEP) ; \
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEP) > $$($1_DEP_TARGETS)
endif
endif
endef
@ -379,7 +396,6 @@ endef
# ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol
# zipping
# CFLAGS_DEBUG_SYMBOLS Overrides the default cflags for enabling debug symbols
# CXXFLAGS_DEBUG_SYMBOLS Overrides the default cxxflags for enabling debug symbols
# STRIPFLAGS Optionally change the flags given to the strip command
# PRECOMPILED_HEADER Header file to use as precompiled header
# PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH
@ -560,9 +576,8 @@ define SetupNativeCompilationBody
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
$$(call SetIfEmpty, $1_CFLAGS_DEBUG_SYMBOLS, $(CFLAGS_DEBUG_SYMBOLS))
$$(call SetIfEmpty, $1_CXXFLAGS_DEBUG_SYMBOLS, $(CXXFLAGS_DEBUG_SYMBOLS))
$1_EXTRA_CFLAGS += $$($1_CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS += $$($1_CFLAGS_DEBUG_SYMBOLS)
endif
ifneq ($$($1_REORDER), )
@ -641,11 +656,12 @@ define SetupNativeCompilationBody
$1_GENERATED_PCH_SRC := $$($1_OBJECT_DIR)/$1_pch.cpp
$1_GENERATED_PCH_OBJ := $$($1_OBJECT_DIR)/$1_pch.obj
$$(eval $$(call add_native_source,$1,$$($1_GENERATED_PCH_SRC), \
$$($1_OBJECT_DIR),,, \
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS) $$($1_SYSROOT_CFLAGS) \
-Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
$$($1_CXX),,no_this_file))
$$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \
FILE := $$($1_GENERATED_PCH_SRC), \
BASE := $1, \
EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
DISABLE_THIS_FILE_DEFINE := true, \
))
$1_USE_PCH_FLAGS := \
-Fp$$($1_PCH_FILE) -Yu$$(notdir $$($1_PRECOMPILED_HEADER))
@ -688,13 +704,13 @@ define SetupNativeCompilationBody
endif
endif
# Now call add_native_source for each source file we are going to compile.
$$(foreach p, $$($1_SRCS), \
$$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS), \
$$($1_CC), \
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS) $$($1_SYSROOT_CFLAGS), \
$$($1_CXX), $$($1_ASFLAGS))))
# Now call SetupCompileNativeFile for each source file we are going to compile.
$$(foreach file, $$($1_SRCS), \
$$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$(file)),\
FILE := $$(file), \
BASE := $1, \
)) \
)
# Setup rule for printing progress info when compiling source files.
# This is a rough heuristic and may not always print accurate information.

View File

@ -59,13 +59,13 @@ define SetupTestFilesCompilationBody
ifeq ($$($1_TYPE), LIBRARY)
$1_PREFIX = lib
$1_OUTPUT_SUBDIR := lib
$1_CFLAGS := $(CFLAGS_TESTLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
$1_CFLAGS := $(CFLAGS_TESTLIB)
$1_LDFLAGS := $(LDFLAGS_TESTLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
$1_COMPILATION_TYPE := LIBRARY
else ifeq ($$($1_TYPE), PROGRAM)
$1_PREFIX = exe
$1_OUTPUT_SUBDIR := bin
$1_CFLAGS := $(CFLAGS_TESTEXE) $(CFLAGS_WARNINGS_ARE_ERRORS)
$1_CFLAGS := $(CFLAGS_TESTEXE)
$1_LDFLAGS := $(LDFLAGS_TESTEXE)
$1_COMPILATION_TYPE := EXECUTABLE
else

View File

@ -743,11 +743,22 @@ var getJibProfilesProfiles = function (input, common, data) {
dependencies: [ "devkit" ],
environment_path: input.get("devkit", "install_path")
+ "/Xcode.app/Contents/Developer/usr/bin"
}
};
profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
}
// On windows we want the debug symbols available at test time
if (input.build_os == "windows") {
windowsRunTestPrebuiltExtra = {
dependencies: [ testedProfile + ".jdk_symbols" ],
environment: {
"PRODUCT_SYMBOLS_HOME": input.get(testedProfile + ".jdk_symbols", "home_path"),
}
};
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
windowsRunTestPrebuiltExtra);
}
// Generate the missing platform attributes
profiles = generatePlatformAttributes(profiles);

View File

@ -1,26 +0,0 @@
!XGetWindowProperty|int
w long
property Atom
long_offset long
long_length long
delete Bool
req_type Atom
actual_type Atom out
actual_format int out
number_of_items long out
bytes_after long out
data pointer out free
!XQueryTree|int
w long
root long out
parent long out
children pointer out free
nchildren int out
!XTranslateCoordinates|int
scr_w long
dest_w long
src_x int
src_y int
dest_x int out
dest_y int out
child long out

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
//
//
// This file is used for automated generation of java classes to wrap native structures.
// The detail on format of this file see WrapperGenerator.java
// For details on format of this file, see WrapperGenerator.java
//
// WARNING: if you modified this file, you need to regenerate sizes.64-solaris-i386
// WARNING: If you modify this file, you need to regenerate sizes-32.txt and sizes-64.txt.
// Run "make update-x11wrappers" to do this.
//
XExtData

View File

@ -30,10 +30,10 @@ $(eval $(call IncludeCustomExtension, gensrc/Gensrc-java.desktop.gmk))
ifneq ($(OPENJDK_TARGET_OS), windows)
include GensrcIcons.gmk
endif
ifneq ($(OPENJDK_TARGET_OS), macosx)
include GensrcX11Wrappers.gmk
endif
ifneq ($(filter $(OPENJDK_TARGET_OS), linux solaris aix), )
include GensrcX11Wrappers.gmk
endif
include GensrcSwing.gmk

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -23,106 +23,32 @@
# questions.
#
# This file is responsible for extracting the x11 native struct offsets to
# the xawt Java library. The tool needs to be run on the os/arch that
# will host the final jvm, thus the tool cannot be used when cross compiling.
# Generate java sources using the X11 offsets that are precalculated in files
# make/data/x11wrappergen/sizes-<address size>.txt.
# To enable cross compiling, the two versions of the generated offset file,
# sizes.32 and sizes.64 are committed into the source code repository.
# These are the ones used.
GENSRC_X11WRAPPERS_OUTPUT_TOP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
# However when not cross compiling, the offset generator tool is built and
# run, to verify that it still generates the same sizes.32 and sizes.64.
GENSRC_X11WRAPPERS_MARKER := $(GENSRC_X11WRAPPERS_OUTPUT_TOP)/_x11wrappers.marker
GENSRC_X11WRAPPERS :=
# Put temporary c-code and executable to calculate offsets here.
# Also put verification offset file here as well.
GENSRC_X11WRAPPERS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_x11wrappers
# Put the generated Java classes used to interface X11 from awt here.
GENSRC_X11WRAPPERS_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11
GENSRC_X11WRAPPERS_OUTPUTDIR := $(GENSRC_X11WRAPPERS_OUTPUT_TOP)/sun/awt/X11
# The pre-calculated offset file are stored here:
GENSRC_SIZER_DIR := $(TOPDIR)/make/data/x11wrappergen
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen
GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS).txt
# Normal case is to generate only according to target bits
GENSRC_X11_VERSION := $(OPENJDK_TARGET_CPU_BITS)
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
ifneq ($(OPENJDK_TARGET_OS), linux)
# On all 64-bit systems except Linux, generate both 32 and 64 bit versions
GENSRC_X11_VERSION := 32 64
endif
else
ifeq ($(OPENJDK_TARGET_OS), solaris)
# As a special case, solaris 32-bit also generates the 64-bit version
GENSRC_X11_VERSION := 32 64
endif
endif
$(info ExecuteWithLog is $(call ExecuteWithLog $(GENSRC_X11WRAPPERS_OUTPUT_TOP)/foobar, CMDLINE))
GENSRC_X11_SIZES_USED := $(addprefix $(GENSRC_X11WRAPPERS_TMP)/sizes., $(GENSRC_X11_VERSION))
# Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the
# file prefix it is given so those not needed need to be hidden.
$(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.%
$(call MakeDir, $(@D))
$(RM) '$@'
$(SORT) $< > $@
# Run the tool on the offset files copied from the source repository to generate several Java classes
# used in awt.
$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS_JDK)
$(call MakeDir, $(GENSRC_X11WRAPPERS_DST))
$(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes
# Run the tool on the offset files to generate several Java classes used in awt.
$(GENSRC_X11WRAPPERS_MARKER): $(BUILD_TOOLS_JDK) $(GENSRC_X11WRAPPERS_DATA) \
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt
$(call MakeDir, $(GENSRC_X11WRAPPERS_OUTPUTDIR))
$(call LogInfo, Generating X11 wrapper source files)
$(call ExecuteWithLog, $@, \
$(TOOL_WRAPPERGENERATOR) gen_java $(GENSRC_X11WRAPPERS_OUTPUTDIR) \
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(GENSRC_X11WRAPPERS_DATA) \
$(OPENJDK_TARGET_CPU_BITS))
$(TOUCH) $@
GENSRC_X11WRAPPERS += $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11
ifneq ($(COMPILE_TYPE), cross)
# This is not a cross compile, regenerate the offset file, so that we
# can compare it with the version in the source code repository.
# Generate the C code for the program that will output the offset file.
$(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS_JDK)
$(call LogInfo, Generating X11 wrapper ($*-bit version))
$(call MakeDir, $(@D))
$(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
# use -m32/-m64 only if the compiler supports it
ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true)
MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*"
endif
SIZER_CFLAGS := \
-I$(TOPDIR)/src/hotspot/share/include \
-I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
-I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
-I$(TOPDIR)/src/java.base/share/native/libjava \
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
#
# Compile the C code into an executable.
$(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
$(call MakeDir, $(@D))
(cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \
$(X_CFLAGS) \
$(X_LIBS) \
$(SIZER_CFLAGS) -lc)
.PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
# Run the executable create the offset file and check that it is identical
# to the offset file in the source code repository.
$(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
$(call LogInfo, Verifying X11 wrapper sizes)
$(call MakeDir, $(@D))
$(GENSRC_X11WRAPPERS_TMP)/sizer.$*.exe | $(SORT) > $@.tmp
$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
mv $@.tmp $@
GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/sizes.$(OPENJDK_TARGET_CPU_BITS).verification
endif
GENSRC_JAVA_DESKTOP += $(GENSRC_X11WRAPPERS)
GENSRC_JAVA_DESKTOP += $(GENSRC_X11WRAPPERS_MARKER)

View File

@ -160,7 +160,9 @@ ifeq ($(call check-jvm-feature, dtrace), true)
> $(DTRACE_SUPPORT_DIR)/$(@F).d))
$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \
-s $(DTRACE_SUPPORT_DIR)/$(@F).d)
$(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(call GetElfeditCommands) $@)
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
$(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(call GetElfeditCommands) $@)
endif
############################################################################
# Build the stand-alone dtrace libraries

View File

@ -82,7 +82,6 @@ $(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \
CFLAGS_macosx := -DGTEST_OS_MAC=1, \
CFLAGS_aix := -qpic=large, \
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef switch format-nonliteral \
tautological-undefined-compare $(BUILD_LIBJVM_DISABLED_WARNINGS_clang), \
@ -116,7 +115,6 @@ $(eval $(call SetupNativeCompilation, BUILD_GTEST_LAUNCHER, \
CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
-I$(GTEST_FRAMEWORK_SRC)/include, \
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
LDFLAGS := $(LDFLAGS_JDKEXE), \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_solaris := -library=stlport4, \

View File

@ -221,7 +221,6 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \
CFLAGS := $(JVM_CFLAGS), \
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_clang := tautological-compare, \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1109,7 +1109,6 @@ public class WrapperGenerator {
}
public void writeJavaWrapperClass(String outputDir) {
// (new File(outputDir, package_path)).mkdirs();
try {
for (Enumeration e = symbolTable.elements() ; e.hasMoreElements() ;) {
BaseType tp = (BaseType) e.nextElement();
@ -1126,7 +1125,6 @@ public class WrapperGenerator {
}
}
public void writeNativeSizer(String file)
{
int type;
@ -1136,7 +1134,6 @@ public class WrapperGenerator {
StructType stp;
Enumeration eo;
try {
FileOutputStream fs = new FileOutputStream(file);
@ -1158,7 +1155,6 @@ public class WrapperGenerator {
pw.println(" unsigned long status;\n");
pw.println("} PropMwmHints;\n");
pw.println("\n\nint main(){");
j=0;
for ( eo = symbolTable.elements() ; eo.hasMoreElements() ;) {
@ -1182,7 +1178,6 @@ public class WrapperGenerator {
pw.println("printf(\"Atom\t%d\\n\",(int)sizeof(Atom));");
pw.println("printf(\"Window\t%d\\n\",(int)sizeof(Window));");
for (eo = symbolTable.elements() ; eo.hasMoreElements() ;) {
@ -1234,7 +1229,8 @@ public class WrapperGenerator {
symbolTable.put("Atom", new AtomicType(AtomicType.TYPE_ATOM, "", "Atom"));
symbolTable.put("ulong", new AtomicType(AtomicType.TYPE_ULONG, "", "ulong"));
}
public WrapperGenerator(String outputDir, String xlibFilename) {
public WrapperGenerator(String xlibFilename) {
initTypes();
try {
BufferedReader in = new BufferedReader(new FileReader(xlibFilename));
@ -1303,33 +1299,19 @@ public class WrapperGenerator {
catch (Exception e) {
e.printStackTrace();
}
}
private void makeSizer(String outputDir) {
if (wide) {
sizerFileName = "sizer.64.c";
} else {
sizerFileName = "sizer.32.c";
}
File fp = new File(outputDir, sizerFileName);
private void makeSizer(String sizerFileName) {
File fp = new File(sizerFileName);
writeNativeSizer(fp.getAbsolutePath());
}
private boolean readSizeInfo(String sizeInfo) {
private boolean readFileSizeInfo(String filename, boolean wide) {
try {
File f = new File(sizeInfo+".32");
boolean res = true;
FileInputStream fis = null;
if (f.exists()) {
fis = new FileInputStream(f);
res = readSizeInfo(fis, false);
fis.close();
}
f = new File(sizeInfo+".64");
if (f.exists()) {
fis = new FileInputStream(f);
res &= readSizeInfo(fis, true);
fis.close();
}
FileInputStream fis = new FileInputStream(filename);
res = readSizeInfo(fis, wide);
fis.close();
return res;
} catch (Exception e) {
e.printStackTrace();
@ -1337,8 +1319,8 @@ public class WrapperGenerator {
}
}
private void startGeneration(String outputDir, String sizeInfo) {
if (readSizeInfo(sizeInfo))
private void startGeneration(String outputDir, String filename, boolean wide) {
if (readFileSizeInfo(filename, wide))
{
writeJavaWrapperClass(outputDir);
}
@ -1348,21 +1330,22 @@ public class WrapperGenerator {
}
public static void main(String[] args) {
if (args.length < 4) {
System.out.println("Usage:\nWrapperGenerator <output_dir> <xlibtypes.txt> <action> [<platform> | <sizes info file>]");
System.out.println("Where <action>: gen, sizer");
System.out.println(" <platform>: 32, 64");
System.out.println("Usage:\nWrapperGenerator gen_java <output_dir> <xlibtypes.txt> <sizes-*.txt> <platform>");
System.out.println(" or");
System.out.println("WrapperGenerator gen_c_source <output_file> <xlibtypes.txt> <platform>");
System.out.println("Where <platform>: 32, 64");
System.exit(1);
}
WrapperGenerator xparser = new WrapperGenerator(args[0], args[1]);
if (args[2].equals("sizer")) {
WrapperGenerator xparser = new WrapperGenerator(args[2]);
if (args[0].equals("gen_c_source")) {
xparser.wide = args[3].equals("64");
xparser.makeSizer(args[0]);
} else if (args[2].equals("gen")) {
xparser.startGeneration(args[0], args[3]);
xparser.makeSizer(args[1]);
} else if (args[0].equals("gen_java")) {
boolean wide = args[4].equals("64");
xparser.startGeneration(args[1], args[3], wide);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,7 @@ package javax.security.auth;
*
* <p> The target name is the name of a security configuration parameter
* (see below). Currently the {@code AuthPermission} object is used to
* guard access to the {@link Policy}, {@link Subject},
* guard access to the {@link Subject},
* {@link javax.security.auth.login.LoginContext}, and
* {@link javax.security.auth.login.Configuration} objects.
*
@ -121,21 +121,6 @@ package javax.security.auth;
* {@code LoginContext}.
* </pre>
*
* <p> {@code javax.security.auth.Policy} has been
* deprecated in favor of {@code java.security.Policy}.
* Therefore, the following target names have also been deprecated:
*
* <pre>
* getPolicy - allow the caller to retrieve the system-wide
* Subject-based access control policy.
*
* setPolicy - allow the caller to set the system-wide
* Subject-based access control policy.
*
* refreshPolicy - allow the caller to refresh the system-wide
* Subject-based access control policy.
* </pre>
*
* @implNote
* Implementations may define additional target names, but should use naming
* conventions such as reverse domain name notation to avoid name clashes.

View File

@ -1,356 +0,0 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.security.auth;
import java.security.Security;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction;
import java.util.Objects;
import sun.security.util.Debug;
/**
* <p> This is an abstract class for representing the system policy for
* Subject-based authorization. A subclass implementation
* of this class provides a means to specify a Subject-based
* access control {@code Policy}.
*
* <p> A {@code Policy} object can be queried for the set of
* Permissions granted to code running as a
* {@code Principal} in the following manner:
*
* <pre>
* policy = Policy.getPolicy();
* PermissionCollection perms = policy.getPermissions(subject,
* codeSource);
* </pre>
*
* The {@code Policy} object consults the local policy and returns
* and appropriate {@code Permissions} object with the
* Permissions granted to the Principals associated with the
* provided {@code subject}, and granted to the code specified
* by the provided {@code codeSource}.
*
* <p> A {@code Policy} contains the following information.
* Note that this example only represents the syntax for the default
* {@code Policy} implementation. Subclass implementations of this class
* may implement alternative syntaxes and may retrieve the
* {@code Policy} from any source such as files, databases,
* or servers.
*
* <p> Each entry in the {@code Policy} is represented as
* a <b><i>grant</i></b> entry. Each <b><i>grant</i></b> entry
* specifies a codebase, code signers, and Principals triplet,
* as well as the Permissions granted to that triplet.
*
* <pre>
* grant CodeBase ["URL"], Signedby ["signers"],
* Principal [Principal_Class] "Principal_Name" {
* Permission Permission_Class ["Target_Name"]
* [, "Permission_Actions"]
* [, signedBy "SignerName"];
* };
* </pre>
*
* The CodeBase and Signedby components of the triplet name/value pairs
* are optional. If they are not present, then any codebase will match,
* and any signer (including unsigned code) will match.
* For Example,
*
* <pre>
* grant CodeBase "foo.com", Signedby "foo",
* Principal com.sun.security.auth.UnixPrincipal "duke" {
* permission java.io.FilePermission "/home/duke", "read, write";
* };
* </pre>
*
* This <b><i>grant</i></b> entry specifies that code from "foo.com",
* signed by "foo', and running as a {@code UnixPrincipal} with the
* name, duke, has one {@code Permission}. This {@code Permission}
* permits the executing code to read and write files in the directory,
* "/home/duke".
*
* <p> To "run" as a particular {@code Principal},
* code invokes the {@code Subject.doAs(subject, ...)} method.
* After invoking that method, the code runs as all the Principals
* associated with the specified {@code Subject}.
* Note that this {@code Policy} (and the Permissions
* granted in this {@code Policy}) only become effective
* after the call to {@code Subject.doAs} has occurred.
*
* <p> Multiple Principals may be listed within one <b><i>grant</i></b> entry.
* All the Principals in the grant entry must be associated with
* the {@code Subject} provided to {@code Subject.doAs}
* for that {@code Subject} to be granted the specified Permissions.
*
* <pre>
* grant Principal com.sun.security.auth.UnixPrincipal "duke",
* Principal com.sun.security.auth.UnixNumericUserPrincipal "0" {
* permission java.io.FilePermission "/home/duke", "read, write";
* permission java.net.SocketPermission "duke.com", "connect";
* };
* </pre>
*
* This entry grants any code running as both "duke" and "0"
* permission to read and write files in duke's home directory,
* as well as permission to make socket connections to "duke.com".
*
* <p> Note that non Principal-based grant entries are not permitted
* in this {@code Policy}. Therefore, grant entries such as:
*
* <pre>
* grant CodeBase "foo.com", Signedby "foo" {
* permission java.io.FilePermission "/tmp/scratch", "read, write";
* };
* </pre>
*
* are rejected. Such permission must be listed in the
* {@code java.security.Policy}.
*
* <p> The default {@code Policy} implementation can be changed by
* setting the value of the {@code auth.policy.provider} security property to
* the fully qualified name of the desired {@code Policy} implementation class.
*
* @deprecated Replaced by java.security.Policy.
* java.security.Policy has a method:
* <pre>
* public PermissionCollection getPermissions
* (java.security.ProtectionDomain pd)
*
* </pre>
* and ProtectionDomain has a constructor:
* <pre>
* public ProtectionDomain
* (CodeSource cs,
* PermissionCollection permissions,
* ClassLoader loader,
* Principal[] principals)
* </pre>
*
* These two APIs provide callers the means to query the
* Policy for Principal-based Permission entries.
* This class is subject to removal in a future version of Java SE.
*
* @since 1.4
* @see java.security.Security security properties
*/
@Deprecated(since="1.4", forRemoval=true)
public abstract class Policy {
private static Policy policy;
private static final String AUTH_POLICY =
"sun.security.provider.AuthPolicyFile";
private final java.security.AccessControlContext acc =
java.security.AccessController.getContext();
// true if a custom (not AUTH_POLICY) system-wide policy object is set
private static boolean isCustomPolicy;
/**
* Sole constructor. (For invocation by subclass constructors, typically
* implicit.)
*/
protected Policy() { }
/**
* Returns the installed Policy object.
* This method first calls
* {@code SecurityManager.checkPermission} with the
* {@code AuthPermission("getPolicy")} permission
* to ensure the caller has permission to get the Policy object.
*
* @return the installed Policy. The return value cannot be
* {@code null}.
*
* @exception java.lang.SecurityException if the current thread does not
* have permission to get the Policy object.
*
* @see #setPolicy
*/
public static Policy getPolicy() {
java.lang.SecurityManager sm = System.getSecurityManager();
if (sm != null) sm.checkPermission(new AuthPermission("getPolicy"));
return getPolicyNoCheck();
}
/**
* Returns the installed Policy object, skipping the security check.
*
* @return the installed Policy.
*
*/
static Policy getPolicyNoCheck() {
if (policy == null) {
synchronized(Policy.class) {
if (policy == null) {
String policy_class = null;
policy_class = AccessController.doPrivileged
(new PrivilegedAction<String>() {
public String run() {
return java.security.Security.getProperty
("auth.policy.provider");
}
});
if (policy_class == null) {
policy_class = AUTH_POLICY;
}
try {
final String finalClass = policy_class;
Policy untrustedImpl = AccessController.doPrivileged(
new PrivilegedExceptionAction<Policy>() {
public Policy run() throws ClassNotFoundException,
InstantiationException,
IllegalAccessException {
Class<? extends Policy> implClass = Class.forName(
finalClass, false,
Thread.currentThread().getContextClassLoader()
).asSubclass(Policy.class);
return implClass.newInstance();
}
});
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() {
public Void run() {
setPolicy(untrustedImpl);
isCustomPolicy = !finalClass.equals(AUTH_POLICY);
return null;
}
}, Objects.requireNonNull(untrustedImpl.acc)
);
} catch (Exception e) {
throw new SecurityException
(sun.security.util.ResourcesMgr.getString
("unable.to.instantiate.Subject.based.policy"));
}
}
}
}
return policy;
}
/**
* Sets the system-wide Policy object. This method first calls
* {@code SecurityManager.checkPermission} with the
* {@code AuthPermission("setPolicy")}
* permission to ensure the caller has permission to set the Policy.
*
* @param policy the new system Policy object.
*
* @exception java.lang.SecurityException if the current thread does not
* have permission to set the Policy.
*
* @see #getPolicy
*/
public static void setPolicy(Policy policy) {
java.lang.SecurityManager sm = System.getSecurityManager();
if (sm != null) sm.checkPermission(new AuthPermission("setPolicy"));
Policy.policy = policy;
// all non-null policy objects are assumed to be custom
isCustomPolicy = policy != null ? true : false;
}
/**
* Returns true if a custom (not AUTH_POLICY) system-wide policy object
* has been set or installed. This method is called by
* SubjectDomainCombiner to provide backwards compatibility for
* developers that provide their own javax.security.auth.Policy
* implementations.
*
* @return true if a custom (not AUTH_POLICY) system-wide policy object
* has been set; false otherwise
*/
static boolean isCustomPolicySet(Debug debug) {
if (policy != null) {
if (debug != null && isCustomPolicy) {
debug.println("Providing backwards compatibility for " +
"javax.security.auth.policy implementation: " +
policy.toString());
}
return isCustomPolicy;
}
// check if custom policy has been set using auth.policy.provider prop
String policyClass = java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<String>() {
public String run() {
return Security.getProperty("auth.policy.provider");
}
});
if (policyClass != null && !policyClass.equals(AUTH_POLICY)) {
if (debug != null) {
debug.println("Providing backwards compatibility for " +
"javax.security.auth.policy implementation: " +
policyClass);
}
return true;
}
return false;
}
/**
* Retrieve the Permissions granted to the Principals associated with
* the specified {@code CodeSource}.
*
* @param subject the {@code Subject}
* whose associated Principals,
* in conjunction with the provided
* {@code CodeSource}, determines the Permissions
* returned by this method. This parameter
* may be {@code null}.
*
* @param cs the code specified by its {@code CodeSource}
* that determines, in conjunction with the provided
* {@code Subject}, the Permissions
* returned by this method. This parameter may be
* {@code null}.
*
* @return the Collection of Permissions granted to all the
* {@code Subject} and code specified in
* the provided <i>subject</i> and <i>cs</i>
* parameters.
*/
public abstract java.security.PermissionCollection getPermissions
(Subject subject,
java.security.CodeSource cs);
/**
* Refresh and reload the Policy.
*
* <p>This method causes this object to refresh/reload its current
* Policy. This is implementation-dependent.
* For example, if the Policy object is stored in
* a file, calling {@code refresh} will cause the file to be re-read.
*
* @exception SecurityException if the caller does not have permission
* to refresh the Policy.
*/
public abstract void refresh();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,13 +26,9 @@
package javax.security.auth;
import java.security.AccessController;
import java.security.Permission;
import java.security.Permissions;
import java.security.PermissionCollection;
import java.security.Principal;
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
import java.security.Security;
import java.util.Set;
import java.util.WeakHashMap;
import java.lang.ref.WeakReference;
@ -56,15 +52,6 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner {
sun.security.util.Debug.getInstance("combiner",
"\t[SubjectDomainCombiner]");
@SuppressWarnings({"deprecation", "removal"})
// Note: check only at classloading time, not dynamically during combine()
private static final boolean useJavaxPolicy =
javax.security.auth.Policy.isCustomPolicySet(debug);
// Relevant only when useJavaxPolicy is true
private static final boolean allowCaching =
(useJavaxPolicy && cachePolicy());
/**
* Associate the provided {@code Subject} with this
* {@code SubjectDomainCombiner}.
@ -196,12 +183,6 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner {
return null;
}
// maintain backwards compatibility for developers who provide
// their own custom javax.security.auth.Policy implementations
if (useJavaxPolicy) {
return combineJavaxPolicy(currentDomains, assignedDomains);
}
int cLen = (currentDomains == null ? 0 : currentDomains.length);
int aLen = (assignedDomains == null ? 0 : assignedDomains.length);
@ -292,151 +273,6 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner {
}
}
/**
* Use the javax.security.auth.Policy implementation
*/
private ProtectionDomain[] combineJavaxPolicy(
ProtectionDomain[] currentDomains,
ProtectionDomain[] assignedDomains) {
if (!allowCaching) {
java.security.AccessController.doPrivileged
(new PrivilegedAction<Void>() {
@SuppressWarnings({"deprecation", "removal"})
public Void run() {
// Call refresh only caching is disallowed
javax.security.auth.Policy.getPolicy().refresh();
return null;
}
});
}
int cLen = (currentDomains == null ? 0 : currentDomains.length);
int aLen = (assignedDomains == null ? 0 : assignedDomains.length);
// the ProtectionDomains for the new AccessControlContext
// that we will return
ProtectionDomain[] newDomains = new ProtectionDomain[cLen + aLen];
synchronized(cachedPDs) {
if (!subject.isReadOnly() &&
!subject.getPrincipals().equals(principalSet)) {
// if the Subject was mutated, clear the PD cache
Set<Principal> newSet = subject.getPrincipals();
synchronized(newSet) {
principalSet = new java.util.HashSet<Principal>(newSet);
}
principals = principalSet.toArray
(new Principal[principalSet.size()]);
cachedPDs.clear();
if (debug != null) {
debug.println("Subject mutated - clearing cache");
}
}
for (int i = 0; i < cLen; i++) {
ProtectionDomain pd = currentDomains[i];
ProtectionDomain subjectPd = cachedPDs.getValue(pd);
if (subjectPd == null) {
if (pd.staticPermissionsOnly()) {
// keep static ProtectionDomain objects static
subjectPd = pd;
} else {
// XXX
// we must first add the original permissions.
// that way when we later add the new JAAS permissions,
// any unresolved JAAS-related permissions will
// automatically get resolved.
// get the original perms
Permissions perms = new Permissions();
PermissionCollection coll = pd.getPermissions();
java.util.Enumeration<Permission> e;
if (coll != null) {
synchronized (coll) {
e = coll.elements();
while (e.hasMoreElements()) {
Permission newPerm =
e.nextElement();
perms.add(newPerm);
}
}
}
// get perms from the policy
final java.security.CodeSource finalCs = pd.getCodeSource();
final Subject finalS = subject;
PermissionCollection newPerms =
java.security.AccessController.doPrivileged
(new PrivilegedAction<PermissionCollection>() {
@SuppressWarnings({"deprecation", "removal"})
public PermissionCollection run() {
return
javax.security.auth.Policy.getPolicy().getPermissions
(finalS, finalCs);
}
});
// add the newly granted perms,
// avoiding duplicates
synchronized (newPerms) {
e = newPerms.elements();
while (e.hasMoreElements()) {
Permission newPerm = e.nextElement();
if (!perms.implies(newPerm)) {
perms.add(newPerm);
if (debug != null)
debug.println (
"Adding perm " + newPerm + "\n");
}
}
}
subjectPd = new ProtectionDomain
(finalCs, perms, pd.getClassLoader(), principals);
}
if (allowCaching)
cachedPDs.putValue(pd, subjectPd);
}
newDomains[i] = subjectPd;
}
}
if (debug != null) {
debug.println("updated current: ");
for (int i = 0; i < cLen; i++) {
debug.println("\tupdated[" + i + "] = " + newDomains[i]);
}
}
// now add on the assigned domains
if (aLen > 0) {
System.arraycopy(assignedDomains, 0, newDomains, cLen, aLen);
}
if (debug != null) {
if (newDomains == null || newDomains.length == 0) {
debug.println("returning null");
} else {
debug.println("combinedDomains: ");
for (int i = 0; i < newDomains.length; i++) {
debug.println("newDomain " + i + ": " +
newDomains[i].toString());
}
}
}
// return the new ProtectionDomains
if (newDomains == null || newDomains.length == 0) {
return null;
} else {
return newDomains;
}
}
private static ProtectionDomain[] optimize(ProtectionDomain[] domains) {
if (domains == null || domains.length == 0)
return null;
@ -476,21 +312,6 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner {
return ((num == 0 || optimized.length == 0) ? null : optimized);
}
private static boolean cachePolicy() {
String s = AccessController.doPrivileged
(new PrivilegedAction<String>() {
public String run() {
return Security.getProperty("cache.auth.policy");
}
});
if (s != null) {
return Boolean.parseBoolean(s);
}
// cache by default
return true;
}
private static void printInputDomains(ProtectionDomain[] currentDomains,
ProtectionDomain[] assignedDomains) {
if (currentDomains == null || currentDomains.length == 0) {

View File

@ -57,9 +57,6 @@ public class MimeTable implements FileNameMap {
"/etc/mailcap",
"/usr/etc/mailcap",
"/usr/local/etc/mailcap",
System.getProperty("hotjava.home",
"/usr/local/hotjava")
+ "/lib/mailcap",
};
return null;
}

View File

@ -63,8 +63,6 @@ public interface SelChImpl extends Channel {
void translateAndSetInterestOps(int ops, SelectionKeyImpl sk);
int validOps();
void kill() throws IOException;
}

View File

@ -96,7 +96,7 @@ class SocketChannelImpl
private static final int ST_CLOSING = 3;
private static final int ST_KILLPENDING = 4;
private static final int ST_KILLED = 5;
private int state;
private volatile int state; // need stateLock to change
// IDs of native threads doing reads and writes, for signalling
private long readerThread;
@ -148,12 +148,37 @@ class SocketChannelImpl
}
}
// @throws ClosedChannelException if channel is closed
/**
* Checks that the channel is open.
*
* @throws ClosedChannelException if channel is closed (or closing)
*/
private void ensureOpen() throws ClosedChannelException {
if (!isOpen())
throw new ClosedChannelException();
}
/**
* Checks that the channel is open and connected.
*
* @apiNote This method uses the "state" field to check if the channel is
* open. It should never be used in conjuncion with isOpen or ensureOpen
* as these methods check AbstractInterruptibleChannel's closed field - that
* field is set before implCloseSelectableChannel is called and so before
* the state is changed.
*
* @throws ClosedChannelException if channel is closed (or closing)
* @throws NotYetConnectedException if open and not connected
*/
private void ensureOpenAndConnected() throws ClosedChannelException {
int state = this.state;
if (state < ST_CONNECTED) {
throw new NotYetConnectedException();
} else if (state > ST_CONNECTED) {
throw new ClosedChannelException();
}
}
@Override
public Socket socket() {
synchronized (stateLock) {
@ -275,13 +300,14 @@ class SocketChannelImpl
if (blocking) {
// set hook for Thread.interrupt
begin();
}
synchronized (stateLock) {
ensureOpen();
if (state != ST_CONNECTED)
throw new NotYetConnectedException();
if (blocking)
synchronized (stateLock) {
ensureOpenAndConnected();
// record thread so it can be signalled if needed
readerThread = NativeThread.current();
}
} else {
ensureOpenAndConnected();
}
}
@ -385,15 +411,16 @@ class SocketChannelImpl
if (blocking) {
// set hook for Thread.interrupt
begin();
}
synchronized (stateLock) {
ensureOpen();
if (isOutputClosed)
throw new ClosedChannelException();
if (state != ST_CONNECTED)
throw new NotYetConnectedException();
if (blocking)
synchronized (stateLock) {
ensureOpenAndConnected();
if (isOutputClosed)
throw new ClosedChannelException();
// record thread so it can be signalled if needed
writerThread = NativeThread.current();
}
} else {
ensureOpenAndConnected();
}
}
@ -574,38 +601,48 @@ class SocketChannelImpl
@Override
public boolean isConnected() {
synchronized (stateLock) {
return (state == ST_CONNECTED);
}
return (state == ST_CONNECTED);
}
@Override
public boolean isConnectionPending() {
synchronized (stateLock) {
return (state == ST_CONNECTIONPENDING);
}
return (state == ST_CONNECTIONPENDING);
}
/**
* Marks the beginning of a connect operation that might block.
*
* @param blocking true if configured blocking
* @param isa the remote address
* @throws ClosedChannelException if the channel is closed
* @throws AlreadyConnectedException if already connected
* @throws ConnectionPendingException is a connection is pending
* @throws IOException if the pre-connect hook fails
*/
private void beginConnect(boolean blocking) throws ClosedChannelException {
private void beginConnect(boolean blocking, InetSocketAddress isa)
throws IOException
{
if (blocking) {
// set hook for Thread.interrupt
begin();
}
synchronized (stateLock) {
ensureOpen();
int state = this.state;
if (state == ST_CONNECTED)
throw new AlreadyConnectedException();
if (state == ST_CONNECTIONPENDING)
throw new ConnectionPendingException();
if (blocking)
assert state == ST_UNCONNECTED;
this.state = ST_CONNECTIONPENDING;
if (localAddress == null)
NetHooks.beforeTcpConnect(fd, isa.getAddress(), isa.getPort());
remoteAddress = isa;
if (blocking) {
// record thread so it can be signalled if needed
readerThread = NativeThread.current();
}
}
}
@ -614,11 +651,21 @@ class SocketChannelImpl
*
* @throws AsynchronousCloseException if the channel was closed due to this
* thread being interrupted on a blocking connect operation.
* @throws IOException if completed and unable to obtain the local address
*/
private void endConnect(boolean blocking, boolean completed)
throws AsynchronousCloseException
throws IOException
{
endRead(blocking, completed);
if (completed) {
synchronized (stateLock) {
if (state == ST_CONNECTIONPENDING) {
localAddress = Net.localAddress(fd);
state = ST_CONNECTED;
}
}
}
}
@Override
@ -628,64 +675,37 @@ class SocketChannelImpl
if (sm != null)
sm.checkConnect(isa.getAddress().getHostAddress(), isa.getPort());
readLock.lock();
InetAddress ia = isa.getAddress();
if (ia.isAnyLocalAddress())
ia = InetAddress.getLocalHost();
try {
writeLock.lock();
readLock.lock();
try {
// notify before-connect hook
synchronized (stateLock) {
if (state == ST_UNCONNECTED && localAddress == null) {
NetHooks.beforeTcpConnect(fd, isa.getAddress(), isa.getPort());
}
}
InetAddress ia = isa.getAddress();
if (ia.isAnyLocalAddress())
ia = InetAddress.getLocalHost();
int n = 0;
boolean blocking = isBlocking();
writeLock.lock();
try {
int n = 0;
boolean blocking = isBlocking();
try {
beginConnect(blocking);
if (blocking) {
do {
n = Net.connect(fd, ia, isa.getPort());
} while (n == IOStatus.INTERRUPTED && isOpen());
} else {
beginConnect(blocking, isa);
do {
n = Net.connect(fd, ia, isa.getPort());
}
} while (n == IOStatus.INTERRUPTED && isOpen());
} finally {
endConnect(blocking, n > 0);
}
} catch (IOException x) {
// connect failed, close socket
close();
throw x;
}
// connection may be established
synchronized (stateLock) {
if (!isOpen())
throw new AsynchronousCloseException();
remoteAddress = isa;
if (n > 0) {
// connected established
localAddress = Net.localAddress(fd);
state = ST_CONNECTED;
return true;
} else {
// connection pending
assert !blocking;
state = ST_CONNECTIONPENDING;
return false;
endConnect(blocking, (n > 0));
}
assert IOStatus.check(n);
return n > 0;
} finally {
writeLock.unlock();
}
} finally {
writeLock.unlock();
readLock.unlock();
}
} finally {
readLock.unlock();
} catch (IOException ioe) {
// connect failed, close the channel
close();
throw ioe;
}
}
@ -704,8 +724,10 @@ class SocketChannelImpl
ensureOpen();
if (state != ST_CONNECTIONPENDING)
throw new NoConnectionPendingException();
if (blocking)
if (blocking) {
// record thread so it can be signalled if needed
readerThread = NativeThread.current();
}
}
}
@ -714,65 +736,62 @@ class SocketChannelImpl
*
* @throws AsynchronousCloseException if the channel was closed due to this
* thread being interrupted on a blocking connect operation.
* @throws IOException if completed and unable to obtain the local address
*/
private void endFinishConnect(boolean blocking, boolean completed)
throws AsynchronousCloseException
throws IOException
{
endRead(blocking, completed);
if (completed) {
synchronized (stateLock) {
if (state == ST_CONNECTIONPENDING) {
localAddress = Net.localAddress(fd);
state = ST_CONNECTED;
}
}
}
}
@Override
public boolean finishConnect() throws IOException {
readLock.lock();
try {
writeLock.lock();
readLock.lock();
try {
// already connected?
synchronized (stateLock) {
if (state == ST_CONNECTED)
return true;
}
int n = 0;
boolean blocking = isBlocking();
writeLock.lock();
try {
// no-op if already connected
if (isConnected())
return true;
boolean blocking = isBlocking();
boolean connected = false;
try {
beginFinishConnect(blocking);
int n = 0;
if (blocking) {
do {
n = checkConnect(fd, true);
} while (n == 0 || (n == IOStatus.INTERRUPTED) && isOpen());
} while ((n == 0 || n == IOStatus.INTERRUPTED) && isOpen());
} else {
n = checkConnect(fd, false);
}
connected = (n > 0);
} finally {
endFinishConnect(blocking, n > 0);
}
} catch (IOException x) {
close();
throw x;
}
// post finishConnect, connection may be established
synchronized (stateLock) {
if (!isOpen())
throw new AsynchronousCloseException();
if (n > 0) {
// connection established
localAddress = Net.localAddress(fd);
state = ST_CONNECTED;
return true;
} else {
// connection still pending
assert !blocking;
return false;
endFinishConnect(blocking, connected);
}
assert (blocking && connected) ^ !blocking;
return connected;
} finally {
writeLock.unlock();
}
} finally {
writeLock.unlock();
readLock.unlock();
}
} finally {
readLock.unlock();
} catch (IOException ioe) {
// connect failed, close the channel
close();
throw ioe;
}
}
@ -994,20 +1013,17 @@ class SocketChannelImpl
return (newOps & ~oldOps) != 0;
}
boolean connected = isConnected();
if (((ops & Net.POLLIN) != 0) &&
((intOps & SelectionKey.OP_READ) != 0) &&
(state == ST_CONNECTED))
((intOps & SelectionKey.OP_READ) != 0) && connected)
newOps |= SelectionKey.OP_READ;
if (((ops & Net.POLLCONN) != 0) &&
((intOps & SelectionKey.OP_CONNECT) != 0) &&
((state == ST_UNCONNECTED) || (state == ST_CONNECTIONPENDING))) {
((intOps & SelectionKey.OP_CONNECT) != 0) && isConnectionPending())
newOps |= SelectionKey.OP_CONNECT;
}
if (((ops & Net.POLLOUT) != 0) &&
((intOps & SelectionKey.OP_WRITE) != 0) &&
(state == ST_CONNECTED))
((intOps & SelectionKey.OP_WRITE) != 0) && connected)
newOps |= SelectionKey.OP_WRITE;
sk.nioReadyOps(newOps);

View File

@ -51,13 +51,6 @@ import sun.net.www.ParseUtil;
* This class represents a default Policy implementation for the
* "JavaPolicy" type.
*
* Note:
* For backward compatibility with JAAS 1.0 it loads
* both java.auth.policy and java.policy. However, it
* is recommended that java.auth.policy not be used
* and that java.policy contain all grant entries including
* those that contain principal-based entries.
*
* <p> This object stores the policy for the entire Java runtime,
* and is the amalgamation of multiple static policy
* configurations that resides in files.
@ -75,17 +68,13 @@ import sun.net.www.ParseUtil;
* are needed in order for the runtime to operate correctly.
* <li>
* Loop through the <code>java.security.Security</code> properties,
* <i>policy.url.1</i>, <i>policy.url.2</i>, ...,
* <i>policy.url.X</i>" and
* <i>auth.policy.url.1</i>, <i>auth.policy.url.2</i>, ...,
* <i>auth.policy.url.X</i>". These properties are set
* and <i>policy.url.1</i>, <i>policy.url.2</i>, ...,
* <i>policy.url.X</i>". These properties are set
* in the Java security properties file, which is located in the file named
* &lt;JAVA_HOME&gt;/conf/security/java.security.
* Each property value specifies a <code>URL</code> pointing to a
* policy file to be loaded. Read in and load each policy.
*
* <i>auth.policy.url</i> is supported only for backward compatibility.
*
* If none of these could be loaded, use a builtin static policy
* equivalent to the conf/security/java.policy file.
*
@ -98,21 +87,7 @@ import sun.net.www.ParseUtil;
* <i>policy.allowSystemProperty</i> is set to <i>true</i>),
* also load that policy.
*
* <li>
* The <code>java.lang.System</code> property
* <i>java.security.auth.policy</i> may also be set to a
* <code>URL</code> pointing to another policy file
* (which is the case when a user uses the -D switch at runtime).
* If this property is defined, and its use is allowed by the
* security property file (the Security property,
* <i>policy.allowSystemProperty</i> is set to <i>true</i>),
* also load that policy.
*
* <i>java.security.auth.policy</i> is supported only for backward
* compatibility.
*
* If the <i>java.security.policy</i> or
* <i>java.security.auth.policy</i> property is defined using
* If the <i>java.security.policy</i> property is defined using
* "==" (rather than "="), then load the specified policy file and ignore
* all other configured policies. Note, that the default.policy file is
* also loaded, as specified in the first step of the algorithm above.
@ -269,8 +244,6 @@ public class PolicyFile extends java.security.Policy {
"javax.security.auth.x500.X500Principal";
private static final String POLICY = "java.security.policy";
private static final String POLICY_URL = "policy.url.";
private static final String AUTH_POLICY = "java.security.auth.policy";
private static final String AUTH_POLICY_URL = "auth.policy.url.";
private static final int DEFAULT_CACHE_SIZE = 1;
@ -411,14 +384,6 @@ public class PolicyFile extends java.security.Policy {
/**
* Caller did not specify URL via Policy.getInstance.
* Read from URLs listed in the java.security properties file.
*
* We call initPolicyFile with POLICY, POLICY_URL and then
* call it with AUTH_POLICY and AUTH_POLICY_URL.
* So first we will process the JAVA standard policy
* and then process the JAVA AUTH Policy.
* This is for backward compatibility as well as to handle
* cases where the user has a single unified policyfile
* with both java policy entries and auth entries
*/
boolean loaded_one = initPolicyFile(POLICY, POLICY_URL, newInfo);
@ -428,8 +393,6 @@ public class PolicyFile extends java.security.Policy {
// use static policy if all else fails
initStaticPolicy(newInfo);
}
initPolicyFile(AUTH_POLICY, AUTH_POLICY_URL, newInfo);
}
}

View File

@ -150,11 +150,6 @@ public class Resources extends java.util.ListResourceBundle {
// sun.security.pkcs11.SunPKCS11
{"PKCS11.Token.providerName.Password.",
"PKCS11 Token [{0}] Password: "},
/* --- DEPRECATED --- */
// javax.security.auth.Policy
{"unable.to.instantiate.Subject.based.policy",
"unable to instantiate Subject-based policy"}
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -293,8 +293,7 @@ Java_sun_nio_ch_Net_connect0(JNIEnv *env, jclass clazz, jboolean preferIPv6,
int sa_len = 0;
int rv;
if (NET_InetAddressToSockaddr(env, iao, port, &sa, &sa_len,
preferIPv6) != 0) {
if (NET_InetAddressToSockaddr(env, iao, port, &sa, &sa_len, preferIPv6) != 0) {
return IOS_THROWN;
}
@ -761,11 +760,11 @@ handleSocketError(JNIEnv *env, jint errorValue)
break;
#endif
case ECONNREFUSED:
xn = JNU_JAVANETPKG "ConnectException";
break;
case ETIMEDOUT:
case ENOTCONN:
xn = JNU_JAVANETPKG "ConnectException";
break;
case EHOSTUNREACH:
xn = JNU_JAVANETPKG "NoRouteToHostException";
break;

View File

@ -59,23 +59,29 @@ Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this,
poller.events = POLLOUT;
poller.revents = 0;
result = poll(&poller, 1, block ? -1 : 0);
if (result < 0) {
JNU_ThrowIOExceptionWithLastError(env, "Poll failed");
return IOS_THROWN;
if (errno == EINTR) {
return IOS_INTERRUPTED;
} else {
JNU_ThrowIOExceptionWithLastError(env, "poll failed");
return IOS_THROWN;
}
}
if (!block && (result == 0))
return IOS_UNAVAILABLE;
return IOS_UNAVAILABLE;
if (poller.revents) {
if (result > 0) {
errno = 0;
result = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &n);
if (result < 0) {
handleSocketError(env, errno);
return JNI_FALSE;
return handleSocketError(env, errno);
} else if (error) {
handleSocketError(env, error);
return JNI_FALSE;
return handleSocketError(env, error);
} else if ((poller.revents & POLLHUP) != 0) {
return handleSocketError(env, ENOTCONN);
}
// connected
return 1;
}
return 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,14 +39,15 @@ int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP);
#ifdef DEBUG
void printnif (netif *nif) {
#ifdef _WIN64
printf ("nif:0x%I64x name:%s\n", nif,nif->name);
printf ("nif:0x%I64x name:%s\n", (UINT_PTR)nif, nif->name);
#else
printf ("nif:0x%x name:%s\n", nif,nif->name);
printf ("nif:0x%x name:%s\n", nif, nif->name);
#endif
if (nif->dNameIsUnicode) {
printf ("dName:%S index:%d ", nif->displayName,nif->index);
printf ("dName:%S index:%d ", (unsigned short *)nif->displayName,
nif->index);
} else {
printf ("dName:%s index:%d ", nif->displayName,nif->index);
printf ("dName:%s index:%d ", nif->displayName, nif->index);
}
printf ("naddrs:%d\n", nif->naddrs);
}

View File

@ -58,9 +58,7 @@ Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this,
jobject fdo, jboolean block)
{
int optError = 0;
int lastError = 0;
int result = 0;
int retry = 0;
int result;
int n = sizeof(int);
jint fd = fdval(env, fdo);
fd_set wr, ex;
@ -73,64 +71,33 @@ Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this,
result = select(fd+1, 0, &wr, &ex, block ? NULL : &t);
/* save last winsock error */
if (result == SOCKET_ERROR) {
lastError = WSAGetLastError();
}
if (block) { /* must configure socket back to blocking state */
u_long argp = 0;
int r = ioctlsocket(fd, FIONBIO, &argp);
if (r == SOCKET_ERROR) {
handleSocketError(env, WSAGetLastError());
}
}
if (result == 0) { /* timeout */
return block ? 0 : IOS_UNAVAILABLE;
} else {
if (result == SOCKET_ERROR) { /* select failed */
handleSocketError(env, lastError);
if (result == SOCKET_ERROR) { /* select failed */
handleSocketError(env, WSAGetLastError());
return IOS_THROWN;
}
}
/*
* Socket is writable or error occurred. On some Windows editions
* the socket will appear writable when the connect fails so we
* check for error rather than writable.
*/
if (!FD_ISSET(fd, &ex)) {
return 1; /* connection established */
// connection established if writable and no error to check
if (FD_ISSET(fd, &wr) && !FD_ISSET(fd, &ex)) {
return 1;
}
/*
* A getsockopt( SO_ERROR ) may indicate success on NT4 even
* though the connection has failed. The workaround is to allow
* winsock to be scheduled and this is done via by yielding.
* As the yield approach is problematic in heavy load situations
* we attempt up to 3 times to get the failure reason.
*/
for (retry=0; retry<3; retry++) {
result = getsockopt((SOCKET)fd,
SOL_SOCKET,
SO_ERROR,
(char *)&optError,
&n);
if (result == SOCKET_ERROR) {
int lastError = WSAGetLastError();
if (lastError == WSAEINPROGRESS) {
return IOS_UNAVAILABLE;
}
NET_ThrowNew(env, lastError, "getsockopt");
return IOS_THROWN;
result = getsockopt((SOCKET)fd,
SOL_SOCKET,
SO_ERROR,
(char *)&optError,
&n);
if (result == SOCKET_ERROR) {
int lastError = WSAGetLastError();
if (lastError == WSAEINPROGRESS) {
return IOS_UNAVAILABLE;
}
if (optError) {
break;
}
Sleep(0);
NET_ThrowNew(env, lastError, "getsockopt");
return IOS_THROWN;
}
if (optError != NO_ERROR) {
handleSocketError(env, optError);
return IOS_THROWN;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -172,22 +172,22 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegOpenKey()
*/
private static native int[] WindowsRegOpenKey(int hKey, byte[] subKey,
int securityMask);
private static native long[] WindowsRegOpenKey(long hKey, byte[] subKey,
int securityMask);
/**
* Retries RegOpenKey() MAX_ATTEMPTS times before giving up.
*/
private static int[] WindowsRegOpenKey1(int hKey, byte[] subKey,
int securityMask) {
int[] result = WindowsRegOpenKey(hKey, subKey, securityMask);
private static long[] WindowsRegOpenKey1(long hKey, byte[] subKey,
int securityMask) {
long[] result = WindowsRegOpenKey(hKey, subKey, securityMask);
if (result[ERROR_CODE] == ERROR_SUCCESS) {
return result;
} else if (result[ERROR_CODE] == ERROR_FILE_NOT_FOUND) {
logger().warning("Trying to recreate Windows registry node " +
byteArrayToString(subKey) + " at root 0x" +
Integer.toHexString(hKey) + ".");
Long.toHexString(hKey) + ".");
// Try recreation
int handle = WindowsRegCreateKeyEx(hKey, subKey)[NATIVE_HANDLE];
long handle = WindowsRegCreateKeyEx(hKey, subKey)[NATIVE_HANDLE];
WindowsRegCloseKey(handle);
return WindowsRegOpenKey(hKey, subKey, securityMask);
} else if (result[ERROR_CODE] != ERROR_ACCESS_DENIED) {
@ -211,18 +211,18 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegCloseKey()
*/
private static native int WindowsRegCloseKey(int hKey);
private static native int WindowsRegCloseKey(long hKey);
/**
* Java wrapper for Windows registry API RegCreateKeyEx()
*/
private static native int[] WindowsRegCreateKeyEx(int hKey, byte[] subKey);
private static native long[] WindowsRegCreateKeyEx(long hKey, byte[] subKey);
/**
* Retries RegCreateKeyEx() MAX_ATTEMPTS times before giving up.
*/
private static int[] WindowsRegCreateKeyEx1(int hKey, byte[] subKey) {
int[] result = WindowsRegCreateKeyEx(hKey, subKey);
private static long[] WindowsRegCreateKeyEx1(long hKey, byte[] subKey) {
long[] result = WindowsRegCreateKeyEx(hKey, subKey);
if (result[ERROR_CODE] == ERROR_SUCCESS) {
return result;
} else {
@ -245,17 +245,17 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegDeleteKey()
*/
private static native int WindowsRegDeleteKey(int hKey, byte[] subKey);
private static native int WindowsRegDeleteKey(long hKey, byte[] subKey);
/**
* Java wrapper for Windows registry API RegFlushKey()
*/
private static native int WindowsRegFlushKey(int hKey);
private static native int WindowsRegFlushKey(long hKey);
/**
* Retries RegFlushKey() MAX_ATTEMPTS times before giving up.
*/
private static int WindowsRegFlushKey1(int hKey) {
private static int WindowsRegFlushKey1(long hKey) {
int result = WindowsRegFlushKey(hKey);
if (result == ERROR_SUCCESS) {
return result;
@ -280,17 +280,17 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegQueryValueEx()
*/
private static native byte[] WindowsRegQueryValueEx(int hKey,
private static native byte[] WindowsRegQueryValueEx(long hKey,
byte[] valueName);
/**
* Java wrapper for Windows registry API RegSetValueEx()
*/
private static native int WindowsRegSetValueEx(int hKey, byte[] valueName,
private static native int WindowsRegSetValueEx(long hKey, byte[] valueName,
byte[] value);
/**
* Retries RegSetValueEx() MAX_ATTEMPTS times before giving up.
*/
private static int WindowsRegSetValueEx1(int hKey, byte[] valueName,
private static int WindowsRegSetValueEx1(long hKey, byte[] valueName,
byte[] value) {
int result = WindowsRegSetValueEx(hKey, valueName, value);
if (result == ERROR_SUCCESS) {
@ -316,18 +316,18 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegDeleteValue()
*/
private static native int WindowsRegDeleteValue(int hKey, byte[] valueName);
private static native int WindowsRegDeleteValue(long hKey, byte[] valueName);
/**
* Java wrapper for Windows registry API RegQueryInfoKey()
*/
private static native int[] WindowsRegQueryInfoKey(int hKey);
private static native long[] WindowsRegQueryInfoKey(long hKey);
/**
* Retries RegQueryInfoKey() MAX_ATTEMPTS times before giving up.
*/
private static int[] WindowsRegQueryInfoKey1(int hKey) {
int[] result = WindowsRegQueryInfoKey(hKey);
private static long[] WindowsRegQueryInfoKey1(long hKey) {
long[] result = WindowsRegQueryInfoKey(hKey);
if (result[ERROR_CODE] == ERROR_SUCCESS) {
return result;
} else {
@ -351,13 +351,13 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegEnumKeyEx()
*/
private static native byte[] WindowsRegEnumKeyEx(int hKey, int subKeyIndex,
private static native byte[] WindowsRegEnumKeyEx(long hKey, int subKeyIndex,
int maxKeyLength);
/**
* Retries RegEnumKeyEx() MAX_ATTEMPTS times before giving up.
*/
private static byte[] WindowsRegEnumKeyEx1(int hKey, int subKeyIndex,
private static byte[] WindowsRegEnumKeyEx1(long hKey, int subKeyIndex,
int maxKeyLength) {
byte[] result = WindowsRegEnumKeyEx(hKey, subKeyIndex, maxKeyLength);
if (result != null) {
@ -383,12 +383,12 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Java wrapper for Windows registry API RegEnumValue()
*/
private static native byte[] WindowsRegEnumValue(int hKey, int valueIndex,
private static native byte[] WindowsRegEnumValue(long hKey, int valueIndex,
int maxValueNameLength);
/**
* Retries RegEnumValueEx() MAX_ATTEMPTS times before giving up.
*/
private static byte[] WindowsRegEnumValue1(int hKey, int valueIndex,
private static byte[] WindowsRegEnumValue1(long hKey, int valueIndex,
int maxValueNameLength) {
byte[] result = WindowsRegEnumValue(hKey, valueIndex,
maxValueNameLength);
@ -421,18 +421,18 @@ class WindowsPreferences extends AbstractPreferences {
*/
private WindowsPreferences(WindowsPreferences parent, String name) {
super(parent, name);
int parentNativeHandle = parent.openKey(KEY_CREATE_SUB_KEY, KEY_READ);
long parentNativeHandle = parent.openKey(KEY_CREATE_SUB_KEY, KEY_READ);
if (parentNativeHandle == NULL_NATIVE_HANDLE) {
// if here, openKey failed and logged
isBackingStoreAvailable = false;
return;
}
int[] result =
long[] result =
WindowsRegCreateKeyEx1(parentNativeHandle, toWindowsName(name));
if (result[ERROR_CODE] != ERROR_SUCCESS) {
logger().warning("Could not create windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" + Integer.toHexString(rootNativeHandle()) +
" at root 0x" + Long.toHexString(rootNativeHandle()) +
". Windows RegCreateKeyEx(...) returned error code " +
result[ERROR_CODE] + ".");
isBackingStoreAvailable = false;
@ -451,14 +451,14 @@ class WindowsPreferences extends AbstractPreferences {
* @param rootNativeHandle Native handle to one of Windows top level keys.
* @param rootDirectory Path to root directory, as a byte-encoded string.
*/
private WindowsPreferences(int rootNativeHandle, byte[] rootDirectory) {
private WindowsPreferences(long rootNativeHandle, byte[] rootDirectory) {
super(null, "");
int[] result =
long[] result =
WindowsRegCreateKeyEx1(rootNativeHandle, rootDirectory);
if (result[ERROR_CODE] != ERROR_SUCCESS) {
logger().warning("Could not open/create prefs root node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" + Integer.toHexString(rootNativeHandle()) +
" at root 0x" + Long.toHexString(rootNativeHandle()) +
". Windows RegCreateKeyEx(...) returned error code " +
result[ERROR_CODE] + ".");
isBackingStoreAvailable = false;
@ -497,7 +497,7 @@ class WindowsPreferences extends AbstractPreferences {
* @see #openKey(int, byte[], int)
* @see #closeKey(int)
*/
private int openKey(int securityMask) {
private long openKey(int securityMask) {
return openKey(securityMask, securityMask);
}
@ -511,7 +511,7 @@ class WindowsPreferences extends AbstractPreferences {
* @see #openKey(int, byte[], int)
* @see #closeKey(int)
*/
private int openKey(int mask1, int mask2) {
private long openKey(int mask1, int mask2) {
return openKey(windowsAbsolutePath(), mask1, mask2);
}
@ -527,12 +527,12 @@ class WindowsPreferences extends AbstractPreferences {
* @see #openKey(int, byte[],int)
* @see #closeKey(int)
*/
private int openKey(byte[] windowsAbsolutePath, int mask1, int mask2) {
private long openKey(byte[] windowsAbsolutePath, int mask1, int mask2) {
/* Check if key's path is short enough be opened at once
otherwise use a path-splitting procedure */
if (windowsAbsolutePath.length <= MAX_WINDOWS_PATH_LENGTH + 1) {
int[] result = WindowsRegOpenKey1(rootNativeHandle(),
windowsAbsolutePath, mask1);
long[] result = WindowsRegOpenKey1(rootNativeHandle(),
windowsAbsolutePath, mask1);
if (result[ERROR_CODE] == ERROR_ACCESS_DENIED && mask2 != mask1)
result = WindowsRegOpenKey1(rootNativeHandle(),
windowsAbsolutePath, mask2);
@ -541,7 +541,7 @@ class WindowsPreferences extends AbstractPreferences {
logger().warning("Could not open windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
". Windows RegOpenKey(...) returned error code " +
result[ERROR_CODE] + ".");
result[NATIVE_HANDLE] = NULL_NATIVE_HANDLE;
@ -550,7 +550,7 @@ class WindowsPreferences extends AbstractPreferences {
"Could not open windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
": Access denied");
}
}
@ -573,12 +573,12 @@ class WindowsPreferences extends AbstractPreferences {
* @see #openKey(byte[],int)
* @see #closeKey(int)
*/
private int openKey(int nativeHandle, byte[] windowsRelativePath,
int mask1, int mask2) {
private long openKey(long nativeHandle, byte[] windowsRelativePath,
int mask1, int mask2) {
/* If the path is short enough open at once. Otherwise split the path */
if (windowsRelativePath.length <= MAX_WINDOWS_PATH_LENGTH + 1 ) {
int[] result = WindowsRegOpenKey1(nativeHandle,
windowsRelativePath, mask1);
long[] result = WindowsRegOpenKey1(nativeHandle,
windowsRelativePath, mask1);
if (result[ERROR_CODE] == ERROR_ACCESS_DENIED && mask2 != mask1)
result = WindowsRegOpenKey1(nativeHandle,
windowsRelativePath, mask2);
@ -586,7 +586,7 @@ class WindowsPreferences extends AbstractPreferences {
if (result[ERROR_CODE] != ERROR_SUCCESS) {
logger().warning("Could not open windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" + Integer.toHexString(nativeHandle) +
" at root 0x" + Long.toHexString(nativeHandle) +
". Windows RegOpenKey(...) returned error code " +
result[ERROR_CODE] + ".");
result[NATIVE_HANDLE] = NULL_NATIVE_HANDLE;
@ -610,13 +610,13 @@ class WindowsPreferences extends AbstractPreferences {
separatorPosition - 1];
System.arraycopy(windowsRelativePath, separatorPosition+1,
nextRelativePath, 0, nextRelativePath.length);
int nextNativeHandle = openKey(nativeHandle, nextRelativeRoot,
long nextNativeHandle = openKey(nativeHandle, nextRelativeRoot,
mask1, mask2);
if (nextNativeHandle == NULL_NATIVE_HANDLE) {
return NULL_NATIVE_HANDLE;
}
int result = openKey(nextNativeHandle, nextRelativePath,
mask1,mask2);
long result = openKey(nextNativeHandle, nextRelativePath,
mask1,mask2);
closeKey(nextNativeHandle);
return result;
}
@ -630,13 +630,13 @@ class WindowsPreferences extends AbstractPreferences {
* @see #openKey(byte[],int)
* @see #openKey(int, byte[],int)
*/
private void closeKey(int nativeHandle) {
private void closeKey(long nativeHandle) {
int result = WindowsRegCloseKey(nativeHandle);
if (result != ERROR_SUCCESS) {
logger().warning("Could not close windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
". Windows RegCloseKey(...) returned error code " +
result + ".");
}
@ -649,7 +649,7 @@ class WindowsPreferences extends AbstractPreferences {
* @see #getSpi(String)
*/
protected void putSpi(String javaName, String value) {
int nativeHandle = openKey(KEY_SET_VALUE);
long nativeHandle = openKey(KEY_SET_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) {
isBackingStoreAvailable = false;
return;
@ -662,7 +662,7 @@ class WindowsPreferences extends AbstractPreferences {
" at Windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
". Windows RegSetValueEx(...) returned error code " +
result + ".");
isBackingStoreAvailable = false;
@ -677,7 +677,7 @@ class WindowsPreferences extends AbstractPreferences {
* @see #putSpi(String, String)
*/
protected String getSpi(String javaName) {
int nativeHandle = openKey(KEY_QUERY_VALUE);
long nativeHandle = openKey(KEY_QUERY_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) {
return null;
}
@ -699,7 +699,7 @@ class WindowsPreferences extends AbstractPreferences {
* been deleted.
*/
protected void removeSpi(String key) {
int nativeHandle = openKey(KEY_SET_VALUE);
long nativeHandle = openKey(KEY_SET_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) {
return;
}
@ -709,7 +709,7 @@ class WindowsPreferences extends AbstractPreferences {
logger().warning("Could not delete windows registry value " +
byteArrayToString(windowsAbsolutePath()) + "\\" +
toWindowsName(key) + " at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
". Windows RegDeleteValue(...) returned error code " +
result + ".");
isBackingStoreAvailable = false;
@ -725,27 +725,27 @@ class WindowsPreferences extends AbstractPreferences {
*/
protected String[] keysSpi() throws BackingStoreException{
// Find out the number of values
int nativeHandle = openKey(KEY_QUERY_VALUE);
long nativeHandle = openKey(KEY_QUERY_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) {
throw new BackingStoreException(
"Could not open windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) + ".");
Long.toHexString(rootNativeHandle()) + ".");
}
int[] result = WindowsRegQueryInfoKey1(nativeHandle);
long[] result = WindowsRegQueryInfoKey1(nativeHandle);
if (result[ERROR_CODE] != ERROR_SUCCESS) {
String info = "Could not query windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
". Windows RegQueryInfoKeyEx(...) returned error code " +
result[ERROR_CODE] + ".";
logger().warning(info);
throw new BackingStoreException(info);
}
int maxValueNameLength = result[MAX_VALUE_NAME_LENGTH];
int valuesNumber = result[VALUES_NUMBER];
int maxValueNameLength = (int)result[MAX_VALUE_NAME_LENGTH];
int valuesNumber = (int)result[VALUES_NUMBER];
if (valuesNumber == 0) {
closeKey(nativeHandle);
return new String[0];
@ -759,7 +759,7 @@ class WindowsPreferences extends AbstractPreferences {
String info =
"Could not enumerate value #" + i + " of windows node " +
byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
Integer.toHexString(rootNativeHandle()) + ".";
Long.toHexString(rootNativeHandle()) + ".";
logger().warning(info);
throw new BackingStoreException(info);
}
@ -777,27 +777,27 @@ class WindowsPreferences extends AbstractPreferences {
*/
protected String[] childrenNamesSpi() throws BackingStoreException {
// Open key
int nativeHandle = openKey(KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE);
long nativeHandle = openKey(KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) {
throw new BackingStoreException(
"Could not open windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) + ".");
Long.toHexString(rootNativeHandle()) + ".");
}
// Get number of children
int[] result = WindowsRegQueryInfoKey1(nativeHandle);
long[] result = WindowsRegQueryInfoKey1(nativeHandle);
if (result[ERROR_CODE] != ERROR_SUCCESS) {
String info = "Could not query windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" + Integer.toHexString(rootNativeHandle()) +
" at root 0x" + Long.toHexString(rootNativeHandle()) +
". Windows RegQueryInfoKeyEx(...) returned error code " +
result[ERROR_CODE] + ".";
logger().warning(info);
throw new BackingStoreException(info);
}
int maxKeyLength = result[MAX_KEY_LENGTH];
int subKeysNumber = result[SUBKEYS_NUMBER];
int maxKeyLength = (int)result[MAX_KEY_LENGTH];
int subKeysNumber = (int)result[SUBKEYS_NUMBER];
if (subKeysNumber == 0) {
closeKey(nativeHandle);
return new String[0];
@ -812,7 +812,7 @@ class WindowsPreferences extends AbstractPreferences {
String info =
"Could not enumerate key #" + i + " of windows node " +
byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
Integer.toHexString(rootNativeHandle()) + ". ";
Long.toHexString(rootNativeHandle()) + ". ";
logger().warning(info);
throw new BackingStoreException(info);
}
@ -839,20 +839,20 @@ class WindowsPreferences extends AbstractPreferences {
throw new BackingStoreException(
"flush(): Backing store not available.");
}
int nativeHandle = openKey(KEY_READ);
long nativeHandle = openKey(KEY_READ);
if (nativeHandle == NULL_NATIVE_HANDLE) {
throw new BackingStoreException(
"Could not open windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) + ".");
Long.toHexString(rootNativeHandle()) + ".");
}
int result = WindowsRegFlushKey1(nativeHandle);
if (result != ERROR_SUCCESS) {
String info = "Could not flush windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) +
Long.toHexString(rootNativeHandle()) +
". Windows RegFlushKey(...) returned error code " +
result + ".";
logger().warning(info);
@ -891,21 +891,21 @@ class WindowsPreferences extends AbstractPreferences {
* is not available.
*/
public void removeNodeSpi() throws BackingStoreException {
int parentNativeHandle =
long parentNativeHandle =
((WindowsPreferences)parent()).openKey(DELETE);
if (parentNativeHandle == NULL_NATIVE_HANDLE) {
throw new BackingStoreException(
"Could not open parent windows registry node of " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" +
Integer.toHexString(rootNativeHandle()) + ".");
Long.toHexString(rootNativeHandle()) + ".");
}
int result =
WindowsRegDeleteKey(parentNativeHandle, toWindowsName(name()));
if (result != ERROR_SUCCESS) {
String info = "Could not delete windows registry node " +
byteArrayToString(windowsAbsolutePath()) +
" at root 0x" + Integer.toHexString(rootNativeHandle()) +
" at root 0x" + Long.toHexString(rootNativeHandle()) +
". Windows RegDeleteKeyEx(...) returned error code " +
result + ".";
logger().warning(info);
@ -1089,7 +1089,7 @@ class WindowsPreferences extends AbstractPreferences {
if ((ch < 0x0020) || (ch > 0x007f)){
// write \udddd
windowsName.append("/u");
String hex = Integer.toHexString(javaName.charAt(i));
String hex = Long.toHexString(javaName.charAt(i));
StringBuilder hex4 = new StringBuilder(hex);
hex4.reverse();
int len = 4 - hex4.length();
@ -1115,7 +1115,7 @@ class WindowsPreferences extends AbstractPreferences {
/**
* Returns native handle for the top Windows node for this node.
*/
private int rootNativeHandle() {
private long rootNativeHandle() {
return (isUserNode()
? USER_ROOT_NATIVE_HANDLE
: SYSTEM_ROOT_NATIVE_HANDLE);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,222 +37,222 @@ extern "C" {
*/
DEF_STATIC_JNI_OnLoad
JNIEXPORT jintArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegOpenKey
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray lpSubKey, jint securityMask) {
HKEY handle;
char* str;
int tmp[2];
int errorCode=-1;
jintArray result;
str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
CHECK_NULL_RETURN(str, NULL);
errorCode = RegOpenKeyEx((HKEY)hKey, str, 0, securityMask, &handle);
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
tmp[0]= (int) handle;
tmp[1]= errorCode;
result = (*env)->NewIntArray(env,2);
if (result != NULL) {
(*env)->SetIntArrayRegion(env, result, 0, 2, tmp);
}
return result;
JNIEXPORT jlongArray JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegOpenKey(JNIEnv* env,
jclass this_class, jlong hKey, jbyteArray lpSubKey, jint securityMask) {
char* str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
CHECK_NULL_RETURN(str, NULL);
HKEY handle;
int errorCode = RegOpenKeyEx((HKEY) hKey, str, 0, securityMask, &handle);
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
jlong tmp[2];
tmp[0] = (jlong) handle;
tmp[1] = errorCode;
jlongArray result = (*env)->NewLongArray(env, 2);
if (result != NULL) {
(*env)->SetLongArrayRegion(env, result, 0, 2, tmp);
}
return result;
}
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegCloseKey
(JNIEnv* env, jclass this_class, jint hKey) {
return (jint) RegCloseKey((HKEY) hKey);
};
JNIEXPORT jint JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegCloseKey(JNIEnv* env,
jclass this_class, jlong hKey) {
return (jint) RegCloseKey((HKEY) hKey);
};
JNIEXPORT jintArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegCreateKeyEx
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray lpSubKey) {
HKEY handle;
char* str;
int tmp[3];
DWORD lpdwDisposition;
int errorCode;
jintArray result = NULL;
str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
CHECK_NULL_RETURN(str, NULL);
errorCode = RegCreateKeyEx((HKEY)hKey, str, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_READ,
NULL, &handle, &lpdwDisposition);
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
tmp[0]= (int) handle;
tmp[1]= errorCode;
tmp[2]= lpdwDisposition;
result = (*env)->NewIntArray(env,3);
if (result != NULL) {
(*env)->SetIntArrayRegion(env, result, 0, 3, tmp);
}
return result;
JNIEXPORT jlongArray JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegCreateKeyEx(JNIEnv* env,
jclass this_class, jlong hKey, jbyteArray lpSubKey) {
char* str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
CHECK_NULL_RETURN(str, NULL);
HKEY handle;
DWORD lpdwDisposition;
int errorCode = RegCreateKeyEx((HKEY) hKey, str, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_READ,
NULL, &handle, &lpdwDisposition);
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
jlong tmp[3];
tmp[0] = (jlong) handle;
tmp[1] = errorCode;
tmp[2] = lpdwDisposition;
jlongArray result = (*env)->NewLongArray(env, 3);
if (result != NULL) {
(*env)->SetLongArrayRegion(env, result, 0, 3, tmp);
}
return result;
}
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegDeleteKey
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray lpSubKey) {
char* str;
int result;
str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
CHECK_NULL_RETURN(str, -1);
result = RegDeleteKey((HKEY)hKey, str);
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
return result;
JNIEXPORT jint JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegDeleteKey(JNIEnv* env,
jclass this_class, jlong hKey, jbyteArray lpSubKey) {
char* str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
CHECK_NULL_RETURN(str, -1);
};
int result = RegDeleteKey((HKEY) hKey, str);
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
return result;
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegFlushKey
(JNIEnv* env, jclass this_class, jint hKey) {
return RegFlushKey ((HKEY)hKey);
}
};
JNIEXPORT jbyteArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegQueryValueEx
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray valueName) {
char* valueNameStr;
char* buffer;
jbyteArray result;
DWORD valueType;
DWORD valueSize;
valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
CHECK_NULL_RETURN(valueNameStr, NULL);
if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, NULL,
&valueSize) != ERROR_SUCCESS) {
JNIEXPORT jint JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegFlushKey(JNIEnv* env,
jclass this_class, jlong hKey) {
return RegFlushKey((HKEY) hKey);
}
JNIEXPORT jbyteArray JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegQueryValueEx(JNIEnv* env,
jclass this_class, jlong hKey, jbyteArray valueName) {
char* valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
CHECK_NULL_RETURN(valueNameStr, NULL);
DWORD valueType;
DWORD valueSize;
if (RegQueryValueEx((HKEY) hKey, valueNameStr, NULL, &valueType, NULL,
&valueSize) != ERROR_SUCCESS) {
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return NULL;
}
buffer = (char*)malloc(valueSize);
if (buffer != NULL) {
if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, buffer,
&valueSize) != ERROR_SUCCESS) {
free(buffer);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return NULL;
}
} else {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return NULL;
}
if (valueType == REG_SZ) {
result = (*env)->NewByteArray(env, valueSize);
if (result != NULL) {
(*env)->SetByteArrayRegion(env, result, 0, valueSize, buffer);
}
} else {
result = NULL;
}
free(buffer);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return result;
}
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegSetValueEx
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray valueName, jbyteArray data) {
char* valueNameStr;
char* dataStr;
int size = -1;
int nameSize = -1;
int error_code = -1;
if ((valueName == NULL)||(data == NULL)) {return -1;}
size = (*env)->GetArrayLength(env, data);
dataStr = (*env)->GetByteArrayElements(env, data, NULL);
CHECK_NULL_RETURN(dataStr, -1);
valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
if (valueNameStr != NULL) {
error_code = RegSetValueEx((HKEY)hKey, valueNameStr, 0,
REG_SZ, dataStr, size);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
}
(*env)->ReleaseByteArrayElements(env, data, dataStr, 0);
return error_code;
}
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegDeleteValue
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray valueName) {
char* valueNameStr;
int error_code = -1;
if (valueName == NULL) {return -1;}
valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
CHECK_NULL_RETURN(valueNameStr, -1);
error_code = RegDeleteValue((HKEY)hKey, valueNameStr);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return error_code;
}
JNIEXPORT jintArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegQueryInfoKey
(JNIEnv* env, jclass this_class, jint hKey) {
jintArray result = NULL;
int tmp[5];
int valuesNumber = -1;
int maxValueNameLength = -1;
int maxSubKeyLength = -1;
int subKeysNumber = -1;
int errorCode = -1;
errorCode = RegQueryInfoKey((HKEY)hKey, NULL, NULL, NULL,
&subKeysNumber, &maxSubKeyLength, NULL,
&valuesNumber, &maxValueNameLength,
NULL, NULL, NULL);
tmp[0]= subKeysNumber;
tmp[1]= (int)errorCode;
tmp[2]= valuesNumber;
tmp[3]= maxSubKeyLength;
tmp[4]= maxValueNameLength;
result = (*env)->NewIntArray(env,5);
if (result != NULL) {
(*env)->SetIntArrayRegion(env, result, 0, 5, tmp);
}
return result;
}
JNIEXPORT jbyteArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegEnumKeyEx
(JNIEnv* env, jclass this_class, jint hKey , jint subKeyIndex, jint maxKeyLength) {
int size = maxKeyLength;
jbyteArray result;
char* buffer = NULL;
buffer = (char*)malloc(maxKeyLength);
if (buffer == NULL) {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
return NULL;
}
if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, &size, NULL, NULL,
NULL, NULL) != ERROR_SUCCESS){
free(buffer);
return NULL;
}
result = (*env)->NewByteArray(env, size + 1);
if (result != NULL) {
(*env)->SetByteArrayRegion(env, result, 0, size + 1, buffer);
}
free(buffer);
return result;
}
JNIEXPORT jbyteArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegEnumValue
(JNIEnv* env, jclass this_class, jint hKey , jint valueIndex, jint maxValueNameLength){
int size = maxValueNameLength;
jbyteArray result;
char* buffer = NULL;
int error_code;
buffer = (char*)malloc(maxValueNameLength);
if (buffer == NULL) {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
return NULL;
}
error_code = RegEnumValue((HKEY) hKey, valueIndex, buffer,
&size, NULL, NULL, NULL, NULL);
if (error_code!= ERROR_SUCCESS){
char* buffer = (char*) malloc(valueSize);
if (buffer != NULL) {
if (RegQueryValueEx((HKEY) hKey, valueNameStr, NULL, &valueType, buffer,
&valueSize) != ERROR_SUCCESS) {
free(buffer);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return NULL;
}
result = (*env)->NewByteArray(env, size + 1);
if (result != NULL) {
(*env)->SetByteArrayRegion(env, result, 0, size + 1, buffer);
}
free(buffer);
return result;
}
}
} else {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return NULL;
}
jbyteArray result;
if (valueType == REG_SZ) {
result = (*env)->NewByteArray(env, valueSize);
if (result != NULL) {
(*env)->SetByteArrayRegion(env, result, 0, valueSize, buffer);
}
} else {
result = NULL;
}
free(buffer);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return result;
}
JNIEXPORT jint JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegSetValueEx(JNIEnv* env,
jclass this_class, jlong hKey, jbyteArray valueName, jbyteArray data) {
if ((valueName == NULL) || (data == NULL)) {
return -1;
}
int size = (*env)->GetArrayLength(env, data);
char* dataStr = (*env)->GetByteArrayElements(env, data, NULL);
CHECK_NULL_RETURN(dataStr, -1);
char* valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
int error_code = -1;
if (valueNameStr != NULL) {
error_code = RegSetValueEx((HKEY) hKey, valueNameStr, 0,
REG_SZ, dataStr, size);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
}
(*env)->ReleaseByteArrayElements(env, data, dataStr, 0);
return error_code;
}
JNIEXPORT jint JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegDeleteValue(JNIEnv* env,
jclass this_class, jlong hKey, jbyteArray valueName) {
if (valueName == NULL) {
return -1;
}
char* valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL);
CHECK_NULL_RETURN(valueNameStr, -1);
int error_code = RegDeleteValue((HKEY) hKey, valueNameStr);
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0);
return error_code;
}
JNIEXPORT jlongArray JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegQueryInfoKey(JNIEnv* env,
jclass this_class, jlong hKey) {
int subKeysNumber;
int maxSubKeyLength;
int valuesNumber;
int maxValueNameLength;
int errorCode = RegQueryInfoKey((HKEY) hKey, NULL, NULL, NULL,
&subKeysNumber, &maxSubKeyLength, NULL,
&valuesNumber, &maxValueNameLength,
NULL, NULL, NULL);
jlong tmp[5];
tmp[0] = subKeysNumber;
tmp[1] = errorCode;
tmp[2] = valuesNumber;
tmp[3] = maxSubKeyLength;
tmp[4] = maxValueNameLength;
jintArray result = (*env)->NewLongArray(env, 5);
if (result != NULL) {
(*env)->SetLongArrayRegion(env, result, 0, 5, tmp);
}
return result;
}
JNIEXPORT jbyteArray JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegEnumKeyEx(JNIEnv* env,
jclass this_class, jlong hKey, jint subKeyIndex, jint maxKeyLength) {
int size = maxKeyLength;
char* buffer = (char*) malloc(maxKeyLength);
if (buffer == NULL) {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
return NULL;
}
if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, &size, NULL, NULL,
NULL, NULL) != ERROR_SUCCESS) {
free(buffer);
return NULL;
}
jbyteArray result = (*env)->NewByteArray(env, size + 1);
if (result != NULL) {
(*env)->SetByteArrayRegion(env, result, 0, size + 1, buffer);
}
free(buffer);
return result;
}
JNIEXPORT jbyteArray JNICALL
Java_java_util_prefs_WindowsPreferences_WindowsRegEnumValue(JNIEnv* env,
jclass this_class, jlong hKey, jint valueIndex, jint maxValueNameLength) {
int size = maxValueNameLength;
char* buffer = (char*) malloc(maxValueNameLength);
if (buffer == NULL) {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
return NULL;
}
int error_code = RegEnumValue((HKEY) hKey, valueIndex, buffer,
&size, NULL, NULL, NULL, NULL);
if (error_code != ERROR_SUCCESS) {
free(buffer);
return NULL;
}
jbyteArray result = (*env)->NewByteArray(env, size + 1);
if (result != NULL) {
(*env)->SetByteArrayRegion(env, result, 0, size + 1, buffer);
}
free(buffer);
return result;
}
#ifdef __cplusplus

View File

@ -1696,6 +1696,11 @@ public class JavacParser implements Parser {
if (lambdaClassifier.diagFragment != null) {
log.error(DiagnosticFlag.SYNTAX, pos, Errors.InvalidLambdaParameterDeclaration(lambdaClassifier.diagFragment));
}
for (JCVariableDecl param: params) {
if (param.vartype != null && isRestrictedLocalVarTypeName(param.vartype)) {
param.vartype = null;
}
}
}
return lambdaExpressionOrStatementRest(params, pos);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -92,7 +92,7 @@ void ThrowException(JNIEnv *env, const char *exceptionName, DWORD dwError)
* Overloaded 'operator new[]' variant, which will raise Java's
* OutOfMemoryError in the case of a failure.
*/
static void* operator new[](std::size_t size, JNIEnv *env)
void* operator new[](std::size_t size, JNIEnv *env)
{
void* buf = ::operator new[](size, std::nothrow);
if (buf == NULL) {
@ -1356,212 +1356,6 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_destroyKeyContainer
}
}
/*
* Class: sun_security_mscapi_RSACipher
* Method: findCertificateUsingAlias
* Signature: (Ljava/lang/String;Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_sun_security_mscapi_RSACipher_findCertificateUsingAlias
(JNIEnv *env, jobject obj, jstring jCertStoreName, jstring jCertAliasName)
{
const char* pszCertStoreName = NULL;
const char* pszCertAliasName = NULL;
HCERTSTORE hCertStore = NULL;
PCCERT_CONTEXT pCertContext = NULL;
char* pszNameString = NULL; // certificate's friendly name
DWORD cchNameString = 0;
__try
{
if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL))
== NULL) {
__leave;
}
if ((pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL))
== NULL) {
__leave;
}
// Open a system certificate store.
if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) {
ThrowException(env, KEYSTORE_EXCEPTION, GetLastError());
__leave;
}
// Use CertEnumCertificatesInStore to get the certificates
// from the open store. pCertContext must be reset to
// NULL to retrieve the first certificate in the store.
while (pCertContext = ::CertEnumCertificatesInStore(hCertStore, pCertContext))
{
if ((cchNameString = ::CertGetNameString(pCertContext,
CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, NULL, 0)) == 1) {
continue; // not found
}
pszNameString = new (env) char[cchNameString];
if (pszNameString == NULL) {
__leave;
}
if (::CertGetNameString(pCertContext,
CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, pszNameString,
cchNameString) == 1) {
continue; // not found
}
// Compare the certificate's friendly name with supplied alias name
if (strcmp(pszCertAliasName, pszNameString) == 0) {
delete [] pszNameString;
break;
} else {
delete [] pszNameString;
}
}
}
__finally
{
if (hCertStore)
::CertCloseStore(hCertStore, 0);
if (pszCertStoreName)
env->ReleaseStringUTFChars(jCertStoreName, pszCertStoreName);
if (pszCertAliasName)
env->ReleaseStringUTFChars(jCertAliasName, pszCertAliasName);
}
return (jlong) pCertContext;
}
/*
* Class: sun_security_mscapi_RSACipher
* Method: getKeyFromCert
* Signature: (JZ)J
*/
JNIEXPORT jlong JNICALL Java_sun_security_mscapi_RSACipher_getKeyFromCert
(JNIEnv *env, jobject obj, jlong pCertContext, jboolean usePrivateKey)
{
HCRYPTPROV hCryptProv = NULL;
HCRYPTKEY hKey = NULL;
DWORD dwKeySpec;
BOOL bCallerFreeProv = FALSE;
BOOL bRes;
__try
{
if (usePrivateKey == JNI_TRUE) {
// Locate the key container for the certificate's private key
// First, probe it silently
bRes = ::CryptAcquireCertificatePrivateKey(
(PCCERT_CONTEXT) pCertContext, CRYPT_ACQUIRE_SILENT_FLAG,
NULL, &hCryptProv, &dwKeySpec, &bCallerFreeProv);
if (bRes == FALSE && GetLastError() != NTE_SILENT_CONTEXT)
{
ThrowException(env, KEYSTORE_EXCEPTION, GetLastError());
__leave;
}
if (bCallerFreeProv == TRUE) {
::CryptReleaseContext(hCryptProv, NULL);
bCallerFreeProv = FALSE;
}
// Now, do it normally (not silently)
if (::CryptAcquireCertificatePrivateKey(
(PCCERT_CONTEXT) pCertContext, 0, NULL, &hCryptProv,
&dwKeySpec, &bCallerFreeProv) == FALSE)
{
ThrowException(env, KEYSTORE_EXCEPTION, GetLastError());
__leave;
}
// Get a handle to the private key
if (::CryptGetUserKey(hCryptProv, dwKeySpec, &hKey) == FALSE) {
ThrowException(env, KEY_EXCEPTION, GetLastError());
__leave;
}
}
else // use public key
{
bCallerFreeProv = TRUE;
// Acquire a CSP context.
if (::CryptAcquireContext(&hCryptProv, "J2SE", NULL,
PROV_RSA_FULL, 0) == FALSE)
{
// If CSP context hasn't been created, create one.
//
if (::CryptAcquireContext(&hCryptProv, "J2SE", NULL,
PROV_RSA_FULL, CRYPT_NEWKEYSET) == FALSE)
{
ThrowException(env, KEYSTORE_EXCEPTION, GetLastError());
__leave;
}
}
// Import the certificate's public key into the key container
if (::CryptImportPublicKeyInfo(hCryptProv, X509_ASN_ENCODING,
&(((PCCERT_CONTEXT) pCertContext)->pCertInfo->SubjectPublicKeyInfo),
&hKey) == FALSE)
{
ThrowException(env, KEY_EXCEPTION, GetLastError());
__leave;
}
}
}
__finally
{
//--------------------------------------------------------------------
// Clean up.
if (bCallerFreeProv == TRUE && hCryptProv != NULL)
::CryptReleaseContext(hCryptProv, 0);
}
return hKey; // TODO - when finished with this key, call
// CryptDestroyKey(hKey)
}
/*
* Class: sun_security_mscapi_KeyStore
* Method: getKeyLength
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_security_mscapi_KeyStore_getKeyLength
(JNIEnv *env, jobject obj, jlong hKey)
{
DWORD dwDataLen = sizeof(DWORD);
BYTE pbData[sizeof(DWORD)];
DWORD length = 0;
__try
{
// Get key length (in bits)
//TODO - may need to use KP_BLOCKLEN instead?
if (!(::CryptGetKeyParam((HCRYPTKEY) hKey, KP_KEYLEN, (BYTE *)pbData, &dwDataLen,
0))) {
ThrowException(env, KEY_EXCEPTION, GetLastError());
__leave;
}
length = (DWORD) pbData;
}
__finally
{
// no cleanup required
}
return (jint) length;
}
/*
* Class: sun_security_mscapi_RSACipher
* Method: encryptDecrypt
@ -1804,38 +1598,47 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getModulus
* Convert an array in big-endian byte order into little-endian byte order.
*/
int convertToLittleEndian(JNIEnv *env, jbyteArray source, jbyte* destination,
int destinationLength) {
int destinationLength) {
int sourceLength = env->GetArrayLength(source);
int result = -1;
jbyte* sourceBytes = NULL;
jbyte* sourceBytes = env->GetByteArrayElements(source, 0);
if (sourceBytes == NULL) {
return -1;
}
__try {
int sourceLength = env->GetArrayLength(source);
int copyLen = sourceLength;
if (sourceLength > destinationLength) {
// source might include an extra sign byte
if (sourceLength == destinationLength + 1 && sourceBytes[0] == 0) {
copyLen--;
} else {
return -1;
sourceBytes = env->GetByteArrayElements(source, 0);
if (sourceBytes == NULL) {
__leave;
}
int copyLen = sourceLength;
if (sourceLength > destinationLength) {
// source might include an extra sign byte
if (sourceLength == destinationLength + 1 && sourceBytes[0] == 0) {
copyLen--;
} else {
__leave;
}
}
// Copy bytes from the end of the source array to the beginning of the
// destination array (until the destination array is full).
// This ensures that the sign byte from the source array will be excluded.
for (int i = 0; i < copyLen; i++) {
destination[i] = sourceBytes[sourceLength - 1 - i];
}
if (copyLen < destinationLength) {
memset(destination + copyLen, 0, destinationLength - copyLen);
}
result = destinationLength;
} __finally {
// Clean up.
if (sourceBytes) {
env->ReleaseByteArrayElements(source, sourceBytes, JNI_ABORT);
}
}
// Copy bytes from the end of the source array to the beginning of the
// destination array (until the destination array is full).
// This ensures that the sign byte from the source array will be excluded.
for (int i = 0; i < copyLen; i++) {
destination[i] = sourceBytes[sourceLength - 1 - i];
}
if (copyLen < destinationLength) {
memset(destination + copyLen, 0, destinationLength - copyLen);
}
env->ReleaseByteArrayElements(source, sourceBytes, JNI_ABORT);
return destinationLength;
return result;
}
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -395,7 +395,6 @@ class ServerImpl implements TimeSource {
} else {
try {
if (key.isReadable()) {
boolean closed;
SocketChannel chan = (SocketChannel)key.channel();
HttpConnection conn = (HttpConnection)key.attachment();
@ -437,7 +436,6 @@ class ServerImpl implements TimeSource {
}
public void handle (SocketChannel chan, HttpConnection conn)
throws IOException
{
try {
Exchange t = new Exchange (chan, protocol, conn);
@ -448,6 +446,9 @@ class ServerImpl implements TimeSource {
} catch (IOException e) {
logger.log (Level.TRACE, "Dispatcher (5)", e);
closeConnection(conn);
} catch (Throwable e) {
logger.log (Level.TRACE, "Dispatcher (6)", e);
closeConnection(conn);
}
}
}

View File

@ -307,8 +307,7 @@ public class HtmlConfiguration extends BaseConfiguration {
}
if (htmlVersion == null) {
reporter.print(WARNING, getText("doclet.HTML_version_not_specified", helpfile));
htmlVersion = HtmlVersion.HTML4;
htmlVersion = HtmlVersion.HTML5;
}
// check if helpfile exists
@ -658,6 +657,7 @@ public class HtmlConfiguration extends BaseConfiguration {
new Option(resources, "-html4") {
@Override
public boolean process(String opt, List<String> args) {
reporter.print(WARNING, getText("doclet.HTML_4_specified", helpfile));
htmlVersion = HtmlVersion.HTML4;
return true;
}

View File

@ -445,9 +445,8 @@ doclet.usage.xdoclint-package.description=\
disable checks for the specified packages.
# L10N: do not localize the option names -html4 and -html5
doclet.HTML_version_not_specified=\
You have not specified the version of HTML to use.\n\
The default is currently HTML 4.01, but this will change to HTML5\n\
in a future release. To suppress this warning, please specify the\n\
version of HTML used in your documentation comments and to be\n\
generated by this doclet, using the -html4 or -html5 options.
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.

View File

@ -101,7 +101,7 @@ public final class Label implements Serializable {
}
/**
* Retrieve the top <tt>count</tt> types on the stack without modifying it.
* Retrieve the top <code>count</code> types on the stack without modifying it.
*
* @param count number of types to return
* @return array of Types

View File

@ -2057,7 +2057,7 @@ public class MethodEmitter {
}
/**
* Retrieve the top <tt>count</tt> types on the stack without modifying it.
* Retrieve the top <code>count</code> types on the stack without modifying it.
*
* @param count number of types to return
* @return array of Types

View File

@ -257,7 +257,7 @@ public class Block extends Node implements BreakableNode, Terminal, Flags<Block>
}
/**
* Test if this block represents a <tt>catch</tt> block in a <tt>try</tt> statement.
* Test if this block represents a <code>catch</code> block in a <code>try</code> statement.
* This is used by the Splitter as catch blocks are not be subject to splitting.
*
* @return true if this block represents a catch block in a try statement.

View File

@ -41,7 +41,7 @@ import java.util.Locale;
* of different formats.
*
* <p>This class is neither thread-safe nor reusable. Calling the
* <tt>parse()</tt> method more than once will yield undefined results.</p>
* <code>parse()</code> method more than once will yield undefined results.</p>
*/
public class DateParser {
@ -118,7 +118,7 @@ public class DateParser {
}
/**
* Construct a new <tt>DateParser</tt> instance for parsing the given string.
* Construct a new <code>DateParser</code> instance for parsing the given string.
* @param string the string to be parsed
*/
public DateParser(final String string) {
@ -130,7 +130,7 @@ public class DateParser {
/**
* Try parsing the given string as date according to the extended ISO 8601 format
* specified in ES5 15.9.1.15. Fall back to legacy mode if that fails.
* This method returns <tt>true</tt> if the string could be parsed.
* This method returns <code>true</code> if the string could be parsed.
* @return true if the string could be parsed as date
*/
public boolean parse() {
@ -143,8 +143,8 @@ public class DateParser {
*
* <pre> [('-'|'+')yy]yyyy[-MM[-dd]][Thh:mm[:ss[.sss]][Z|(+|-)hh:mm]] </pre>
*
* <p>If the string does not contain a time zone offset, the <tt>TIMEZONE</tt> field
* is set to <tt>0</tt> (GMT).</p>
* <p>If the string does not contain a time zone offset, the <code>TIMEZONE</code> field
* is set to <code>0</code> (GMT).</p>
* @return true if string represents a valid ES5 date string.
*/
public boolean parseEcmaDate() {
@ -221,14 +221,14 @@ public class DateParser {
/**
* Try parsing the date using a fuzzy algorithm that can handle a variety of formats.
*
* <p>Numbers separated by <tt>':'</tt> are treated as time values, optionally followed by a
* millisecond value separated by <tt>'.'</tt>. Other number values are treated as date values.
* <p>Numbers separated by <code>':'</code> are treated as time values, optionally followed by a
* millisecond value separated by <code>'.'</code>. Other number values are treated as date values.
* The exact sequence of day, month, and year values to apply is determined heuristically.</p>
*
* <p>English month names and selected time zone names as well as AM/PM markers are recognized
* and handled properly. Additionally, numeric time zone offsets such as <tt>(+|-)hh:mm</tt> or
* <tt>(+|-)hhmm</tt> are recognized. If the string does not contain a time zone offset
* the <tt>TIMEZONE</tt>field is left undefined, meaning the local time zone should be applied.</p>
* and handled properly. Additionally, numeric time zone offsets such as <code>(+|-)hh:mm</code> or
* <code>(+|-)hhmm</code> are recognized. If the string does not contain a time zone offset
* the <code>TIMEZONE</code>field is left undefined, meaning the local time zone should be applied.</p>
*
* <p>English weekday names are recognized but ignored. All text in parentheses is ignored as well.
* All other text causes parsing to fail.</p>
@ -331,10 +331,10 @@ public class DateParser {
}
/**
* Get the parsed date and time fields as an array of <tt>Integers</tt>.
* Get the parsed date and time fields as an array of <code>Integers</code>.
*
* <p>If parsing was successful, all fields are guaranteed to be set except for the
* <tt>TIMEZONE</tt> field which may be <tt>null</tt>, meaning that local time zone
* <code>TIMEZONE</code> field which may be <code>null</code>, meaning that local time zone
* offset should be applied.</p>
*
* @return the parsed date fields

View File

@ -592,7 +592,7 @@ public class Lexer extends Scanner {
/**
* Check whether the given token represents the beginning of a literal. If so scan
* the literal and return <tt>true</tt>, otherwise return false.
* the literal and return <code>true</code>, otherwise return false.
*
* @param token the token.
* @param startTokenType the token type.

View File

@ -32,7 +32,7 @@ import java.util.Deque;
/**
* This class represents a string composed of two parts which may themselves be
* instances of <tt>ConsString</tt> or {@link String}. Copying of characters to
* instances of <code>ConsString</code> or {@link String}. Copying of characters to
* a proper string is delayed until it becomes necessary.
*/
public final class ConsString implements CharSequence {

View File

@ -60,15 +60,15 @@ package jdk.nashorn.internal.runtime.linker;
* Dangerous characters are the union of all characters forbidden
* or otherwise restricted by the JVM specification,
* plus their mates, if they are brackets
* (<code><big><b>[</b></big></code> and <code><big><b>]</b></big></code>,
* <code><big><b>&lt;</b></big></code> and <code><big><b>&gt;</b></big></code>),
* plus, arbitrarily, the colon character <code><big><b>:</b></big></code>.
* (<code><b>[</b></code> and <code><b>]</b></code>,
* <code><b>&lt;</b></code> and <code><b>&gt;</b></code>),
* plus, arbitrarily, the colon character <code><b>:</b></code>.
* There is no distinction between type, method, and field names.
* This makes it easier to convert between mangled names of different
* types, since they do not need to be decoded (demangled).
* </p>
* <p>
* The escape character is backslash <code><big><b>\</b></big></code>
* The escape character is backslash <code><b>\</b></code>
* (also known as reverse solidus).
* This character is, until now, unheard of in bytecode names,
* but traditional in the proposed role.
@ -92,32 +92,32 @@ package jdk.nashorn.internal.runtime.linker;
* </p>
* <p>
* The dangerous characters are
* <code><big><b>/</b></big></code> (forward slash, used to delimit package components),
* <code><big><b>.</b></big></code> (dot, also a package delimiter),
* <code><big><b>;</b></big></code> (semicolon, used in signatures),
* <code><big><b>$</b></big></code> (dollar, used in inner classes and synthetic members),
* <code><big><b>&lt;</b></big></code> (left angle),
* <code><big><b>&gt;</b></big></code> (right angle),
* <code><big><b>[</b></big></code> (left square bracket, used in array types),
* <code><big><b>]</b></big></code> (right square bracket, reserved in this scheme for language use),
* and <code><big><b>:</b></big></code> (colon, reserved in this scheme for language use).
* <code><b>/</b></code> (forward slash, used to delimit package components),
* <code><b>.</b></code> (dot, also a package delimiter),
* <code><b>;</b></code> (semicolon, used in signatures),
* <code><b>$</b></code> (dollar, used in inner classes and synthetic members),
* <code><b>&lt;</b></code> (left angle),
* <code><b>&gt;</b></code> (right angle),
* <code><b>[</b></code> (left square bracket, used in array types),
* <code><b>]</b></code> (right square bracket, reserved in this scheme for language use),
* and <code><b>:</b></code> (colon, reserved in this scheme for language use).
* Their replacements are, respectively,
* <code><big><b>|</b></big></code> (vertical bar),
* <code><big><b>,</b></big></code> (comma),
* <code><big><b>?</b></big></code> (question mark),
* <code><big><b>%</b></big></code> (percent),
* <code><big><b>^</b></big></code> (caret),
* <code><big><b>_</b></big></code> (underscore), and
* <code><big><b>{</b></big></code> (left curly bracket),
* <code><big><b>}</b></big></code> (right curly bracket),
* <code><big><b>!</b></big></code> (exclamation mark).
* <code><b>|</b></code> (vertical bar),
* <code><b>,</b></code> (comma),
* <code><b>?</b></code> (question mark),
* <code><b>%</b></code> (percent),
* <code><b>^</b></code> (caret),
* <code><b>_</b></code> (underscore), and
* <code><b>{</b></code> (left curly bracket),
* <code><b>}</b></code> (right curly bracket),
* <code><b>!</b></code> (exclamation mark).
* In addition, the replacement character for the escape character itself is
* <code><big><b>-</b></big></code> (hyphen),
* <code><b>-</b></code> (hyphen),
* and the replacement character for the null prefix is
* <code><big><b>=</b></big></code> (equal sign).
* <code><b>=</b></code> (equal sign).
* </p>
* <p>
* An escape character <code><big><b>\</b></big></code>
* An escape character <code><b>\</b></code>
* followed by any of these replacement characters
* is an escape sequence, and there are no other escape sequences.
* An equal sign is only part of an escape sequence
@ -135,16 +135,16 @@ package jdk.nashorn.internal.runtime.linker;
* string can contain <cite>accidental escapes</cite>, apparent escape
* sequences which must not be interpreted as manglings.
* These are disabled by replacing their leading backslash with an
* escape sequence (<code><big><b>\-</b></big></code>). To mangle a string, three logical steps
* escape sequence (<code><b>\-</b></code>). To mangle a string, three logical steps
* are required, though they may be carried out in one pass:
* </p>
* <ol>
* <li>In each accidental escape, replace the backslash with an escape sequence
* (<code><big><b>\-</b></big></code>).</li>
* (<code><b>\-</b></code>).</li>
* <li>Replace each dangerous character with an escape sequence
* (<code><big><b>\|</b></big></code> for <code><big><b>/</b></big></code>, etc.).</li>
* (<code><b>\|</b></code> for <code><b>/</b></code>, etc.).</li>
* <li>If the first two steps introduced any change, <em>and</em>
* if the string does not already begin with a backslash, prepend a null prefix (<code><big><b>\=</b></big></code>).</li>
* if the string does not already begin with a backslash, prepend a null prefix (<code><b>\=</b></code>).</li>
* </ol>
*
* To demangle a mangled string that begins with an escape,
@ -174,9 +174,9 @@ package jdk.nashorn.internal.runtime.linker;
* is a many-to-one function.
* A mangled string is defined as <cite>validly mangled</cite> if
* it is in fact the unique mangling of its spelling string.
* Three examples of invalidly mangled strings are <code><big><b>\=foo</b></big></code>,
* <code><big><b>\-bar</b></big></code>, and <code><big><b>baz\!</b></big></code>, which demangle to <code><big><b>foo</b></big></code>, <code><big><b>\bar</b></big></code>, and
* <code><big><b>baz\!</b></big></code>, but then remangle to <code><big><b>foo</b></big></code>, <code><big><b>\bar</b></big></code>, and <code><big><b>\=baz\-!</b></big></code>.
* Three examples of invalidly mangled strings are <code><b>\=foo</b></code>,
* <code><b>\-bar</b></code>, and <code><b>baz\!</b></code>, which demangle to <code><b>foo</b></code>, <code><b>\bar</b></code>, and
* <code><b>baz\!</b></code>, but then remangle to <code><b>foo</b></code>, <code><b>\bar</b></code>, and <code><b>\=baz\-!</b></code>.
* If a language back-end or runtime is using mangled names,
* it should never present an invalidly mangled bytecode
* name to the JVM. If the runtime encounters one,
@ -237,10 +237,10 @@ package jdk.nashorn.internal.runtime.linker;
* </p>
* <p>
* For example, an HTML-like spelling
* <code><big><b>&lt;pre&gt;</b></big></code> mangles to
* <code><big><b>\^pre\_</b></big></code> and could
* <code><b>&lt;pre&gt;</b></code> mangles to
* <code><b>\^pre\_</b></code> and could
* display more cleanly as
* <code><big><b>'&lt;pre&gt;'</b></big></code>,
* <code><b>'&lt;pre&gt;'</b></code>,
* with the quotes included.
* Such string-like conventions are <em>not</em> suitable
* for mangled bytecode names, in part because
@ -256,11 +256,11 @@ package jdk.nashorn.internal.runtime.linker;
* which contain dangerous characters (like dots in field
* names or brackets in method names) should not be
* simply quoted. The bytecode names
* <code><big><b>\=phase\,1</b></big></code> and
* <code><big><b>phase.1</b></big></code> are distinct,
* <code><b>\=phase\,1</b></code> and
* <code><b>phase.1</b></code> are distinct,
* and in demangled displays they should be presented as
* <code><big><b>'phase.1'</b></big></code> and something like
* <code><big><b>'phase'.1</b></big></code>, respectively.
* <code><b>'phase.1'</b></code> and something like
* <code><b>'phase'.1</b></code>, respectively.
* </p>
*/
public final class NameCodec {

View File

@ -34,6 +34,9 @@ JTREG_VM_TYPE ?= -agentvm
USE_JTREG_ASSERT ?= true
LIMIT_JTREG_VM_MEMORY ?= true
X:=
SPACE:=$(X) $(X)
.DEFAULT : all
# Empty these to get rid of some default rules
@ -87,6 +90,11 @@ else
endif
endif
# convert list of directories to dos paths
define MixedDirs
$(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
endef
ifdef ALT_SLASH_JAVA
SLASH_JAVA = $(ALT_SLASH_JAVA)
endif
@ -124,6 +132,19 @@ ifndef PRODUCT_HOME
PRODUCT_HOME := $(PRODUCT_HOME)
endif
# On Windows, setup the _NT_SYMBOL_PATH if possible.
ifeq ($(PLATFORM), windows)
ifndef _NT_SYMBOL_PATH
ifdef PRODUCT_SYMBOLS_HOME
_NT_SYMBOL_PATH := \
$(subst $(SPACE),;,$(strip $(call MixedDirs, $(sort $(dir $(wildcard \
$(addprefix $(PRODUCT_SYMBOLS_HOME)/bin/, *.pdb */*.pdb)))))))
export _NT_SYMBOL_PATH
endif
endif
JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH='$(_NT_SYMBOL_PATH)'
endif
# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
# Should be passed into 'java' only.
# Could include: -d64 -server -client OR any java option
@ -334,11 +355,6 @@ else
JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
endif
# convert list of directories to dos paths
define MixedDirs
$(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
endef
# ------------------------------------------------------------------
# When called from JPRT the TESTDIRS variable is set to the jtreg tests to run

View File

@ -29,6 +29,7 @@ tier1 = \
:jdk_lang \
:jdk_util \
:jdk_svc_sanity \
:build_sanity \
sun/nio/cs/ISO8859x.java \
java/nio/Buffer \
com/sun/crypto/provider/Cipher \
@ -61,6 +62,10 @@ tier3 = \
# Other test definitions; generally smaller granularity than tiers
#
# Build source checking
build_sanity = \
sanity/releaseFile
# java.lang package and VM runtime support
jdk_lang = \
java/lang \

View File

@ -0,0 +1,107 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8169358
* @summary HttpServer does not close client connection when RejectedExecutionException occurs.
*/
import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class TaskRejectedTest {
private static final int BACKLOG = 0;
private static final String REQUEST_PATH = "/";
private static final int TIMEOUT = 10000; // 10 sec
private static void runClient(InetSocketAddress listenAddr)
throws MalformedURLException, IOException {
URL url = new URL("http", listenAddr.getHostString(),
listenAddr.getPort(), REQUEST_PATH);
HttpURLConnection con = (HttpURLConnection)url.openConnection();
con.setConnectTimeout(TIMEOUT);
con.setReadTimeout(TIMEOUT);
try {
con.connect();
con.getResponseCode();
} catch (SocketTimeoutException e) {
throw new RuntimeException("Connection was not closed by peer.", e);
} catch (SocketException e) {
// Expected (connection reset)
} finally {
con.disconnect();
}
}
public static void main(String[] args) throws Exception {
Logger logger = Logger.getLogger(
HttpServer.class.getPackage().getName());
Handler consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(Level.FINEST);
logger.setLevel(Level.FINEST);
logger.addHandler(consoleHandler);
Executor executor = Executors.newSingleThreadExecutor(r -> {
throw new RejectedExecutionException("test");
});
InetSocketAddress addr = new InetSocketAddress(
InetAddress.getLoopbackAddress(), 0);
HttpServer httpServer = HttpServer.create(addr, BACKLOG);
httpServer.setExecutor(executor);
httpServer.createContext(REQUEST_PATH, exc -> {
exc.sendResponseHeaders(200, 0);
exc.close();
});
try {
httpServer.start();
runClient(httpServer.getAddress());
} finally {
httpServer.stop(0);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -708,9 +708,9 @@ public class AsyncCloseAndInterrupt {
test(connectedSocketChannelFactory);
if (TestUtil.onWindows()) {
if (TestUtil.onWindows() || TestUtil.onSolaris()) {
log.println("WARNING Cannot reliably test connect/finishConnect"
+ " operations on Windows");
+ " operations on this platform");
} else {
// Only the following tests need refuser's connection backlog
// to be saturated

View File

@ -0,0 +1,143 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 8198928
* @run main CloseDuringConnect
* @summary Attempt to cause a deadlock by closing a SocketChannel in one thread
* where another thread is closing the channel after a connect fail
*/
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.SocketChannel;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.stream.IntStream;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
public class CloseDuringConnect {
// number of test iterations, needs to be 5-10 at least
static final int ITERATIONS = 50;
// maximum delay before closing SocketChannel, in milliseconds
static final int MAX_DELAY_BEFORE_CLOSE = 20;
/**
* Returns the socket address of an endpoint that refuses connections. The
* endpoint is an InetSocketAddress where the address is the loopback address
* and the port is a system port (1-1023 range).
*/
static SocketAddress refusingEndpoint() {
InetAddress lb = InetAddress.getLoopbackAddress();
int port = 1;
while (port < 1024) {
SocketAddress sa = new InetSocketAddress(lb, port);
try {
SocketChannel.open(sa).close();
} catch (IOException ioe) {
return sa;
}
port++;
}
throw new RuntimeException("Unable to find system port that is refusing connections");
}
/**
* Invoked by a task in the thread pool to connect to a remote address.
* The connection should never be established.
*/
static Void connect(SocketChannel sc, SocketAddress remote) {
try {
if (!sc.connect(remote)) {
while (!sc.finishConnect()) {
Thread.yield();
}
}
throw new RuntimeException("Connected, should not happen");
} catch (IOException expected) { }
if (sc.isConnected())
throw new RuntimeException("isConnected return true, should not happen");
return null;
}
/**
* Invoked by a task in the thread pool to close a socket channel.
*/
static Void close(SocketChannel sc) {
try {
sc.close();
} catch (IOException e) {
throw new UncheckedIOException("close failed", e);
}
return null;
}
/**
* Test for deadlock by submitting a task to connect to the given address
* while another task closes the socket channel.
* @param pool the thread pool to submit or schedule tasks
* @param remote the remote address, does not accept connections
* @param blocking socket channel blocking mode
* @param delay the delay, in millis, before closing the channel
*/
static void test(ScheduledExecutorService pool,
SocketAddress remote,
boolean blocking,
long delay) {
try {
SocketChannel sc = SocketChannel.open();
sc.configureBlocking(blocking);
Future<Void> r1 = pool.submit(() -> connect(sc, remote));
Future<Void> r2 = pool.schedule(() -> close(sc), delay, MILLISECONDS);
r1.get();
r2.get();
} catch (Throwable t) {
throw new RuntimeException("Test failed", t);
}
}
public static void main(String[] args) throws Exception {
SocketAddress refusing = refusingEndpoint();
ScheduledExecutorService pool = Executors.newScheduledThreadPool(2);
try {
IntStream.range(0, ITERATIONS).forEach(i -> {
System.out.format("Iteration %d ...%n", (i + 1));
// Execute the test for varying delays up to MAX_DELAY_BEFORE_CLOSE,
// for socket channels configured both blocking and non-blocking
IntStream.range(0, MAX_DELAY_BEFORE_CLOSE).forEach(delay -> {
test(pool, refusing, /*blocking mode*/true, delay);
test(pool, refusing, /*blocking mode*/false, delay);
});
});
} finally {
pool.shutdown();
}
}
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -24,9 +24,9 @@
/*
* @test
* @bug 8192837
* @summary Test to verify release file does not contain closed repo info if it's open bundle
* @run main NegativeSOURCETest
* @bug 8193660
* @summary Check SOURCE line in "release" file for closedjdk
* @run main CheckSource
*/
import java.io.BufferedReader;
@ -35,14 +35,14 @@ import java.io.FileReader;
import java.io.FileNotFoundException;
import java.io.IOException;
public class NegativeSOURCETest {
public class CheckSource {
NegativeSOURCETest(String dataFile) {
CheckSource(String dataFile, boolean isOpenJDK) {
// Read data files
readFile(dataFile);
readFile(dataFile, isOpenJDK);
}
private void readFile(String fileName) {
private void readFile(String fileName, boolean isOpenJDK) {
String fishForSOURCE = null;
File file = new File(fileName);
@ -80,10 +80,26 @@ public class NegativeSOURCETest {
if (fishForSOURCE == null) {
throw new RuntimeException("SOURCE line was not found!");
} else {
// OK it was found, did it have closed/open in it?
if (fishForSOURCE.contains("closed") || fishForSOURCE.contains("open")) {
System.out.println("The offending string: " + fishForSOURCE);
throw new RuntimeException("The test failed, closed/open found!");
// OK it was found, did it have correct sources?
System.out.println("The source string found: " + fishForSOURCE);
// First it MUST have .: regardless of closed or openJDK
if (!fishForSOURCE.contains(".:")) {
throw new RuntimeException("The test failed, .: not found!");
}
// take out the .: source path
fishForSOURCE = fishForSOURCE.replace(".:", "");
// if its closedJDK it MUST have open:
if (!isOpenJDK && !fishForSOURCE.contains("open:")) {
throw new RuntimeException("The test failed, open: not found!");
}
// take out the open: source path
fishForSOURCE = fishForSOURCE.replace("open:", "");
// if any other source exists, that's an error
if (fishForSOURCE.contains(":")) {
throw new RuntimeException("The test failed, additional sources found!");
}
}
@ -98,9 +114,7 @@ public class NegativeSOURCETest {
System.out.println("JDK Path : " + jdkPath);
System.out.println("Runtime Name : " + runtime);
if (runtime.contains("OpenJDK"))
new NegativeSOURCETest(jdkPath + "/release");
else
System.out.println("Test skipped: not an OpenJDK build.");
new CheckSource(jdkPath + "/release",
runtime.contains("OpenJDK"));
}
}

View File

@ -42,6 +42,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.security.MessageDigest;
import java.security.Security;
import javax.net.ssl.SSLSocket;
@ -49,6 +50,7 @@ public class HandshakeHashCloneExhaustion extends SSLSocketTemplate {
private static String[] protocol;
private static String[] ciphersuite;
private static String[] mds = { "SHA", "MD5", "SHA-256" };
/*
* ==================
@ -57,6 +59,14 @@ public class HandshakeHashCloneExhaustion extends SSLSocketTemplate {
public static void main(String[] args) throws Exception {
// Add in a non-cloneable MD5/SHA1/SHA-256 implementation
Security.insertProviderAt(new MyProvider(), 1);
// make sure our provider is functioning
for (String s : mds) {
MessageDigest md = MessageDigest.getInstance(s);
String p = md.getProvider().getName();
if (!p.equals("MyProvider")) {
throw new RuntimeException("Unexpected provider: " + p);
}
}
if (args.length != 2) {
throw new Exception(

View File

@ -28,8 +28,8 @@ public final class MyProvider extends Provider {
public MyProvider() {
super("MyProvider", "1.0",
"Test Provider: SHA1/MD5/SHA256 exhaustion testing");
put("MessageDigest.SHA", "DigestBase.SHADigest");
put("MessageDigest.MD5", "DigestBase.MD5Digest");
put("MessageDigest.SHA-256", "DigestBase.SHA256Digest");
put("MessageDigest.SHA", "DigestBase$SHA");
put("MessageDigest.MD5", "DigestBase$MD5");
put("MessageDigest.SHA-256", "DigestBase$SHA256");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4638136 7198273 8025633 8081854
* @bug 4638136 7198273 8025633 8081854 8182765
* @summary Add ability to skip over nav bar for accessibility
* @author dkramer
* @library ../lib
@ -46,21 +46,37 @@ public class AccessSkipNav extends JavadocTester {
"p1", "p2");
checkExit(Exit.OK);
// Testing only for the presence of the <a href> and <a name>
// Testing only for the presence of the <a href> and <a id>
checkOutput("p1/C1.html", true,
// Top navbar <a href>
"<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a>",
// Top navbar <a name>
"<a name=\"skip.navbar.top\">\n"
"<a id=\"skip.navbar.top\">\n"
+ "<!-- -->\n"
+ "</a>",
// Bottom navbar <a href>
"<a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a>",
// Bottom navbar <a name>
"<a id=\"skip.navbar.bottom\">\n"
+ "<!-- -->\n"
+ "</a>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"p1", "p2");
checkExit(Exit.OK);
// Testing only for the presence of <a name>
checkOutput("p1/C1.html", true,
"<a name=\"skip.navbar.top\">\n"
+ "<!-- -->\n"
+ "</a>",
"<a name=\"skip.navbar.bottom\">\n"
+ "<!-- -->\n"
+ "</a>");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4637604 4775148 8183037
* @bug 4637604 4775148 8183037 8182765
* @summary Test the tables for summary attribute
* @author dkramer
* @library ../lib
@ -47,15 +47,29 @@ public class AccessSummary extends JavadocTester {
void testAccessSummary() {
javadoc("-d", "out", "-sourcepath", testSrc, "p1", "p2");
checkExit(Exit.OK);
checkOutput("overview-summary.html", true,
checkSummary(false);
}
@Test
void testAccessSummary_html4() {
javadoc("-d", "out-html4",
"-html4",
"-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\"");
// Test that the summary attribute appears
checkOutput("p1/C1.html", true,
// Test that the summary attribute appears or not
checkOutput("p1/C1.html", found,
"summary=\"Constructor Summary table, listing constructors, and an explanation\"");
// Test that the summary attribute appears
checkOutput("constant-values.html", true,
// Test that the summary attribute appears or not
checkOutput("constant-values.html", found,
"summary=\"Constant Field Values table, listing constant fields, and values\"");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4034096 4764726 6235799
* @bug 4034096 4764726 6235799 8182765
* @summary Add support for HTML keywords via META tag for
* class and member names to improve API search
* @author dkramer
@ -58,23 +58,7 @@ public class MetaTag extends JavadocTester {
checkExit(Exit.OK);
checkOutput("p1/C1.html", true,
"<meta name=\"keywords\" content=\"p1.C1 class\">",
"<meta name=\"keywords\" content=\"field1\">",
"<meta name=\"keywords\" content=\"field2\">",
"<meta name=\"keywords\" content=\"method1()\">",
"<meta name=\"keywords\" content=\"method2()\">");
checkOutput("p1/package-summary.html", true,
"<meta name=\"keywords\" content=\"p1 package\">");
checkOutput("overview-summary.html", true,
"<meta name=\"keywords\" content=\"Overview, Sample Packages\">");
// NOTE: Hopefully, this regression test is not run at midnight. If the output
// was generated yesterday and this test is run today, the test will fail.
checkOutput("overview-summary.html", true,
"<meta name=\"date\" content=\"" + date() + "\">");
checkMeta("dc.created", true);
}
@Test
@ -87,24 +71,55 @@ public class MetaTag extends JavadocTester {
checkExit(Exit.OK);
// No keywords when -keywords is not used.
checkOutput("p1/C1.html", false,
"<META NAME=\"keywords\" CONTENT=\"p1.C1 class\">",
"<META NAME=\"keywords\" CONTENT=\"field1\">",
"<META NAME=\"keywords\" CONTENT=\"field2\">",
"<META NAME=\"keywords\" CONTENT=\"method1()\">",
"<META NAME=\"keywords\" CONTENT=\"method2()\">");
checkMeta("dc.created", false);
}
checkOutput("p1/package-summary.html", false,
"<META NAME=\"keywords\" CONTENT=\"p1 package\">");
@Test
void testStandard_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-sourcepath", testSrc,
"-keywords",
"-doctitle", "Sample Packages",
"p1", "p2");
checkOutput("overview-summary.html", false,
"<META NAME=\"keywords\" CONTENT=\"Overview Summary, Sample Packages\">");
checkExit(Exit.OK);
checkMeta("date", true);
}
@Test
void testNoTimestamp_html4() {
javadoc("-d", "out-2-html4",
"-html4",
"-sourcepath", testSrc,
"-notimestamp",
"-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,
"<meta name=\"keywords\" content=\"p1.C1 class\">",
"<meta name=\"keywords\" content=\"field1\">",
"<meta name=\"keywords\" content=\"field2\">",
"<meta name=\"keywords\" content=\"method1()\">",
"<meta name=\"keywords\" content=\"method2()\">");
checkOutput("p1/package-summary.html", found,
"<meta name=\"keywords\" content=\"p1 package\">");
checkOutput("overview-summary.html", found,
"<meta name=\"keywords\" content=\"Overview, Sample Packages\">");
// The date metatag should not show up when -notimestamp is used.
// NOTE: Hopefully, this regression test is not run at midnight. If the output
// was generated yesterday and this test is run today, the test will fail.
checkOutput("overview-summary.html", false,
"<META NAME=\"date\" CONTENT=\"" + date() + "\">");
checkOutput("overview-summary.html", found,
"<meta name=\"" + metaNameDate + "\" content=\"" + date() + "\">");
}
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4275630 4749453 4625400 4753048 4415270 8074521
* @bug 4275630 4749453 4625400 4753048 4415270 8074521 8182765
* @summary Generated HTML is invalid with frames.
* Displays unnecessary horizontal scroll bars.
* Missing whitespace in DOCTYPE declaration
@ -53,26 +53,42 @@ public class ValidHtml extends JavadocTester {
"-sourcepath", testSrc,
"p1", "p2");
checkExit(Exit.OK);
// Test the proper DOCTYPE element are present:
checkOutput("index.html", true, LOOSE);
checkOutput("overview-summary.html", true, LOOSE);
checkOutput("p1/package-summary.html", true, LOOSE);
checkOutput("p1/C.html", true, LOOSE);
checkOutput("overview-frame.html", true, LOOSE);
checkOutput("allclasses-frame.html", true, LOOSE);
checkOutput("p1/package-frame.html", true, LOOSE);
// Test for IFRAME element:
checkOutput("index.html", true,
"<iframe");
// Test the table elements are in the correct order:
checkOutput("p1/package-use.html", true,
"</td>\n"
+ "</tr>");
String HTML5 = "<!DOCTYPE HTML>";
checkValidHTML(HTML5);
}
private static final String LOOSE =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
@Test
void test_html4() {
// Test for all cases except the split index page
javadoc("-d", "out-html4",
"-html4",
"-doctitle", "Document Title",
"-windowtitle", "Window Title",
"-use",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"p1", "p2");
checkExit(Exit.OK);
String HTML4 = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
checkValidHTML(HTML4);
}
void checkValidHTML(String doctype) {
// Test the proper DOCTYPE element are present:
checkOutput("index.html", true, doctype);
checkOutput("overview-summary.html", true, doctype);
checkOutput("p1/package-summary.html", true, doctype);
checkOutput("p1/C.html", true, doctype);
checkOutput("overview-frame.html", true, doctype);
checkOutput("allclasses-frame.html", true, doctype);
checkOutput("p1/package-frame.html", true, doctype);
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8025633 8025524 8081854 8187521
* @bug 8025633 8025524 8081854 8187521 8182765
* @summary Test for valid name attribute in HTML anchors.
* @author Bhavesh Patel
* @library /tools/lib ../lib
@ -33,7 +33,6 @@
*/
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -54,6 +53,7 @@ public class TestAnchorNames extends JavadocTester {
@Test
void testHtml4(Path ignore) {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"-source", "8", //so that '_' can be used as an identifier
"-use",
@ -175,7 +175,6 @@ public class TestAnchorNames extends JavadocTester {
"-sourcepath", testSrc,
"-source", "8", //so that '_' can be used as an identifier
"-use",
"-html5",
"pkg1");
checkExit(Exit.OK);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 8025633 8081854
* @bug 8025633 8081854 8182765
* @summary Make sure that annotations types with optional elements have
* element headers
* @author Mahmood Ali
@ -47,6 +47,18 @@ public class TestAnnotationOptional extends JavadocTester {
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/AnnotationOptional.html", true,
"<a id=\"annotation.type.element.detail\">");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/AnnotationOptional.html", true,
"<a name=\"annotation.type.element.detail\">");
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4973609 8015249 8025633 8026567 6469561 8071982 8162363
* @bug 4973609 8015249 8025633 8026567 6469561 8071982 8162363 8182765
* @summary Make sure that annotation types with 0 members does not have
* extra HR tags.
* @author jamieh
@ -72,11 +72,11 @@ public class TestAnnotationTypes extends JavadocTester {
checkOutput("pkg/AnnotationType.html", true,
"<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->",
"<ul class=\"blockList\">",
"<li class=\"blockList\"><a name=\"annotation.type.element.detail\">",
"<li class=\"blockList\"><a id=\"annotation.type.element.detail\">",
"<!-- -->",
"</a>",
"<h3>Element Detail</h3>",
"<a name=\"value--\">",
"<a id=\"value()\">",
"<!-- -->",
"</a>",
"<ul class=\"blockListLast\">",
@ -89,7 +89,10 @@ public class TestAnnotationTypes extends JavadocTester {
+ "<P>\n\n"
+ "<P>"
+ "<!-- ========= END OF CLASS DATA ========= -->" + "<HR>");
}
@Test
void testLinkSource() {
javadoc("-d", "out-2",
"-linksource",
"-sourcepath", testSrc,
@ -112,4 +115,16 @@ public class TestAnnotationTypes extends JavadocTester {
"public @interface <a href=\"../src-html/pkg/AnnotationTypeField.html#line.31"
+ "\">AnnotationTypeField</a></pre>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/AnnotationType.html", true,
"<li class=\"blockList\"><a name=\"annotation.type.element.detail\">",
"<a name=\"value--\">");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4652655 4857717 8025633 8026567 8071982 8164407
* @bug 4652655 4857717 8025633 8026567 8071982 8164407 8182765
* @summary This test verifies that class cross references work properly.
* @author jamieh
* @library ../lib
@ -35,6 +35,8 @@
public class TestClassCrossReferences extends JavadocTester {
static final String uri = "http://docs.oracle.com/javase/8/docs/api/";
public static void main(String... args) throws Exception {
TestClassCrossReferences tester = new TestClassCrossReferences();
tester.runTests();
@ -42,8 +44,6 @@ public class TestClassCrossReferences extends JavadocTester {
@Test
void test() {
final String uri = "http://docs.oracle.com/javase/8/docs/api/";
javadoc("-d", "out",
"-Xdoclint:none",
"-sourcepath", testSrc,
@ -58,7 +58,7 @@ public class TestClassCrossReferences extends JavadocTester {
+ "title=\"class or interface in javax.swing.text\" class=\"externalLink\"><code>Link to AttributeContext innerclass</code></a>",
"<a href=\"" + uri + "java/math/BigDecimal.html?is-external=true\" "
+ "title=\"class or interface in java.math\" class=\"externalLink\"><code>Link to external class BigDecimal</code></a>",
"<a href=\"" + uri + "java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" "
"<a href=\"" + uri + "java/math/BigInteger.html?is-external=true#gcd(java.math.BigInteger)\" "
+ "title=\"class or interface in java.math\" class=\"externalLink\"><code>Link to external member gcd</code></a>",
"<a href=\"" + uri + "javax/tools/SimpleJavaFileObject.html?is-external=true#URI\" "
+ "title=\"class or interface in javax.tools\" class=\"externalLink\"><code>Link to external member URI</code></a>",
@ -68,4 +68,18 @@ public class TestClassCrossReferences extends JavadocTester {
+ "</dl>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-Xdoclint:none",
"-sourcepath", testSrc,
"-linkoffline", uri, testSrc,
testSrc("C.java"));
checkExit(Exit.OK);
checkOutput("C.html", true,
"<a href=\"" + uri + "java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" "
+ "title=\"class or interface in java.math\" class=\"externalLink\"><code>Link to external member gcd</code></a>");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8163800 8175200 8186332
* @bug 8163800 8175200 8186332 8182765
* @summary The fix for JDK-8072052 shows up other minor incorrect use of styles
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -51,11 +51,11 @@ public class TestClassLinks extends JavadocTester {
checkOutput("p/C1.html", true,
"<code><a href=\"C2.html\" title=\"class in p\">C2</a></code>",
"<code><span class=\"memberNameLink\"><a href=\"#C1--\">C1</a></span>()</code>");
"<code><span class=\"memberNameLink\"><a href=\"#%3Cinit%3E()\">C1</a></span>()</code>");
checkOutput("p/C2.html", true,
"<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
"<code><span class=\"memberNameLink\"><a href=\"#C2--\">C2</a></span>()</code>");
"<code><span class=\"memberNameLink\"><a href=\"#%3Cinit%3E()\">C2</a></span>()</code>");
checkOutput("p/C3.html", true,
"<code><a href=\"I1.html\" title=\"interface in p\">I1</a></code>, "
@ -63,7 +63,7 @@ public class TestClassLinks extends JavadocTester {
+ "<code><a href=\"I2.html\" title=\"interface in p\">I2</a></code>, "
+ "<code><a href=\"IT1.html\" title=\"interface in p\">IT1</a>&lt;T&gt;</code>, "
+ "<code><a href=\"IT2.html\" title=\"interface in p\">IT2</a>&lt;java.lang.String&gt;</code>",
"<code><span class=\"memberNameLink\"><a href=\"#C3--\">C3</a></span>()</code>");
"<code><span class=\"memberNameLink\"><a href=\"#%3Cinit%3E()\">C3</a></span>()</code>");
checkOutput("p/I1.html", true,
"<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
@ -82,7 +82,26 @@ public class TestClassLinks extends JavadocTester {
checkOutput("p/IT2.html", true,
"code><a href=\"C3.html\" title=\"class in p\">C3</a></code>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-Xdoclint:none",
"-sourcepath", testSrc,
"-package",
"p");
checkExit(Exit.OK);
checkOutput("p/C1.html", true,
"<code><span class=\"memberNameLink\"><a href=\"#C1--\">C1</a></span>()</code>");
checkOutput("p/C2.html", true,
"<code><span class=\"memberNameLink\"><a href=\"#C2--\">C2</a></span>()</code>");
checkOutput("p/C3.html", true,
"<code><span class=\"memberNameLink\"><a href=\"#C3--\">C3</a></span>()</code>");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8025524 8031625 8081854 8175200 8186332
* @bug 8025524 8031625 8081854 8175200 8186332 8182765
* @summary Test for constructor name which should be a non-qualified name.
* @author Bhavesh Patel
* @library ../lib
@ -46,6 +46,57 @@ public class TestConstructors extends JavadocTester {
"pkg1");
checkExit(Exit.OK);
checkOutput("pkg1/Outer.html", true,
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"Outer.Inner.html#%3Cinit%3E()\"><code>Inner()</code></a>, \n"
+ "<a href=\"Outer.Inner.html#%3Cinit%3E(int)\"><code>Inner(int)</code></a>, \n"
+ "<a href=\"Outer.Inner.NestedInner.html#%3Cinit%3E()\"><code>NestedInner()</code></a>, \n"
+ "<a href=\"Outer.Inner.NestedInner.html#%3Cinit%3E(int)\"><code>NestedInner(int)</code></a>, \n"
+ "<a href=\"#%3Cinit%3E()\"><code>Outer()</code></a>, \n"
+ "<a href=\"#%3Cinit%3E(int)\"><code>Outer(int)</code></a></dd>",
"Link: <a href=\"Outer.Inner.html#%3Cinit%3E()\"><code>Inner()</code></a>, "
+ "<a href=\"#%3Cinit%3E(int)\"><code>Outer(int)</code></a>, "
+ "<a href=\"Outer.Inner.NestedInner.html#%3Cinit%3E(int)\"><code>NestedInner(int)</code></a>",
"<a href=\"#%3Cinit%3E()\">Outer</a></span>()",
"<a id=\"&lt;init&gt;(int)\">",
"<a href=\"#%3Cinit%3E(int)\">Outer</a></span>&#8203;(int&nbsp;i)",
"<a id=\"&lt;init&gt;(int)\">");
checkOutput("pkg1/Outer.Inner.html", true,
"<a href=\"#%3Cinit%3E()\">Inner</a></span>()",
"<a id=\"&lt;init&gt;()\">",
"<a href=\"#%3Cinit%3E(int)\">Inner</a></span>&#8203;(int&nbsp;i)",
"<a id=\"&lt;init&gt;(int)\">");
checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
"<a href=\"#%3Cinit%3E()\">NestedInner</a></span>()",
"<a id=\"&lt;init&gt;()\">",
"<a href=\"#%3Cinit%3E(int)\">NestedInner</a></span>&#8203;(int&nbsp;i)",
"<a id=\"&lt;init&gt;(int)\">");
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,
"<a href=\"Outer.Inner.html#Outer.Inner()\"><code>Outer.Inner()</code></a>",
"<a href=\"Outer.Inner.html#Outer.Inner(int)\"><code>Outer.Inner(int)</code></a>",
"<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner()\"><code>Outer.Inner.NestedInner()</code></a>",
"<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner(int)\"><code>Outer.Inner.NestedInner(int)</code></a>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg1");
checkExit(Exit.OK);
checkOutput("pkg1/Outer.html", true,
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4927552 8026567 8071982 8162674 8175200 8175218 8183511 8186332
* 8169819 8074407 8191030
* 8169819 8074407 8191030 8182765
* @summary test generated docs for deprecated items
* @author jamieh
* @library ../lib
@ -209,6 +209,97 @@ public class TestDeprecatedDocs extends JavadocTester {
+ "<li><a href=\"#enum.constant\">Enum Constants</a></li>\n"
+ "<li><a href=\"#annotation.type.member\">Annotation Type Elements</a></li>\n"
+ "</ul>",
"<a id=\"forRemoval\">",
"<table class=\"deprecatedSummary\">\n"
+ "<caption><span>For Removal</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Element</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>",
"<table class=\"deprecatedSummary\">\n"
+ "<caption><span>Enums</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Enum</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n"
+ "<tbody>\n"
+ "<tr class=\"altColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestEnum.html\" title=\"enum in pkg\">pkg.TestEnum</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">enum_test1 passes.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "</tbody>\n"
+ "</table>",
"<table class=\"deprecatedSummary\">\n"
+ "<caption><span>Exceptions</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Exceptions</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n"
+ "<tbody>\n"
+ "<tr class=\"altColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestException.html\" title=\"class in pkg\">pkg.TestException</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">exception_test1 passes.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "</tbody>\n"
+ "</table>",
"<table class=\"deprecatedSummary\">\n"
+ "<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Field</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n"
+ "<tbody>\n"
+ "<tr class=\"altColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/DeprecatedClassByAnnotation.html#field\">pkg.DeprecatedClassByAnnotation.field</a></th>\n"
+ "<td class=\"colLast\"></td>\n"
+ "</tr>\n"
+ "<tr class=\"rowColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestAnnotationType.html#field\">pkg.TestAnnotationType.field</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">annotation_test4 passes.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "<tr class=\"altColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestClass.html#field\">pkg.TestClass.field</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">class_test2 passes. This is the second sentence of deprecated description for a field.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "<tr class=\"rowColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestError.html#field\">pkg.TestError.field</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">error_test2 passes.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "<tr class=\"altColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestException.html#field\">pkg.TestException.field</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">exception_test2 passes.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "<tr class=\"rowColor\">\n"
+ "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestInterface.html#field\">pkg.TestInterface.field</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"deprecationComment\">interface_test2 passes.</div>\n"
+ "</td>\n"
+ "</tr>\n"
+ "</tbody>\n"
+ "</table>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("deprecated-list.html", true,
"<a name=\"forRemoval\">",
"<table class=\"deprecatedSummary\" summary=\"For Removal table, listing for removal, and an explanation\">\n"
+ "<caption><span>For Removal</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4857717 8025633 8026567 8164407
* @bug 4857717 8025633 8026567 8164407 8182765
* @summary Test to make sure that externally overriden and implemented methods
* are documented properly. The method should still include "implements" or
* "overrides" documentation even though the method is external.
@ -33,9 +33,10 @@
* @build JavadocTester TestExternalOverridenMethod
* @run main TestExternalOverridenMethod
*/
public class TestExternalOverridenMethod extends JavadocTester {
static final String uri = "http://java.sun.com/j2se/1.4.1/docs/api";
public static void main(String... args) throws Exception {
TestExternalOverridenMethod tester = new TestExternalOverridenMethod();
tester.runTests();
@ -43,13 +44,35 @@ public class TestExternalOverridenMethod extends JavadocTester {
@Test
void test() {
String uri = "http://java.sun.com/j2se/1.4.1/docs/api";
javadoc("-d", "out",
"-sourcepath", testSrc,
"-linkoffline", uri, testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/XReader.html", true,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"" + uri + "/java/io/FilterReader.html?is-external=true#read()\" "
+ "title=\"class or interface in java.io\" class=\"externalLink\">read</a></code>&nbsp;in class&nbsp;<code>"
+ "<a href=\"" + uri + "/java/io/FilterReader.html?is-external=true\" "
+ "title=\"class or interface in java.io\" class=\"externalLink\">FilterReader</a></code></dd>",
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"" + uri + "/java/io/DataInput.html?is-external=true#readInt()\" "
+ "title=\"class or interface in java.io\" class=\"externalLink\">readInt</a></code>&nbsp;in interface&nbsp;<code>"
+ "<a href=\"" + uri + "/java/io/DataInput.html?is-external=true\" "
+ "title=\"class or interface in java.io\" class=\"externalLink\">DataInput</a></code></dd>"
);
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"-linkoffline", uri, testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/XReader.html", true,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"" + uri + "/java/io/FilterReader.html?is-external=true#read--\" "

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8073100
* @bug 8073100 8182765
* @summary ensure the hidden tag works as intended
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -38,7 +38,6 @@ public class TestHiddenTag extends JavadocTester {
tester.runTests();
}
/**
* Perform tests on &#64;hidden tags
*/
@ -51,20 +50,20 @@ public class TestHiddenTag extends JavadocTester {
checkExit(Exit.OK);
checkOutput("pkg1/A.html", true,
"<a name=\"visibleField\">",
"<a name=\"visibleMethod--\">",
"<a id=\"visibleField\">",
"<a id=\"visibleMethod()\">",
"<dt>Direct Known Subclasses:</dt>\n" +
"<dd><code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
"A.VisibleInner</a></code>, <code><a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
"title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></dd>");
checkOutput("pkg1/A.html", false,
"<a name=\"inVisibleField\">",
"<a name=\"inVisibleMethod--\">");
"<a id=\"inVisibleField\">",
"<a id=\"inVisibleMethod()\">");
checkOutput("pkg1/A.VisibleInner.html", true,
"<code><a href=\"A.html#visibleField\">visibleField</a></code>",
"<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>",
"<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>",
"<h3>Nested classes/interfaces inherited from class&nbsp;pkg1." +
"<a href=\"A.html\" title=\"class in pkg1\">A</a></h3>\n" +
"<code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
@ -73,16 +72,16 @@ public class TestHiddenTag extends JavadocTester {
"</ul>");
checkOutput("pkg1/A.VisibleInner.html", false,
"../pkg1/A.VisibleInner.html#VisibleInner--",
"<a name=\"inVisibleField\">",
"<a name=\"inVisibleMethod--\">");
"../pkg1/A.VisibleInner.html#VisibleInner()",
"<a id=\"inVisibleField\">",
"<a id=\"inVisibleMethod()\">");
checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", true,
"<pre>public static class <span class=\"typeNameLabel\">" +
"A.VisibleInnerExtendsInvisibleInner</span>\n" +
"extends <a href=\"A.html\" title=\"class in pkg1\">A</a></pre>",
"<code><a href=\"A.html#visibleField\">visibleField</a></code></li>",
"<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
"<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>");
checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", false,
"invisibleField",
@ -98,6 +97,33 @@ public class TestHiddenTag extends JavadocTester {
checkFiles(false,
"pkg1/A.InvisibleInner.html",
"pkg1/A.InvisibleInnerExtendsVisibleInner.html");
}
@Test
public void test1_html4() {
javadoc("-d", "out1-html4",
"-html4",
"-sourcepath", testSrc,
"-package",
"pkg1");
checkExit(Exit.OK);
checkOutput("pkg1/A.html", true,
"<a name=\"visibleField\">",
"<a name=\"visibleMethod--\">");
checkOutput("pkg1/A.VisibleInner.html", true,
"<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", true,
"<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
checkOutput("pkg1/A.html", false,
"<a name=\"inVisibleMethod--\">");
checkOutput("pkg1/A.VisibleInner.html", false,
"../pkg1/A.VisibleInner.html#VisibleInner--",
"<a name=\"inVisibleField\">",
"<a name=\"inVisibleMethod--\">");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4663254 8016328 8025633 8026567 8081854
* @bug 4663254 8016328 8025633 8026567 8081854 8182765
* @summary Verify that spaces do not appear in hrefs and anchors.
* @author jamieh
* @library ../lib
@ -48,6 +48,49 @@ public class TestHref extends JavadocTester {
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/C1.html", true,
//External link.
"href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long,int)\"",
//Member summary table link.
"href=\"#method(int,int,java.util.ArrayList)\"",
//Anchor test.
"<a id=\"method(int,int,java.util.ArrayList)\">\n"
+ "<!-- -->\n"
+ "</a>",
//Backward compatibility anchor test."pkg/C1.html",
"<a id=\"method(int,int,java.util.ArrayList)\">\n"
+ "<!-- -->\n"
+ "</a>");
checkOutput("pkg/C2.html", true,
//{@link} test.
"Link: <a href=\"C1.html#method(int,int,java.util.ArrayList)\">",
//@see test.
"See Also:</span></dt>\n"
+ "<dd><a href=\"C1.html#method(int,int,java.util.ArrayList)\">"
);
checkOutput("pkg/C4.html", true,
//Header does not link to the page itself.
"Class C4&lt;E extends C4&lt;E&gt;&gt;</h2>",
//Signature does not link to the page itself.
"public abstract class <span class=\"typeNameLabel\">C4&lt;E extends C4&lt;E&gt;&gt;</span>"
);
checkOutput(Output.OUT, false,
"<a> tag is malformed");
}
@Test
void test_html4() {
javadoc("-Xdoclint:none",
"-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/C1.html", true,
//External link.
"href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\"",
@ -69,15 +112,5 @@ public class TestHref extends JavadocTester {
"See Also:</span></dt>\n"
+ "<dd><a href=\"C1.html#method-int-int-java.util.ArrayList-\">"
);
checkOutput("pkg/C4.html", true,
//Header does not link to the page itself.
"Class C4&lt;E extends C4&lt;E&gt;&gt;</h2>",
//Signature does not link to the page itself.
"public abstract class <span class=\"typeNameLabel\">C4&lt;E extends C4&lt;E&gt;&gt;</span>"
);
checkOutput(Output.OUT, false,
"<a> tag is malformed");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 6786690 6820360 8025633 8026567 8175200 8183511 8186332 8074407
* @bug 6786690 6820360 8025633 8026567 8175200 8183511 8186332 8074407 8182765
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
* @library ../lib
@ -57,6 +57,17 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
checkCommentDeprecated(true);
}
@Test
void test_Comment_Deprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-1-html4",
"-html4",
"-sourcepath", testSrc,
"pkg1");
checkExit(Exit.OK);
checkCommentDeprecated_html4(true);
}
@Test
void test_NoComment_Deprecated() {
// tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5);
@ -72,6 +83,18 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
checkCommentDeprecated(false); // ??
}
@Test
void test_NoComment_Deprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-2-html4",
"-html4",
"-nocomment",
"-sourcepath", testSrc,
"pkg1");
checkExit(Exit.OK);
checkCommentDeprecated_html4(false);
}
@Test
void test_Comment_NoDeprecated() {
// tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5);
@ -87,6 +110,19 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
checkNoCommentNoDeprecated(false);
}
@Test
void test_Comment_NoDeprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-3-html4",
"-html4",
"-nodeprecated",
"-sourcepath", testSrc,
"pkg1");
checkExit(Exit.OK);
checkNoDeprecated_html4();
checkNoCommentNoDeprecated_html4(false);
}
@Test
void testNoCommentNoDeprecated() {
// tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5);
@ -103,6 +139,19 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
checkCommentDeprecated(false);
}
@Test
void testNoCommentNoDeprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-4-html4",
"-html4",
"-nocomment",
"-nodeprecated",
"-sourcepath", testSrc,
"pkg1");
checkNoCommentNoDeprecated_html4(true);
checkCommentDeprecated_html4(false);
}
void checkCommon(boolean checkC5) {
// Test common to all runs of javadoc. The class signature should print
// properly enclosed definition list tags and the Annotation Type
@ -166,7 +215,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#setUndecorated-boolean-\">"
+ "<dd><a href=\"#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>",
"<dl>\n"
@ -193,7 +242,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd>"
+ "<a href=\"#readObject--\"><code>readObject()"
+ "<a href=\"#readObject()\"><code>readObject()"
+ "</code></a></dd>\n"
+ "</dl>",
"<dl>\n"
@ -201,7 +250,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:"
+ "</span></dt>\n"
+ "<dd><a href=\"#setUndecorated-boolean-\">"
+ "<dd><a href=\"#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>");
@ -215,6 +264,85 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dd>1.4</dd>\n"
+ "</dl>");
checkOutput("serialized-form.html", expectFound,
"<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:</span>"
+ "</dt>\n"
+ "<dd><code>"
+ "java.io.IOException</code></dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span>"
+ "</dt>\n"
+ "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>\n"
+ "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
+ " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a>.</div>\n"
+ "</div>\n"
+ "<div class=\"block\">This field indicates whether the C1 is "
+ "undecorated.</div>\n"
+ "&nbsp;\n"
+ "<dl>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span>"
+ "</dt>\n"
+ "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>\n"
+ "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
+ " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a>.</div>\n"
+ "</div>\n"
+ "<div class=\"block\">Reads the object stream.</div>\n"
+ "<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:"
+ "</span></dt>\n"
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>"
+ "</div>\n"
+ "<div class=\"block\">The name for this class.</div>");
}
void checkCommentDeprecated_html4(boolean expectFound) {
// Test for normal run of javadoc in which various ClassDocs and
// serialized form should have properly nested definition list tags
// enclosing comments, tags and deprecated information.
checkOutput("pkg1/C1.html", expectFound,
"<dl>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#setUndecorated-boolean-\">"
+ "<code>setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>",
"<dl>\n"
+ "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n"
+ "<dd><code>undecorated"
+ "</code> - <code>true</code> if no decorations are\n"
+ " to be enabled;\n"
+ " <code>false</code> "
+ "if decorations are to be enabled.</dd>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:"
+ "</span></dt>\n"
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd>"
+ "<a href=\"#readObject--\"><code>readObject()"
+ "</code></a></dd>\n"
+ "</dl>",
"<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n"
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:"
+ "</span></dt>\n"
+ "<dd><a href=\"#setUndecorated-boolean-\">"
+ "<code>setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>");
checkOutput("serialized-form.html", expectFound,
"<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:</span>"
@ -252,10 +380,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dt><span class=\"throwsLabel\">Throws:"
+ "</span></dt>\n"
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>"
+ "</div>\n"
+ "<div class=\"block\">The name for this class.</div>");
+ "</dl>");
}
void checkNoDeprecated() {
@ -299,6 +424,81 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dd><code>"
+ "HeadlessException</code></dd>\n"
+ "</dl>",
"<dl>\n"
+ "<dt><span class=\"paramLabel\">Parameters:"
+ "</span></dt>\n"
+ "<dd><code>undecorated</code> - <code>true</code>"
+ " if no decorations are\n"
+ " to be enabled;\n"
+ " <code>false</code> if decorations are to be enabled."
+ "</dd>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#readObject()\">"
+ "<code>readObject()</code></a></dd>\n"
+ "</dl>",
"<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:</span>"
+ "</dt>\n"
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "<dt>"
+ "<span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>");
checkOutput("serialized-form.html", true,
"<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:</span>"
+ "</dt>\n"
+ "<dd><code>"
+ "java.io.IOException</code></dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span>"
+ "</dt>\n"
+ "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>\n"
+ "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
+ " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a>.</div>\n"
+ "</div>\n"
+ "<div class=\"block\">This field indicates whether the C1 is "
+ "undecorated.</div>\n"
+ "&nbsp;\n"
+ "<dl>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>1.4</dd>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span>"
+ "</dt>\n"
+ "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>\n"
+ "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
+ " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a>.</div>\n"
+ "</div>\n"
+ "<div class=\"block\">Reads the object stream.</div>\n"
+ "<dl>\n"
+ "<dt><span class=\"throwsLabel\">Throws:"
+ "</span></dt>\n"
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>"
+ "</div>\n"
+ "<div class=\"block\">"
+ "The name for this class.</div>");
}
void checkNoDeprecated_html4() {
// Test with -nodeprecated option. The ClassDocs should have properly nested
// definition list tags enclosing comments and tags. The ClassDocs should not
// display definition list for deprecated information. The serialized form
// should display properly nested definition list tags for comments, tags
// and deprecated information.
checkOutput("pkg1/C1.html", true,
"<dl>\n"
+ "<dt><span class=\"paramLabel\">Parameters:"
+ "</span></dt>\n"
@ -360,11 +560,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
+ "<dt><span class=\"throwsLabel\">Throws:"
+ "</span></dt>\n"
+ "<dd><code>java.io.IOException</code></dd>\n"
+ "</dl>",
"<span class=\"deprecatedLabel\">Deprecated.</span>"
+ "</div>\n"
+ "<div class=\"block\">"
+ "The name for this class.</div>");
+ "</dl>");
}
void checkNoCommentNoDeprecated(boolean expectFound) {
@ -386,6 +582,30 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"APPLICATION_EXCLUDE</pre>\n" +
"</li>");
checkOutput("serialized-form.html", expectFound,
"<pre>boolean " +
"undecorated</pre>\n" +
"<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">" +
"Deprecated.</span>\n"
+ "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
+ " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>"
+ "setUndecorated(boolean)</code></a>.</div>\n"
+ "</div>\n"
+
"</li>",
"<span class=\"deprecatedLabel\">"
+ "Deprecated.</span>\n"
+ "<div class=\"deprecationComment\">As of JDK version"
+ " 1.5, replaced by\n"
+ " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">"
+ "<code>setUndecorated(boolean)</code></a>.</div>\n"
+ "</div>\n"
+ "</li>");
}
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,
"<pre>boolean " +
"undecorated</pre>\n" +

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 8008164 8169819 8183037
* @bug 8008164 8169819 8183037 8182765
* @summary Test styles on HTML tables generated by javadoc.
* @author Bhavesh Patel
* @library ../lib
@ -45,6 +45,43 @@ public class TestHtmlTableStyles extends JavadocTester {
"-sourcepath", testSrc,
"-use",
"pkg1", "pkg2");
checkExit(Exit.ERROR);
checkOutput(Output.OUT, true,
"attribute not supported in HTML5: summary",
"attribute border for table only accepts \"\" or \"1\", use CSS instead: BORDER",
"attribute not supported in HTML5: cellpadding",
"attribute not supported in HTML5: cellspacing",
"attribute not supported in HTML5: align");
checkOutput("pkg1/TestTable.html", true,
"<table summary=\"Summary\" border cellpadding=3 cellspacing=1>",
"<table class=\"memberSummary\">",
"<table class=\"memberSummary\">",
"<table class=\"memberSummary\">");
checkOutput("pkg1/package-summary.html", true,
"<table class=\"typeSummary\">");
checkOutput("pkg1/class-use/TestTable.html", true,
"<table class=\"useSummary\">");
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\">");
checkOutput("deprecated-list.html", true,
"<table class=\"deprecatedSummary\">");
checkOutput("constant-values.html", true,
"<table class=\"constantsSummary\">");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"-use",
"pkg1", "pkg2");
checkExit(Exit.OK);
checkOutput("pkg1/TestTable.html", true,

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 6786688 8008164 8162363 8169819 8183037
* @bug 6786688 8008164 8162363 8169819 8183037 8182765
* @summary HTML tables should have table summary, caption and table headers.
* @author Bhavesh Patel
* @library ../lib
@ -53,11 +53,95 @@ public class TestHtmlTableTags extends JavadocTester {
"pkg1", "pkg2");
checkExit(Exit.OK);
checkHtmlTableSummaries();
checkHtmlTableTag();
checkHtmlTableCaptions();
checkHtmlTableHeaders();
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"-use",
"pkg1", "pkg2");
checkExit(Exit.OK);
checkHtmlTableSummaries();
}
/*
* Tests for validating table tag for HTML tables
*/
void checkHtmlTableTag() {
//Package summary
checkOutput("pkg1/package-summary.html", true,
"<table class=\"typeSummary\">",
"<table class=\"typeSummary\">");
checkOutput("pkg2/package-summary.html", true,
"<table class=\"typeSummary\">",
"<table class=\"typeSummary\">");
// Class documentation
checkOutput("pkg1/C1.html", true,
"<table class=\"memberSummary\">",
"<table class=\"memberSummary\">");
checkOutput("pkg2/C2.html", true,
"<table class=\"memberSummary\">",
"<table class=\"memberSummary\">");
checkOutput("pkg2/C2.ModalExclusionType.html", true,
"<table class=\"memberSummary\">");
checkOutput("pkg2/C3.html", true,
"<table class=\"memberSummary\">");
checkOutput("pkg2/C4.html", true,
"<table class=\"memberSummary\">");
// Class use documentation
checkOutput("pkg1/class-use/I1.html", true,
"<table class=\"useSummary\">");
checkOutput("pkg1/class-use/C1.html", true,
"<table class=\"useSummary\">",
"<table class=\"useSummary\">");
checkOutput("pkg2/class-use/C2.html", true,
"<table class=\"useSummary\">",
"<table class=\"useSummary\">");
checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
"<table class=\"useSummary\">");
checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
"<table class=\"useSummary\">");
// Package use documentation
checkOutput("pkg1/package-use.html", true,
"<table class=\"useSummary\">",
"<table class=\"useSummary\">");
checkOutput("pkg2/package-use.html", true,
"<table class=\"useSummary\">",
"<table class=\"useSummary\">");
// Deprecated
checkOutput("deprecated-list.html", true,
"<table class=\"deprecatedSummary\">",
"<table class=\"deprecatedSummary\">");
// Constant values
checkOutput("constant-values.html", true,
"<table class=\"constantsSummary\">");
// Overview Summary
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\">");
}
/*
* Tests for validating summary for HTML tables
*/

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 6786682 4649116
* @bug 6786682 4649116 8182765
* @summary This test verifies the use of lang attribute by <HTML>.
* @author Bhavesh Patel
* @library ../lib
@ -105,6 +105,104 @@ public class TestHtmlTag extends JavadocTester {
"pkg3");
checkExit(Exit.OK);
checkOutput("pkg3/package-summary.html", true,
"<div class=\"contentContainer\">\n"
+ "<section role=\"region\"><a id=\"package.description\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<div class=\"block\"><p>This is the first line. Note the newlines before the &lt;p&gt; is relevant.</div>\n"
+ "</section>");
checkOutput("pkg3/A.DatatypeFactory.html", true,
"<div class=\"block\"><p>\n"
+ " Factory that creates new <code>javax.xml.datatype</code>\n"
+ " <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>\n"
+ "\n"
+ " <p>\n"
+ " A new instance of the <code>DatatypeFactory</code> is created through the\n"
+ " <a href=\"#newInstance()\"><code>newInstance()</code></a> method that uses the following implementation\n"
+ " resolution mechanisms to determine an implementation:</p>\n"
+ " <ol>\n"
+ " <li>\n"
+ " If the system property specified by <a href=\"#DATATYPEFACTORY_PROPERTY\"><code>DATATYPEFACTORY_PROPERTY</code></a>,\n"
+ " \"<code>javax.xml.datatype.DatatypeFactory</code>\", exists, a class with\n"
+ " the name of the property value is instantiated. Any Exception thrown\n"
+ " during the instantiation process is wrapped as a\n"
+ " <code>IllegalStateException</code>.\n"
+ " </li>\n"
+ " <li>\n"
+ " If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a\n"
+ " <code>Properties</code> <code>Object</code>. The\n"
+ " <code>Properties</code> <code>Object </code> is then queried for the\n"
+ " property as documented in the prior step and processed as documented in\n"
+ " the prior step.\n"
+ " </li>\n"
+ " <li>\n"
+ " Uses the service-provider loading facilities, defined by the\n"
+ " <code>ServiceLoader</code> class, to attempt to locate and load an\n"
+ " implementation of the service using the default loading mechanism:\n"
+ " the service-provider loading facility will use the current thread's context class loader\n"
+ " to attempt to load the service. If the context class loader is null, the system class loader will be used.\n"
+ " <br>\n"
+ " In case of <code>service configuration error</code> a\n"
+ " <code>DatatypeConfigurationException</code> will be thrown.\n"
+ " </li>\n"
+ " <li>\n"
+ " The final mechanism is to attempt to instantiate the <code>Class</code>\n"
+ " specified by <a href=\"#DATATYPEFACTORY_IMPLEMENTATION_CLASS\"><code>DATATYPEFACTORY_IMPLEMENTATION_CLASS</code></a>. Any Exception\n"
+ " thrown during the instantiation process is wrapped as a\n"
+ " <code>IllegalStateException</code>.\n"
+ " </li>\n"
+ " </ol></div>");
checkOutput("pkg3/A.ActivationDesc.html", true,
"<pre>public class <span class=\"typeNameLabel\">A.ActivationDesc</span>\n"
+ "extends java.lang.Object\n"
+ "implements java.io.Serializable</pre>\n"
+ "<div class=\"block\">An activation descriptor contains the information necessary to activate\n"
+ " an object: <ul>\n"
+ " <li> the object's group identifier,\n"
+ " <li> the object's fully-qualified class name,\n"
+ " <li> the object's code location (the location of the class), a codebase\n"
+ " URL path,\n"
+ " <li> the object's restart \"mode\", and,\n"
+ " <li> a \"marshalled\" object that can contain object specific\n"
+ " initialization data. </ul>\n"
+ "\n"
+ " <p>\n"
+ " A descriptor registered with the activation system can be used to\n"
+ " recreate/activate the object specified by the descriptor. The\n"
+ " <code>MarshalledObject</code> in the object's descriptor is passed as the\n"
+ " second argument to the remote object's constructor for object to use\n"
+ " during reinitialization/activation.</div>");
checkOutput("pkg3/A.ActivationGroupID.html", true,
"<pre>public class <span class=\"typeNameLabel\">A.ActivationGroupID</span>\n"
+ "extends java.lang.Object\n"
+ "implements java.io.Serializable</pre>\n"
+ "<div class=\"block\">The identifier for a registered activation group serves several purposes:\n"
+ " <ul>\n"
+ " <li>identifies the group uniquely within the activation system, and\n"
+ " <li>contains a reference to the group's activation system so that the\n"
+ " group can contact its activation system when necessary.</ul><p>\n"
+ "\n"
+ " The <code>ActivationGroupID</code> is returned from the call to\n"
+ " <code>ActivationSystem.registerGroup</code> and is used to identify the\n"
+ " group within the activation system. This group id is passed as one of the\n"
+ " arguments to the activation group's special constructor when an\n"
+ " activation group is created/recreated.</div>\n"
+ "<dl>");
}
@Test
void test_other_html4() {
javadoc("-locale", "en_US",
"-d", "out-other-html4",
"-html4",
"-sourcepath", testSrc,
"pkg3");
checkExit(Exit.OK);
checkOutput("pkg3/package-summary.html", true,
"<div class=\"contentContainer\"><a name=\"package.description\">\n"
+ "<!-- -->\n"
@ -154,43 +252,5 @@ public class TestHtmlTag extends JavadocTester {
+ " <code>IllegalStateException</code>.\n"
+ " </li>\n"
+ " </ol></div>");
checkOutput("pkg3/A.ActivationDesc.html", true,
"<pre>public class <span class=\"typeNameLabel\">A.ActivationDesc</span>\n"
+ "extends java.lang.Object\n"
+ "implements java.io.Serializable</pre>\n"
+ "<div class=\"block\">An activation descriptor contains the information necessary to activate\n"
+ " an object: <ul>\n"
+ " <li> the object's group identifier,\n"
+ " <li> the object's fully-qualified class name,\n"
+ " <li> the object's code location (the location of the class), a codebase\n"
+ " URL path,\n"
+ " <li> the object's restart \"mode\", and,\n"
+ " <li> a \"marshalled\" object that can contain object specific\n"
+ " initialization data. </ul>\n"
+ "\n"
+ " <p>\n"
+ " A descriptor registered with the activation system can be used to\n"
+ " recreate/activate the object specified by the descriptor. The\n"
+ " <code>MarshalledObject</code> in the object's descriptor is passed as the\n"
+ " second argument to the remote object's constructor for object to use\n"
+ " during reinitialization/activation.</div>");
checkOutput("pkg3/A.ActivationGroupID.html", true,
"<pre>public class <span class=\"typeNameLabel\">A.ActivationGroupID</span>\n"
+ "extends java.lang.Object\n"
+ "implements java.io.Serializable</pre>\n"
+ "<div class=\"block\">The identifier for a registered activation group serves several purposes:\n"
+ " <ul>\n"
+ " <li>identifies the group uniquely within the activation system, and\n"
+ " <li>contains a reference to the group's activation system so that the\n"
+ " group can contact its activation system when necessary.</ul><p>\n"
+ "\n"
+ " The <code>ActivationGroupID</code> is returned from the call to\n"
+ " <code>ActivationSystem.registerGroup</code> and is used to identify the\n"
+ " group within the activation system. This group id is passed as one of the\n"
+ " arguments to the activation group's special constructor when an\n"
+ " activation group is created/recreated.</div>\n"
+ "<dl>");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819 8183037
* @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819 8183037 8182765
* @summary Test the version of HTML generated by the javadoc tool.
* @author bpatel
* @library ../lib
@ -41,7 +41,9 @@ public class TestHtmlVersion extends JavadocTester {
@Test
void test1() {
javadoc("-d", "out-1", "-private", "-linksource", "-html5",
javadoc("-d", "out-1",
"-private",
"-linksource",
"-sourcepath", testSrc,
"-use",
"pkg", "pkg1", "pkg2", "pkg3");
@ -53,7 +55,10 @@ public class TestHtmlVersion extends JavadocTester {
@Test
void test2() {
javadoc("-d", "out-2", "-private", "-linksource", "-html4",
javadoc("-d", "out-2",
"-html4",
"-private",
"-linksource",
"-sourcepath", testSrc,
"-use",
"pkg", "pkg1", "pkg2", "pkg3");
@ -65,7 +70,10 @@ public class TestHtmlVersion extends JavadocTester {
@Test
void test3() {
javadoc("-d", "out-3", "-private", "-linksource",
javadoc("-d", "out-3",
"-html4",
"-private",
"-linksource",
"-sourcepath", testSrc,
"-use",
"pkg", "pkg1", "pkg2", "pkg3");
@ -77,7 +85,9 @@ public class TestHtmlVersion extends JavadocTester {
@Test
void test4() {
javadoc("-d", "out-4", "-private", "-linksource", "-html5",
javadoc("-d", "out-4",
"-private",
"-linksource",
"-sourcepath", testSrc,
"-use",
"pkg3");

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8194955
* @bug 8194955 8182765
* @summary Warn when default HTML version is used.
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -47,8 +47,11 @@ public class TestHtmlWarning extends JavadocTester {
}
private static final Path testFile = Paths.get("C.java");
private static final String warning =
"javadoc: warning - You have not specified the version of HTML to use.";
private static final String warning
= "javadoc: warning - 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.";
@Test
void testHtml4() {
@ -57,7 +60,7 @@ public class TestHtmlWarning extends JavadocTester {
testFile.toString());
checkExit(Exit.OK);
checkOutput(Output.OUT, false, warning);
checkOutput(Output.OUT, true, warning);
}
@Test
@ -76,6 +79,6 @@ public class TestHtmlWarning extends JavadocTester {
testFile.toString());
checkExit(Exit.OK);
checkOutput(Output.OUT, true, warning);
checkOutput(Output.OUT, false, warning);
}
}

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4682448 4947464 5029946 8025633 8026567 8035473 8139101 8175200
8186332 8186703
8186332 8186703 8182765
* @summary Verify that the public modifier does not show up in the
* documentation for public methods, as recommended by the JLS.
* If A implements I and B extends A, B should be in the list of
@ -99,14 +99,14 @@ public class TestInterface extends JavadocTester {
+ "</ul>",
//Make sure "Specified By" has substituted type parameters.
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"Interface.html#method--\">method</a>"
+ "<dd><code><a href=\"Interface.html#method()\">method</a>"
+ "</code>&nbsp;in interface&nbsp;<code>"
+ "<a href=\"Interface.html\" title=\"interface in pkg\">"
+ "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
+ "CE</a>&gt;</code></dd>",
//Make sure "Overrides" has substituted type parameters.
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"Parent.html#method--\">method</a>"
+ "<dd><code><a href=\"Parent.html#method()\">method</a>"
+ "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
+ "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
+ "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
@ -120,7 +120,7 @@ public class TestInterface extends JavadocTester {
+ "</dl>");
checkOutput("pkg/Interface.html", false,
"public int&nbsp;method()",
"public int&nbsp;method--",
"public static final&nbsp;int field");
checkOutput("pkg/ClassWithStaticMembers.html", false,
@ -133,6 +133,52 @@ public class TestInterface extends JavadocTester {
+ "<pre>public static&nbsp;int f</pre>\n"
+ "<div class=\"block\">A hider field</div>",
"<td class=\"colFirst\"><code>static void</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#m()\">m</a></span>()</code></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"block\">A hider method</div>\n"
+ "</td>\n",
"<h4>staticMethod</h4>\n"
+ "<pre>public static&nbsp;void&nbsp;staticMethod()</pre>\n"
+ "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
+ "Description copied from interface:&nbsp;<code>"
+ "<a href=\"InterfaceWithStaticMembers.html#staticMethod()\">"
+ "InterfaceWithStaticMembers</a></code></span></div>\n"
+ "<div class=\"block\">A static method</div>\n");
checkOutput("pkg/ClassWithStaticMembers.InnerClass.html", true,
"<pre>public static class <span class=\"typeNameLabel\">"
+ "ClassWithStaticMembers.InnerClass</span>\n"
+ "extends java.lang.Object</pre>\n"
+ "<div class=\"block\">A hider inner class</div>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/Child.html", true,
//Make sure "Specified By" has substituted type parameters.
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"Interface.html#method--\">method</a>"
+ "</code>&nbsp;in interface&nbsp;<code>"
+ "<a href=\"Interface.html\" title=\"interface in pkg\">"
+ "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
+ "CE</a>&gt;</code></dd>",
//Make sure "Overrides" has substituted type parameters.
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"Parent.html#method--\">method</a>"
+ "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
+ "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
+ "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
checkOutput("pkg/ClassWithStaticMembers.html", true,
"<td class=\"colFirst\"><code>static void</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#m--\">m</a></span>()</code></th>\n"
@ -148,11 +194,8 @@ public class TestInterface extends JavadocTester {
+ "InterfaceWithStaticMembers</a></code></span></div>\n"
+ "<div class=\"block\">A static method</div>\n");
checkOutput("pkg/ClassWithStaticMembers.InnerClass.html", true,
"<pre>public static class <span class=\"typeNameLabel\">"
+ "ClassWithStaticMembers.InnerClass</span>\n"
+ "extends java.lang.Object</pre>\n"
+ "<div class=\"block\">A hider inner class</div>");
checkOutput("pkg/Interface.html", false,
"public int&nbsp;method()");
}
@Test
@ -162,6 +205,23 @@ public class TestInterface extends JavadocTester {
"pkg1");
checkExit(Exit.OK);
checkOutput("pkg1/Child.html", true,
// Ensure the correct Overrides in the inheritance hierarchy is reported
"<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
"<dd><code><a href=\"GrandParent.html#method1()\">method1</a></code>" +
"&nbsp;in class&nbsp;" +
"<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
"&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
}
@Test
void test1_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-sourcepath", testSrc,
"pkg1");
checkExit(Exit.OK);
checkOutput("pkg1/Child.html", true,
// Ensure the correct Overrides in the inheritance hierarchy is reported
"<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130 8162363
* 8167967 8172528 8175200 8178830 8182257 8186332
* 8167967 8172528 8175200 8178830 8182257 8186332 8182765
* @summary Test of the JavaFX doclet features.
* @author jvalenta
* @library ../lib
@ -51,9 +51,8 @@ public class TestJavaFX extends JavadocTester {
checkOutput("pkg1/C.html", true,
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#getRate--\"><code>getRate()</code></a>, \n"
+ "<a href=\"#setRate-double-\">"
+ "<code>setRate(double)</code></a></dd>",
+ "<dd><a href=\"#getRate()\"><code>getRate()</code></a>, \n"
+ "<a href=\"#setRate(double)\"><code>setRate(double)</code></a></dd>",
"<pre>public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
+ "<div class=\"block\">Sets the value of the property rate.</div>\n"
+ "<dl>\n"
@ -77,7 +76,7 @@ public class TestJavaFX extends JavadocTester {
"<p>Gets the value of the property <code>Property</code>",
"<span class=\"simpleTagLabel\">Property description:</span>",
"<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#setTestMethodProperty--\">"
+ "<a href=\"#setTestMethodProperty()\">"
+ "setTestMethodProperty</a></span>()</code></th>",
"<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#pausedProperty\">paused</a></span></code></th>\n"
@ -135,7 +134,7 @@ public class TestJavaFX extends JavadocTester {
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>JavaFX 8.0</dd>",
"<h3>Property Summary</h3>\n"
+ "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
+ "<table class=\"memberSummary\">\n"
+ "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<tr class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code><a href=\"C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
@ -168,6 +167,30 @@ public class TestJavaFX extends JavadocTester {
checkOutput("pkg1/D.html", false, "shouldNotAppear");
}
@Test
void test1_html4() {
javadoc("-d", "out1-html4",
"-html4",
"-sourcepath", testSrc,
"-javafx",
"-package",
"pkg1");
checkExit(Exit.OK);
checkOutput("pkg1/C.html", true,
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#getRate--\"><code>getRate()</code></a>, \n"
+ "<a href=\"#setRate-double-\">"
+ "<code>setRate(double)</code></a></dd>",
"<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#setTestMethodProperty--\">"
+ "setTestMethodProperty</a></span>()</code></th>",
"<h3>Property Summary</h3>\n"
+ "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
+ "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
/*
* Test with -javafx option enabled, to ensure property getters and setters
* are treated correctly.
@ -180,6 +203,61 @@ public class TestJavaFX extends JavadocTester {
"-package",
"pkg2");
checkExit(Exit.OK);
checkOutput("pkg2/Test.html", true,
"<h3>Property Detail</h3>\n"
+ "<a id=\"betaProperty\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\">\n"
+ "<h4>beta</h4>\n"
+ "<pre>public&nbsp;java.lang.Object betaProperty</pre>\n"
+ "</li>\n"
+ "</ul>\n"
+ "<a id=\"gammaProperty\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\">\n"
+ "<h4>gamma</h4>\n"
+ "<pre>public final&nbsp;java.util.List&lt;java.lang.String&gt; gammaProperty</pre>\n"
+ "</li>\n"
+ "</ul>\n"
+ "<a id=\"deltaProperty\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<ul class=\"blockListLast\">\n"
+ "<li class=\"blockList\">\n"
+ "<h4>delta</h4>\n"
+ "<pre>public final&nbsp;java.util.List&lt;"
+ "java.util.Set&lt;? super java.lang.Object&gt;&gt; deltaProperty</pre>\n"
+ "</li>\n"
+ "</ul>\n"
+ "</li>\n"
+ "</ul>",
"<h3>Property Summary</h3>\n"
+ "<table class=\"memberSummary\">\n"
+ "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("pkg2/Test.html", false,
"<h3>Property Summary</h3>\n"
+ "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Methods</span><span class=\"tabEnd\">&nbsp;</span>"
+ "</span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">Instance Methods</a>"
+ "</span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span>"
+ "<a href=\"javascript:show(8);\">Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
+ "</caption>");
}
@Test
void test2_html4() {
javadoc("-d", "out2a-html4",
"-html4",
"-sourcepath", testSrc,
"-javafx",
"-package",
"pkg2");
checkExit(Exit.OK);
checkOutput("pkg2/Test.html", true,
"<h3>Property Detail</h3>\n"
+ "<a name=\"betaProperty\">\n"
@ -215,15 +293,6 @@ public class TestJavaFX extends JavadocTester {
"<h3>Property Summary</h3>\n"
+ "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
+ "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("pkg2/Test.html", false,
"<h3>Property Summary</h3>\n"
+ "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Methods</span><span class=\"tabEnd\">&nbsp;</span>"
+ "</span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">Instance Methods</a>"
+ "</span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span>"
+ "<a href=\"javascript:show(8);\">Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
+ "</caption>");
}
/*
@ -238,6 +307,47 @@ public class TestJavaFX extends JavadocTester {
"pkg2");
checkExit(Exit.OK);
checkOutput("pkg2/Test.html", false, "<h3>Property Summary</h3>");
checkOutput("pkg2/Test.html", true,
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n"
+ "<th class=\"colSecond\" scope=\"col\">Method</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n"
+ "<tr id=\"i0\" class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code>&lt;T&gt;&nbsp;java.lang.Object</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#alphaProperty(java.util.List)\">alphaProperty</a>"
+ "</span>&#8203;(java.util.List&lt;T&gt;&nbsp;foo)</code></th>\n"
+ "<td class=\"colLast\">&nbsp;</td>\n"
+ "</tr>\n"
+ "<tr id=\"i1\" class=\"rowColor\">\n"
+ "<td class=\"colFirst\"><code>java.lang.Object</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#betaProperty()\">betaProperty</a></span>()</code></th>\n"
+ "<td class=\"colLast\">&nbsp;</td>\n"
+ "</tr>\n"
+ "<tr id=\"i2\" class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code>java.util.List&lt;java.util.Set&lt;? super java.lang.Object&gt;&gt;"
+ "</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#deltaProperty()\">deltaProperty</a></span>()</code></th>\n"
+ "<td class=\"colLast\">&nbsp;</td>\n"
+ "</tr>\n"
+ "<tr id=\"i3\" class=\"rowColor\">\n"
+ "<td class=\"colFirst\"><code>java.util.List&lt;java.lang.String&gt;</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#gammaProperty()\">gammaProperty</a></span>()</code></th>\n"
+ "<td class=\"colLast\">&nbsp;</td>"
);
}
@Test
void test3_html4() {
javadoc("-d", "out2b-html4",
"-html4",
"-sourcepath", testSrc,
"-package",
"pkg2");
checkExit(Exit.OK);
checkOutput("pkg2/Test.html", true,
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n"
+ "<th class=\"colSecond\" scope=\"col\">Method</th>\n"

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4720957 5020118 8026567 8038976 8184969 8164407
* @bug 4720957 5020118 8026567 8038976 8184969 8164407 8182765
* @summary Test to make sure that -link and -linkoffline link to
* right files, and URLs with and without trailing slash are accepted.
* @author jamieh
@ -66,7 +66,9 @@ public class TestLinkOption extends JavadocTester {
"-linkoffline", url, testSrc + "/jdk",
"-package",
"pkg", "mylib.lang");
checkExit(Exit.OK);
checkExit(Exit.ERROR);
checkOutput(Output.OUT, true,
"tag not supported in the generated HTML version: tt");
checkOutput("pkg/C.html", true,
"<a href=\"" + url + "java/lang/String.html?is-external=true\" "
@ -82,11 +84,11 @@ public class TestLinkOption extends JavadocTester {
checkOutput("pkg/B.html", true,
"<div class=\"block\">A method with html tag the method "
+ "<a href=\"" + url + "java/lang/ClassLoader.html?is-external=true#getSystemClassLoader--\""
+ "<a href=\"" + url + "java/lang/ClassLoader.html?is-external=true#getSystemClassLoader()\""
+ " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
+ "</code></a> as the parent class loader.</div>",
"<div class=\"block\">is equivalent to invoking <code>"
+ "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
+ "<a href=\"#createTempFile(java.lang.String,java.lang.String,java.io.File)\">"
+ "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>",
"<a href=\"" + url + "java/lang/String.html?is-external=true\" "
+ "title=\"class or interface in java.lang\" class=\"externalLink\">Link-Plain to String Class</a>",
@ -109,6 +111,25 @@ public class TestLinkOption extends JavadocTester {
+ "title=\"class or interface in java.lang\" class=\"externalLink\">Object</a></pre>"
);
String out1_html4 = "out1-html4";
javadoc("-d", out1_html4,
"-html4",
"-classpath", mylib,
"-sourcepath", testSrc,
"-linkoffline", url, testSrc + "/jdk",
"-package",
"pkg", "mylib.lang");
checkExit(Exit.OK);
checkOutput("pkg/B.html", true,
"<div class=\"block\">A method with html tag the method "
+ "<a href=\"" + url + "java/lang/ClassLoader.html?is-external=true#getSystemClassLoader--\""
+ " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
+ "</code></a> as the parent class loader.</div>",
"<div class=\"block\">is equivalent to invoking <code>"
+ "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
+ "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>");
// Generate the documentation using -linkoffline and a relative path as the first parameter.
// We will try linking to the docs generated in test 1 with a relative path.
String out2 = "out2";

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4732864 6280605 7064544 8014636 8016328 8025633 8071982
* @bug 4732864 6280605 7064544 8014636 8016328 8025633 8071982 8182765
* @summary Make sure that you can link from one member to another using
* non-qualified name, furthermore, ensure the right one is linked.
* @author jamieh
@ -52,9 +52,9 @@ public class TestLinkTaglet extends JavadocTester {
"Qualified Link: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+ " Unqualified Link1: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+ " Unqualified Link2: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+ " Qualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
+ " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
+ " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
+ " Qualified Link: <a href=\"#method(pkg.C.InnerC,pkg.C.InnerC2)\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
+ " Unqualified Link: <a href=\"#method(pkg.C.InnerC,pkg.C.InnerC2)\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
+ " Unqualified Link: <a href=\"#method(pkg.C.InnerC,pkg.C.InnerC2)\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
+ " Package Link: <a href=\"package-summary.html\"><code>pkg</code></a>.<br/>");
checkOutput("pkg/C.InnerC.html", true,
@ -73,4 +73,23 @@ public class TestLinkTaglet extends JavadocTester {
checkFiles(false, "checkPkg/A.html");
}
@Test
void test_html4() {
javadoc("-Xdoclint:none",
"-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg", testSrc("checkPkg/B.java"));
checkExit(Exit.OK);
checkOutput("pkg/C.html", true,
"Qualified Link: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+ " Unqualified Link1: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+ " Unqualified Link2: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+ " Qualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
+ " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
+ " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
+ " Package Link: <a href=\"package-summary.html\"><code>pkg</code></a>.<br/>");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4521661 8081854
* @bug 4521661 8081854 8182765
* @summary Test to make sure that there is a link with a proper anchor
* from a serializable class to serialized-form.html.
* @author jamieh
@ -48,8 +48,20 @@ public class TestLinkToSerialForm extends JavadocTester {
checkExit(Exit.OK);
checkOutput("serialized-form.html", true,
"<a name=\"pkg.C\">");
"<a id=\"pkg.C\">");
checkOutput("pkg/C.html", true,
"<a href=\"../serialized-form.html#pkg.C\">");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("serialized-form.html", true,
"<a name=\"pkg.C\">");
}
}

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4638588 4635809 6256068 6270645 8025633 8026567 8162363 8175200
* 8192850
* 8192850 8182765
* @summary Test to make sure that members are inherited properly in the Javadoc.
* Verify that inheritance labels are correct.
* @author jamieh
@ -52,13 +52,13 @@ public class TestMemberInheritance extends JavadocTester {
// Public field should be inherited
"<a href=\"BaseClass.html#pubField\">",
// Public method should be inherited
"<a href=\"BaseClass.html#pubMethod--\">",
"<a href=\"BaseClass.html#pubMethod()\">",
// Public inner class should be inherited.
"<a href=\"BaseClass.pubInnerClass.html\" title=\"class in pkg\">",
// Protected field should be inherited
"<a href=\"BaseClass.html#proField\">",
// Protected method should be inherited
"<a href=\"BaseClass.html#proMethod--\">",
"<a href=\"BaseClass.html#proMethod()\">",
// Protected inner class should be inherited.
"<a href=\"BaseClass.proInnerClass.html\" title=\"class in pkg\">",
// New labels as of 1.5.0
@ -67,6 +67,57 @@ public class TestMemberInheritance extends JavadocTester {
"Nested classes/interfaces inherited from interface&nbsp;pkg."
+ "<a href=\"BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>");
checkOutput("pkg/BaseClass.html", true,
// Test overriding/implementing methods with generic parameters.
"<dl>\n"
+ "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"BaseInterface.html#getAnnotation(java.lang.Class)\">"
+ "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>"
+ "<a href=\"BaseInterface.html\" title=\"interface in pkg\">"
+ "BaseInterface</a></code></dd>\n"
+ "</dl>");
checkOutput("diamond/Z.html", true,
// Test diamond inheritance member summary (6256068)
"<code><a href=\"A.html#aMethod()\">aMethod</a></code>");
checkOutput("inheritDist/C.html", true,
// Test that doc is inherited from closed parent (6270645)
"<div class=\"block\">m1-B</div>");
checkOutput("pkg/SubClass.html", false,
"<a href=\"BaseClass.html#staticMethod()\">staticMethod</a></code>");
checkOutput("pkg1/Implementer.html", true,
// ensure the method makes it
"<td class=\"colFirst\"><code>static java.time.Period</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#between(java.time.LocalDate,java.time.LocalDate)\">"
+ "between</a></span>&#8203;(java.time.LocalDate&nbsp;startDateInclusive,\n"
+ " java.time.LocalDate&nbsp;endDateExclusive)</code></th>");
checkOutput("pkg1/Implementer.html", false,
"<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"Interface.html\""
+ " title=\"interface in pkg1\">Interface</a></h3>\n"
+ "<code><a href=\"Interface.html#between(java.time.chrono.ChronoLocalDate"
+ ",java.time.chrono.ChronoLocalDate)\">between</a></code>"
);
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg", "diamond", "inheritDist", "pkg1");
checkExit(Exit.OK);
checkOutput("pkg/SubClass.html", true,
// Public method should be inherited
"<a href=\"BaseClass.html#pubMethod--\">",
// Protected method should be inherited
"<a href=\"BaseClass.html#proMethod--\">");
checkOutput("pkg/BaseClass.html", true,
// Test overriding/implementing methods with generic parameters.
"<dl>\n"
@ -81,10 +132,6 @@ public class TestMemberInheritance extends JavadocTester {
// Test diamond inheritance member summary (6256068)
"<code><a href=\"A.html#aMethod--\">aMethod</a></code>");
checkOutput("inheritDist/C.html", true,
// Test that doc is inherited from closed parent (6270645)
"<div class=\"block\">m1-B</div>");
checkOutput("pkg/SubClass.html", false,
"<a href=\"BaseClass.html#staticMethod--\">staticMethod</a></code>");

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332
* @bug 4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332 8182765
* @summary Test the case where the overriden method returns a different
* type than the method in the child class. Make sure the
* documentation is inherited but the return type isn't.
@ -43,7 +43,43 @@ public class TestMemberSummary extends JavadocTester {
@Test
void test() {
javadoc("-d", "out", "-private",
javadoc("-d", "out",
"-private",
"-sourcepath", testSrc,
"pkg","pkg2");
checkExit(Exit.OK);
checkOutput("pkg/PublicChild.html", true,
// Check return type in member summary.
"<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest()\">"
+ "returnTypeTest</a></span>()</code>",
// Check return type in member detail.
"<pre>public&nbsp;<a href=\"PublicChild.html\" title=\"class in pkg\">"
+ "PublicChild</a>&nbsp;returnTypeTest()</pre>",
"<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#%3Cinit%3E()\">PublicChild</a></span>()</code></th>");
checkOutput("pkg/PrivateParent.html", true,
"<td class=\"colFirst\"><code>private </code></td>\n"
+ "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#%3Cinit%3E(int)\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
+ "</th>");
// Legacy anchor dimensions (6290760)
checkOutput("pkg2/A.html", true,
"<a id=\"f(java.lang.Object[])\">\n"
+ "<!-- -->\n"
+ "</a><a id=\"f(T[])\">\n"
+ "<!-- -->\n"
+ "</a>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-private",
"-sourcepath", testSrc,
"pkg","pkg2");
checkExit(Exit.OK);
@ -53,9 +89,6 @@ public class TestMemberSummary extends JavadocTester {
"<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">"
+ "returnTypeTest</a></span>()</code>",
// Check return type in member detail.
"<pre>public&nbsp;<a href=\"PublicChild.html\" title=\"class in pkg\">"
+ "PublicChild</a>&nbsp;returnTypeTest()</pre>",
"<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>");

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8178339
* @bug 8178339 8182765
* @summary Tests indirect exports and opens in the module summary page
* @modules jdk.javadoc/jdk.javadoc.internal.api
* jdk.javadoc/jdk.javadoc.internal.tool
@ -72,6 +72,16 @@ public class TestIndirectExportsOpens extends JavadocTester {
checkExit(Exit.OK);
verifyIndirectExports(false);
verifyIndirectOpens(false);
javadoc("-d", base.resolve("out-api-html4").toString(),
"-html4",
"-quiet",
"--module-source-path", base.toString(),
"--expand-requires", "transitive",
"--module", "a");
checkExit(Exit.OK);
verifyIndirectExports_html4(false);
verifyIndirectOpens_html4(false);
}
@Test
@ -98,6 +108,16 @@ public class TestIndirectExportsOpens extends JavadocTester {
checkExit(Exit.OK);
verifyIndirectExports(true);
verifyIndirectOpens(true);
javadoc("-d", base.resolve("out-api-html4").toString(),
"-html4",
"-quiet",
"--module-source-path", base.toString(),
"--expand-requires", "transitive",
"--module", "a");
checkExit(Exit.OK);
verifyIndirectExports_html4(true);
verifyIndirectOpens_html4(true);
}
@Test
@ -125,6 +145,17 @@ public class TestIndirectExportsOpens extends JavadocTester {
checkExit(Exit.OK);
verifyIndirectExports(false);
verifyIndirectOpens(false);
javadoc("-d", base.resolve("out-api-html4").toString(),
"-html4",
"-quiet",
"--module-source-path", base.toString(),
"--expand-requires", "transitive",
"--module", "a");
checkExit(Exit.OK);
verifyIndirectExports_html4(false);
verifyIndirectOpens_html4(false);
}
@Test
@ -157,13 +188,13 @@ public class TestIndirectExportsOpens extends JavadocTester {
// could be listed in the indirects section, so just
// check for minimal expected strings.
checkOutput("a/module-summary.html", true,
"Indirect Exports table",
"Indirect Exports",
"<th class=\"colFirst\" scope=\"row\"><a href=\"../m/module-summary.html\">m</a></th>\n"
+ "<td class=\"colLast\"><a href=\"../m/exportsto/package-summary.html\">exportsto</a></td>\n"
+ "</tr>\n");
checkOutput("a/module-summary.html", true,
"Indirect Opens table",
"Indirect Opens",
"<th class=\"colFirst\" scope=\"row\"><a href=\"../m/module-summary.html\">m</a></th>\n"
+ "<td class=\"colLast\">opensto</td>\n"
+ "</tr>\n");
@ -188,7 +219,7 @@ public class TestIndirectExportsOpens extends JavadocTester {
}
checkOutput("a/module-summary.html", present,
"<table class=\"packagesSummary\" summary=\"" + typeString + " table, listing modules, and packages\">\n"
"<table class=\"packagesSummary\">\n"
+ "<caption><span>" + typeString + "</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">From</th>\n"
@ -203,5 +234,37 @@ public class TestIndirectExportsOpens extends JavadocTester {
+ "</table>\n");
}
}
void verifyIndirectExports_html4(boolean present) {
verifyIndirects_html4(present, false);
}
void verifyIndirectOpens_html4(boolean present) {
verifyIndirects_html4(present, true);
}
void verifyIndirects_html4(boolean present, boolean opens) {
String typeString = opens ? "Indirect Opens" : "Indirect Exports";
// Avoid false positives, just check for primary string absence.
if (!present) {
checkOutput("a/module-summary.html", false, typeString);
return;
}
checkOutput("a/module-summary.html", present,
"<table class=\"packagesSummary\" summary=\"" + typeString + " table, listing modules, and packages\">\n"
+ "<caption><span>" + typeString + "</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">From</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
+ "</tr>\n"
+ "<tbody>\n"
+ "<tr class=\"altColor\">\n"
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"../m/module-summary.html\">m</a></th>\n"
+ "<td class=\"colLast\"><a href=\"../m/pm/package-summary.html\">pm</a></td>\n"
+ "</tr>\n"
+ "</tbody>\n"
+ "</table>\n");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8178067 8192007
* @bug 8178067 8192007 8182765
* @summary tests the module's services, such as provides and uses
* @modules jdk.javadoc/jdk.javadoc.internal.api
* jdk.javadoc/jdk.javadoc.internal.tool
@ -117,7 +117,8 @@ public class TestModuleServices extends JavadocTester {
mb.write(src);
javadoc("-d", base.resolve("out").toString(),
"-quiet", "-noindex",
"-quiet",
"-noindex",
"--module-source-path", src.toString(),
"--module", "moduleService,moduleServiceProvider,moduleServiceUser,moduleServiceUserNoDescription",
"pkgService", "moduleServiceProvider/pkgServiceProvider", "moduleServiceUser/pkgServiceUser",
@ -193,6 +194,33 @@ public class TestModuleServices extends JavadocTester {
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
checkOutput("m/module-summary.html", true,
"<table class=\"usesSummary\">\n" +
"<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
"<tr>\n" +
"<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
"<th class=\"colLast\" scope=\"col\">Description</th>\n" +
"</tr>\n" +
"<tbody>\n" +
"<tr class=\"altColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"class in p1\">A</a></th>\n" +
"<td class=\"colLast\">&nbsp;</td>\n" +
"</tr>\n" +
"<tr class=\"rowColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p1/B.html\" title=\"class in p1\">B</a></th>\n" +
"<td class=\"colLast\">&nbsp;</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n");
javadoc("-d", base.toString() + "/out-html4",
"-html4",
"-quiet",
"--show-module-contents", "all",
"--module-source-path", base.toString(),
"--module", "m");
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<table class=\"usesSummary\" summary=\"Uses table, listing types, and an explanation\">\n" +
"<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
@ -233,6 +261,28 @@ public class TestModuleServices extends JavadocTester {
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
checkOutput("m/module-summary.html", true,
"<table class=\"usesSummary\">\n" +
"<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
"<tr>\n" +
"<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
"<th class=\"colLast\" scope=\"col\">Description</th>\n" +
"</tr>\n" +
"<tbody>\n" +
"<tr class=\"altColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"class in p1\">A</a></th>\n" +
"<td class=\"colLast\">&nbsp;</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n");
javadoc("-d", base.toString() + "/out-html4",
"-html4",
"-quiet",
"--module-source-path", base.toString(),
"--module", "m");
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<table class=\"usesSummary\" summary=\"Uses table, listing types, and an explanation\">\n" +
"<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
@ -299,6 +349,33 @@ public class TestModuleServices extends JavadocTester {
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
checkOutput("m/module-summary.html", true,
"<table class=\"providesSummary\">\n" +
"<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
"<tr>\n" +
"<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
"<th class=\"colLast\" scope=\"col\">Description</th>\n" +
"</tr>\n" +
"<tbody>\n" +
"<tr class=\"altColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"interface in p1\">A</a></th>\n" +
"<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"p1/B.html\" title=\"class in p1\">B</a>)</td>\n" +
"</tr>\n" +
"<tr class=\"rowColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p2/A.html\" title=\"interface in p2\">A</a></th>\n" +
"<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"p2/B.html\" title=\"class in p2\">B</a>)</td>\n" +
"</tr>\n" +
"</tbody>\n");
javadoc("-d", base.toString() + "/out-html4",
"-html4",
"-quiet",
"--show-module-contents", "all",
"--module-source-path", base.toString(),
"--module", "m");
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<table class=\"providesSummary\" summary=\"Provides table, listing types, and an explanation\">\n" +
"<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
@ -342,6 +419,30 @@ public class TestModuleServices extends JavadocTester {
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
checkOutput("m/module-summary.html", true,
"<table class=\"providesSummary\">\n" +
"<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
"<tr>\n" +
"<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
"<th class=\"colLast\" scope=\"col\">Description</th>\n" +
"</tr>\n" +
"<tbody>\n" +
"<tr class=\"altColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"interface in p1\">A</a></th>\n" +
"<td class=\"colLast\">\n" +
"<div class=\"block\">abc</div>\n</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n");
javadoc("-d", base.toString() + "/out-html4",
"-html4",
"-quiet",
"--module-source-path", base.toString(),
"--module", "m");
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<table class=\"providesSummary\" summary=\"Provides table, listing types, and an explanation\">\n" +
"<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
@ -384,6 +485,44 @@ public class TestModuleServices extends JavadocTester {
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
checkOutput("m/module-summary.html", true,
"<table class=\"providesSummary\">\n" +
"<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
"<tr>\n" +
"<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
"<th class=\"colLast\" scope=\"col\">Description</th>\n" +
"</tr>\n" +
"<tbody>\n" +
"<tr class=\"altColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"interface in p1\">A</a></th>\n" +
"<td class=\"colLast\">\n" +
"<div class=\"block\">abc</div>\n</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>",
"<table class=\"usesSummary\">\n" +
"<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
"<tr>\n" +
"<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
"<th class=\"colLast\" scope=\"col\">Description</th>\n" +
"</tr>\n" +
"<tbody>\n" +
"<tr class=\"altColor\">\n" +
"<th class=\"colFirst\" scope=\"row\"><a href=\"p2/B.html\" title=\"class in p2\">B</a></th>\n" +
"<td class=\"colLast\">\n" +
"<div class=\"block\">def</div>\n</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n");
javadoc("-d", base.toString() + "/out-html4",
"-html4",
"-quiet",
"--module-source-path", base.toString(),
"--module", "m");
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<table class=\"providesSummary\" summary=\"Provides table, listing types, and an explanation\">\n" +
"<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +

View File

@ -26,7 +26,7 @@
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
* 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
* 8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
8164407 8192007
8164407 8192007 8182765
* @summary Test modules support in javadoc.
* @author bpatel
* @library ../lib
@ -46,7 +46,10 @@ public class TestModules extends JavadocTester {
*/
@Test
void testHtml4() {
javadoc("-d", "out", "-use", "-Xdoclint:none",
javadoc("-d", "out",
"-html4",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
@ -68,7 +71,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testHtml5() {
javadoc("-d", "out-html5", "-html5", "-use", "-Xdoclint:none",
javadoc("-d", "out-html5",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
@ -90,7 +95,11 @@ public class TestModules extends JavadocTester {
*/
@Test
void testHtml4NoComment() {
javadoc("-d", "out-nocomment", "-nocomment", "-use", "-Xdoclint:none",
javadoc("-d", "out-nocomment",
"-html4",
"-nocomment",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
@ -108,7 +117,10 @@ public class TestModules extends JavadocTester {
*/
@Test
void testHtml5NoComment() {
javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use", "-Xdoclint:none",
javadoc("-d", "out-html5-nocomment",
"-nocomment",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
@ -126,7 +138,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testHtml4UnnamedModule() {
javadoc("-d", "out-nomodule", "-use",
javadoc("-d", "out-nomodule",
"-html4",
"-use",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"testpkgnomodule", "testpkgnomodule1");
@ -143,7 +157,8 @@ public class TestModules extends JavadocTester {
*/
@Test
void testHtml5UnnamedModule() {
javadoc("-d", "out-html5-nomodule", "-html5", "-use",
javadoc("-d", "out-html5-nomodule",
"-use",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"testpkgnomodule", "testpkgnomodule1");
@ -159,7 +174,10 @@ public class TestModules extends JavadocTester {
*/
@Test
void testJDTagsInModules() {
javadoc("-d", "out-mdltags", "-author", "-version", "-Xdoclint:none",
javadoc("-d", "out-mdltags",
"-author",
"-version",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
@ -169,12 +187,33 @@ public class TestModules extends JavadocTester {
checkModuleTags();
}
/**
* Test generated module pages with javadoc tags.
*/
@Test
void testJDTagsInModules_html4() {
javadoc("-d", "out-mdltags-html4",
"-html4",
"-author",
"-version",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
"--module", "moduletags,moduleB",
"testpkgmdltags", "testpkgmdlB");
checkExit(Exit.OK);
checkModuleTags_html4();
}
/**
* Test generated module summary page.
*/
@Test
void testModuleSummary() {
javadoc("-d", "out-moduleSummary", "-use", "-Xdoclint:none",
javadoc("-d", "out-moduleSummary",
"-use",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
"testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
@ -183,12 +222,30 @@ public class TestModules extends JavadocTester {
checkNegatedModuleSummary();
}
/**
* Test generated module summary page.
*/
@Test
void testModuleSummary_html4() {
javadoc("-d", "out-moduleSummary-html4",
"-html4",
"-use",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
"testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
checkExit(Exit.OK);
checkModuleSummary_html4();
checkNegatedModuleSummary_html4();
}
/**
* Test generated module summary page of an aggregating module.
*/
@Test
void testAggregatorModuleSummary() {
javadoc("-d", "out-aggregatorModuleSummary", "-use",
javadoc("-d", "out-aggregatorModuleSummary",
"-use",
"--module-source-path", testSrc,
"--expand-requires", "transitive",
"--module", "moduleT");
@ -201,7 +258,8 @@ public class TestModules extends JavadocTester {
*/
@Test
void testModuleFilesAndLinks() {
javadoc("-d", "out-modulelinks", "-Xdoclint:none",
javadoc("-d", "out-modulelinks",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
"testpkgmdlA", "testpkgmdlB");
@ -215,7 +273,8 @@ public class TestModules extends JavadocTester {
*/
@Test
void testModuleDeprecation() {
javadoc("-d", "out-moduledepr", "-Xdoclint:none",
javadoc("-d", "out-moduledepr",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
@ -230,7 +289,8 @@ public class TestModules extends JavadocTester {
*/
@Test
void testModuleAnnotation() {
javadoc("-d", "out-moduleanno", "-Xdoclint:none",
javadoc("-d", "out-moduleanno",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
"testpkgmdlA", "testpkgmdlB");
@ -238,12 +298,32 @@ public class TestModules extends JavadocTester {
checkModuleAnnotation();
}
/**
* Test annotations on modules.
*/
@Test
void testModuleAnnotation_html4() {
javadoc("-d", "out-moduleanno-html4",
"-html4",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
"testpkgmdlA", "testpkgmdlB");
checkExit(Exit.OK);
checkModuleAnnotation_html4();
}
/**
* Test module summary pages in "api" mode.
*/
@Test
void testApiMode() {
javadoc("-d", "out-api", "-use", "--show-module-contents=api", "-author", "-version", "-Xdoclint:none",
javadoc("-d", "out-api",
"-use",
"--show-module-contents=api",
"-author",
"-version",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
@ -262,7 +342,12 @@ public class TestModules extends JavadocTester {
*/
@Test
void testAllMode() {
javadoc("-d", "out-all", "-use", "--show-module-contents=all", "-author", "-version", "-Xdoclint:none",
javadoc("-d", "out-all",
"-use",
"--show-module-contents=all",
"-author",
"-version",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
@ -276,12 +361,36 @@ public class TestModules extends JavadocTester {
checkAllModulesLink(true);
}
/**
* Test module summary pages in "all" mode.
*/
@Test
void testAllModeHtml4() {
javadoc("-d", "out-all-html4",
"-html4",
"-use",
"--show-module-contents=all",
"-author",
"-version",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB,moduleC,moduletags",
"testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
checkExit(Exit.OK);
checkModuleModeCommon_html4();
checkModuleModeApi_html4(false);
}
/**
* Test generated module summary page of a module with no exported package.
*/
@Test
void testModuleSummaryNoExportedPkgAll() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgAll", "-use", "--show-module-contents=all",
javadoc("-d", "out-ModuleSummaryNoExportedPkgAll",
"-use",
"--show-module-contents=all",
"-sourcepath", testSrc + "/moduleNoExport",
"--module", "moduleNoExport",
"testpkgmdlNoExport");
@ -289,12 +398,29 @@ public class TestModules extends JavadocTester {
checkModuleSummaryNoExported(true);
}
/**
* Test generated module summary page of a module with no exported package.
*/
@Test
void testModuleSummaryNoExportedPkgAll_html4() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgAll-html4",
"-html4",
"-use",
"--show-module-contents=all",
"-sourcepath", testSrc + "/moduleNoExport",
"--module", "moduleNoExport",
"testpkgmdlNoExport");
checkExit(Exit.OK);
checkModuleSummaryNoExported_html4(true);
}
/**
* Test generated module summary page of a module with no exported package.
*/
@Test
void testModuleSummaryNoExportedPkgApi() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgApi", "-use",
javadoc("-d", "out-ModuleSummaryNoExportedPkgApi",
"-use",
"-sourcepath", testSrc + "/moduleNoExport",
"--module", "moduleNoExport",
"testpkgmdlNoExport");
@ -302,6 +428,21 @@ public class TestModules extends JavadocTester {
checkModuleSummaryNoExported(false);
}
/**
* Test generated module summary page of a module with no exported package.
*/
@Test
void testModuleSummaryNoExportedPkgApi_html4() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgApi-html4",
"-html4",
"-use",
"-sourcepath", testSrc + "/moduleNoExport",
"--module", "moduleNoExport",
"testpkgmdlNoExport");
checkExit(Exit.OK);
checkModuleSummaryNoExported_html4(false);
}
/**
* Test generated module pages for javadoc run for a single module having a single package.
*/
@ -320,7 +461,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testSingleModuleMultiplePkg() {
javadoc("-d", "out-singlemodmultiplepkg", "--show-module-contents=all", "-Xdoclint:none",
javadoc("-d", "out-singlemodmultiplepkg",
"--show-module-contents=all",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleB",
"testpkg2mdlB", "testpkgmdlB");
@ -333,7 +476,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testGroupOption() {
javadoc("-d", "out-group", "--show-module-contents=all", "-Xdoclint:none",
javadoc("-d", "out-group",
"--show-module-contents=all",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
@ -347,6 +492,28 @@ public class TestModules extends JavadocTester {
checkGroupOption();
}
/**
* Test -group option for modules. The overview-summary.html page should group the modules accordingly.
*/
@Test
void testGroupOption_html4() {
javadoc("-d", "out-group-html4",
"-html4",
"--show-module-contents=all",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
"-group", "Module Group A", "moduleA*",
"-group", "Module Group B & C", "moduleB*:moduleC*",
"-group", "Java SE Modules", "java*",
"--module", "moduleA,moduleB,moduleC,moduletags",
"moduleA/concealedpkgmdlA", "testpkgmdlA", "testpkg2mdlB", "testpkgmdlB", "testpkgmdlC",
"testpkgmdltags");
checkExit(Exit.OK);
checkGroupOption_html4();
}
/**
* Test -group option for modules and the ordering of module groups.
* The overview-summary.html page should group the modules accordingly and display the group tabs in
@ -354,7 +521,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testGroupOptionOrdering() {
javadoc("-d", "out-groupOrder", "--show-module-contents=all", "-Xdoclint:none",
javadoc("-d", "out-groupOrder",
"--show-module-contents=all",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
"-tag", "moduletag:s:Module Tag:",
"--module-source-path", testSrc,
@ -374,7 +543,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testUnnamedModuleGroupOption() {
javadoc("-d", "out-groupnomodule", "-use", "-Xdoclint:none",
javadoc("-d", "out-groupnomodule",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"-group", "Package Group 0", "testpkgnomodule",
@ -384,6 +555,24 @@ public class TestModules extends JavadocTester {
checkUnnamedModuleGroupOption();
}
/**
* Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
*/
@Test
void testUnnamedModuleGroupOption_html4() {
javadoc("-d", "out-groupnomodule-html4",
"-html4",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"-group", "Package Group 0", "testpkgnomodule",
"-group", "Package Group 1", "testpkgnomodule1",
"testpkgnomodule", "testpkgnomodule1");
checkExit(Exit.OK);
checkUnnamedModuleGroupOption_html4();
}
/**
* Test -group option for unnamed modules and the ordering of package groups.
* The overview-summary.html page should group the packages accordingly and display the group tabs in
@ -391,7 +580,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testGroupOptionPackageOrdering() {
javadoc("-d", "out-groupPkgOrder", "-use", "-Xdoclint:none",
javadoc("-d", "out-groupPkgOrder",
"-use",
"-Xdoclint:none",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"-group", "Z Group", "testpkgnomodule",
@ -406,7 +597,9 @@ public class TestModules extends JavadocTester {
*/
@Test
void testGroupOptionSingleModule() {
javadoc("-d", "out-groupsinglemodule", "-use", "-Xdoclint:none",
javadoc("-d", "out-groupsinglemodule",
"-use",
"-Xdoclint:none",
"--module-source-path", testSrc,
"-group", "Module Group B", "moduleB*",
"--module", "moduleB",
@ -415,12 +608,31 @@ public class TestModules extends JavadocTester {
checkGroupOptionSingleModule();
}
/**
* Test -group option for a single module.
*/
@Test
void testGroupOptionSingleModule_html4() {
javadoc("-d", "out-groupsinglemodule-html4",
"-html4",
"-use",
"-Xdoclint:none",
"--module-source-path", testSrc,
"-group", "Module Group B", "moduleB*",
"--module", "moduleB",
"testpkg2mdlB", "testpkgmdlB");
checkExit(Exit.OK);
checkGroupOptionSingleModule_html4();
}
/**
* Test -group option for a single module.
*/
@Test
void testModuleName() {
javadoc("-d", "out-modulename", "-use", "-Xdoclint:none",
javadoc("-d", "out-modulename",
"-use",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleB,test.moduleFullName",
"testpkg2mdlB", "testpkgmdlB", "testpkgmdlfullname");
@ -434,7 +646,10 @@ public class TestModules extends JavadocTester {
@Test
void testLinkOffline() {
String url = "https://docs.oracle.com/javase/9/docs/api/";
javadoc("-d", "out-linkoffline", "-use", "--show-module-contents=all", "-Xdoclint:none",
javadoc("-d", "out-linkoffline",
"-use",
"--show-module-contents=all",
"-Xdoclint:none",
"--module-source-path", testSrc,
"--module", "moduleA,moduleB",
"-linkoffline", url, testSrc + "/jdk",
@ -589,7 +804,7 @@ public class TestModules extends JavadocTester {
"Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in "
+ "testpkgmdltags\"><code>TestClassInModuleTags</code></a>.",
"Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#"
+ "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.",
+ "testMethod(java.lang.String)\"><code>testMethod(String)</code></a>.",
"Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.",
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>JDK 9</dd>",
@ -610,6 +825,12 @@ public class TestModules extends JavadocTester {
+ "<dd>Just a simple module tag.</dd>");
}
void checkModuleTags_html4() {
checkOutput("moduletags/module-summary.html", true,
"Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#"
+ "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.");
}
void checkOverviewSummaryModules() {
checkOutput("overview-summary.html", true,
"<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
@ -724,7 +945,7 @@ public class TestModules extends JavadocTester {
+ "Packages</a>&nbsp;|&nbsp;Services</li>\n"
+ "</ul>",
"<!-- ============ MODULES SUMMARY =========== -->\n"
+ "<a name=\"modules.summary\">\n"
+ "<a id=\"modules.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<tr class=\"altColor\" id=\"i0\">\n"
@ -732,7 +953,7 @@ public class TestModules extends JavadocTester {
+ "<td class=\"colLast\">&nbsp;</td>\n"
+ "</tr>",
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<a id=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<tr class=\"altColor\">\n"
@ -747,7 +968,7 @@ public class TestModules extends JavadocTester {
+ "<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">"
+ "Services</a></li>",
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<a id=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<tr class=\"altColor\" id=\"i0\">\n"
@ -755,11 +976,11 @@ public class TestModules extends JavadocTester {
+ "<td class=\"colLast\">&nbsp;</td>\n"
+ "</tr>",
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<a id=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<!-- ============ SERVICES SUMMARY =========== -->\n"
+ "<a name=\"services.summary\">\n"
+ "<a id=\"services.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<tr class=\"altColor\">\n"
@ -784,6 +1005,31 @@ public class TestModules extends JavadocTester {
+ "</tr>");
}
void checkModuleSummary_html4() {
checkOutput("moduleA/module-summary.html", true,
"<!-- ============ MODULES SUMMARY =========== -->\n"
+ "<a name=\"modules.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>");
checkOutput("moduleB/module-summary.html", true,
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<!-- ============ SERVICES SUMMARY =========== -->\n"
+ "<a name=\"services.summary\">\n"
+ "<!-- -->\n"
+ "</a>");
}
void checkAggregatorModuleSummary() {
checkOutput("moduleT/module-summary.html", true,
"<div class=\"header\">\n"
@ -812,6 +1058,14 @@ public class TestModules extends JavadocTester {
}
void checkNegatedModuleSummary() {
checkOutput("moduleA/module-summary.html", false,
"<!-- ============ SERVICES SUMMARY =========== -->\n"
+ "<a id=\"services.summary\">\n"
+ "<!-- -->\n"
+ "</a>");
}
void checkNegatedModuleSummary_html4() {
checkOutput("moduleA/module-summary.html", false,
"<!-- ============ SERVICES SUMMARY =========== -->\n"
+ "<a name=\"services.summary\">\n"
@ -922,7 +1176,7 @@ public class TestModules extends JavadocTester {
+ "<td class=\"colLast\">\n"
+ "<div class=\"block\">This is a test description for the moduletags module.<br>\n"
+ " Type Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>TestClassInModuleTags</code></a>.<br>\n"
+ " Member Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html#testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.<br>\n"
+ " Member Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html#testMethod(java.lang.String)\"><code>testMethod(String)</code></a>.<br>\n"
+ " Package Link: <a href=\"moduletags/testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.<br></div>\n"
+ "</td>");
checkOutput("moduleA/module-summary.html", true,
@ -937,14 +1191,14 @@ public class TestModules extends JavadocTester {
checkOutput("moduletags/module-summary.html", true,
"<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a href=\"#modules.summary\">Modules"
+ "</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;Services</li>",
"<table class=\"requiresSummary\" summary=\"Indirect Requires table, listing modules, and an explanation\">\n"
"<table class=\"requiresSummary\">\n"
+ "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<td class=\"colFirst\">transitive</td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"../moduleB/module-summary.html\">moduleB</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
+ "</td>",
"<table class=\"packagesSummary\" summary=\"Indirect Exports table, listing modules, and packages\">\n"
"<table class=\"packagesSummary\">\n"
+ "<caption><span>Indirect Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<td class=\"colFirst\">transitive static</td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"../moduleA/module-summary.html\">moduleA</a></th>\n"
@ -952,6 +1206,42 @@ public class TestModules extends JavadocTester {
+ "<div class=\"block\">This is a test description for the moduleA module with a Search "
+ "phrase <a id=\"searchphrase\" class=\"searchTagResult\">search phrase</a>.</div>\n"
+ "</td>",
"<table class=\"requiresSummary\">\n"
+ "<caption><span>Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
+ "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>",
"<table class=\"requiresSummary\">\n"
+ "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
+ "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>",
"<table class=\"packagesSummary\">\n"
+ "<caption><span>Indirect Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">From</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
+ "</tr>\n",
"<th class=\"colFirst\" scope=\"row\"><a href=\"../moduleB/module-summary.html\">moduleB</a></th>\n"
+ "<td class=\"colLast\"><a href=\"../moduleB/testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n");
}
void checkModuleModeCommon_html4() {
checkOutput("overview-summary.html", true,
"<th class=\"colFirst\" scope=\"row\"><a href=\"moduletags/module-summary.html\">moduletags</a></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"block\">This is a test description for the moduletags module.<br>\n"
+ " Type Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>TestClassInModuleTags</code></a>.<br>\n"
+ " Member Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html#testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.<br>\n"
+ " Package Link: <a href=\"moduletags/testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.<br></div>\n"
+ "</td>");
checkOutput("moduletags/module-summary.html", true,
"<table class=\"requiresSummary\" summary=\"Indirect Requires table, listing modules, and an explanation\">\n"
+ "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<table class=\"packagesSummary\" summary=\"Indirect Exports table, listing modules, and packages\">\n"
+ "<caption><span>Indirect Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<table class=\"requiresSummary\" summary=\"Requires table, listing modules, and an explanation\">\n"
+ "<caption><span>Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
@ -969,9 +1259,7 @@ public class TestModules extends JavadocTester {
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">From</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
+ "</tr>\n",
"<th class=\"colFirst\" scope=\"row\"><a href=\"../moduleB/module-summary.html\">moduleB</a></th>\n"
+ "<td class=\"colLast\"><a href=\"../moduleB/testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n");
+ "</tr>\n");
}
void checkModuleModeApi(boolean found) {
@ -983,7 +1271,7 @@ public class TestModules extends JavadocTester {
+ "<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">Services</a></li>",
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
+ "<td class=\"colLast\">&nbsp;</td>",
"<table class=\"packagesSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
"<table class=\"packagesSummary\">\n"
+ "<caption><span>Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
@ -1001,6 +1289,23 @@ public class TestModules extends JavadocTester {
+ "<td class=\"colLast\">&nbsp;</td>");
}
void checkModuleModeApi_html4(boolean found) {
checkOutput("moduleB/module-summary.html", found,
"<table class=\"packagesSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+ "<caption><span>Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n"
+ "<tbody>\n"
+ "<tr class=\"altColor\" id=\"i0\">\n"
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
+ "<td class=\"colLast\">&nbsp;</td>\n"
+ "</tr>\n"
+ "</tbody>\n"
+ "</table>");
}
void checkModuleModeAll(boolean found) {
checkOutput("moduleA/module-summary.html", found,
"<td class=\"colFirst\"> </td>\n"
@ -1084,13 +1389,20 @@ public class TestModules extends JavadocTester {
void checkModuleAnnotation() {
checkOutput("moduleB/module-summary.html", true,
"<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n"
+ " <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n"
"<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional()\">optional</a>=\"Module Annotation\",\n"
+ " <a href=\"testpkgmdlB/AnnotationType.html#required()\">required</a>=2016)\n"
+ "</p>");
checkOutput("moduleB/module-summary.html", false,
"@AnnotationTypeUndocumented");
}
void checkModuleAnnotation_html4() {
checkOutput("moduleB/module-summary.html", true,
"<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n"
+ " <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n"
+ "</p>");
}
void checkOverviewFrame(boolean found) {
checkOutput("index.html", !found,
"<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
@ -1101,13 +1413,43 @@ public class TestModules extends JavadocTester {
void checkModuleSummaryNoExported(boolean found) {
checkOutput("moduleNoExport/module-summary.html", found,
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<a id=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>",
"<caption><span>Concealed</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
void checkModuleSummaryNoExported_html4(boolean found) {
checkOutput("moduleNoExport/module-summary.html", found,
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
+ "<a name=\"packages.summary\">\n"
+ "<!-- -->\n"
+ "</a>");
}
void checkGroupOption() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span class=\"tabEnd\">&nbsp;"
+ "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+ "Module Group A</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\">"
+ "<span><a href=\"javascript:showGroups(2);\">Module Group B &amp; C</a></span><span class=\"tabEnd\">"
+ "&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:showGroups(4);\">"
+ "Other Modules</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
"var groups = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
+ "var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"Module Group A\"],2:[\"t2\",\"Module Group B & C\"],4:[\"t4\",\"Other Modules\"]};\n"
+ "var altColor = \"altColor\";\n"
+ "var rowColor = \"rowColor\";\n"
+ "var tableTab = \"tableTab\";\n"
+ "var activeTableTab = \"activeTableTab\";");
checkOutput("overview-summary.html", false,
"<table class=\"overviewSummary\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"Java SE Modules");
}
void checkGroupOption_html4() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
@ -1159,7 +1501,7 @@ public class TestModules extends JavadocTester {
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<table class=\"overviewSummary\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;"
+ "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+ "Package Group 0</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" "
@ -1173,6 +1515,20 @@ public class TestModules extends JavadocTester {
+ "var activeTableTab = \"activeTableTab\";");
}
void checkUnnamedModuleGroupOption_html4() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;"
+ "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+ "Package Group 0</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" "
+ "class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">Package Group 1</a></span>"
+ "<span class=\"tabEnd\">&nbsp;</span></span></caption>");
}
void checkGroupOptionPackageOrdering() {
checkOutput("overview-summary.html", true,
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span "
@ -1184,6 +1540,16 @@ public class TestModules extends JavadocTester {
}
void checkGroupOptionSingleModule() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\">\n"
+ "<caption><span>Module Group B</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("overview-summary.html", false,
"<table class=\"overviewSummary\">\n"
+ "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
}
void checkGroupOptionSingleModule_html4() {
checkOutput("overview-summary.html", true,
"<div class=\"contentContainer\">\n"
+ "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 8182765
* @summary Make sure the Next/Prev Class links iterate through all types.
* Make sure the navagation is 2 columns, not 3.
* @author jamieh
@ -42,7 +42,8 @@ public class TestNavigation extends JavadocTester {
@Test
void test() {
javadoc("-d", "out", "-overview", testSrc("overview.html"),
javadoc("-d", "out",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
@ -62,11 +63,54 @@ public class TestNavigation extends JavadocTester {
checkOutput("pkg/I.html", true,
// Test for 4664607
"<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
+ "<a name=\"navbar.top.firstrow\">\n"
+ "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n"
+ "</a>",
"<li><a href=\"../overview-summary.html\">Overview</a></li>");
// Remaining tests check for additional padding to offset the fixed navigation bar.
checkOutput("pkg/A.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>\n"
+ "</header>\n"
+ "<!-- ======== START OF CLASS DATA ======== -->");
checkOutput("pkg/package-summary.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>\n"
+ "</header>\n"
+ "<main role=\"main\">\n"
+ "<div class=\"header\">");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/I.html", true,
// Test for 4664607
"<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
+ "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n"
+ "</a>");
// Remaining tests check for additional padding to offset the fixed navigation bar.
checkOutput("pkg/A.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
@ -92,7 +136,8 @@ public class TestNavigation extends JavadocTester {
// Test for checking additional padding to offset the fixed navigation bar in HTML5.
@Test
void test1() {
javadoc("-d", "out-1", "-html5",
javadoc("-d", "out-1",
"-html5",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
@ -123,7 +168,8 @@ public class TestNavigation extends JavadocTester {
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
@Test
void test2() {
javadoc("-d", "out-2", "-nonavbar",
javadoc("-d", "out-2",
"-nonavbar",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
@ -152,7 +198,9 @@ public class TestNavigation extends JavadocTester {
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
@Test
void test3() {
javadoc("-d", "out-3", "-html5", "-nonavbar",
javadoc("-d", "out-3",
"-html5",
"-nonavbar",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 6758050 8025633
* @bug 6758050 8025633 8182765
* @summary Test HTML output for nested generic types.
* @author bpatel
* @library ../lib
@ -46,6 +46,20 @@ public class TestNestedGenerics extends JavadocTester {
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/NestedGenerics.html", true,
"<div class=\"block\">Contains <a " +
"href=\"#foo(java.util.Map)\"><code>foo" +
"(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/NestedGenerics.html", true,
"<div class=\"block\">Contains <a " +
"href=\"#foo-java.util.Map-\"><code>foo" +

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633 8026567 8162363
* 8175200 8186332
* 8175200 8186332 8182765
* @summary Run Javadoc on a set of source files that demonstrate new
* language features. Check the output to ensure that the new
* language features are properly documented.
@ -46,8 +46,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
void test() {
javadoc("-Xdoclint:none",
"-d", "out",
"-use", "-sourcepath",
testSrc,
"-use",
"-sourcepath", testSrc,
"pkg", "pkg1", "pkg2");
checkExit(Exit.OK);
@ -57,6 +57,21 @@ public class TestNewLanguageFeatures extends JavadocTester {
checkAnnotationTypeUsage();
}
@Test
void test_html4() {
javadoc("-Xdoclint:none",
"-d", "out-html4",
"-html4",
"-use",
"-sourcepath", testSrc,
"pkg", "pkg1", "pkg2");
checkExit(Exit.OK);
checkTypeParameters_html4();
checkVarArgs_html4();
checkAnnotationTypeUsage_html4();
}
//=================================
// ENUM TESTING
//=================================
@ -136,7 +151,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
"<td class=\"colFirst\"><code><a href=\"TypeParameters.html\" "
+ "title=\"type parameter in TypeParameters\">E</a>[]</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodThatReturnsTypeParameterA-E:A-\">"
+ "<a href=\"#methodThatReturnsTypeParameterA(E%5B%5D)\">"
+ "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"TypeParameters.html\" "
+ "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</code>",
"<pre>public&nbsp;<a href=\"TypeParameters.html\" "
@ -146,7 +161,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
"<td class=\"colFirst\"><code>&lt;T extends java.lang.Object &amp; java.lang.Comparable&lt;? super T&gt;&gt;"
+ "<br>T</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
+ "<a href=\"#methodtThatReturnsTypeParametersB(java.util.Collection)\">"
+ "methodtThatReturnsTypeParametersB</a></span>&#8203;(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
"<div class=\"block\">Returns TypeParameters</div>\n",
// Method takes a TypeVariable
@ -154,7 +169,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "<a href=\"TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
+ "</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#orElseThrow-java.util.function.Supplier-\">"
+ "<a href=\"#orElseThrow(java.util.function.Supplier)\">"
+ "orElseThrow</a></span>&#8203;(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
);
@ -231,7 +246,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "pkg2\">Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest1."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest1.html#method-T-\">method</a></span>"
+ "ClassUseTest1.html#method(T)\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>",
"<caption><span>Fields in <a href=\"../"
+ "package-summary.html\">pkg2</a> with type parameters of "
@ -272,7 +287,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "</span></caption>",
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">"
+ "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest1.html#method-T-\">method</a></span>"
+ "ClassUseTest1.html#method(T)\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>"
);
@ -295,7 +310,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "&nbsp;</span></caption>",
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest2.html#method-T-\">method</a></span>"
+ "ClassUseTest2.html#method(T)\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>",
"<caption><span>Fields in <a href=\"../"
+ "package-summary.html\">pkg2</a> declared as <a href=\"../"
@ -336,7 +351,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "</span></caption>",
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest2.html#method-T-\">method</a></span>"
+ "ClassUseTest2.html#method(T)\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>",
"<caption><span>Methods in <a href=\"../"
+ "package-summary.html\">pkg2</a> that return types with "
@ -371,7 +386,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "&nbsp;</span></caption>",
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3"
+ ".</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
+ "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code></th>",
+ "html#method(T)\">method</a></span>&#8203;(T&nbsp;t)</code></th>",
"<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
+ "ParamTest2.html\" title=\"class in pkg2\">"
+ "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".."
@ -400,7 +415,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
+ "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code>"
+ "html#method(T)\">method</a></span>&#8203;(T&nbsp;t)</code>"
+ "</th>",
"<caption><span>Methods in <a href=\"../"
+ "package-summary.html\">pkg2</a> that return types with "
@ -434,7 +449,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "<td class=\"colFirst\"><code>void</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
+ "html#method-java.util.Set-\">method</a></span>&#8203;(java."
+ "html#method(java.util.Set)\">method</a></span>&#8203;(java."
+ "util.Set&lt;<a href=\"../Foo4.html\" title=\""
+ "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code></th>",
"<caption><span>Constructor parameters in <a href=\"../"
@ -444,6 +459,129 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "</span></caption>"
);
//=================================
// TYPE PARAMETER IN INDEX
//=================================
checkOutput("index-all.html", true,
"<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method(java.util.Vector)\">"
+ "method(Vector&lt;Object&gt;)</a></span>"
);
// TODO: duplicate of previous case; left in delibarately for now to simplify comparison testing
//=================================
// TYPE PARAMETER IN INDEX
//=================================
checkOutput("index-all.html", true,
"<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method(java.util.Vector)\">"
+ "method(Vector&lt;Object&gt;)</a></span>"
);
// No type parameters in class frame.
checkOutput("allclasses-frame.html", false,
"<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+ "TypeParameters</a>&lt;<a href=\"../pkg/TypeParameters.html\" "
+ "title=\"type parameter in TypeParameters\">E</a>&gt;"
);
}
//=================================
// TYPE PARAMETER TESTING
//=================================
void checkTypeParameters_html4() {
checkOutput("pkg/TypeParameters.html", true,
// Make sure the header is correct.
"<td class=\"colFirst\"><code><a href=\"TypeParameters.html\" "
+ "title=\"type parameter in TypeParameters\">E</a>[]</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodThatReturnsTypeParameterA-E:A-\">"
+ "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"TypeParameters.html\" "
+ "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</code>",
"<td class=\"colFirst\"><code>&lt;T extends java.lang.Object &amp; java.lang.Comparable&lt;? super T&gt;&gt;"
+ "<br>T</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
+ "methodtThatReturnsTypeParametersB</a></span>&#8203;(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
"<div class=\"block\">Returns TypeParameters</div>\n",
// Method takes a TypeVariable
"<td class=\"colFirst\"><code>&lt;X extends java.lang.Throwable&gt;<br>"
+ "<a href=\"TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
+ "</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#orElseThrow-java.util.function.Supplier-\">"
+ "orElseThrow</a></span>&#8203;(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
);
//==============================================================
// Test Class-Use Documentation for Type Parameters.
//==============================================================
// ClassUseTest1: <T extends Foo & Foo2>
checkOutput("pkg2/class-use/Foo.html", true,
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest1."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest1.html#method-T-\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>"
);
checkOutput("pkg2/class-use/Foo2.html", true,
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">"
+ "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest1.html#method-T-\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>"
);
// ClassUseTest2: <T extends ParamTest<Foo3>>
checkOutput("pkg2/class-use/ParamTest.html", true,
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest2.html#method-T-\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>"
);
checkOutput("pkg2/class-use/Foo3.html", true,
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../"
+ "ClassUseTest2.html#method-T-\">method</a></span>"
+ "&#8203;(T&nbsp;t)</code></th>"
);
// ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
checkOutput("pkg2/class-use/ParamTest2.html", true,
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3"
+ ".</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
+ "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code></th>"
);
checkOutput("pkg2/class-use/Foo4.html", true,
"<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
+ "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code>"
+ "</th>"
);
// Type parameters in constructor and method args
checkOutput("pkg2/class-use/Foo4.html", true,
"<caption><span>Method parameters in <a href=\"../"
+ "package-summary.html\">pkg2</a> with type arguments of "
+ "type <a href=\"../Foo4.html\" title=\"class in "
+ "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
+ "</span></caption>\n"
+ "<tr>\n"
+ "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n"
+ "<th class=\"colSecond\" scope=\"col\">Method</th>\n"
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n"
+ "<tbody>\n"
+ "<tr class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code>void</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
+ "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
+ "html#method-java.util.Set-\">method</a></span>&#8203;(java."
+ "util.Set&lt;<a href=\"../Foo4.html\" title=\""
+ "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code></th>"
);
//=================================
// TYPE PARAMETER IN INDEX
//=================================
@ -461,19 +599,24 @@ public class TestNewLanguageFeatures extends JavadocTester {
+ "method(Vector&lt;Object&gt;)</a></span>"
);
// No type parameters in class frame.
checkOutput("allclasses-frame.html", false,
"<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+ "TypeParameters</a>&lt;<a href=\"../pkg/TypeParameters.html\" "
+ "title=\"type parameter in TypeParameters\">E</a>&gt;"
);
}
//=================================
// VAR ARG TESTING
//=================================
void checkVarArgs() {
checkOutput("pkg/VarArgs.html", true,
"(int...&nbsp;i)",
"(int[][]...&nbsp;i)",
"(int[]...)",
"<a href=\"TypeParameters.html\" title=\"class in pkg\">"
+ "TypeParameters</a>...&nbsp;t");
}
//=================================
// VAR ARG TESTING
//=================================
void checkVarArgs_html4() {
checkOutput("pkg/VarArgs.html", true,
"(int...&nbsp;i)",
"(int[][]...&nbsp;i)",
@ -520,16 +663,16 @@ public class TestNewLanguageFeatures extends JavadocTester {
void checkAnnotationTypeUsage() {
checkOutput("pkg/package-summary.html", true,
// PACKAGE
"<a href=\"AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">required</a>=1994)");
"<a href=\"AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"AnnotationType.html#optional()\">optional</a>=\"Package Annotation\",\n"
+ " <a href=\"AnnotationType.html#required()\">required</a>=1994)");
checkOutput("pkg/AnnotationTypeUsage.html", true,
// CLASS
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "<a href=\"AnnotationType.html#optional()\">optional</a>"
+ "=\"Class Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ " <a href=\"AnnotationType.html#required()\">"
+ "required</a>=1994)\n"
+ "public class <span class=\"typeNameLabel\">"
+ "AnnotationTypeUsage</span>\n"
@ -537,41 +680,41 @@ public class TestNewLanguageFeatures extends JavadocTester {
// FIELD
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "<a href=\"AnnotationType.html#optional()\">optional</a>"
+ "=\"Field Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ " <a href=\"AnnotationType.html#required()\">"
+ "required</a>=1994)\n"
+ "public&nbsp;int field</pre>",
// CONSTRUCTOR
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "<a href=\"AnnotationType.html#optional()\">optional</a>"
+ "=\"Constructor Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ " <a href=\"AnnotationType.html#required()\">"
+ "required</a>=1994)\n"
+ "public&nbsp;AnnotationTypeUsage()</pre>",
// METHOD
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "<a href=\"AnnotationType.html#optional()\">optional</a>"
+ "=\"Method Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ " <a href=\"AnnotationType.html#required()\">"
+ "required</a>=1994)\n"
+ "public&nbsp;void&nbsp;method()</pre>",
// METHOD PARAMS
"<pre>public&nbsp;void&nbsp;methodWithParams&#8203;("
+ "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+ "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
+ "@AnnotationType</a>(<a href=\"AnnotationType.html#optional()\">"
+ "optional</a>=\"Parameter Annotation\",<a "
+ "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
+ "href=\"AnnotationType.html#required()\">required</a>=1994)\n"
+ " int&nbsp;documented,\n"
+ " int&nbsp;undocmented)</pre>",
// CONSTRUCTOR PARAMS
"<pre>public&nbsp;AnnotationTypeUsage&#8203;(<a "
+ "href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+ "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
+ "@AnnotationType</a>(<a href=\"AnnotationType.html#optional()\">"
+ "optional</a>=\"Constructor Param Annotation\",<a "
+ "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
+ "href=\"AnnotationType.html#required()\">required</a>=1994)\n"
+ " int&nbsp;documented,\n"
+ " int&nbsp;undocmented)</pre>");
@ -643,6 +786,101 @@ public class TestNewLanguageFeatures extends JavadocTester {
checkOutput(Output.OUT, false,
"Internal error: package sets don't match: [] with: null");
//=================================
// ANNOTATION TYPE USAGE TESTING (All Different Types).
//=================================
checkOutput("pkg1/B.html", true,
// Integer
"<a href=\"A.html#d()\">d</a>=3.14,",
// Double
"<a href=\"A.html#d()\">d</a>=3.14,",
// Boolean
"<a href=\"A.html#b()\">b</a>=true,",
// String
"<a href=\"A.html#s()\">s</a>=\"sigh\",",
// Class
"<a href=\"A.html#c()\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,",
// Bounded Class
"<a href=\"A.html#w()\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,",
// Enum
"<a href=\"A.html#e()\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,",
// Annotation Type
"<a href=\"A.html#a()\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required()\">required</a>=1994),",
// String Array
"<a href=\"A.html#sa()\">sa</a>={\"up\",\"down\"},",
// Primitive
"<a href=\"A.html#primitiveClassTest()\">primitiveClassTest</a>=boolean.class,");
// XXX: Add array test case after this if fixed:
//5020899: Incorrect internal representation of class-valued annotation elements
// Make sure that annotations are surrounded by <pre> and </pre>
checkOutput("pkg1/B.html", true,
"<pre><a href=\"A.html\" title=\"annotation in pkg1\">@A</a>",
"public interface <span class=\"typeNameLabel\">B</span></pre>");
}
//=================================
// ANNOTATION TYPE USAGE TESTING
//=================================
void checkAnnotationTypeUsage_html4() {
checkOutput("pkg/package-summary.html", true,
// PACKAGE
"<a href=\"AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">required</a>=1994)");
checkOutput("pkg/AnnotationTypeUsage.html", true,
// CLASS
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "=\"Class Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ "required</a>=1994)\n"
+ "public class <span class=\"typeNameLabel\">"
+ "AnnotationTypeUsage</span>\n"
+ "extends java.lang.Object</pre>",
// FIELD
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "=\"Field Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ "required</a>=1994)\n"
+ "public&nbsp;int field</pre>",
// CONSTRUCTOR
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "=\"Constructor Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ "required</a>=1994)\n"
+ "public&nbsp;AnnotationTypeUsage()</pre>",
// METHOD
"<pre><a href=\"AnnotationType.html\" "
+ "title=\"annotation in pkg\">@AnnotationType</a>("
+ "<a href=\"AnnotationType.html#optional--\">optional</a>"
+ "=\"Method Annotation\",\n"
+ " <a href=\"AnnotationType.html#required--\">"
+ "required</a>=1994)\n"
+ "public&nbsp;void&nbsp;method()</pre>",
// METHOD PARAMS
"<pre>public&nbsp;void&nbsp;methodWithParams&#8203;("
+ "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+ "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
+ "optional</a>=\"Parameter Annotation\",<a "
+ "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
+ " int&nbsp;documented,\n"
+ " int&nbsp;undocmented)</pre>",
// CONSTRUCTOR PARAMS
"<pre>public&nbsp;AnnotationTypeUsage&#8203;(<a "
+ "href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+ "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
+ "optional</a>=\"Constructor Param Annotation\",<a "
+ "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
+ " int&nbsp;documented,\n"
+ " int&nbsp;undocmented)</pre>");
//=================================
// ANNOTATION TYPE USAGE TESTING (All Different Types).
//=================================
@ -667,14 +905,5 @@ public class TestNewLanguageFeatures extends JavadocTester {
"<a href=\"A.html#sa--\">sa</a>={\"up\",\"down\"},",
// Primitive
"<a href=\"A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,");
// XXX: Add array test case after this if fixed:
//5020899: Incorrect internal representation of class-valued annotation elements
// Make sure that annotations are surrounded by <pre> and </pre>
checkOutput("pkg1/B.html", true,
"<pre><a href=\"A.html\" title=\"annotation in pkg1\">@A</a>",
"public interface <span class=\"typeNameLabel\">B</span></pre>");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8048628 8174715
* @bug 8048628 8174715 8182765
* @summary Verify html inline tags are removed correctly in the first sentence.
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -43,7 +43,11 @@ public class TestNonInlineHtmlTagRemoval extends JavadocTester {
javadoc("-d", "out1",
"-sourcepath", testSrc,
testSrc("C.java"));
checkExit(Exit.OK);
checkExit(Exit.ERROR);
checkOutput(Output.OUT, true,
"attribute not supported in HTML5: compact",
"attribute not supported in HTML5: type");
checkOutput("C.html", true,
"<div class=\"block\">case1 end of sentence.</div>",
@ -59,6 +63,15 @@ public class TestNonInlineHtmlTagRemoval extends JavadocTester {
"<div class=\"block\">caseB A block quote example:</div>");
}
@Test
void testPositive_html4() {
javadoc("-d", "out1-html4",
"-html4",
"-sourcepath", testSrc,
testSrc("C.java"));
checkExit(Exit.OK);
}
@Test
void testNegative() {
javadoc("-d", "out2",

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4749567 8071982 8175200 8186332 8185371
* @bug 4749567 8071982 8175200 8186332 8185371 8182765
* @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree,
* -stylesheetfile, --main-stylesheet, --add-stylesheet options.
* @author Bhavesh Patel
@ -198,7 +198,7 @@ public class TestOptions extends JavadocTester {
checkOutput("src-html/linksource/AnnotationTypeField.html", true,
"<title>Source code</title>",
"<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
"<span class=\"sourceLineNo\">031</span><a id=\"line.31\">"
+ "@Documented public @interface AnnotationTypeField {</a>");
checkOutput("linksource/Properties.html", true,
@ -211,7 +211,7 @@ public class TestOptions extends JavadocTester {
checkOutput("src-html/linksource/Properties.html", true,
"<title>Source code</title>",
"<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
"<span class=\"sourceLineNo\">031</span><a id=\"line.31\"> "
+ "public Object someProperty() {</a>");
checkOutput("linksource/SomeClass.html", true,
@ -226,13 +226,13 @@ public class TestOptions extends JavadocTester {
checkOutput("src-html/linksource/SomeClass.html", true,
"<title>Source code</title>",
"<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
"<span class=\"sourceLineNo\">029</span><a id=\"line.29\">"
+ "public class SomeClass {</a>",
"<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
"<span class=\"sourceLineNo\">031</span><a id=\"line.31\"> "
+ "public int field;</a>",
"<span class=\"sourceLineNo\">033</span><a name=\"line.33\"> "
"<span class=\"sourceLineNo\">033</span><a id=\"line.33\"> "
+ "public SomeClass() {</a>",
"<span class=\"sourceLineNo\">036</span><a name=\"line.36\"> "
"<span class=\"sourceLineNo\">036</span><a id=\"line.36\"> "
+ "public int method() {</a>");
checkOutput("linksource/SomeEnum.html", true,
@ -243,6 +243,40 @@ public class TestOptions extends JavadocTester {
+ "title=\"enum in linksource\">SomeEnum</a> <a href="
+ "\"../src-html/linksource/SomeEnum.html#line.30\">VALUE2</a></pre>");
checkOutput("src-html/linksource/SomeEnum.html", true,
"<span class=\"sourceLineNo\">029</span><a id=\"line.29\"> VALUE1,</a>",
"<span class=\"sourceLineNo\">030</span><a id=\"line.30\"> VALUE2</a>");
}
@Test
void testLinkSource_html4() {
javadoc("-d", "out-9-html4",
"-html4",
"-linksource",
"-javafx",
"-sourcepath", testSrc,
"-package",
"linksource");
checkExit(Exit.OK);
checkOutput("src-html/linksource/AnnotationTypeField.html", true,
"<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
+ "@Documented public @interface AnnotationTypeField {</a>");
checkOutput("src-html/linksource/Properties.html", true,
"<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
+ "public Object someProperty() {</a>");
checkOutput("src-html/linksource/SomeClass.html", true,
"<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
+ "public class SomeClass {</a>",
"<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
+ "public int field;</a>",
"<span class=\"sourceLineNo\">033</span><a name=\"line.33\"> "
+ "public SomeClass() {</a>",
"<span class=\"sourceLineNo\">036</span><a name=\"line.36\"> "
+ "public int method() {</a>");
checkOutput("src-html/linksource/SomeEnum.html", true,
"<span class=\"sourceLineNo\">029</span><a name=\"line.29\"> VALUE1,</a>",
"<span class=\"sourceLineNo\">030</span><a name=\"line.30\"> VALUE2</a>");

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8039410 8042601 8042829 8049393 8050031 8155061 8155995 8167967 8169813
* @bug 8039410 8042601 8042829 8049393 8050031 8155061 8155995 8167967 8169813 8182765
* @summary test to determine if members are ordered correctly
* @library ../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -93,9 +93,9 @@ public class TestOrdering extends JavadocTester {
String contents = tester.readFile(usePage);
// check constructors
tester.checking("constructors");
int idx1 = contents.indexOf("C.html#C-UsedInC");
int idx2 = contents.indexOf("C.html#C-UsedInC-int");
int idx3 = contents.indexOf("C.html#C-UsedInC-java.lang.String");
int idx1 = contents.indexOf("C.html#%3Cinit%3E(UsedInC");
int idx2 = contents.indexOf("C.html#%3Cinit%3E(UsedInC,int");
int idx3 = contents.indexOf("C.html#%3Cinit%3E(UsedInC,java.lang.String");
if (idx1 == -1 || idx2 == -1 || idx3 == -1) {
tester.failed("ctor strings not found");
} else if (idx1 > idx2 || idx2 > idx3 || idx1 > idx3) {
@ -106,8 +106,8 @@ public class TestOrdering extends JavadocTester {
// check methods
tester.checking("methods");
idx1 = contents.indexOf("C.html#ymethod-int");
idx2 = contents.indexOf("C.html#ymethod-java.lang.String");
idx1 = contents.indexOf("C.html#ymethod(int");
idx2 = contents.indexOf("C.html#ymethod(java.lang.String");
if (idx1 == -1 || idx2 == -1) {
tester.failed("#ymethod strings not found");
} else if (idx1 > idx2) {
@ -135,42 +135,42 @@ public class TestOrdering extends JavadocTester {
checkClassUseOrdering("pkg1/class-use/UsedClass.html");
tester.checkOrder("pkg1/class-use/UsedClass.html",
"../MethodOrder.html#m--",
"../MethodOrder.html#m-byte:A-",
"../MethodOrder.html#m-double-",
"../MethodOrder.html#m-double-double-",
"../MethodOrder.html#m-double-java.lang.Double-",
"../MethodOrder.html#m-int-",
"../MethodOrder.html#m-int-int-",
"../MethodOrder.html#m-int-java.lang.Integer-",
"../MethodOrder.html#m-long-",
"../MethodOrder.html#m-long-long-",
"../MethodOrder.html#m-long-java.lang.Long-",
"../MethodOrder.html#m-long-java.lang.Long...-",
"../MethodOrder.html#m-java.lang.Double-",
"../MethodOrder.html#m-java.lang.Double-double-",
"../MethodOrder.html#m-java.lang.Double-java.lang.Double-",
"../MethodOrder.html#m-java.lang.Integer-",
"../MethodOrder.html#m-java.lang.Integer-int-",
"../MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
"../MethodOrder.html#m-java.lang.Object:A-",
"../MethodOrder.html#m-java.util.ArrayList-",
"../MethodOrder.html#m-java.util.Collection-",
"../MethodOrder.html#m-java.util.List-");
"../MethodOrder.html#m()",
"../MethodOrder.html#m(byte%5B%5D)",
"../MethodOrder.html#m(double)",
"../MethodOrder.html#m(double,double)",
"../MethodOrder.html#m(double,java.lang.Double)",
"../MethodOrder.html#m(int)",
"../MethodOrder.html#m(int,int)",
"../MethodOrder.html#m(int,java.lang.Integer)",
"../MethodOrder.html#m(long)",
"../MethodOrder.html#m(long,long)",
"../MethodOrder.html#m(long,java.lang.Long)",
"../MethodOrder.html#m(long,java.lang.Long...)",
"../MethodOrder.html#m(java.lang.Double)",
"../MethodOrder.html#m(java.lang.Double,double)",
"../MethodOrder.html#m(java.lang.Double,java.lang.Double)",
"../MethodOrder.html#m(java.lang.Integer)",
"../MethodOrder.html#m(java.lang.Integer,int)",
"../MethodOrder.html#m(java.lang.Integer,java.lang.Integer)",
"../MethodOrder.html#m(java.lang.Object%5B%5D)",
"../MethodOrder.html#m(java.util.ArrayList)",
"../MethodOrder.html#m(java.util.Collection)",
"../MethodOrder.html#m(java.util.List)");
tester.checkOrder("pkg1/class-use/UsedClass.html",
"../MethodOrder.html#tpm-pkg1.UsedClass-",
"../MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
"../MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
"../MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-");
"../MethodOrder.html#tpm(pkg1.UsedClass)",
"../MethodOrder.html#tpm(pkg1.UsedClass,pkg1.UsedClass)",
"../MethodOrder.html#tpm(pkg1.UsedClass,pkg1.UsedClass%5B%5D)",
"../MethodOrder.html#tpm(pkg1.UsedClass,java.lang.String)");
tester.checkOrder("pkg1/class-use/UsedClass.html",
"../A.html#A-pkg1.UsedClass-",
"../B.A.html#A-pkg1.UsedClass-",
"../B.html#B-pkg1.UsedClass-",
"../A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
"../A.C.html#C-pkg1.UsedClass-java.util.Collection-",
"../A.C.html#C-pkg1.UsedClass-java.util.List-");
"../A.html#%3Cinit%3E(pkg1.UsedClass)",
"../B.A.html#%3Cinit%3E(pkg1.UsedClass)",
"../B.html#%3Cinit%3E(pkg1.UsedClass)",
"../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.lang.Object%5B%5D)",
"../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.util.Collection)",
"../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.util.List)");
tester.checkOrder("pkg1/ImplementsOrdering.html",
"<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>",
@ -213,7 +213,7 @@ public class TestOrdering extends JavadocTester {
void checkClassUseOrdering(String usePage) {
checkClassUseOrdering(usePage, "C#ITERATION#.html#zfield");
checkClassUseOrdering(usePage, "C#ITERATION#.html#fieldInC#ITERATION#");
checkClassUseOrdering(usePage, "C#ITERATION#.html#zmethod-pkg1.UsedClass");
checkClassUseOrdering(usePage, "C#ITERATION#.html#zmethod(pkg1.UsedClass");
checkClassUseOrdering(usePage, "C#ITERATION#.html#methodInC#ITERATION#");
}
@ -346,17 +346,17 @@ public class TestOrdering extends JavadocTester {
};
static String expectedMethodOrdering[] = {
"Add.html#add--",
"Add.html#add-double-",
"Add.html#add-double-byte-",
"Add.html#add-double-double-",
"Add.html#add-double-java.lang.Double-",
"Add.html#add-float-",
"Add.html#add-float-int-",
"Add.html#add-int-",
"Add.html#add-int-float-",
"Add.html#add-java.lang.Double-",
"Add.html#add-java.lang.Integer-"
"Add.html#add()",
"Add.html#add(double)",
"Add.html#add(double,byte)",
"Add.html#add(double,double)",
"Add.html#add(double,java.lang.Double)",
"Add.html#add(float)",
"Add.html#add(float,int)",
"Add.html#add(int)",
"Add.html#add(int,float)",
"Add.html#add(java.lang.Double)",
"Add.html#add(java.lang.Integer)"
};
static String expectedPackageOrdering[] = {
@ -593,10 +593,10 @@ public class TestOrdering extends JavadocTester {
tester.checkOrder("pkg5/AnnoOptionalTest.html",
"<h3>Optional Element Summary</h3>",
"<a href=\"#four--\">four</a>",
"<a href=\"#one--\">one</a>",
"<a href=\"#three--\">three</a>",
"<a href=\"#two--\">two</a>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Element Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
@ -605,10 +605,10 @@ public class TestOrdering extends JavadocTester {
tester.checkOrder("pkg5/AnnoRequiredTest.html",
"<h3>Required Element Summary</h3>",
"<a href=\"#four--\">four</a>",
"<a href=\"#one--\">one</a>",
"<a href=\"#three--\">three</a>",
"<a href=\"#two--\">two</a>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Element Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
@ -617,15 +617,15 @@ public class TestOrdering extends JavadocTester {
tester.checkOrder("pkg5/CtorTest.html",
"<h3>Constructor Summary</h3>",
"<a href=\"#CtorTest-int-\"",
"<a href=\"#CtorTest-int-int-\"",
"<a href=\"#CtorTest-int-int-int-\"",
"<a href=\"#CtorTest-int-int-int-int-\"",
"<a href=\"#%3Cinit%3E(int)\"",
"<a href=\"#%3Cinit%3E(int,int)\"",
"<a href=\"#%3Cinit%3E(int,int,int)\"",
"<a href=\"#%3Cinit%3E(int,int,int,int)\"",
"<h3>Constructor Detail</h3>",
"<a name=\"CtorTest-int-int-int-int-\">",
"<a name=\"CtorTest-int-int-int-\">",
"<a name=\"CtorTest-int-int-\">",
"<a name=\"CtorTest-int-\">");
"<a id=\"&lt;init&gt;(int,int,int,int)\">",
"<a id=\"&lt;init&gt;(int,int,int)\">",
"<a id=\"&lt;init&gt;(int,int)\">",
"<a id=\"&lt;init&gt;(int)\">");
tester.checkOrder("pkg5/EnumTest.html",
"<h3>Enum Constant Summary</h3>",
@ -653,10 +653,10 @@ public class TestOrdering extends JavadocTester {
tester.checkOrder("pkg5/IntfTest.html",
"<h3>Method Summary</h3>",
"<a href=\"#four--\">four</a>",
"<a href=\"#one--\">one</a>",
"<a href=\"#three--\">three</a>",
"<a href=\"#two--\">two</a>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Method Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
@ -665,10 +665,10 @@ public class TestOrdering extends JavadocTester {
tester.checkOrder("pkg5/MethodTest.html",
"<h3>Method Summary</h3>",
"<a href=\"#four--\">four</a>",
"<a href=\"#one--\">one</a>",
"<a href=\"#three--\">three</a>",
"<a href=\"#two--\">two</a>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Method Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
@ -686,6 +686,25 @@ public class TestOrdering extends JavadocTester {
"<h4>twoProperty</h4>",
"<h4>threeProperty</h4>",
"<h4>fourProperty</h4>");
tester.javadoc("-d", "out-5-html4",
"-html4",
"-javafx",
"-sourcepath", tester.testSrc(new File(".").getPath()),
"pkg5"
);
tester.checkExit(Exit.OK);
tester.checkOrder("pkg5/CtorTest.html",
"<a href=\"#CtorTest-int-\"",
"<a href=\"#CtorTest-int-int-\"",
"<a href=\"#CtorTest-int-int-int-\"",
"<a href=\"#CtorTest-int-int-int-int-\"",
"<a name=\"CtorTest-int-int-int-int-\">",
"<a name=\"CtorTest-int-int-int-\">",
"<a name=\"CtorTest-int-int-\">",
"<a name=\"CtorTest-int-\">");
}
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4368820 8025633 8026567
* @bug 4368820 8025633 8026567 8182765
* @summary Inherited comment should link directly to member, not just
* class
* @author jamieh
@ -51,6 +51,20 @@ public class TestOverriddenMethodDocCopy extends JavadocTester {
"pkg1", "pkg2");
checkExit(Exit.OK);
checkOutput("pkg1/SubClass.html", true,
"<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>"
+ "<a href=\"BaseClass.html#overridenMethodWithDocsToCopy()\">"
+ "BaseClass</a></code></span>");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"pkg1", "pkg2");
checkExit(Exit.OK);
checkOutput("pkg1/SubClass.html", true,
"<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>"
+ "<a href=\"BaseClass.html#overridenMethodWithDocsToCopy--\">"

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4634891 8025633 8026567
* @bug 4634891 8025633 8026567 8182765
* @summary Determine if overridden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
@ -48,6 +48,54 @@ public class TestOverriddenPrivateMethodsWithPackageFlag extends JavadocTester {
"pkg1", "pkg2");
checkExit(Exit.OK);
// The public method should be overridden
checkOutput("pkg1/SubClass.html", true,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"BaseClass.html#publicMethod()\">"
+ "publicMethod</a></code>&nbsp;in class&nbsp;<code>"
+ "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
// The public method in different package should be overridden
checkOutput("pkg2/SubClass.html", true,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">"
+ "publicMethod</a></code>&nbsp;in class&nbsp;<code>"
+ "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
// The package private method should be overridden since the base and sub class are in the same
// package.
checkOutput("pkg1/SubClass.html", true,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"BaseClass.html#packagePrivateMethod()\">"
+ "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>"
+ "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
// The private method in should not be overridden
checkOutput("pkg1/SubClass.html", false,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"BaseClass.html#privateMethod--\">");
// The private method in different package should not be overridden
checkOutput("pkg2/SubClass.html", false,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod--\">");
// The package private method should not be overridden since the base and sub class are in
// different packages.
checkOutput("pkg2/SubClass.html", false,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">");
}
@Test
void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
"-package",
"pkg1", "pkg2");
checkExit(Exit.OK);
// The public method should be overridden
checkOutput("pkg1/SubClass.html", true,
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8157000 8192850
* @bug 8157000 8192850 8182765
* @summary test the behavior of --override-methods option
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -94,11 +94,11 @@ public class TestOverrideMethods extends JavadocTester {
// Check method summary
"Method Summary",
"void",
"#m1--\">m1",
"#m1()\">m1",
"A modified method",
"void",
"#m4-java.lang.String-java.lang.String-\">m4",
"#m4(java.lang.String,java.lang.String)\">m4",
"java.lang.String&nbsp;k,",
"java.lang.String",
"&nbsp;v)",
@ -106,12 +106,12 @@ public class TestOverrideMethods extends JavadocTester {
// Check footnotes
"Methods declared in class&nbsp;pkg5.<a href=\"Classes.GP.html",
"Classes.GP",
"Classes.GP.html#m0--\">m0",
"Classes.GP.html#m0()\">m0",
// Check method details for override
"overrideSpecifyLabel",
"Overrides:",
"Classes.GP.html#m7--\">m7",
"Classes.GP.html#m7()\">m7",
"in class",
"Classes.GP.html",
"Classes.GP"
@ -120,47 +120,47 @@ public class TestOverrideMethods extends JavadocTester {
checkOrder("pkg5/Classes.C.html",
// Check footnotes 2
"Methods declared in class&nbsp;pkg5.",
"Classes.P.html#getRate--\">getRate",
"Classes.P.html#m2--\">m2",
"Classes.P.html#m3--\">m3",
"Classes.P.html#m4-K-V-\">m4",
"Classes.P.html#rateProperty--\">rateProperty",
"Classes.P.html#setRate-double-\">setRate",
"Classes.P.html#getRate()\">getRate",
"Classes.P.html#m2()\">m2",
"Classes.P.html#m3()\">m3",
"Classes.P.html#m4(K,V)\">m4",
"Classes.P.html#rateProperty()\">rateProperty",
"Classes.P.html#setRate(double)\">setRate",
// Check @link
"A test of links to the methods in this class. <p>\n",
"Classes.GP.html#m0--",
"Classes.GP.html#m0()",
"Classes.GP.m0()",
"#m1--",
"#m1()",
"m1()",
"Classes.P.html#m2--",
"Classes.P.html#m2()",
"Classes.P.m2()",
"Classes.P.html#m3--",
"Classes.P.html#m3()",
"Classes.P.m3()",
"m4(java.lang.String,java.lang.String)",
"Classes.P.html#m5--",
"Classes.P.html#m5()",
"Classes.P.m5()",
"#m6--",
"#m6()",
"m6()",
"#m7--",
"#m7()",
"m7()",
"End of links",
// Check @see
"See Also:",
"Classes.GP.html#m0--",
"Classes.GP.html#m0()",
"Classes.GP.m0()",
"#m1--",
"#m1()",
"m1()",
"Classes.P.html#m2--",
"Classes.P.html#m2()",
"Classes.P.m2()",
"Classes.P.html#m3--",
"Classes.P.html#m3()",
"Classes.P.m3()",
"#m4-java.lang.String-java.lang.String-",
"#m4(java.lang.String,java.lang.String)",
"m4(String k, String v)",
"Classes.P.html#m5--\"><code>Classes.P.m5()",
"#m6--\"><code>m6()",
"#m7--\"><code>m7()"
"Classes.P.html#m5()\"><code>Classes.P.m5()",
"#m6()\"><code>m6()",
"#m7()\"><code>m7()"
);
// Tests for interfaces
@ -172,24 +172,24 @@ public class TestOverrideMethods extends JavadocTester {
checkOrder("pkg5/Interfaces.D.html",
"Start of links <p>",
"Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
"Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
"Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
"Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
"#m--\"><code>m()",
"#n--\"><code>n()",
"Interfaces.C.html#o--\"><code>Interfaces.C.o()",
"Interfaces.A.html#m0()\"><code>Interfaces.A.m0()",
"Interfaces.A.html#m1()\"><code>Interfaces.A.m1()",
"Interfaces.A.html#m2()\"><code>Interfaces.A.m2()",
"Interfaces.A.html#m3()\"><code>Interfaces.A.m3()",
"#m()\"><code>m()",
"#n()\"><code>n()",
"Interfaces.C.html#o()\"><code>Interfaces.C.o()",
"End of links",
// Check @see links
"See Also:",
"Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
"Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
"Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
"Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
"#m--\"><code>m()",
"#n--\"><code>n()",
"Interfaces.C.html#o--\"><code>Interfaces.C.o()",
"Interfaces.A.html#m0()\"><code>Interfaces.A.m0()",
"Interfaces.A.html#m1()\"><code>Interfaces.A.m1()",
"Interfaces.A.html#m2()\"><code>Interfaces.A.m2()",
"Interfaces.A.html#m3()\"><code>Interfaces.A.m3()",
"#m()\"><code>m()",
"#n()\"><code>n()",
"Interfaces.C.html#o()\"><code>Interfaces.C.o()",
// Check properties
"Properties declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html\" "
@ -209,24 +209,128 @@ public class TestOverrideMethods extends JavadocTester {
// Check Method Summary
"Method Summary",
"#m--\">m",
"#n--\">n",
"#m()\">m",
"#n()\">n",
// Check footnotes
"Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html",
"Interfaces.A.html#getRate--\">getRate",
"Interfaces.A.html#rateProperty--\">rateProperty",
"Interfaces.A.html#setRate-double-",
"Interfaces.A.html#getRate()\">getRate",
"Interfaces.A.html#rateProperty()\">rateProperty",
"Interfaces.A.html#setRate(double)",
"Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.B.html",
"Interfaces.B.html#m1--\">m1",
"Interfaces.B.html#m3--\">m3",
"Interfaces.B.html#m1()\">m1",
"Interfaces.B.html#m3()\">m3",
"Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.C.html",
"<a href=\"Interfaces.C.html#o--\">o</a>"
"<a href=\"Interfaces.C.html#o()\">o</a>"
);
// Test synthetic values and valuesof of an enum.
checkOrder("index-all.html",
"<h2 class=\"title\">M</h2>",
"<a href=\"pkg5/Interfaces.C.html#m()\">m()",
"<a href=\"pkg5/Interfaces.D.html#m()\">m()</a>",
"<a href=\"pkg5/Classes.GP.html#m0()\">m0()",
"<a href=\"pkg5/Interfaces.A.html#m0()\">m0()</a>",
"<a href=\"pkg5/Classes.C.html#m1()\">m1()</a>",
"<a href=\"pkg5/Classes.P.html#m1()\">m1()</a>",
"<a href=\"pkg5/Interfaces.A.html#m1()\">m1()</a>",
"<a href=\"pkg5/Interfaces.B.html#m1()\">m1()</a>",
"<a href=\"pkg5/Classes.P.html#m2()\">m2()</a>",
"<a href=\"pkg5/Interfaces.A.html#m2()\">m2()</a>",
"<a href=\"pkg5/Classes.P.html#m3()\">m3()</a>",
"<a href=\"pkg5/Interfaces.A.html#m3()\">m3()</a>",
"<a href=\"pkg5/Interfaces.B.html#m3()\">m3()</a>",
"<a href=\"pkg5/Classes.C.html#m4(java.lang.String,java.lang.String)\">m4(String, String)</a>",
"<a href=\"pkg5/Classes.P.html#m4(K,V)\">m4(K, V)</a>",
"<a href=\"pkg5/Classes.P.html#m5()\">m5()</a>",
"<a href=\"pkg5/Classes.C.html#m6()\">m6()</a>",
"<a href=\"pkg5/Classes.P.html#m6()\">m6()</a>",
"<a href=\"pkg5/Classes.C.html#m7()\">m7()</a>",
"<a href=\"pkg5/Classes.GP.html#m7()\">m7()</a>",
"Returns the enum constant of this type with the specified name.",
"Returns an array containing the constants of this enum type, in\n" +
"the order they are declared."
);
}
@Test
void testSummary_html4() {
javadoc("-d", "out-summary-html4",
"-html4",
"-sourcepath", testSrc,
"-javafx",
"--override-methods=summary",
"pkg5");
checkExit(Exit.OK);
checkOrder("pkg5/Classes.C.html",
"#m1--\">m1",
"#m4-java.lang.String-java.lang.String-\">m4",
"Classes.GP.html#m0--\">m0",
"Classes.GP.html#m7--\">m7"
);
checkOrder("pkg5/Classes.C.html",
// Check footnotes 2
"Classes.P.html#getRate--\">getRate",
"Classes.P.html#m2--\">m2",
"Classes.P.html#m3--\">m3",
"Classes.P.html#m4-K-V-\">m4",
"Classes.P.html#rateProperty--\">rateProperty",
"Classes.P.html#setRate-double-\">setRate",
// Check @link
"Classes.GP.html#m0--",
"#m1--",
"Classes.P.html#m2--",
"Classes.P.html#m3--",
"Classes.P.html#m5--",
"#m6--",
"#m7--",
// Check @see
"Classes.GP.html#m0--",
"#m1--",
"Classes.P.html#m2--",
"Classes.P.html#m3--",
"#m4-java.lang.String-java.lang.String-",
"Classes.P.html#m5--\"><code>Classes.P.m5()",
"#m6--\"><code>m6()",
"#m7--\"><code>m7()"
);
// Tests for interfaces
// Make sure the static methods in the super interface
// do not make it to this interface
checkOrder("pkg5/Interfaces.D.html",
"Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
"Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
"Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
"Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
"#m--\"><code>m()",
"#n--\"><code>n()",
"Interfaces.C.html#o--\"><code>Interfaces.C.o()",
"Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
"Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
"Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
"Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
"#m--\"><code>m()",
"#n--\"><code>n()",
"Interfaces.C.html#o--\"><code>Interfaces.C.o()",
"#m--\">m",
"#n--\">n",
"Interfaces.A.html#getRate--\">getRate",
"Interfaces.A.html#rateProperty--\">rateProperty",
"Interfaces.A.html#setRate-double-",
"Interfaces.B.html#m1--\">m1",
"Interfaces.B.html#m3--\">m3",
"<a href=\"Interfaces.C.html#o--\">o</a>"
);
// Test synthetic values and valuesof of an enum.
checkOrder("index-all.html",
"<a href=\"pkg5/Interfaces.C.html#m--\">m()",
"<a href=\"pkg5/Interfaces.D.html#m--\">m()</a>",
"<a href=\"pkg5/Classes.GP.html#m0--\">m0()",
@ -246,10 +350,7 @@ public class TestOverrideMethods extends JavadocTester {
"<a href=\"pkg5/Classes.C.html#m6--\">m6()</a>",
"<a href=\"pkg5/Classes.P.html#m6--\">m6()</a>",
"<a href=\"pkg5/Classes.C.html#m7--\">m7()</a>",
"<a href=\"pkg5/Classes.GP.html#m7--\">m7()</a>",
"Returns the enum constant of this type with the specified name.",
"Returns an array containing the constants of this enum type, in\n" +
"the order they are declared."
"<a href=\"pkg5/Classes.GP.html#m7--\">m7()</a>"
);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 8173302
* @bug 8173302 8182765
* @summary make sure the overview-summary and module-summary pages don't
* don't have the See link, and the overview is copied correctly.
* @library ../lib
@ -48,15 +48,20 @@ public class TestOverview extends JavadocTester {
"-sourcepath", testSrc("src"),
"p1", "p2");
checkExit(Exit.OK);
checkOutput("overview-summary.html", true,
"<div class=\"header\">\n"
+ "<h1 class=\"title\">Document Title</h1>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">This is line1. This is line 2.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">"
);
checkOverview();
}
@Test
void test1_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-doctitle", "Document Title",
"-windowtitle", "Window Title",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc("src"),
"p1", "p2");
checkExit(Exit.OK);
checkOverview_html4();
}
@Test
@ -68,6 +73,35 @@ public class TestOverview extends JavadocTester {
"-sourcepath", testSrc("msrc"),
"p1", "p2");
checkExit(Exit.OK);
checkOverview();
}
@Test
void test2_html4() {
javadoc("-d", "out-2-html4",
"-html4",
"-doctitle", "Document Title",
"-windowtitle", "Window Title",
"-overview", testSrc("overview.html"),
"-sourcepath", testSrc("msrc"),
"p1", "p2");
checkExit(Exit.OK);
checkOverview_html4();
}
void checkOverview() {
checkOutput("overview-summary.html", true,
"<div class=\"header\">\n"
+ "<h1 class=\"title\">Document Title</h1>\n"
+ "</div>\n"
+ "<main role=\"main\">\n"
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">This is line1. This is line 2.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">");
}
void checkOverview_html4() {
checkOutput("overview-summary.html", true,
"<div class=\"header\">\n"
+ "<h1 class=\"title\">Document Title</h1>\n"
@ -75,7 +109,6 @@ public class TestOverview extends JavadocTester {
+ "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">This is line1. This is line 2.</div>\n"
+ "</div>\n"
+ "<div class=\"contentContainer\">"
);
+ "<div class=\"contentContainer\">");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 8185194
* @bug 8185194 8182765
* @summary Test anchor for package description in package summary page
* @library ../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -42,8 +42,7 @@ public class TestPackageDescription extends JavadocTester {
void test1() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg",
"-html5");
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/package-summary.html", true,
@ -56,6 +55,7 @@ public class TestPackageDescription extends JavadocTester {
@Test
void test2() {
javadoc("-d", "out-2",
"-html4",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4780441 4874845 4978816 8014017 8016328 8025633 8026567 8175200
* @bug 4780441 4874845 4978816 8014017 8016328 8025633 8026567 8175200 8182765
* @summary Make sure that when the -private flag is not used, members
* inherited from package private class are documented in the child.
*
@ -42,7 +42,6 @@
* @build JavadocTester
* @run main TestPrivateClasses
*/
public class TestPrivateClasses extends JavadocTester {
public static void main(String... args) throws Exception {
@ -62,7 +61,7 @@ public class TestPrivateClasses extends JavadocTester {
"<a href=\"#fieldInheritedFromParent\">"
+ "fieldInheritedFromParent</a>",
// Method inheritance from non-public superclass.
"<a href=\"#methodInheritedFromParent-int-\">"
"<a href=\"#methodInheritedFromParent(int)\">"
+ "methodInheritedFromParent</a>",
// private class does not show up in tree
"<ul class=\"inheritance\">\n"
@ -94,15 +93,15 @@ public class TestPrivateClasses extends JavadocTester {
checkOutput("pkg/PublicChild.html", false,
// Should not document comments from private inherited interfaces
"<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
"<a href=\"#methodInterface-int-\">" +
"methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n" +
"<div class=\"block\">Comment from interface.</div>\n</td>",
"<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodInterface(int)\">"
+ "methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n"
+ "<div class=\"block\">Comment from interface.</div>\n</td>",
// and similarly one more
"<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
"<a href=\"#methodInterface2-int-\">" +
"methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n" +
"<div class=\"block\">Comment from interface.</div>\n</td>"
"<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodInterface2(int)\">"
+ "methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n"
+ "<div class=\"block\">Comment from interface.</div>\n</td>"
);
checkOutput("pkg/PublicInterface.html", true,
@ -110,7 +109,7 @@ public class TestPrivateClasses extends JavadocTester {
"<a href=\"#fieldInheritedFromInterface\">"
+ "fieldInheritedFromInterface</a>",
// Method inheritance from non-public superinterface.
"<a href=\"#methodInterface-int-\">"
"<a href=\"#methodInterface(int)\">"
+ "methodInterface</a>",
//Make sure implemented interfaces from private superclass are inherited
"<dl>\n"
@ -132,13 +131,49 @@ public class TestPrivateClasses extends JavadocTester {
checkOutput("pkg2/C.html", false,
//Do not inherit private interface method with generic parameters.
//This method has been implemented.
"<span class=\"memberNameLink\"><a href=\"I.html#hello-T-\">hello</a></span>");
"<span class=\"memberNameLink\"><a href=\"I.html#hello(T)\">hello</a></span>");
checkOutput("constant-values.html", false,
// Make inherited constant are documented correctly.
"PrivateInterface");
}
@Test
void testDefault_html4() {
javadoc("-d", "out-default-html4",
"-html4",
"-sourcepath", testSrc,
"pkg", "pkg2");
checkExit(Exit.OK);
checkOutput("pkg/PublicChild.html", true,
// Method inheritance from non-public superclass.
"<a href=\"#methodInheritedFromParent-int-\">");
checkOutput("pkg/PublicChild.html", false,
// Should not document comments from private inherited interfaces
"<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodInterface-int-\">"
+ "methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n"
+ "<div class=\"block\">Comment from interface.</div>\n</td>",
// and similarly one more
"<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#methodInterface2-int-\">"
+ "methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n"
+ "<div class=\"block\">Comment from interface.</div>\n</td>"
);
checkOutput("pkg/PublicInterface.html", true,
// Method inheritance from non-public superinterface.
"<a href=\"#methodInterface-int-\">"
+ "methodInterface</a>");
checkOutput("pkg2/C.html", false,
//Do not inherit private interface method with generic parameters.
//This method has been implemented.
"<span class=\"memberNameLink\"><a href=\"I.html#hello-T-\">hello</a></span>");
}
@Test
void testPrivate() {
javadoc("-d", "out-private",
@ -158,17 +193,17 @@ public class TestPrivateClasses extends JavadocTester {
"Methods inherited from class&nbsp;pkg."
+ "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
+ "PrivateParent</a>",
"<a href=\"PrivateParent.html#methodInheritedFromParent-int-\">"
"<a href=\"PrivateParent.html#methodInheritedFromParent(int)\">"
+ "methodInheritedFromParent</a>",
// Should document that a method overrides method from private class.
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
+ "<dd><code><a href=\"PrivateParent.html#methodOverridenFromParent(char%5B%5D,int,T,V,java.util.List)\">"
+ "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>"
+ "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
+ "PrivateParent</a></code></dd>",
// Should document that a method is specified by private interface.
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"PrivateInterface.html#methodInterface-int-\">"
+ "<dd><code><a href=\"PrivateInterface.html#methodInterface(int)\">"
+ "methodInterface</a></code>&nbsp;in interface&nbsp;<code>"
+ "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
+ "PrivateInterface</a></code></dd>",
@ -208,6 +243,56 @@ public class TestPrivateClasses extends JavadocTester {
+ "</a></code></dd>\n"
+ "</dl>");
checkOutput("pkg/PrivateInterface.html", true,
"<a href=\"#methodInterface(int)\">"
+ "methodInterface</a>"
);
checkOutput("pkg2/C.html", true,
//Since private flag is used, we can document that private interface method
//with generic parameters has been implemented.
"<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<code>"
+ "<a href=\"I.html#hello(T)\">I</a></code></span>",
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"I.html#hello(T)\">hello</a></code>"
+ "&nbsp;in interface&nbsp;<code>"
+ "<a href=\"I.html\" title=\"interface in pkg2\">I</a>"
+ "&lt;java.lang.String&gt;</code></dd>");
checkOutput("pkg/PrivateParent.html", true,
//Make sure when no modifier appear in the class signature, the
//signature is displayed correctly without extra space at the beginning.
"<pre>class <span class=\"typeNameLabel\">PrivateParent</span>");
checkOutput("pkg/PrivateParent.html", false,
"<pre> class <span class=\"typeNameLabel\">PrivateParent</span>");
}
@Test
void testPrivate_html4() {
javadoc("-d", "out-private-html4",
"-html4",
"-sourcepath", testSrc,
"-private",
"pkg", "pkg2");
checkExit(Exit.OK);
checkOutput("pkg/PublicChild.html", true,
"<a href=\"PrivateParent.html#methodInheritedFromParent-int-\">"
+ "methodInheritedFromParent</a>",
// Should document that a method overrides method from private class.
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+ "<dd><code><a href=\"PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
+ "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>"
+ "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
+ "PrivateParent</a></code></dd>",
// Should document that a method is specified by private interface.
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+ "<dd><code><a href=\"PrivateInterface.html#methodInterface-int-\">"
+ "methodInterface</a></code>&nbsp;in interface&nbsp;<code>"
+ "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
+ "PrivateInterface</a></code></dd>");
checkOutput("pkg/PrivateInterface.html", true,
"<a href=\"#methodInterface-int-\">"
+ "methodInterface</a>"
@ -223,13 +308,5 @@ public class TestPrivateClasses extends JavadocTester {
+ "&nbsp;in interface&nbsp;<code>"
+ "<a href=\"I.html\" title=\"interface in pkg2\">I</a>"
+ "&lt;java.lang.String&gt;</code></dd>");
checkOutput("pkg/PrivateParent.html", true,
//Make sure when no modifier appear in the class signature, the
//signature is displayed correctly without extra space at the beginning.
"<pre>class <span class=\"typeNameLabel\">PrivateParent</span>");
checkOutput("pkg/PrivateParent.html", false,
"<pre> class <span class=\"typeNameLabel\">PrivateParent</span>");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8176231 8189843
* @bug 8176231 8189843 8182765
* @summary Test JavaFX property.
* @library ../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -46,6 +46,77 @@ public class TestProperty extends JavadocTester {
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/MyClass.html", true,
"<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>"
+ "&lt;<a href=\"MyObj.html\" "
+ "title=\"class in pkg\">MyObj</a>&gt; goodProperty</pre>\n"
+ "<div class=\"block\">This is an Object property where the "
+ "Object is a single Object.</div>\n"
+ "<dl>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#getGood()\"><code>getGood()</code></a>, \n"
+ "<a href=\"#setGood(pkg.MyObj)\">"
+ "<code>setGood(MyObj)</code></a></dd>\n"
+ "</dl>",
"<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>"
+ "&lt;<a href=\"MyObj.html\" "
+ "title=\"class in pkg\">MyObj</a>[]&gt; badProperty</pre>\n"
+ "<div class=\"block\">This is an Object property where the "
+ "Object is an array.</div>\n"
+ "<dl>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#getBad()\"><code>getBad()</code></a>, \n"
+ "<a href=\"#setBad(pkg.MyObj%5B%5D)\">"
+ "<code>setBad(MyObj[])</code></a></dd>\n"
+ "</dl>",
// id should not be used in the property table
"<tr class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
+ "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#badProperty\">bad</a></span></code></th>",
// id should be used in the method table
"<tr id=\"i0\" class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
+ "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#badProperty()\">badProperty</a></span>()</code></th>"
);
checkOutput("pkg/MyClassT.html", true,
"<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>"
+ "&lt;java.util.List&lt;<a href=\"MyClassT.html\" "
+ "title=\"type parameter in MyClassT\">T</a>&gt;&gt; "
+ "listProperty</pre>\n"
+ "<div class=\"block\">This is an Object property where the "
+ "Object is a single <code>List&lt;T&gt;</code>.</div>\n"
+ "<dl>\n"
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+ "<dd><a href=\"#getList()\">"
+ "<code>getList()</code></a>, \n"
+ "<a href=\"#setList(java.util.List)\">"
+ "<code>setList(List)</code></a></dd>\n"
+ "</dl>"
);
}
@Test
void testArrays_html4() {
javadoc("-d", "out-html4",
"-html4",
"-javafx",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/MyClass.html", true,
"<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>"
@ -73,14 +144,6 @@ public class TestProperty extends JavadocTester {
+ "<code>setBad(MyObj[])</code></a></dd>\n"
+ "</dl>",
// id should not be used in the property table
"<tr class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+ "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
+ "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"#badProperty\">bad</a></span></code></th>",
// id should be used in the method table
"<tr id=\"i0\" class=\"altColor\">\n"
+ "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "

Some files were not shown because too many files have changed in this diff Show More