--- a/.hgtags Fri Mar 02 15:02:26 2018 -0800
+++ b/.hgtags Fri Mar 02 21:00:12 2018 +0100
@@ -471,3 +471,6 @@
107413b070b92c88bde6230ceb4a19b579781068 jdk-10+43
dfa46cfe56346884a61efdc30dc50f7505d66761 jdk-11+1
03ae177c26b016353e5ea1cab6ffd051dfa086ca jdk-11+2
+663f20fc51091bd7f95d18448850ba091207b7bd jdk-10+44
+4f96cf952e71cb8a127334494faf28880c26181b jdk-10+45
+1fd4d6068f54561cfc67d54fc9ca84af7212c4f8 jdk-11+3
--- a/make/Docs.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/Docs.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -61,7 +61,7 @@
$(SUPPORT_OUTPUTDIR)/rmic/* $(TOPDIR)/src/*/share/doc/stub)
# URLs
-JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
+JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase10&id=homepage
BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
COPYRIGHT_URL := {@docroot}/../legal/copyright.html
LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java10speclicense.html
--- a/make/autoconf/basics.m4 Fri Mar 02 15:02:26 2018 -0800
+++ b/make/autoconf/basics.m4 Fri Mar 02 21:00:12 2018 +0100
@@ -1127,6 +1127,8 @@
fi
fi
BASIC_REQUIRE_PROGS(SETFILE, SetFile)
+ elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
+ BASIC_REQUIRE_PROGS(ELFEDIT, elfedit)
fi
])
--- a/make/autoconf/spec.gmk.in Fri Mar 02 15:02:26 2018 -0800
+++ b/make/autoconf/spec.gmk.in Fri Mar 02 21:00:12 2018 +0100
@@ -710,6 +710,7 @@
LDD:=@LDD@
OTOOL:=@OTOOL@
READELF:=@READELF@
+ELFEDIT:=@ELFEDIT@
EXPR:=@EXPR@
FILE:=@FILE@
DOT:=@DOT@
--- a/make/common/NativeCompilation.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/common/NativeCompilation.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
ifndef _NATIVE_COMPILATION_GMK
_NATIVE_COMPILATION_GMK := 1
-ifeq (,$(_MAKEBASE_GMK))
+ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
endif
@@ -231,32 +231,32 @@
endif
endif
- ifneq (,$$(filter %.c,$2))
+ ifneq ($$(filter %.c, $2), )
# Compile as a C file
- $1_$2_FLAGS=$(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
+ $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))
+ $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_$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))
+ $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))
+ $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_$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)
+ $1_$2_COMP := $7
+ $1_$2_DEP_FLAG := $(CXX_FLAG_DEPS)
else
$$(error Internal error in NativeCompilation.gmk: no compiler for file $2)
endif
@@ -264,14 +264,14 @@
$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))
+ ifeq ($$(findstring $$($1_$2_OBJ), $$($1_OBJS_SO_FAR)), )
+ $1_OBJS_SO_FAR += $$($1_$2_OBJ)
+ ifeq ($$(filter %.s %.S, $2), )
# And this is the dependency file for this obj file.
- $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
+ $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_$2_DEP_TARGETS := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_$2_OBJ))
# Include previously generated dependency information. (if it exists)
-include $$($1_$2_DEP)
@@ -280,7 +280,7 @@
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_$2_DEBUG_OUT_FLAGS := -Fd$$(strip $$(patsubst $$($1_OBJECT_DIR)/%, \
$$($1_OBJECT_DIR)/pdb/%, $$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ))))
endif
endif
@@ -293,10 +293,10 @@
endif
$$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) $$($1_$2_VARDEPS_FILE) | $$($1_BUILD_INFO)
- $$(call LogInfo, Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET))))
+ $$(call LogInfo, Compiling $$(notdir $2) (for $$($1_BASENAME)))
$$(call MakeDir, $$(@D) $$(@D)/pdb)
ifneq ($(TOOLCHAIN_TYPE), microsoft)
- ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
+ 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.
$$(call ExecuteWithLog, $$@, \
@@ -308,7 +308,7 @@
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),)
+ ifneq ($$($1_$2_DEP), )
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
endif
else
@@ -338,6 +338,9 @@
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
+# NAME The base name for the resulting binary, excluding decorations (like *.exe)
+# TYPE Type of binary (EXECUTABLE, LIBRARY or STATIC_LIBRARY). Default is LIBRARY.
+# SUFFIX Override the default suffix for the output file
# TOOLCHAIN Name of toolchain setup to use. Defaults to TOOLCHAIN_DEFAULT.
# SRC one or more directory roots to scan for C/C++ files.
# CFLAGS the compiler flags to be used, used both for C and C++.
@@ -347,8 +350,6 @@
# ARFLAGS the archiver flags to be used
# OBJECT_DIR the directory where we store the object files
# OUTPUT_DIR the directory where the resulting binary is put
-# LIBRARY the resulting library file
-# PROGRAM the resulting exec file
# INCLUDES only pick source from these directories
# EXCLUDES do not pick source from these directories
# INCLUDE_FILES only compile exactly these files!
@@ -385,105 +386,59 @@
SetupNativeCompilation = $(NamedParamsMacroTemplate)
define SetupNativeCompilationBody
+ # If type is unspecified, default to LIBRARY
+ ifeq ($$($1_TYPE), )
+ $1_TYPE := LIBRARY
+ endif
+
# If we're doing a static build and producing a library
# force it to be a static library and remove the -l libraries
ifeq ($(STATIC_BUILD), true)
- ifneq ($$($1_LIBRARY),)
- $1_STATIC_LIBRARY := $$($1_LIBRARY)
- $1_LIBRARY :=
+ ifeq ($$($1_TYPE), LIBRARY)
+ $1_TYPE := STATIC_LIBRARY
endif
endif
- ifneq (,$$($1_BIN))
- $$(error BIN has been replaced with OBJECT_DIR)
- endif
-
- ifneq (,$$($1_LIB))
- $$(error LIB has been replaced with LIBRARY)
- endif
-
- ifneq (,$$($1_EXE))
- $$(error EXE has been replaced with PROGRAM)
- endif
-
- ifneq (,$$($1_LIBRARY))
- ifeq (,$$($1_OUTPUT_DIR))
- $$(error LIBRARY requires OUTPUT_DIR)
- endif
-
- ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY)))
- $$(error directory of LIBRARY should be specified using OUTPUT_DIR)
- endif
-
- ifneq (,$(findstring $(SHARED_LIBRARY_SUFFIX),$$($1_LIBRARY)))
- $$(error LIBRARY should be specified without SHARED_LIBRARY_SUFFIX: $(SHARED_LIBRARY_SUFFIX))
- endif
-
- ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY)))
- $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
- endif
-
- ifeq ($$($1_SUFFIX), )
- $1_SUFFIX := $(SHARED_LIBRARY_SUFFIX)
- endif
-
- $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$$($1_SUFFIX)
- $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
- $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_LIBRARY)
- endif
-
- ifneq (,$$($1_STATIC_LIBRARY))
- ifeq (,$$($1_OUTPUT_DIR))
- $$(error STATIC_LIBRARY requires OUTPUT_DIR)
- endif
-
- ifneq ($$($1_STATIC_LIBRARY),$(basename $$($1_STATIC_LIBRARY)))
- $$(error directory of STATIC_LIBRARY should be specified using OUTPUT_DIR)
- endif
-
- ifneq (,$(findstring $(STATIC_LIBRARY_SUFFIX),$$($1_STATIC_LIBRARY)))
- $$(error STATIC_LIBRARY should be specified without STATIC_LIBRARY_SUFFIX: $(STATIC_LIBRARY_SUFFIX))
- endif
-
- ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY)))
- $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
- endif
-
- ifeq ($$($1_SUFFIX), )
- $1_SUFFIX := $(STATIC_LIBRARY_SUFFIX)
- endif
-
- $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$$($1_SUFFIX)
- $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
- $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)
- endif
-
- ifneq (,$$($1_PROGRAM))
- ifeq (,$$($1_OUTPUT_DIR))
- $$(error PROGRAM requires OUTPUT_DIR)
- endif
-
- ifneq ($$($1_PROGRAM),$(basename $$($1_PROGRAM)))
- $$(error directory of PROGRAM should be specified using OUTPUT_DIR)
- endif
-
- ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM)))
- $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
- endif
-
+ ifeq ($$($1_TYPE), EXECUTABLE)
+ $1_PREFIX :=
ifeq ($$($1_SUFFIX), )
$1_SUFFIX := $(EXE_SUFFIX)
endif
+ else
+ $1_PREFIX := $(LIBRARY_PREFIX)
+ ifeq ($$($1_TYPE), LIBRARY)
+ ifeq ($$($1_SUFFIX), )
+ $1_SUFFIX := $(SHARED_LIBRARY_SUFFIX)
+ endif
+ else ifeq ($$($1_TYPE), STATIC_LIBRARY)
+ ifeq ($$($1_SUFFIX), )
+ $1_SUFFIX := $(STATIC_LIBRARY_SUFFIX)
+ endif
+ endif
+ endif
- $1_BASENAME:=$$($1_PROGRAM)$$($1_SUFFIX)
- $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
- $1_NOSUFFIX:=$$($1_PROGRAM)
+ ifneq ($$($1_NAME), $(basename $$($1_NAME)))
+ $$(error NAME must not contain any directory path in $1)
endif
- $1_SAFE_NAME := $$(strip $$(subst /,_, $1))
+ ifneq ($(findstring $$($1_SUFFIX), $$($1_NAME)), )
+ $$(error NAME should be specified without suffix: $$($1_SUFFIX) in $1)
+ endif
+ ifneq ($(findstring $$($1_PREFIX), $$($1_NAME)), )
+ $$(error NAME should be specified without prefix: $$($1_PREFIX) in $1)
+ endif
+ ifeq ($$($1_OUTPUT_DIR), )
+ $$(error OUTPUT_DIR is missing in $1)
+ endif
+ ifneq ($$($1_MANIFEST), )
+ ifeq ($$($1_MANIFEST_VERSION), )
+ $$(error If MANIFEST is provided, then MANIFEST_VERSION is required in $1)
+ endif
+ endif
- ifeq (,$$($1_TARGET))
- $$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation)
- endif
+ $1_BASENAME := $$($1_PREFIX)$$($1_NAME)$$($1_SUFFIX)
+ $1_TARGET := $$($1_OUTPUT_DIR)/$$($1_BASENAME)
+ $1_NOSUFFIX := $$($1_PREFIX)$$($1_NAME)
+ $1_SAFE_NAME := $$(strip $$(subst /,_, $1))
# Setup the toolchain to be used
$$(call SetIfEmpty, $1_TOOLCHAIN, TOOLCHAIN_DEFAULT)
@@ -499,41 +454,35 @@
$$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_CFLAGS))
$$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_LDFLAGS))
- ifneq ($$($1_MANIFEST), )
- ifeq ($$($1_MANIFEST_VERSION), )
- $$(error If MANIFEST is provided, then MANIFEST_VERSION is required in $1)
- endif
- endif
-
# Make sure the dirs exist.
- $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
- $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),, \
+ $$(call MakeDir, $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
+ $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
# Find all files in the source trees. Preserve order.
- $1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind,$$(s)))
+ $1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind, $$(s)))
$1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
# Extract the C/C++ files.
ifneq ($$($1_EXCLUDE_PATTERNS), )
# We must not match the exclude pattern against the src root(s).
$1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
- $$(foreach i,$$($1_SRC),$$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
+ $$(foreach i, $$($1_SRC), $$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
$$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
$1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
$$($1_SRCS_WITHOUT_ROOTS))
endif
- ifneq ($$($1_EXCLUDE_FILES),)
+ ifneq ($$($1_EXCLUDE_FILES), )
$1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
endif
- ifneq ($$($1_ALL_EXCLUDE_FILES),)
+ ifneq ($$($1_ALL_EXCLUDE_FILES), )
$1_EXCLUDE_FILES_PAT := $$($1_ALL_EXCLUDE_FILES) \
- $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_ALL_EXCLUDE_FILES)))
- $1_EXCLUDE_FILES_PAT := $$(addprefix %,$$($1_EXCLUDE_FILES_PAT))
- $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT),$$($1_SRCS))
+ $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_ALL_EXCLUDE_FILES)))
+ $1_EXCLUDE_FILES_PAT := $$(addprefix %, $$($1_EXCLUDE_FILES_PAT))
+ $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT), $$($1_SRCS))
endif
ifneq ($$($1_INCLUDE_FILES), )
- $1_INCLUDE_FILES_PAT := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
- $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT),$$($1_SRCS))
+ $1_INCLUDE_FILES_PAT := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
+ $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT), $$($1_SRCS))
endif
# There can be only a single bin dir root, no need to foreach over the roots.
$1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
@@ -541,29 +490,29 @@
# and we have a list of all existing object files: $$($1_BINS)
# Prepend the source/bin path to the filter expressions. Then do the filtering.
- ifneq ($$($1_INCLUDES),)
- $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
- $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
+ ifneq ($$($1_INCLUDES), )
+ $1_SRC_INCLUDES := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
+ $1_SRCS := $$(filter $$($1_SRC_INCLUDES), $$($1_SRCS))
endif
- ifneq ($$($1_EXCLUDES),)
- $1_SRC_EXCLUDES := $$(addsuffix /%,$$($1_EXCLUDES))
- $1_SRC_EXCLUDES += $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
- $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
+ ifneq ($$($1_EXCLUDES), )
+ $1_SRC_EXCLUDES := $$(addsuffix /%, $$($1_EXCLUDES))
+ $1_SRC_EXCLUDES += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_EXCLUDES))))
+ $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES), $$($1_SRCS))
endif
$1_SRCS += $$($1_EXTRA_FILES)
- ifeq (,$$($1_SRCS))
+ ifeq ($$($1_SRCS), )
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
endif
# Calculate the expected output from compiling the sources
$1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
- $1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/,$$($1_EXPECTED_OBJS_FILENAMES))
+ $1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/, $$($1_EXPECTED_OBJS_FILENAMES))
# Are there too many object files on disk? Perhaps because some source file was removed?
- $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
+ $1_SUPERFLOUS_OBJS := $$(sort $$(filter-out $$($1_EXPECTED_OBJS), $$($1_BINS)))
# Clean out the superfluous object files.
- ifneq ($$($1_SUPERFLUOUS_OBJS),)
+ ifneq ($$($1_SUPERFLUOUS_OBJS), )
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
endif
# Sort to remove dupliates and provide a reproducable order on the input files to the linker.
@@ -571,42 +520,42 @@
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS, and/or OPENJDK_TARGET_OS plus
# OPENJDK_TARGET_CPU pair dependent variables for CFLAGS.
- $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) \
+ $1_EXTRA_CFLAGS := $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) \
$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU))
- ifneq ($(DEBUG_LEVEL),release)
+ ifneq ($(DEBUG_LEVEL), release)
# Pickup extra debug dependent variables for CFLAGS
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_debug)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_debug)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_debug)
else
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
- $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_release)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
+ $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
endif
# Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
- $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
- ifneq ($(DEBUG_LEVEL),release)
+ $1_EXTRA_CXXFLAGS := $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
+ ifneq ($(DEBUG_LEVEL), release)
# Pickup extra debug dependent variables for CXXFLAGS
- $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
- $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
- $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
+ $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_debug)
+ $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
+ $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
else
- $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
- $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
- $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
+ $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_release)
+ $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
+ $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
endif
# If no C++ flags are explicitly set, default to using the C flags.
# After that, we can set additional C++ flags that should not interfere
# with the mechanism for copying the C flags by default.
- ifeq ($$($1_CXXFLAGS),)
- $1_CXXFLAGS:=$$($1_CFLAGS)
+ ifeq ($$($1_CXXFLAGS), )
+ $1_CXXFLAGS := $$($1_CFLAGS)
endif
- ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
- $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
+ ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)), )
+ $1_EXTRA_CXXFLAGS := $$($1_EXTRA_CFLAGS)
endif
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
@@ -616,19 +565,19 @@
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_DEBUG_SYMBOLS)
endif
- ifneq (,$$($1_REORDER))
+ ifneq ($$($1_REORDER), )
$1_EXTRA_CFLAGS += $$(C_FLAG_REORDER)
$1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
endif
# Pass the library name for static JNI library naming
- ifneq ($$($1_STATIC_LIBRARY),)
- $1_EXTRA_CFLAGS += -DLIBRARY_NAME=$$($1_STATIC_LIBRARY)
- $1_EXTRA_CXXFLAGS += -DLIBRARY_NAME=$$($1_STATIC_LIBRARY)
+ ifeq ($$($1_TYPE), STATIC_LIBRARY)
+ $1_EXTRA_CFLAGS += -DLIBRARY_NAME=$$($1_NAME)
+ $1_EXTRA_CXXFLAGS += -DLIBRARY_NAME=$$($1_NAME)
endif
# Pick up disabled warnings, if possible on this platform.
- ifneq ($(DISABLE_WARNING_PREFIX),)
+ ifneq ($(DISABLE_WARNING_PREFIX), )
$1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
$$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)))
@@ -639,8 +588,8 @@
# Check if warnings should be considered errors.
# Pick first binary and toolchain specific, then binary specific, then general setting.
- ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)),)
- ifeq ($$($1_WARNINGS_AS_ERRORS),)
+ ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), )
+ ifeq ($$($1_WARNINGS_AS_ERRORS), )
$1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$(WARNINGS_AS_ERRORS)
else
$1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$($1_WARNINGS_AS_ERRORS)
@@ -740,7 +689,7 @@
endif
# Now call add_native_source for each source file we are going to compile.
- $$(foreach p,$$($1_SRCS), \
+ $$(foreach p, $$($1_SRCS), \
$$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS), \
$$($1_CC), \
@@ -750,7 +699,7 @@
# Setup rule for printing progress info when compiling source files.
# This is a rough heuristic and may not always print accurate information.
$$($1_BUILD_INFO): $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE)
- ifeq ($$(wildcard $$($1_TARGET)),)
+ ifeq ($$(wildcard $$($1_TARGET)), )
$(ECHO) 'Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \
$$(filter-out %.vardeps, $$?)) file(s)'
else
@@ -763,10 +712,10 @@
# On windows we need to create a resource file
ifeq ($(OPENJDK_TARGET_OS), windows)
- ifneq (,$$($1_VERSIONINFO_RESOURCE))
- $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
- $1_RES_DEP:=$$($1_RES).d
- $1_RES_DEP_TARGETS:=$$($1_RES).d.targets
+ ifneq ($$($1_VERSIONINFO_RESOURCE), )
+ $1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res
+ $1_RES_DEP := $$($1_RES).d
+ $1_RES_DEP_TARGETS := $$($1_RES).d.targets
-include $$($1_RES_DEP)
-include $$($1_RES_DEP_TARGETS)
@@ -775,7 +724,7 @@
$$($1_RES).vardeps)
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
- $$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET))))
+ $$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$($1_BASENAME)))
$$(call MakeDir, $$(@D) $$($1_OBJECT_DIR))
$$(call ExecuteWithLog, $$@, \
$$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
@@ -798,10 +747,10 @@
endif
endif
- ifneq ($(DISABLE_MAPFILES),true)
+ ifneq ($(DISABLE_MAPFILES), true)
$1_REAL_MAPFILE := $$($1_MAPFILE)
- ifneq ($(OPENJDK_TARGET_OS),windows)
- ifneq (,$$($1_REORDER))
+ ifneq ($(OPENJDK_TARGET_OS), windows)
+ ifneq ($$($1_REORDER), )
$1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile
$$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
@@ -815,9 +764,9 @@
# Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables
# for LDFLAGS and LIBS
- $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
- $1_EXTRA_LIBS:=$$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS))
- ifneq (,$$($1_REAL_MAPFILE))
+ $1_EXTRA_LDFLAGS := $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
+ $1_EXTRA_LIBS := $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS))
+ ifneq ($$($1_REAL_MAPFILE), )
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
endif
@@ -835,7 +784,7 @@
ifeq ($$($1_COPY_DEBUG_SYMBOLS), true)
ifneq ($$($1_DEBUG_SYMBOLS), false)
# Only copy debug symbols for dynamic libraries and programs.
- ifeq ($$($1_STATIC_LIBRARY), )
+ ifneq ($$($1_TYPE), STATIC_LIBRARY)
# Generate debuginfo files.
ifeq ($(OPENJDK_TARGET_OS), windows)
$1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb" \
@@ -899,17 +848,17 @@
endif
endif
- ifneq (,$$($1_LIBRARY))
+ ifeq ($$($1_TYPE), LIBRARY)
# Generating a dynamic library.
$1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
ifeq ($(OPENJDK_TARGET_OS), windows)
- $1_EXTRA_LDFLAGS += "-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib"
+ $1_EXTRA_LDFLAGS += "-implib:$$($1_OBJECT_DIR)/$$($1_NAME).lib"
# Create a rule for the import lib so that other rules may depend on it
- $$($1_OBJECT_DIR)/$$($1_LIBRARY).lib: $$($1_TARGET)
+ $$($1_OBJECT_DIR)/$$($1_NAME).lib: $$($1_TARGET)
endif
# Create loadmap on AIX. Helps in diagnosing some problems.
- ifneq ($(COMPILER_BINDCMD_FILE_FLAG),)
+ ifneq ($(COMPILER_BINDCMD_FILE_FLAG), )
$1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap
endif
@@ -924,7 +873,7 @@
# If there are many object files, use an @-file...
ifneq ($$(word 17, $$($1_ALL_OBJS)), )
$1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt
- ifneq ($(COMPILER_COMMAND_FILE_FLAG),)
+ ifneq ($(COMPILER_COMMAND_FILE_FLAG), )
$1_LD_OBJ_ARG := $(COMPILER_COMMAND_FILE_FLAG)$$($1_OBJ_FILE_LIST)
else
# ...except for toolchains which don't support them.
@@ -986,7 +935,7 @@
endif
- ifneq (,$$($1_STATIC_LIBRARY))
+ ifeq ($$($1_TYPE), STATIC_LIBRARY)
$1_VARDEPS := $$($1_AR) $$($1_ARFLAGS) $$($1_LIBS) \
$$($1_EXTRA_LIBS)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
@@ -1000,7 +949,7 @@
endif
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP)
- $$(call LogInfo, Archiving $$($1_STATIC_LIBRARY))
+ $$(call LogInfo, Building static library $$($1_BASENAME))
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
$$($1_RES))
@@ -1013,7 +962,7 @@
endif
endif
- ifneq (,$$($1_PROGRAM))
+ ifeq ($$($1_TYPE), EXECUTABLE)
# A executable binary has been specified, setup the target for it.
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
$$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
@@ -1038,13 +987,13 @@
$$($1_LIBS) $$($1_EXTRA_LIBS))
ifeq ($(OPENJDK_TARGET_OS), windows)
ifneq ($$($1_MANIFEST), )
- $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_PROGRAM).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
+ $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
endif
endif
# This only works if the openjdk_codesign identity is present on the system. Let
# silently fail otherwise.
- ifneq (,$(CODESIGN))
- ifneq (,$$($1_CODESIGN))
+ ifneq ($(CODESIGN), )
+ ifneq ($$($1_CODESIGN), )
$(CODESIGN) -s openjdk_codesign $$@
endif
endif
--- a/make/common/TestFilesCompilation.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/common/TestFilesCompilation.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -61,11 +61,13 @@
$1_OUTPUT_SUBDIR := lib
$1_CFLAGS := $(CFLAGS_TESTLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
$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_LDFLAGS := $(LDFLAGS_TESTEXE)
+ $1_COMPILATION_TYPE := EXECUTABLE
else
$$(error Unknown type: $$($1_TYPE))
endif
@@ -78,7 +80,8 @@
$$(foreach file, $$($1_FILE_LIST),\
$$(eval name := $$(strip $$(patsubst $$($1_PREFIX)%, %, $$(basename $$(notdir $$(file)))))) \
$$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
- $$($1_TYPE) := $$(name), \
+ NAME := $$(name), \
+ TYPE := $$($1_COMPILATION_TYPE), \
SRC := $$(patsubst %/,%,$$(dir $$(file))), \
INCLUDE_FILES := $$(notdir $$(file)), \
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$($1_PREFIX)$$(name), \
--- a/make/hotspot/gensrc/GensrcAdlc.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/hotspot/gensrc/GensrcAdlc.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -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
@@ -53,7 +53,7 @@
# Set the C++ standard if supported
ADLC_CFLAGS += $(CXXSTD_CXXFLAG)
-
+
# NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
# hurt.
ADLC_CFLAGS += -DASSERT
@@ -63,6 +63,8 @@
ADLC_CFLAGS += -I$(TOPDIR)/src/hotspot/share
$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
+ NAME := adlc, \
+ TYPE := EXECUTABLE, \
TOOLCHAIN := TOOLCHAIN_BUILD_LINK_CXX, \
SRC := $(TOPDIR)/src/hotspot/share/adlc, \
EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
@@ -71,7 +73,6 @@
LIBS := $(ADLC_LIBS), \
OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
- PROGRAM := adlc, \
DEBUG_SYMBOLS := false, \
DISABLED_WARNINGS_clang := tautological-compare, \
DISABLED_WARNINGS_solstudio := notemsource, \
--- a/make/hotspot/lib/CompileDtracePostJvm.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/hotspot/lib/CompileDtracePostJvm.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -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
@@ -46,6 +46,8 @@
# in the libjvm.so, using JVM_CFLAGS as setup in CompileJvm.gmk. Otherwise
# this would preferrably have been done as a part of GensrcDtrace.gmk.
$(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
+ NAME := dtraceGenOffsets, \
+ TYPE := EXECUTABLE, \
SRC := $(TOPDIR)/make/hotspot/src/native/dtrace, \
CC := $(BUILD_CXX), \
CXX := $(BUILD_CXX), \
@@ -56,7 +58,6 @@
LIBS := -lc, \
OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
- PROGRAM := dtraceGenOffsets, \
))
DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
@@ -156,21 +157,19 @@
# Unfortunately dtrace generates incorrect types for some symbols in
# dtrace_jhelper.o, resulting in "warning: symbol X has differing types"
- # This is tracked in JDK-6890703.
- $(DTRACE_JHELPER_OBJ): $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d \
- $(JVM_OFFSETS_INDEX_H)
+ # See JDK-6890703 for details.
+ # We work around this by fixing the types for these symbols using elfedit,
+ # after dtrace has generated the .o file.
+ JHELPER_DTRACE_SRC := $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d
+ DTRACE_EXTERNAL_SYMBOLS := $(shell $(GREP) ^extern $(JHELPER_DTRACE_SRC) | $(AWK) '{ gsub(";","") ; print $$3 }')
+ DTRACE_ELFEDIT_COMMANDS := $(foreach symbol, $(DTRACE_EXTERNAL_SYMBOLS), \
+ -e 'sym:st_type $(symbol) 1')
+
+ $(DTRACE_JHELPER_OBJ): $(JHELPER_DTRACE_SRC) $(JVM_OFFSETS_INDEX_H)
$(call LogInfo, Running dtrace for $(<F))
$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) $(DTRACE_CPP_FLAGS) -C \
-I$(DTRACE_SUPPORT_DIR) -o $@ -s $<)
-
- # NOTE: We should really do something like this, but unfortunately this
- # results in a compilation error. :-(
- # $(call MakeDir, $(DTRACE_SUPPORT_DIR))
- # $(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, $(CC) -E \
- # $(DTRACE_CPP_FLAGS) -I$(DTRACE_SUPPORT_DIR) $^ \
- # > $(DTRACE_SUPPORT_DIR)/$(@F).d)
- # $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \
- # -s $(DTRACE_SUPPORT_DIR)/$(@F).d)
+ $(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(DTRACE_ELFEDIT_COMMANDS) $@)
############################################################################
# Build the stand-alone dtrace libraries
@@ -178,7 +177,7 @@
LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \
- LIBRARY := jvm_dtrace, \
+ NAME := jvm_dtrace, \
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \
CFLAGS := -m64 -G -mt -KPIC, \
@@ -193,7 +192,7 @@
# Note that libjvm_db.c has tests for COMPILER2, but this was never set by
# the old build.
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \
- LIBRARY := jvm_db, \
+ NAME := jvm_db, \
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \
CFLAGS := -I$(JVM_VARIANT_OUTPUTDIR)/gensrc -I$(DTRACE_SUPPORT_DIR) \
--- a/make/hotspot/lib/CompileGtest.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/hotspot/lib/CompileGtest.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -63,8 +63,8 @@
# exclusive to the gtest libjvm.so.
$(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \
+ NAME := jvm, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
- LIBRARY := jvm, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
SRC := $(GTEST_TEST_SRC), \
@@ -108,7 +108,8 @@
$(eval $(call SetupNativeCompilation, BUILD_GTEST_LAUNCHER, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
- PROGRAM := gtestLauncher, \
+ NAME := gtestLauncher, \
+ TYPE := EXECUTABLE, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
--- a/make/hotspot/lib/CompileJvm.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/hotspot/lib/CompileJvm.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -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
@@ -210,8 +210,8 @@
# Now set up the actual compilation of the main hotspot native library
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
+ NAME := jvm, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
- LIBRARY := jvm, \
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
SRC := $(JVM_SRC_DIRS), \
EXCLUDES := $(JVM_EXCLUDES), \
--- a/make/hotspot/lib/CompileLibjsig.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/hotspot/lib/CompileLibjsig.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -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
@@ -90,7 +90,7 @@
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
$(eval $(call SetupNativeCompilation, BUILD_LIBJSIG, \
- LIBRARY := jsig, \
+ NAME := jsig, \
SRC := $(LIBJSIG_SRC_DIR), \
OUTPUT_DIR := $(LIB_OUTPUTDIR), \
LANG := C, \
--- a/make/jdk/src/classes/build/tools/taglet/ExtLink.java Fri Mar 02 15:02:26 2018 -0800
+++ b/make/jdk/src/classes/build/tools/taglet/ExtLink.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,14 +49,14 @@
* will produce the following html
* <p>
* {@code
- * Please see <a href="https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=Borealis">a spectacular</a> sight.
+ * Please see <a href="https://www.oracle.com/pls/topic/lookup?ctx=javase10&id=Borealis">a spectacular</a> sight.
* }
*/
public class ExtLink implements Taglet {
static final String TAG_NAME = "extLink";
- static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=";
+ static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase10&id=";
static final Pattern TAG_PATTERN = Pattern.compile("(?s)(\\s*)(?<name>\\w+)(\\s+)(?<desc>.*)$");
--- a/make/launcher/Launcher-java.base.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/launcher/Launcher-java.base.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -73,6 +73,8 @@
ifeq ($(OPENJDK_TARGET_OS), linux)
$(eval $(call SetupNativeCompilation, BUILD_JEXEC, \
+ NAME := jexec, \
+ TYPE := EXECUTABLE, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/launcher, \
INCLUDE_FILES := jexec.c, \
OPTIMIZATION := LOW, \
@@ -83,7 +85,6 @@
LDFLAGS := $(LDFLAGS_JDKEXE), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
- PROGRAM := jexec, \
))
TARGETS += $(BUILD_JEXEC)
@@ -93,6 +94,8 @@
ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix), )
$(eval $(call SetupNativeCompilation, BUILD_JSPAWNHELPER, \
+ NAME := jspawnhelper, \
+ TYPE := EXECUTABLE, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKEXE) -I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
@@ -100,7 +103,6 @@
LDFLAGS := $(LDFLAGS_JDKEXE), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jspawnhelper, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
- PROGRAM := jspawnhelper, \
))
TARGETS += $(BUILD_JSPAWNHELPER)
--- a/make/launcher/Launcher-jdk.accessibility.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/launcher/Launcher-jdk.accessibility.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,9 @@
JABSWITCH_SRC := $(TOPDIR)/src/jdk.accessibility/windows/native/jabswitch
ACCESSBRIDGE_SRC := $(TOPDIR)/src/jdk.accessibility/windows/native/common
- $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
+ $(eval $(call SetupNativeCompilation, BUILD_JABSWITCH, \
+ NAME := jabswitch, \
+ TYPE := EXECUTABLE, \
SRC := $(JABSWITCH_SRC), \
INCLUDE_FILES := jabswitch.cpp, \
CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
@@ -44,7 +46,6 @@
LIBS := advapi32.lib version.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jabswitch, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
- PROGRAM := jabswitch, \
VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRC)/AccessBridgeStatusWindow.RC, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=jabswitch.exe" \
@@ -70,6 +71,8 @@
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
$$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
+ NAME := jaccessinspector$1, \
+ TYPE := EXECUTABLE, \
SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/bridge, \
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
@@ -77,7 +80,6 @@
LIBS := advapi32.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
- PROGRAM := jaccessinspector$1, \
VERSIONINFO_RESOURCE := $(TOPDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
RC_FLAGS := $$(RC_FLAGS) \
-D "JDK_FNAME=jaccessinspector$1.exe" \
@@ -96,7 +98,9 @@
# Parameter 1 File name suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
- $$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
+ $$(eval $$(call SetupNativeCompilation, BUILD_JACCESSWALKER$1, \
+ NAME := jaccesswalker$1, \
+ TYPE := EXECUTABLE, \
SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/bridge, \
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
@@ -104,7 +108,6 @@
LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
- PROGRAM := jaccesswalker$1, \
VERSIONINFO_RESOURCE := $(TOPDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
RC_FLAGS := $$(RC_FLAGS) \
-D "JDK_FNAME=jaccesswalker$1.exe" \
--- a/make/launcher/Launcher-jdk.pack.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/launcher/Launcher-jdk.pack.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,9 @@
UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200
endif
-$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
+$(eval $(call SetupNativeCompilation, BUILD_UNPACKEXE, \
+ NAME := unpack200, \
+ TYPE := EXECUTABLE, \
SRC := $(UNPACKEXE_SRC), \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
OPTIMIZATION := LOW, \
@@ -91,7 +93,6 @@
LIBS_solaris := -lc, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
- PROGRAM := unpack200, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=unpack200.exe" \
--- a/make/launcher/LauncherCommon.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/launcher/LauncherCommon.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -183,6 +183,8 @@
endif
$$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \
+ NAME := $1, \
+ TYPE := EXECUTABLE, \
EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
OPTIMIZATION := $$($1_OPTIMIZATION), \
CFLAGS := $$($1_CFLAGS) \
@@ -211,7 +213,6 @@
$$($1_LIBS_windows), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
- PROGRAM := $1, \
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
RC_FLAGS := $$(RC_FLAGS) \
-D "JDK_FNAME=$1$(EXE_SUFFIX)" \
--- a/make/lib/Awt2dLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Awt2dLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -48,8 +48,8 @@
BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
- LIBRARY := mlib_image, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMLIB_IMAGE, \
+ NAME := mlib_image, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(BUILD_LIBMLIB_SRC), \
EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
@@ -107,8 +107,8 @@
LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
- $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
- LIBRARY := mlib_image_v, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBMLIB_IMAGE_V, \
+ NAME := mlib_image_v, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBMLIB_IMAGE_V_SRC), \
EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
@@ -226,8 +226,8 @@
LIBAWT_CFLAGS += -fgcse-after-reload
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
- LIBRARY := awt, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBAWT, \
+ NAME := awt, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBAWT_DIRS), \
EXCLUDES := $(LIBAWT_EXCLUDES), \
@@ -347,8 +347,8 @@
BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
endif
- $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
- LIBRARY := awt_xawt, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBAWT_XAWT, \
+ NAME := awt_xawt, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBAWT_XAWT_DIRS), \
EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
@@ -406,8 +406,8 @@
LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
- LIBRARY := lcms, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBLCMS, \
+ NAME := lcms, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBLCMS_SRC), \
INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
@@ -483,8 +483,8 @@
BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
- LIBRARY := javajpeg, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJAVAJPEG, \
+ NAME := javajpeg, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJAVAJPEG_SRC), \
INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
@@ -547,8 +547,8 @@
endif
endif
- $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
- LIBRARY := awt_headless, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBAWT_HEADLESS, \
+ NAME := awt_headless, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBAWT_HEADLESS_DIRS), \
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
@@ -657,8 +657,8 @@
BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
- LIBRARY := fontmanager, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBFONTMANAGER, \
+ NAME := fontmanager, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
SRC := $(LIBFONTMANAGER_SRC), \
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
@@ -691,7 +691,7 @@
LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
LIBS_linux := -lc, \
- LIBS_solaris := -lawt_headless -lc, \
+ LIBS_solaris := -lc, \
LIBS_aix := -lawt_headless,\
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
$(WIN_AWT_LIB), \
@@ -744,8 +744,8 @@
ifeq ($(OPENJDK_TARGET_CPU), x86)
KERNEL32_LIB := kernel32.lib
endif
- $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
- LIBRARY := jawt, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJAWT, \
+ NAME := jawt, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJAWT_SRC), \
INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
@@ -804,8 +804,8 @@
endif
endif
- $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
- LIBRARY := jawt, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJAWT, \
+ NAME := jawt, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJAWT_SRC), \
INCLUDE_FILES := $(JAWT_FILES), \
@@ -935,8 +935,8 @@
LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
endif
- $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \
- LIBRARY := splashscreen, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBSPLASHSCREEN, \
+ NAME := splashscreen, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBSPLASHSCREEN_DIRS), \
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
@@ -1008,8 +1008,8 @@
LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
- $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
- LIBRARY := awt_lwawt, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBAWT_LWAWT, \
+ NAME := awt_lwawt, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBAWT_LWAWT_DIRS), \
INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
@@ -1057,8 +1057,8 @@
ifeq ($(OPENJDK_TARGET_OS), macosx)
- $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
- LIBRARY := osxui, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBOSXUI, \
+ NAME := osxui, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxui, \
OPTIMIZATION := LOW, \
--- a/make/lib/CoreLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/CoreLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -55,8 +55,9 @@
LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC)
ifneq ($(OPENJDK_TARGET_OS), macosx)
- $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
- STATIC_LIBRARY := fdlibm, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \
+ NAME := fdlibm, \
+ TYPE := STATIC_LIBRARY, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
SRC := $(LIBFDLIBM_SRC), \
OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
@@ -77,8 +78,8 @@
# On macosx the old build does partial (incremental) linking of fdlibm instead of
# a plain static library.
- $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
- LIBRARY := fdlibm, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM_MAC, \
+ NAME := fdlibm, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
SRC := $(LIBFDLIBM_SRC), \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
@@ -107,8 +108,8 @@
endif
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
- LIBRARY := verify, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBVERIFY, \
+ NAME := verify, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/java.base/share/native/libverify, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
@@ -155,8 +156,8 @@
endif
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
- LIBRARY := java, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJAVA, \
+ NAME := java, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJAVA_SRC_DIRS), \
OPTIMIZATION := HIGH, \
@@ -218,8 +219,8 @@
BUILD_LIBZIP_MMAP := -DUSE_MMAP
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
- LIBRARY := zip, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBZIP, \
+ NAME := zip, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
OPTIMIZATION := LOW, \
SRC := $(TOPDIR)/src/java.base/share/native/libzip, \
@@ -262,8 +263,8 @@
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
#
-$(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
- LIBRARY := jimage, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJIMAGE, \
+ NAME := jimage, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
OPTIMIZATION := LOW, \
@@ -358,8 +359,8 @@
)
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
- LIBRARY := jli, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJLI, \
+ NAME := jli, \
OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
SRC := $(LIBJLI_SRC_DIRS), \
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
@@ -415,8 +416,9 @@
# with the shared library, so the static library is given a different name. No harm
# in doing it for all platform to reduce complexity.
ifeq ($(OPENJDK_TARGET_OS), windows)
- $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
- STATIC_LIBRARY := jli_static, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+ NAME := jli_static, \
+ TYPE := STATIC_LIBRARY, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
SRC := $(LIBJLI_SRC_DIRS), \
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
@@ -434,8 +436,8 @@
# On macosx they do partial (incremental) linking of libjli_static.a
# code it here...rather than add support to NativeCompilation
# as this is first time I see it
- $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
- LIBRARY := jli_static, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+ NAME := jli_static, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
SRC := $(LIBJLI_SRC_DIRS), \
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
@@ -457,8 +459,9 @@
else ifeq ($(OPENJDK_TARGET_OS), aix)
# AIX also requires a static libjli because the compiler doesn't support '-rpath'
- $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
- STATIC_LIBRARY := jli_static, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+ NAME := jli_static, \
+ TYPE := STATIC_LIBRARY, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
SRC := $(LIBJLI_SRC_DIRS), \
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
--- a/make/lib/Lib-java.instrument.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-java.instrument.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -49,8 +49,8 @@
LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
- LIBRARY := instrument, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBINSTRUMENT, \
+ NAME := instrument, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBINSTRUMENT_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-java.management.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-java.management.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -44,8 +44,8 @@
endif
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
- LIBRARY := management, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMANAGEMENT, \
+ NAME := management, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBMANAGEMENT_SRC), \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
--- a/make/lib/Lib-java.prefs.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-java.prefs.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_TYPE)/native/libprefs
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBPREFS, \
- LIBRARY := prefs, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBPREFS, \
+ NAME := prefs, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBPREF_SRC_DIRS), \
OPTIMIZATION := HIGH, \
--- a/make/lib/Lib-java.rmi.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-java.rmi.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
################################################################################
-$(eval $(call SetupNativeCompilation,BUILD_LIBRMI, \
- LIBRARY := rmi, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBRMI, \
+ NAME := rmi, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/java.rmi/share/native/librmi, \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-java.security.jgss.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-java.security.jgss.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,8 @@
$(TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_TYPE)/native/libj2gss \
#
- $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
- LIBRARY := j2gss, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJ2GSS, \
+ NAME := j2gss, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJ2GSS_SRC), \
OPTIMIZATION := LOW, \
@@ -74,8 +74,8 @@
ifneq ($(BUILD_LIBKRB5_NAME), )
# libosxkrb5 needs to call deprecated krb5 APIs so that java
# can use the native credentials cache.
- $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
- LIBRARY := $(BUILD_LIBKRB5_NAME), \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBKRB5, \
+ NAME := $(BUILD_LIBKRB5_NAME), \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(BUILD_LIBKRB5_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-java.smartcardio.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-java.smartcardio.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
-I$(TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc/MUSCLE \
-I$(SUPPORT_OUTPUTDIR)/headers/java.smartcardio
-$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
- LIBRARY := j2pcsc, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJ2PCSC, \
+ NAME := j2pcsc, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJ2PCSC_SRC), \
CFLAGS_unix := -D__sun_jdk, \
--- a/make/lib/Lib-jdk.accessibility.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.accessibility.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -41,8 +41,8 @@
# Parameter 1 Suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
- $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
- LIBRARY = javaaccessbridge$1, \
+ $(call SetupNativeCompilation, BUILD_JAVAACCESSBRIDGE$1, \
+ NAME := javaaccessbridge$1, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(JAVA_AB_SRCDIR), \
OPTIMIZATION := LOW, \
@@ -71,8 +71,8 @@
define SetupWinDLL
# Parameter 1 Suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
- $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \
- LIBRARY = windowsaccessbridge$1, \
+ $(call SetupNativeCompilation, BUILD_WINDOWSACCESSBRIDGE$1, \
+ NAME := windowsaccessbridge$1, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(WIN_AB_SRCDIR), \
OPTIMIZATION := LOW, \
@@ -99,8 +99,8 @@
define SetupAccessBridgeSysInfo
- $(call SetupNativeCompilation,BUILD_ACCESSBRIDGESYSINFO, \
- LIBRARY = jabsysinfo, \
+ $(call SetupNativeCompilation, BUILD_ACCESSBRIDGESYSINFO, \
+ NAME := jabsysinfo, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(SYSINFO_SRCDIR), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.attach.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.attach.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,8 +34,8 @@
LIBATTACH_CFLAGS := -DPSAPI_VERSION=1
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \
- LIBRARY := attach, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBATTACH, \
+ NAME := attach, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(call FindSrcDirsForLib, jdk.attach, attach), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.crypto.cryptoki.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.crypto.cryptoki.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,8 @@
LIBJ2PKCS11_SRC := $(TOPDIR)/src/jdk.crypto.cryptoki/share/native/libj2pkcs11 \
$(TOPDIR)/src/jdk.crypto.cryptoki/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pkcs11
-$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
- LIBRARY := j2pkcs11, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJ2PKCS11, \
+ NAME := j2pkcs11, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJ2PKCS11_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.crypto.ec.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.crypto.ec.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -43,8 +43,8 @@
ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl
endif
- $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \
- LIBRARY := sunec, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBSUNEC, \
+ NAME := sunec, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBSUNEC_SRC), \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
--- a/make/lib/Lib-jdk.crypto.mscapi.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.crypto.mscapi.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
LIBSUNMSCAPI_SRC := $(TOPDIR)/src/jdk.crypto.mscapi/$(OPENJDK_TARGET_OS_TYPE)/native/libsunmscapi
- $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \
- LIBRARY := sunmscapi, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBSUNMSCAPI, \
+ NAME := sunmscapi, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBSUNMSCAPI_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.crypto.ucrypto.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.crypto.ucrypto.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
LIBJ2UCRYPTO_SRC := $(TOPDIR)/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto
- $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \
- LIBRARY := j2ucrypto, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJ2UCRYPTO, \
+ NAME := j2ucrypto, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJ2UCRYPTO_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.hotspot.agent.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -98,12 +98,12 @@
################################################################################
$(eval $(call SetupNativeCompilation, BUILD_LIBSA, \
+ NAME := $(SA_NAME), \
TOOLCHAIN := $(SA_TOOLCHAIN), \
OPTIMIZATION := NONE, \
DISABLED_WARNINGS_microsoft := 4267, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
- LIBRARY := $(SA_NAME), \
OUTPUT_DIR := $(call FindLibDirForModule, $(MODULE)), \
SRC := $(SA_SRC), \
EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \
--- a/make/lib/Lib-jdk.internal.le.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.internal.le.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,8 @@
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.internal.le \
#
- $(eval $(call SetupNativeCompilation,BUILD_LIBLE, \
- LIBRARY := le, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBLE, \
+ NAME := le, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBLE_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.jdi.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.jdi.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,8 @@
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.jdi \
#
- $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM, \
- LIBRARY := dt_shmem, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBDT_SHMEM, \
+ NAME := dt_shmem, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBDT_SHMEM_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.jdwp.agent.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,8 @@
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
#
-$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \
- LIBRARY := dt_socket, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBDT_SOCKET, \
+ NAME := dt_socket, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBDT_SOCKET_SRC), \
OPTIMIZATION := LOW, \
@@ -73,8 +73,8 @@
$(addprefix -I, $(LIBJDWP_SRC))
# JDWP_LOGGING causes log messages to be compiled into the library.
-$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \
- LIBRARY := jdwp, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJDWP, \
+ NAME := jdwp, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJDWP_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.management.agent.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.management.agent.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
$(LIBJAVA_HEADER_FLAGS) \
#
-$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_AGENT, \
- LIBRARY := management_agent, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMANAGEMENT_AGENT, \
+ NAME := management_agent, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBMANAGEMENT_AGENT_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.management.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.management.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -53,8 +53,8 @@
endif
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_EXT, \
- LIBRARY := management_ext, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMANAGEMENT_EXT, \
+ NAME := management_ext, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBMANAGEMENT_EXT_SRC), \
LANG := C, \
--- a/make/lib/Lib-jdk.net.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.net.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
ifeq ($(OPENJDK_TARGET_OS), solaris)
$(eval $(call SetupNativeCompilation, BUILD_LIBEXTNET, \
- LIBRARY := extnet, \
+ NAME := extnet, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/jdk.net/solaris/native/libextnet, \
OPTIMIZATION := LOW, \
@@ -51,7 +51,7 @@
ifeq ($(OPENJDK_TARGET_OS), linux)
$(eval $(call SetupNativeCompilation, BUILD_LIBEXTNET, \
- LIBRARY := extnet, \
+ NAME := extnet, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/jdk.net/linux/native/libextnet, \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.pack.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.pack.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
################################################################################
-$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
- LIBRARY := unpack, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBUNPACK, \
+ NAME := unpack, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/jdk.pack/share/native/libunpack \
$(TOPDIR)/src/jdk.pack/share/native/common-unpack, \
--- a/make/lib/Lib-jdk.sctp.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.sctp.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,8 @@
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
- $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
- LIBRARY := sctp, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBSCTP, \
+ NAME := sctp, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_TYPE)/native/libsctp, \
OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.security.auth.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/Lib-jdk.security.auth.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,8 @@
LIBJAAS_NAME := jaas_nt
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \
- LIBRARY := $(LIBJAAS_NAME), \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJAAS, \
+ NAME := $(LIBJAAS_NAME), \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(call FindSrcDirsForLib, jdk.security.auth, jaas), \
OPTIMIZATION := LOW, \
--- a/make/lib/LibosxLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/LibosxLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,8 +34,8 @@
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
#
- $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
- LIBRARY := osx, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBOSX, \
+ NAME := osx, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBOSX_DIRS), \
OPTIMIZATION := LOW, \
--- a/make/lib/NetworkingLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/NetworkingLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
LIBNET_SRC_DIRS := $(call FindSrcDirsForLib, java.base, net)
-$(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
- LIBRARY := net, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBNET, \
+ NAME := net, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBNET_SRC_DIRS), \
OPTIMIZATION := LOW, \
--- a/make/lib/NioLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/NioLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -56,8 +56,8 @@
BUILD_LIBNIO_MAPFILE := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
endif
-$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
- LIBRARY := nio, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBNIO, \
+ NAME := nio, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(BUILD_LIBNIO_SRC), \
EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
--- a/make/lib/PlatformLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/PlatformLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,8 @@
LIBOSXAPP_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxapp
- $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \
- LIBRARY := osxapp, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBOSXAPP, \
+ NAME := osxapp, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBOSXAPP_SRC), \
OPTIMIZATION := LOW, \
--- a/make/lib/SecurityLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/SecurityLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
include LibCommon.gmk
ifeq ($(OPENJDK_TARGET_OS), macosx)
- # JavaNativeFoundation framework not supported in static builds
+ # JavaNativeFoundation framework not supported in static builds
ifneq ($(STATIC_BUILD), true)
################################################################################
@@ -36,8 +36,8 @@
$(LIBJAVA_HEADER_FLAGS) \
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
- $(eval $(call SetupNativeCompilation,BUILD_LIBOSXSECURITY, \
- LIBRARY := osxsecurity, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBOSXSECURITY, \
+ NAME := osxsecurity, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBOSXSECURITY_DIRS), \
OPTIMIZATION := LOW, \
--- a/make/lib/SoundLibraries.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/lib/SoundLibraries.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -114,8 +114,8 @@
LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
-$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
- LIBRARY := jsound, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJSOUND, \
+ NAME := jsound, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJSOUND_SRC_DIRS), \
INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \
@@ -149,8 +149,8 @@
ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), )
- $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \
- LIBRARY := jsoundalsa, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJSOUNDALSA, \
+ NAME := jsoundalsa, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJSOUND_SRC_DIRS), \
INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
@@ -186,8 +186,8 @@
ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), )
- $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \
- LIBRARY := jsoundds, \
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJSOUNDDS, \
+ NAME := jsoundds, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBJSOUND_SRC_DIRS), \
INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
--- a/make/test/BuildFailureHandler.gmk Fri Mar 02 15:02:26 2018 -0800
+++ b/make/test/BuildFailureHandler.gmk Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupNativeCompilation, BUILD_LIBTIMEOUT_HANDLER, \
- LIBRARY := timeoutHandler, \
+ NAME := timeoutHandler, \
SRC := $(FH_BASEDIR)/src/windows/native/libtimeoutHandler, \
OBJECT_DIR := $(FH_SUPPORT)/libtimeoutHandler, \
OUTPUT_DIR := $(FH_SUPPORT), \
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp Fri Mar 02 15:02:26 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp Fri Mar 02 21:00:12 2018 +0100
@@ -587,6 +587,20 @@
return;
}
+ // While we are processing RSet buffers during the collection, we
+ // actually don't want to scan any cards on the collection set,
+ // since we don't want to update remembered sets with entries that
+ // point into the collection set, given that live objects from the
+ // collection set are about to move and such entries will be stale
+ // very soon. This change also deals with a reliability issue which
+ // involves scanning a card in the collection set and coming across
+ // an array that was being chunked and looking malformed. Note,
+ // however, that if evacuation fails, we have to scan any objects
+ // that were not moved and create any missing entries.
+ if (r->in_collection_set()) {
+ return;
+ }
+
// The result from the hot card cache insert call is either:
// * pointer to the current card
// (implying that the current card is not 'hot'),
@@ -611,7 +625,8 @@
// Check whether the region formerly in the cache should be
// ignored, as discussed earlier for the original card. The
- // region could have been freed while in the cache.
+ // region could have been freed while in the cache. The cset is
+ // not relevant here, since we're in concurrent phase.
if (!r->is_old_or_humongous()) {
return;
}
--- a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,6 +89,29 @@
}
/**
+ * Compares the objects of two AbstractStringBuilder implementations lexicographically.
+ *
+ * @since 11
+ */
+ int compareTo(AbstractStringBuilder another) {
+ if (this == another) {
+ return 0;
+ }
+
+ byte val1[] = value;
+ byte val2[] = another.value;
+ int count1 = this.count;
+ int count2 = another.count;
+
+ if (coder == another.coder) {
+ return isLatin1() ? StringLatin1.compareTo(val1, val2, count1, count2)
+ : StringUTF16.compareTo(val1, val2, count1, count2);
+ }
+ return isLatin1() ? StringLatin1.compareToUTF16(val1, val2, count1, count2)
+ : StringUTF16.compareToLatin1(val1, val2, count1, count2);
+ }
+
+ /**
* Returns the length (character count).
*
* @return the length of the sequence of characters currently
--- a/src/java.base/share/classes/java/lang/CharSequence.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/CharSequence.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
package java.lang;
import java.util.NoSuchElementException;
+import java.util.Objects;
import java.util.PrimitiveIterator;
import java.util.Spliterator;
import java.util.Spliterators;
@@ -43,9 +44,9 @@
*
* <p> This interface does not refine the general contracts of the {@link
* java.lang.Object#equals(java.lang.Object) equals} and {@link
- * java.lang.Object#hashCode() hashCode} methods. The result of comparing two
- * objects that implement {@code CharSequence} is therefore, in general,
- * undefined. Each object may be implemented by a different class, and there
+ * java.lang.Object#hashCode() hashCode} methods. The result of testing two objects
+ * that implement {@code CharSequence} for equality is therefore, in general, undefined.
+ * Each object may be implemented by a different class, and there
* is no guarantee that each class will be capable of testing its instances
* for equality with those of the other. It is therefore inappropriate to use
* arbitrary {@code CharSequence} instances as elements in a set or as keys in
@@ -237,4 +238,54 @@
Spliterator.ORDERED,
false);
}
+
+ /**
+ * Compares two {@code CharSequence} instances lexicographically. Returns a
+ * negative value, zero, or a positive value if the first sequence is lexicographically
+ * less than, equal to, or greater than the second, respectively.
+ *
+ * <p>
+ * The lexicographical ordering of {@code CharSequence} is defined as follows.
+ * Consider a {@code CharSequence} <i>cs</i> of length <i>len</i> to be a
+ * sequence of char values, <i>cs[0]</i> to <i>cs[len-1]</i>. Suppose <i>k</i>
+ * is the lowest index at which the corresponding char values from each sequence
+ * differ. The lexicographic ordering of the sequences is determined by a numeric
+ * comparison of the char values <i>cs1[k]</i> with <i>cs2[k]</i>. If there is
+ * no such index <i>k</i>, the shorter sequence is considered lexicographically
+ * less than the other. If the sequences have the same length, the sequences are
+ * considered lexicographically equal.
+ *
+ *
+ * @param cs1 the first {@code CharSequence}
+ * @param cs2 the second {@code CharSequence}
+ *
+ * @return the value {@code 0} if the two {@code CharSequence} are equal;
+ * a negative integer if the first {@code CharSequence}
+ * is lexicographically less than the second; or a
+ * positive integer if the first {@code CharSequence} is
+ * lexicographically greater than the second.
+ *
+ * @since 11
+ */
+ @SuppressWarnings("unchecked")
+ public static int compare(CharSequence cs1, CharSequence cs2) {
+ if (Objects.requireNonNull(cs1) == Objects.requireNonNull(cs2)) {
+ return 0;
+ }
+
+ if (cs1.getClass() == cs2.getClass() && cs1 instanceof Comparable) {
+ return ((Comparable<Object>) cs1).compareTo(cs2);
+ }
+
+ for (int i = 0, len = Math.min(cs1.length(), cs2.length()); i < len; i++) {
+ char a = cs1.charAt(i);
+ char b = cs2.charAt(i);
+ if (a != b) {
+ return a - b;
+ }
+ }
+
+ return cs1.length() - cs2.length();
+ }
+
}
--- a/src/java.base/share/classes/java/lang/String.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/String.java Fri Mar 02 21:00:12 2018 +0100
@@ -2963,6 +2963,56 @@
*/
public native String intern();
+ /**
+ * Returns a string whose value is the concatenation of this
+ * string repeated {@code count} times.
+ * <p>
+ * If this string is empty or count is zero then the empty
+ * string is returned.
+ *
+ * @param count number of times to repeat
+ *
+ * @return A string composed of this string repeated
+ * {@code count} times or the empty string if this
+ * string is empty or count is zero
+ *
+ * @throws IllegalArgumentException if the {@code count} is
+ * negative.
+ *
+ * @since 11
+ */
+ public String repeat(int count) {
+ if (count < 0) {
+ throw new IllegalArgumentException("count is negative: " + count);
+ }
+ if (count == 1) {
+ return this;
+ }
+ final int len = value.length;
+ if (len == 0 || count == 0) {
+ return "";
+ }
+ if (len == 1) {
+ final byte[] single = new byte[count];
+ Arrays.fill(single, value[0]);
+ return new String(single, coder);
+ }
+ if (Integer.MAX_VALUE / count < len) {
+ throw new OutOfMemoryError("Repeating " + len + " bytes String " + count +
+ " times will produce a String exceeding maximum size.");
+ }
+ final int limit = len * count;
+ final byte[] multiple = new byte[limit];
+ System.arraycopy(value, 0, multiple, 0, len);
+ int copied = len;
+ for (int next = copied << 1; next < limit && 0 < next; next = next << 1) {
+ System.arraycopy(multiple, 0, multiple, copied, copied);
+ copied = next;
+ }
+ System.arraycopy(multiple, 0, multiple, copied, limit - copied);
+ return new String(multiple, coder);
+ }
+
////////////////////////////////////////////////////////////////
/**
--- a/src/java.base/share/classes/java/lang/StringBuffer.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/StringBuffer.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -90,6 +90,14 @@
* this one, as it supports all of the same operations but it is faster, as
* it performs no synchronization.
*
+ * @apiNote
+ * {@code StringBuffer} implements {@code Comparable} but does not override
+ * {@link Object#equals equals}. Thus, the natural ordering of {@code StringBuffer}
+ * is inconsistent with equals. Care should be exercised if {@code StringBuffer}
+ * objects are used as keys in a {@code SortedMap} or elements in a {@code SortedSet}.
+ * See {@link Comparable}, {@link java.util.SortedMap SortedMap}, or
+ * {@link java.util.SortedSet SortedSet} for more information.
+ *
* @author Arthur van Hoff
* @see java.lang.StringBuilder
* @see java.lang.String
@@ -97,7 +105,7 @@
*/
public final class StringBuffer
extends AbstractStringBuilder
- implements java.io.Serializable, CharSequence
+ implements java.io.Serializable, Comparable<StringBuffer>, CharSequence
{
/**
@@ -162,6 +170,35 @@
append(seq);
}
+ /**
+ * Compares two {@code StringBuffer} instances lexicographically. This method
+ * follows the same rules for lexicographical comparison as defined in the
+ * {@linkplain java.lang.CharSequence#compare(java.lang.CharSequence,
+ * java.lang.CharSequence) CharSequence.compare(this, another)} method.
+ *
+ * <p>
+ * For finer-grained, locale-sensitive String comparison, refer to
+ * {@link java.text.Collator}.
+ *
+ * @implNote
+ * This method synchronizes on {@code this}, the current object, but not
+ * {@code StringBuffer another} with which {@code this StringBuffer} is compared.
+ *
+ * @param another the {@code StringBuffer} to be compared with
+ *
+ * @return the value {@code 0} if this {@code StringBuffer} contains the same
+ * character sequence as that of the argument {@code StringBuffer}; a negative integer
+ * if this {@code StringBuffer} is lexicographically less than the
+ * {@code StringBuffer} argument; or a positive integer if this {@code StringBuffer}
+ * is lexicographically greater than the {@code StringBuffer} argument.
+ *
+ * @since 11
+ */
+ @Override
+ public synchronized int compareTo(StringBuffer another) {
+ return super.compareTo(another);
+ }
+
@Override
public synchronized int length() {
return count;
--- a/src/java.base/share/classes/java/lang/StringBuilder.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/StringBuilder.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,14 @@
* or method in this class will cause a {@link NullPointerException} to be
* thrown.
*
+ * @apiNote
+ * {@code StringBuilder} implements {@code Comparable} but does not override
+ * {@link Object#equals equals}. Thus, the natural ordering of {@code StringBuilder}
+ * is inconsistent with equals. Care should be exercised if {@code StringBuilder}
+ * objects are used as keys in a {@code SortedMap} or elements in a {@code SortedSet}.
+ * See {@link Comparable}, {@link java.util.SortedMap SortedMap}, or
+ * {@link java.util.SortedSet SortedSet} for more information.
+ *
* @author Michael McCloskey
* @see java.lang.StringBuffer
* @see java.lang.String
@@ -76,7 +84,7 @@
*/
public final class StringBuilder
extends AbstractStringBuilder
- implements java.io.Serializable, CharSequence
+ implements java.io.Serializable, Comparable<StringBuilder>, CharSequence
{
/** use serialVersionUID for interoperability */
@@ -130,6 +138,31 @@
append(seq);
}
+ /**
+ * Compares two {@code StringBuilder} instances lexicographically. This method
+ * follows the same rules for lexicographical comparison as defined in the
+ * {@linkplain java.lang.CharSequence#compare(java.lang.CharSequence,
+ * java.lang.CharSequence) CharSequence.compare(this, another)} method.
+ *
+ * <p>
+ * For finer-grained, locale-sensitive String comparison, refer to
+ * {@link java.text.Collator}.
+ *
+ * @param another the {@code StringBuilder} to be compared with
+ *
+ * @return the value {@code 0} if this {@code StringBuilder} contains the same
+ * character sequence as that of the argument {@code StringBuilder}; a negative integer
+ * if this {@code StringBuilder} is lexicographically less than the
+ * {@code StringBuilder} argument; or a positive integer if this {@code StringBuilder}
+ * is lexicographically greater than the {@code StringBuilder} argument.
+ *
+ * @since 11
+ */
+ @Override
+ public int compareTo(StringBuilder another) {
+ return super.compareTo(another);
+ }
+
@Override
public StringBuilder append(Object obj) {
return append(String.valueOf(obj));
--- a/src/java.base/share/classes/java/lang/StringLatin1.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/StringLatin1.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,6 +103,10 @@
public static int compareTo(byte[] value, byte[] other) {
int len1 = value.length;
int len2 = other.length;
+ return compareTo(value, other, len1, len2);
+ }
+
+ public static int compareTo(byte[] value, byte[] other, int len1, int len2) {
int lim = Math.min(len1, len2);
for (int k = 0; k < lim; k++) {
if (value[k] != other[k]) {
@@ -116,6 +120,20 @@
public static int compareToUTF16(byte[] value, byte[] other) {
int len1 = length(value);
int len2 = StringUTF16.length(other);
+ return compareToUTF16Values(value, other, len1, len2);
+ }
+
+ /*
+ * Checks the boundary and then compares the byte arrays.
+ */
+ public static int compareToUTF16(byte[] value, byte[] other, int len1, int len2) {
+ checkOffset(len1, length(value));
+ checkOffset(len2, StringUTF16.length(other));
+
+ return compareToUTF16Values(value, other, len1, len2);
+ }
+
+ private static int compareToUTF16Values(byte[] value, byte[] other, int len1, int len2) {
int lim = Math.min(len1, len2);
for (int k = 0; k < lim; k++) {
char c1 = getChar(value, k);
--- a/src/java.base/share/classes/java/lang/StringUTF16.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/StringUTF16.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -273,6 +273,20 @@
public static int compareTo(byte[] value, byte[] other) {
int len1 = length(value);
int len2 = length(other);
+ return compareValues(value, other, len1, len2);
+ }
+
+ /*
+ * Checks the boundary and then compares the byte arrays.
+ */
+ public static int compareTo(byte[] value, byte[] other, int len1, int len2) {
+ checkOffset(len1, value);
+ checkOffset(len2, other);
+
+ return compareValues(value, other, len1, len2);
+ }
+
+ private static int compareValues(byte[] value, byte[] other, int len1, int len2) {
int lim = Math.min(len1, len2);
for (int k = 0; k < lim; k++) {
char c1 = getChar(value, k);
@@ -289,6 +303,10 @@
return -StringLatin1.compareToUTF16(other, value);
}
+ public static int compareToLatin1(byte[] value, byte[] other, int len1, int len2) {
+ return -StringLatin1.compareToUTF16(other, value, len2, len1);
+ }
+
public static int compareToCI(byte[] value, byte[] other) {
int len1 = length(value);
int len2 = length(other);
--- a/src/java.base/share/classes/java/lang/Thread.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/Thread.java Fri Mar 02 21:00:12 2018 +0100
@@ -1007,22 +1007,22 @@
* @spec JSR-51
*/
public void interrupt() {
- Thread me = Thread.currentThread();
- if (this != me)
+ if (this != Thread.currentThread()) {
checkAccess();
+ // thread may be blocked in an I/O operation
+ synchronized (blockerLock) {
+ Interruptible b = blocker;
+ if (b != null) {
+ interrupt0(); // set interrupt status
+ b.interrupt(this);
+ return;
+ }
+ }
+ }
+
// set interrupt status
interrupt0();
-
- // thread may be blocked in an I/O operation
- if (this != me && blocker != null) {
- synchronized (blockerLock) {
- Interruptible b = blocker;
- if (b != null) {
- b.interrupt(this);
- }
- }
- }
}
/**
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Fri Mar 02 21:00:12 2018 +0100
@@ -93,6 +93,10 @@
private ClassWriter cw;
private MethodVisitor mv;
+ /** Single element internal class name lookup cache. */
+ private Class<?> lastClass;
+ private String lastInternalName;
+
private static final MemberName.Factory MEMBERNAME_FACTORY = MemberName.getFactory();
private static final Class<?> HOST_CLASS = LambdaForm.class;
@@ -602,13 +606,18 @@
mv.visitInsn(opcode);
}
- private static String getInternalName(Class<?> c) {
+ private String getInternalName(Class<?> c) {
if (c == Object.class) return OBJ;
else if (c == Object[].class) return OBJARY;
else if (c == Class.class) return CLS;
else if (c == MethodHandle.class) return MH;
assert(VerifyAccess.isTypeVisible(c, Object.class)) : c.getName();
- return c.getName().replace('.', '/');
+
+ if (c == lastClass) {
+ return lastInternalName;
+ }
+ lastClass = c;
+ return lastInternalName = c.getName().replace('.', '/');
}
private static MemberName resolveFrom(String name, MethodType type, Class<?> holder) {
--- a/src/java.base/share/classes/java/net/URLClassLoader.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/net/URLClassLoader.java Fri Mar 02 21:00:12 2018 +0100
@@ -105,7 +105,8 @@
* @exception SecurityException if a security manager exists and its
* {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
- * @exception NullPointerException if {@code urls} is {@code null}.
+ * @exception NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
* @see SecurityManager#checkCreateClassLoader
*/
public URLClassLoader(URL[] urls, ClassLoader parent) {
@@ -149,7 +150,8 @@
* @exception SecurityException if a security manager exists and its
* {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
- * @exception NullPointerException if {@code urls} is {@code null}.
+ * @exception NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
* @see SecurityManager#checkCreateClassLoader
*/
public URLClassLoader(URL[] urls) {
@@ -192,7 +194,8 @@
* @exception SecurityException if a security manager exists and its
* {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
- * @exception NullPointerException if {@code urls} is {@code null}.
+ * @exception NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
* @see SecurityManager#checkCreateClassLoader
*/
public URLClassLoader(URL[] urls, ClassLoader parent,
@@ -221,7 +224,8 @@
* @param parent the parent class loader for delegation
*
* @throws IllegalArgumentException if the given name is empty.
- * @throws NullPointerException if {@code urls} is {@code null}.
+ * @throws NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
*
* @throws SecurityException if a security manager exists and its
* {@link SecurityManager#checkCreateClassLoader()} method doesn't
@@ -256,7 +260,8 @@
* @param factory the URLStreamHandlerFactory to use when creating URLs
*
* @throws IllegalArgumentException if the given name is empty.
- * @throws NullPointerException if {@code urls} is {@code null}.
+ * @throws NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
*
* @throws SecurityException if a security manager exists and its
* {@code checkCreateClassLoader} method doesn't allow
@@ -805,7 +810,8 @@
*
* @param urls the URLs to search for classes and resources
* @param parent the parent class loader for delegation
- * @exception NullPointerException if {@code urls} is {@code null}.
+ * @exception NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
* @return the resulting class loader
*/
public static URLClassLoader newInstance(final URL[] urls,
@@ -831,7 +837,8 @@
* loading the class.
*
* @param urls the URLs to search for classes and resources
- * @exception NullPointerException if {@code urls} is {@code null}.
+ * @exception NullPointerException if {@code urls} or any of its
+ * elements is {@code null}.
* @return the resulting class loader
*/
public static URLClassLoader newInstance(final URL[] urls) {
--- a/src/java.base/share/classes/java/nio/charset/CoderResult.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/nio/charset/CoderResult.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,8 @@
import java.lang.ref.WeakReference;
import java.nio.*;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.Map;
-import java.util.HashMap;
-
/**
* A description of the result state of a coder.
@@ -197,14 +196,12 @@
protected abstract CoderResult create(int len);
- private synchronized CoderResult get(int len) {
- if (len <= 0)
- throw new IllegalArgumentException("Non-positive length");
+ private CoderResult get(int len) {
Integer k = len;
WeakReference<CoderResult> w;
CoderResult e = null;
if (cache == null) {
- cache = new HashMap<>();
+ cache = new ConcurrentHashMap<>();
} else if ((w = cache.get(k)) != null) {
e = w.get();
}
@@ -214,15 +211,21 @@
}
return e;
}
-
}
- private static Cache malformedCache
+ private static final Cache malformedCache
= new Cache() {
public CoderResult create(int len) {
return new CoderResult(CR_MALFORMED, len);
}};
+ private static final CoderResult[] malformed4 = new CoderResult[] {
+ new CoderResult(CR_MALFORMED, 1),
+ new CoderResult(CR_MALFORMED, 2),
+ new CoderResult(CR_MALFORMED, 3),
+ new CoderResult(CR_MALFORMED, 4),
+ };
+
/**
* Static factory method that returns the unique object describing a
* malformed-input error of the given length.
@@ -233,15 +236,26 @@
* @return The requested coder-result object
*/
public static CoderResult malformedForLength(int length) {
+ if (length <= 0)
+ throw new IllegalArgumentException("Non-positive length");
+ if (length <= 4)
+ return malformed4[length - 1];
return malformedCache.get(length);
}
- private static Cache unmappableCache
+ private static final Cache unmappableCache
= new Cache() {
public CoderResult create(int len) {
return new CoderResult(CR_UNMAPPABLE, len);
}};
+ private static final CoderResult[] unmappable4 = new CoderResult[] {
+ new CoderResult(CR_UNMAPPABLE, 1),
+ new CoderResult(CR_UNMAPPABLE, 2),
+ new CoderResult(CR_UNMAPPABLE, 3),
+ new CoderResult(CR_UNMAPPABLE, 4),
+ };
+
/**
* Static factory method that returns the unique result object describing
* an unmappable-character error of the given length.
@@ -252,6 +266,10 @@
* @return The requested coder-result object
*/
public static CoderResult unmappableForLength(int length) {
+ if (length <= 0)
+ throw new IllegalArgumentException("Non-positive length");
+ if (length <= 4)
+ return unmappable4[length - 1];
return unmappableCache.get(length);
}
--- a/src/java.base/share/classes/java/util/jar/Attributes.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/util/jar/Attributes.java Fri Mar 02 21:00:12 2018 +0100
@@ -40,7 +40,9 @@
* The Attributes class maps Manifest attribute names to associated string
* values. Valid attribute names are case-insensitive, are restricted to
* the ASCII characters in the set [0-9a-zA-Z_-], and cannot exceed 70
- * characters in length. Attribute values can contain any characters and
+ * characters in length. There must be a colon and a SPACE after the name;
+ * the combined length will not exceed 72 characters.
+ * Attribute values can contain any characters and
* will be UTF8-encoded when written to the output stream. See the
* <a href="{@docRoot}/../specs/jar/jar.html">JAR File Specification</a>
* for more information about valid attribute names and values.
@@ -310,8 +312,8 @@
}
buffer.append(value);
+ Manifest.make72Safe(buffer);
buffer.append("\r\n");
- Manifest.make72Safe(buffer);
os.writeBytes(buffer.toString());
}
os.writeBytes("\r\n");
@@ -355,8 +357,8 @@
}
buffer.append(value);
+ Manifest.make72Safe(buffer);
buffer.append("\r\n");
- Manifest.make72Safe(buffer);
out.writeBytes(buffer.toString());
}
}
--- a/src/java.base/share/classes/java/util/jar/Manifest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/java/util/jar/Manifest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -157,8 +157,8 @@
value = new String(vb, 0, 0, vb.length);
}
buffer.append(value);
+ make72Safe(buffer);
buffer.append("\r\n");
- make72Safe(buffer);
dos.writeBytes(buffer.toString());
e.getValue().write(dos);
}
@@ -170,13 +170,11 @@
*/
static void make72Safe(StringBuffer line) {
int length = line.length();
- if (length > 72) {
- int index = 70;
- while (index < length - 2) {
- line.insert(index, "\r\n ");
- index += 72;
- length += 3;
- }
+ int index = 72;
+ while (index < length) {
+ line.insert(index, "\r\n ");
+ index += 74; // + line width + line break ("\r\n")
+ length += 3; // + line break ("\r\n") and space
}
return;
}
--- a/src/java.base/share/classes/sun/invoke/util/BytecodeDescriptor.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.base/share/classes/sun/invoke/util/BytecodeDescriptor.java Fri Mar 02 21:00:12 2018 +0100
@@ -107,6 +107,11 @@
}
public static String unparse(Class<?> type) {
+ if (type == Object.class) {
+ return "Ljava/lang/Object;";
+ } else if (type == int.class) {
+ return "I";
+ }
StringBuilder sb = new StringBuilder();
unparseSig(type, sb);
return sb.toString();
@@ -148,6 +153,8 @@
char c = Wrapper.forBasicType(t).basicTypeChar();
if (c != 'L') {
sb.append(c);
+ } else if (t == Object.class) {
+ sb.append("Ljava/lang/Object;");
} else {
boolean lsemi = (!t.isArray());
if (lsemi) sb.append('L');
--- a/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,8 @@
return instance;
}
+ private static ScreenMenuBar defaultMenuBar;
+
// callback from the native delegate -init function
private static void initMenuStates(final boolean aboutMenuItemVisible,
final boolean aboutMenuItemEnabled,
@@ -76,6 +78,9 @@
void setDefaultMenuBar(final JMenuBar menuBar) {
installDefaultMenuBar(menuBar);
+ if (menuBar == null) {
+ return;
+ }
// scan the current frames, and see if any are foreground
final Frame[] frames = Frame.getFrames();
@@ -100,8 +105,13 @@
}
static void installDefaultMenuBar(final JMenuBar menuBar) {
+
if (menuBar == null) {
// intentionally clearing the default menu
+ if (defaultMenuBar != null) {
+ defaultMenuBar.removeNotify();
+ defaultMenuBar = null;
+ }
nativeSetDefaultMenuBar(0);
return;
}
@@ -124,7 +134,14 @@
throw new IllegalStateException("Application.setDefaultMenuBar() only works if apple.laf.useScreenMenuBar=true");
}
- screenMenuBar.addNotify();
+ if (screenMenuBar != defaultMenuBar) {
+ if (defaultMenuBar != null) {
+ defaultMenuBar.removeNotify();
+ }
+ defaultMenuBar = screenMenuBar;
+ screenMenuBar.addNotify();
+ }
+
final Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(screenMenuBar);
if (!(peer instanceof CMenuBar)) {
// such a thing should not be possible
--- a/src/java.desktop/share/classes/javax/swing/JList.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/share/classes/javax/swing/JList.java Fri Mar 02 21:00:12 2018 +0100
@@ -2359,6 +2359,7 @@
/**
* Selects the specified object from the list.
+ * If the object passed is {@code null}, the selection is cleared.
*
* @param anObject the object to select
* @param shouldScroll {@code true} if the list should scroll to display
@@ -2366,7 +2367,7 @@
*/
public void setSelectedValue(Object anObject,boolean shouldScroll) {
if(anObject == null)
- setSelectedIndex(-1);
+ clearSelection();
else if(!anObject.equals(getSelectedValue())) {
int i,c;
ListModel<E> dm = getModel();
--- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java Fri Mar 02 21:00:12 2018 +0100
@@ -110,6 +110,8 @@
private Dimension doubleBufferMaxSize;
+ private boolean isCustomMaxBufferSizeSet = false;
+
// Support for both the standard and volatile offscreen buffers exists to
// provide backwards compatibility for the [rare] programs which may be
// calling getOffScreenBuffer() and not expecting to get a VolatileImage.
@@ -335,7 +337,13 @@
}
private void displayChanged() {
- clearImages();
+ if (isCustomMaxBufferSizeSet) {
+ clearImages();
+ } else {
+ // Reset buffer maximum size to get valid size from updated graphics
+ // environment in getDoubleBufferMaximumSize()
+ setDoubleBufferMaximumSize(null);
+ }
}
/**
@@ -1156,8 +1164,10 @@
public void setDoubleBufferMaximumSize(Dimension d) {
doubleBufferMaxSize = d;
if (doubleBufferMaxSize == null) {
+ isCustomMaxBufferSizeSet = false;
clearImages();
} else {
+ isCustomMaxBufferSizeSet = true;
clearImages(d.width, d.height);
}
}
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -149,7 +149,7 @@
XRColor c = new XRColor();
for (int i = 0; i < pixels.length; i++) {
- c.setColorValues(pixels[i], true);
+ c.setColorValues(pixels[i]);
renderColors[i * 4 + 0] = (short) c.alpha;
renderColors[i * 4 + 1] = (short) c.red;
renderColors[i * 4 + 2] = (short) c.green;
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@
XRColor c = new XRColor();
for (int i = 0; i < pixels.length; i++) {
- c.setColorValues(pixels[i], true);
+ c.setColorValues(pixels[i]);
colorValues[i * 4 + 0] = c.alpha;
colorValues[i * 4 + 1] = c.red;
colorValues[i * 4 + 2] = c.green;
@@ -83,7 +83,7 @@
return colorValues;
}
- public void setColorValues(int pixel, boolean pre) {
+ public void setColorValues(int pixel) {
long pix = XRUtils.intToULong(pixel);
alpha = (int) (((pix & 0xFF000000) >> 16) + 255);
red = (int) (((pix & 0x00FF0000) >> 8) + 255);
@@ -93,13 +93,6 @@
if (alpha == 255) {
alpha = 0;
}
-
- if (!pre) {
- double alphaMult = XRUtils.XFixedToDouble(alpha);
- this.red = (int) (red * alphaMult);
- this.green = (int) (green * alphaMult);
- this.blue = (int) (blue * alphaMult);
- }
}
public static int byteToXRColorValue(int byteValue) {
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@
}
public void setForeground(int pixel) {
- solidColor.setColorValues(pixel, true);
+ solidColor.setColorValues(pixel);
}
public void setGradientPaint(XRSurfaceData gradient) {
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java Fri Mar 02 21:00:12 2018 +0100
@@ -47,7 +47,7 @@
public XRSurfaceData prepareSrcPict(int pixelVal) {
if(pixelVal != curPixVal) {
- xrCol.setColorValues(pixelVal, true);
+ xrCol.setColorValues(pixelVal);
con.renderRectangle(srcPict.picture, XRUtils.PictOpSrc, xrCol, 0, 0, 1, 1);
this.curPixVal = pixelVal;
}
--- a/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c Fri Mar 02 21:00:12 2018 +0100
@@ -394,77 +394,50 @@
XRectangle bbox; /* bounding box of grabbed area */
list_ptr regions;/* list of regions to read from */
{
- image_region_type *reg;
- int32_t dst_x, dst_y; /* where in pixmap to write (UL) */
- int32_t diff;
-
- XImage *reg_image,*ximage ;
- int32_t srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
- int32_t rem ;
- int32_t bytes_per_line;
- int32_t bitmap_unit;
-
- bitmap_unit = sizeof (long);
- if (format == ZPixmap)
- bytes_per_line = width*depth/8;
- else
- bytes_per_line = width/8;
-
-
- /* Find out how many more bytes are required for padding so that
- ** bytes per scan line will be multiples of bitmap_unit bits */
- if (format == ZPixmap) {
- rem = (bytes_per_line*8)%bitmap_unit;
- if (rem)
- bytes_per_line += (rem/8 + 1);
- }
+ XImage *ximage ;
+ image_region_type* reg;
+ int32_t rect;
ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL,
(uint32_t)width,(uint32_t)height,8,0);
- bytes_per_line = ximage->bytes_per_line;
-
- if (format == ZPixmap)
- ximage->data = malloc(height*bytes_per_line);
- else
- ximage->data = malloc(height*bytes_per_line*depth);
-
+ ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char));
ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
for (reg = (image_region_type *) first_in_list( regions); reg;
reg = (image_region_type *) next_in_list( regions))
{
- int32_t rect;
- struct my_XRegion *vis_reg;
- vis_reg = (struct my_XRegion *)(reg->visible_region);
- for (rect = 0;
- rect < vis_reg->numRects;
- rect++)
+ struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region);
+ for (rect = 0; rect < vis_reg->numRects; rect++)
{
- /** ------------------------------------------------------------------------
- Intersect bbox with visible part of region giving src rect & output
- location. Width is the min right side minus the max left side.
- Similar for height. Offset src rect so x,y are relative to
- origin of win, not the root-relative visible rect of win.
- ------------------------------------------------------------------------ **/
- srcRect_width = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x)
- - MAX( vis_reg->rects[rect].x1, bbox.x);
+ /** ------------------------------------------------------------------------
+ Intersect bbox with visible part of region giving src rect & output
+ location. Width is the min right side minus the max left side.
+ Similar for height. Offset src rect so x,y are relative to
+ origin of win, not the root-relative visible rect of win.
+ ------------------------------------------------------------------------ **/
+ int32_t srcRect_width = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x)
+ - MAX( vis_reg->rects[rect].x1, bbox.x);
+
+ int32_t srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y)
+ - MAX( vis_reg->rects[rect].y1, bbox.y);
- srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y)
- - MAX( vis_reg->rects[rect].y1, bbox.y);
+ int32_t diff = bbox.x - vis_reg->rects[rect].x1;
+ int32_t srcRect_x = MAX( 0, diff) + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
+ int32_t dst_x = MAX( 0, -diff) ;
- diff = bbox.x - vis_reg->rects[rect].x1;
- srcRect_x = MAX( 0, diff) + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
- dst_x = MAX( 0, -diff) ;
- diff = bbox.y - vis_reg->rects[rect].y1;
- srcRect_y = MAX( 0, diff) + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
- dst_y = MAX( 0, -diff) ;
- reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
- (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ;
- TransferImage(disp,reg_image,srcRect_width,
- srcRect_height,reg,ximage,dst_x,dst_y) ;
- XDestroyImage(reg_image);
- }
+ diff = bbox.y - vis_reg->rects[rect].y1;
+ int32_t srcRect_y = MAX( 0, diff) + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
+ int32_t dst_y = MAX( 0, -diff) ;
+ XImage* reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
+ (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ;
+
+ if (reg_image) {
+ TransferImage(disp,reg_image,srcRect_width,
+ srcRect_height,reg,ximage,dst_x,dst_y) ;
+ XDestroyImage(reg_image);
+ }
+ }
}
return ximage ;
}
--- a/src/java.management/share/classes/java/lang/management/MonitorInfo.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.management/share/classes/java/lang/management/MonitorInfo.java Fri Mar 02 21:00:12 2018 +0100
@@ -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
@@ -116,11 +116,10 @@
* <tbody style="text-align:left">
* <tr>
* <th scope="row">lockedStackFrame</th>
- * <td><code>CompositeData as specified in the
- * <a href="ThreadInfo.html#StackTrace">stackTrace</a>
- * attribute defined in the {@link ThreadInfo#from
- * ThreadInfo.from} method.
- * </code></td>
+ * <td><a href="ThreadInfo.html#stackTraceElement">
+ * {@code CompositeData} for {@code StackTraceElement}</a> as specified
+ * in {@link ThreadInfo#from(CompositeData)} method.
+ * </td>
* </tr>
* <tr>
* <th scope="row">lockedStackDepth</th>
@@ -134,7 +133,7 @@
* @throws IllegalArgumentException if {@code cd} does not
* represent a {@code MonitorInfo} with the attributes described
* above.
-
+ *
* @return a {@code MonitorInfo} object represented
* by {@code cd} if {@code cd} is not {@code null};
* {@code null} otherwise.
--- a/src/java.management/share/classes/java/lang/management/ThreadInfo.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.management/share/classes/java/lang/management/ThreadInfo.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
package java.lang.management;
+import javax.management.openmbean.ArrayType;
import javax.management.openmbean.CompositeData;
import sun.management.ManagementFactoryHelper;
import sun.management.ThreadInfoCompositeData;
@@ -110,7 +111,6 @@
private StackTraceElement[] stackTrace;
private MonitorInfo[] lockedMonitors;
private LockInfo[] lockedSynchronizers;
-
private static MonitorInfo[] EMPTY_MONITORS = new MonitorInfo[0];
private static LockInfo[] EMPTY_SYNCS = new LockInfo[0];
@@ -264,6 +264,11 @@
/*
* Constructs a {@code ThreadInfo} object from a
* {@link CompositeData CompositeData}.
+ *
+ * @throws IllegalArgumentException if the given CompositeData does not
+ * contain all of the attributes defined for ThreadInfo of version <= N.
+ *
+ * @see ThreadInfo#from
*/
private ThreadInfo(CompositeData cd) {
ThreadInfoCompositeData ticd = ThreadInfoCompositeData.getInstance(cd);
@@ -281,41 +286,11 @@
suspended = ticd.suspended();
inNative = ticd.inNative();
stackTrace = ticd.stackTrace();
-
- // 6.0 attributes
- if (ticd.hasV6()) {
- lock = ticd.lockInfo();
- lockedMonitors = ticd.lockedMonitors();
- lockedSynchronizers = ticd.lockedSynchronizers();
- } else {
- // lockInfo is a new attribute added in 1.6 ThreadInfo
- // If cd is a 5.0 version, construct the LockInfo object
- // from the lockName value.
- if (lockName != null) {
- String result[] = lockName.split("@");
- if (result.length == 2) {
- int identityHashCode = Integer.parseInt(result[1], 16);
- lock = new LockInfo(result[0], identityHashCode);
- } else {
- assert result.length == 2;
- lock = null;
- }
- } else {
- lock = null;
- }
- lockedMonitors = EMPTY_MONITORS;
- lockedSynchronizers = EMPTY_SYNCS;
- }
-
- // 9.0 attributes
- if (ticd.isCurrentVersion()) {
- daemon = ticd.isDaemon();
- priority = ticd.getPriority();
- } else {
- // Not ideal, but unclear what else we can do.
- daemon = false;
- priority = Thread.NORM_PRIORITY;
- }
+ lock = ticd.lockInfo();
+ lockedMonitors = ticd.lockedMonitors();
+ lockedSynchronizers = ticd.lockedSynchronizers();
+ daemon = ticd.isDaemon();
+ priority = ticd.getPriority();
}
/**
@@ -692,52 +667,105 @@
/**
* Returns a {@code ThreadInfo} object represented by the
* given {@code CompositeData}.
- * The given {@code CompositeData} must contain the following attributes
- * unless otherwise specified below:
+ *
+ * <a id="attributes"></a>
+ * A {@code CompositeData} representing a {@code ThreadInfo} of
+ * version <em>N</em> must contain all of the attributes defined
+ * in version ≤ <em>N</em> unless specified otherwise.
+ * The same rule applies the composite type of the given
+ * {@code CompositeData} and transitively to attributes whose
+ * {@linkplain CompositeData#getCompositeType() type} or
+ * {@linkplain ArrayType#getElementOpenType() component type} is
+ * {@code CompositeType}.
+ * <p>
+ * A {@code CompositeData} representing {@code ThreadInfo} of
+ * version <em>N</em> contains {@code "stackTrace"} attribute and
+ * {@code "lockedMonitors"} attribute representing
+ * an array of {@code StackTraceElement} and
+ * an array of {@link MonitorInfo} respectively
+ * and their types are of version <em>N</em>.
+ * The {@code "lockedStackFrame"} attribute in
+ * {@link MonitorInfo#from(CompositeData) MonitorInfo}'s composite type
+ * must represent {@code StackTraceElement} of the same version <em>N</em>.
+ * Otherwise, this method will throw {@code IllegalArgumentException}.
+ *
* <table class="striped" style="margin-left:2em">
- * <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
+ * <caption style="display:none">The attributes and their types for ThreadInfo's composite data</caption>
* <thead>
* <tr>
* <th scope="col">Attribute Name</th>
* <th scope="col">Type</th>
+ * <th scope="col">Since</th>
* </tr>
* </thead>
* <tbody style="text-align:left">
* <tr>
* <th scope="row">threadId</th>
* <td>{@code java.lang.Long}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">threadName</th>
* <td>{@code java.lang.String}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">threadState</th>
* <td>{@code java.lang.String}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">suspended</th>
* <td>{@code java.lang.Boolean}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">inNative</th>
* <td>{@code java.lang.Boolean}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">blockedCount</th>
* <td>{@code java.lang.Long}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">blockedTime</th>
* <td>{@code java.lang.Long}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">waitedCount</th>
* <td>{@code java.lang.Long}</td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">waitedTime</th>
* <td>{@code java.lang.Long}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">lockName</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">lockOwnerId</th>
+ * <td>{@code java.lang.Long}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">lockOwnerName</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row"><a id="StackTrace">stackTrace</a></th>
+ * <td>{@code javax.management.openmbean.CompositeData[]}, each element
+ * is a {@code CompositeData} representing {@code StackTraceElement}
+ * as specified <a href="#stackTraceElement">below</a>.
+ * </td>
+ * <td>5</td>
* </tr>
* <tr>
* <th scope="row">lockInfo</th>
@@ -745,78 +773,21 @@
* - the mapped type for {@link LockInfo} as specified in the
* {@link LockInfo#from} method.
* <p>
- * If {@code cd} does not contain this attribute,
+ * If the given {@code CompositeData} does not contain this attribute,
* the {@code LockInfo} object will be constructed from
- * the value of the {@code lockName} attribute. </td>
- * </tr>
- * <tr>
- * <th scope="row">lockName</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row">lockOwnerId</th>
- * <td>{@code java.lang.Long}</td>
- * </tr>
- * <tr>
- * <th scope="row">lockOwnerName</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row"><a id="StackTrace">stackTrace</a></th>
- * <td>{@code javax.management.openmbean.CompositeData[]}
- * <p>
- * Each element is a {@code CompositeData} representing
- * StackTraceElement containing the following attributes:
- * <table class="striped" style="margin-left:2em">
- * <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
- * <thead style="text-align:center">
- * <tr>
- * <th scope="col">Attribute Name</th>
- * <th scope="col">Type</th>
- * </tr>
- * </thead>
- * <tbody style="text-align:left">
- * <tr>
- * <th scope="row">moduleName</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row">moduleVersion</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row">className</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row">methodName</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row">fileName</th>
- * <td>{@code java.lang.String}</td>
- * </tr>
- * <tr>
- * <th scope="row">lineNumber</th>
- * <td>{@code java.lang.Integer}</td>
- * </tr>
- * <tr>
- * <th scope="row">nativeMethod</th>
- * <td>{@code java.lang.Boolean}</td>
- * </tr>
- * </tbody>
- * </table>
- * </td>
+ * the value of the {@code lockName} attribute.</td>
+ * <td>6</td>
* </tr>
* <tr>
* <th scope="row">lockedMonitors</th>
* <td>{@code javax.management.openmbean.CompositeData[]}
* whose element type is the mapped type for
* {@link MonitorInfo} as specified in the
- * {@link MonitorInfo#from Monitor.from} method.
+ * {@link MonitorInfo#from MonitorInfo.from} method.
* <p>
- * If {@code cd} does not contain this attribute,
- * this attribute will be set to an empty array. </td>
+ * If the given {@code CompositeData} does not contain this attribute,
+ * this attribute will be set to an empty array.</td>
+ * <td>6</td>
* </tr>
* <tr>
* <th scope="row">lockedSynchronizers</th>
@@ -824,25 +795,93 @@
* whose element type is the mapped type for
* {@link LockInfo} as specified in the {@link LockInfo#from} method.
* <p>
- * If {@code cd} does not contain this attribute,
- * this attribute will be set to an empty array. </td>
+ * If the given {@code CompositeData} does not contain this attribute,
+ * this attribute will be set to an empty array.</td>
+ * <td>6</td>
* </tr>
* <tr>
* <th scope="row">daemon</th>
- * <td>{@code java.lang.Boolean}</td>
+ * <td>{@code java.lang.Boolean}
+ * <p>
+ * If the given {@code CompositeData} does not contain this attribute,
+ * this attribute will be set to {@code false}.</td>
+ * <td>9</td>
* </tr>
* <tr>
* <th scope="row">priority</th>
+ * <td>{@code java.lang.Integer}
+ * <p>
+ * If the given {@code CompositeData} does not contain this attribute,
+ * This attribute will be set to {@link Thread#NORM_PRIORITY}.</td>
+ * <td>9</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ *
+ * <a id="stackTraceElement">A {@code CompositeData} representing
+ * {@code StackTraceElement}</a> of version <em>N</em> must contain
+ * all of the attributes defined in version ≤ <em>N</em>
+ * unless specified otherwise.
+ *
+ * <table class="striped" style="margin-left:2em">
+ * <caption style="display:none">The attributes and their types for StackTraceElement's composite data</caption>
+ * <thead style="text-align:center">
+ * <tr>
+ * <th scope="col">Attribute Name</th>
+ * <th scope="col">Type</th>
+ * <th scope="col">Since</th>
+ * </tr>
+ * </thead>
+ * <tbody style="text-align:left">
+ * <tr>
+ * <th scope="row">classLoaderName</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>9</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">moduleName</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>9</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">moduleVersion</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>9</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">className</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">methodName</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">fileName</th>
+ * <td>{@code java.lang.String}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">lineNumber</th>
* <td>{@code java.lang.Integer}</td>
+ * <td>5</td>
+ * </tr>
+ * <tr>
+ * <th scope="row">nativeMethod</th>
+ * <td>{@code java.lang.Boolean}</td>
+ * <td>5</td>
* </tr>
* </tbody>
* </table>
*
* @param cd {@code CompositeData} representing a {@code ThreadInfo}
*
- * @throws IllegalArgumentException if {@code cd} does not
- * represent a {@code ThreadInfo} with the attributes described
- * above.
+ * @throws IllegalArgumentException if the given {@code cd} and
+ * its composite type does not contain all of
+ * <a href="#attributes">the attributes</a> defined for a
+ * {@code ThreadInfo} of a specific runtime version.
*
* @return a {@code ThreadInfo} object represented
* by {@code cd} if {@code cd} is not {@code null};
--- a/src/java.management/share/classes/sun/management/LockInfoCompositeData.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.management/share/classes/sun/management/LockInfoCompositeData.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 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
@@ -58,15 +58,15 @@
protected CompositeData getCompositeData() {
// CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
- // lockInfoItemNames!
+ // LOCK_INFO_ATTRIBUTES!
final Object[] lockInfoItemValues = {
new String(lock.getClassName()),
lock.getIdentityHashCode(),
};
try {
- return new CompositeDataSupport(lockInfoCompositeType,
- lockInfoItemNames,
+ return new CompositeDataSupport(LOCK_INFO_COMPOSITE_TYPE,
+ LOCK_INFO_ATTRIBUTES,
lockInfoItemValues);
} catch (OpenDataException e) {
// Should never reach here
@@ -74,10 +74,10 @@
}
}
- private static final CompositeType lockInfoCompositeType;
+ private static final CompositeType LOCK_INFO_COMPOSITE_TYPE;
static {
try {
- lockInfoCompositeType = (CompositeType)
+ LOCK_INFO_COMPOSITE_TYPE = (CompositeType)
MappedMXBeanType.toOpenType(LockInfo.class);
} catch (OpenDataException e) {
// Should never reach here
@@ -85,13 +85,13 @@
}
}
- static CompositeType getLockInfoCompositeType() {
- return lockInfoCompositeType;
+ static CompositeType compositeType() {
+ return LOCK_INFO_COMPOSITE_TYPE;
}
private static final String CLASS_NAME = "className";
private static final String IDENTITY_HASH_CODE = "identityHashCode";
- private static final String[] lockInfoItemNames = {
+ private static final String[] LOCK_INFO_ATTRIBUTES = {
CLASS_NAME,
IDENTITY_HASH_CODE,
};
@@ -104,7 +104,7 @@
throw new NullPointerException("Null CompositeData");
}
- if (!isTypeMatched(lockInfoCompositeType, cd.getCompositeType())) {
+ if (!isTypeMatched(LOCK_INFO_COMPOSITE_TYPE, cd.getCompositeType())) {
throw new IllegalArgumentException(
"Unexpected composite type for LockInfo");
}
--- a/src/java.management/share/classes/sun/management/MonitorInfoCompositeData.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.management/share/classes/sun/management/MonitorInfoCompositeData.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, 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
@@ -30,7 +30,7 @@
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.openmbean.OpenDataException;
-import java.util.Set;
+import javax.management.openmbean.OpenType;
/**
* A CompositeData for MonitorInfo for the local management support.
@@ -55,14 +55,14 @@
protected CompositeData getCompositeData() {
// CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
- // monitorInfoItemNames!
+ // MONITOR_INFO_ATTRIBUTES!
- int len = monitorInfoItemNames.length;
+ int len = MONITOR_INFO_ATTRIBUTES.length;
Object[] values = new Object[len];
CompositeData li = LockInfoCompositeData.toCompositeData(lock);
for (int i = 0; i < len; i++) {
- String item = monitorInfoItemNames[i];
+ String item = MONITOR_INFO_ATTRIBUTES[i];
if (item.equals(LOCKED_STACK_FRAME)) {
StackTraceElement ste = lock.getLockedStackFrame();
values[i] = (ste != null ? StackTraceElementCompositeData.
@@ -76,8 +76,8 @@
}
try {
- return new CompositeDataSupport(monitorInfoCompositeType,
- monitorInfoItemNames,
+ return new CompositeDataSupport(MONITOR_INFO_COMPOSITE_TYPE,
+ MONITOR_INFO_ATTRIBUTES,
values);
} catch (OpenDataException e) {
// Should never reach here
@@ -85,28 +85,50 @@
}
}
- private static final CompositeType monitorInfoCompositeType;
- private static final String[] monitorInfoItemNames;
+ private static final String CLASS_NAME = "className";
+ private static final String IDENTITY_HASH_CODE = "identityHashCode";
+ private static final String LOCKED_STACK_FRAME = "lockedStackFrame";
+ private static final String LOCKED_STACK_DEPTH = "lockedStackDepth";
+
+ private static final String[] MONITOR_INFO_ATTRIBUTES = {
+ CLASS_NAME,
+ IDENTITY_HASH_CODE,
+ LOCKED_STACK_FRAME,
+ LOCKED_STACK_DEPTH
+ };
+
+ private static final CompositeType MONITOR_INFO_COMPOSITE_TYPE;
+ private static final CompositeType V6_COMPOSITE_TYPE;
static {
try {
- monitorInfoCompositeType = (CompositeType)
+ MONITOR_INFO_COMPOSITE_TYPE = (CompositeType)
MappedMXBeanType.toOpenType(MonitorInfo.class);
- Set<String> s = monitorInfoCompositeType.keySet();
- monitorInfoItemNames = s.toArray(new String[0]);
+
+ OpenType<?>[] types = new OpenType<?>[MONITOR_INFO_ATTRIBUTES.length];
+ for (int i = 0; i < MONITOR_INFO_ATTRIBUTES.length; i++) {
+ String name = MONITOR_INFO_ATTRIBUTES[i];
+ types[i] = name.equals(LOCKED_STACK_FRAME)
+ ? StackTraceElementCompositeData.v5CompositeType()
+ : MONITOR_INFO_COMPOSITE_TYPE.getType(name);
+ }
+ V6_COMPOSITE_TYPE = new CompositeType("MonitorInfo",
+ "JDK 6 MonitorInfo",
+ MONITOR_INFO_ATTRIBUTES,
+ MONITOR_INFO_ATTRIBUTES,
+ types);
} catch (OpenDataException e) {
// Should never reach here
throw new AssertionError(e);
}
}
- static CompositeType getMonitorInfoCompositeType() {
- return monitorInfoCompositeType;
+ static CompositeType v6CompositeType() {
+ return V6_COMPOSITE_TYPE;
}
- private static final String CLASS_NAME = "className";
- private static final String IDENTITY_HASH_CODE = "identityHashCode";
- private static final String LOCKED_STACK_FRAME = "lockedStackFrame";
- private static final String LOCKED_STACK_DEPTH = "lockedStackDepth";
+ static CompositeType compositeType() {
+ return MONITOR_INFO_COMPOSITE_TYPE;
+ }
public static String getClassName(CompositeData cd) {
return getString(cd, CLASS_NAME);
@@ -138,7 +160,8 @@
throw new NullPointerException("Null CompositeData");
}
- if (!isTypeMatched(monitorInfoCompositeType, cd.getCompositeType())) {
+ if (!isTypeMatched(MONITOR_INFO_COMPOSITE_TYPE, cd.getCompositeType()) &&
+ !isTypeMatched(V6_COMPOSITE_TYPE, cd.getCompositeType())) {
throw new IllegalArgumentException(
"Unexpected composite type for MonitorInfo");
}
--- a/src/java.management/share/classes/sun/management/StackTraceElementCompositeData.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.management/share/classes/sun/management/StackTraceElementCompositeData.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, 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
@@ -25,13 +25,13 @@
package sun.management;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Predicate;
import javax.management.openmbean.CompositeType;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import java.util.Arrays;
+import java.util.stream.Stream;
/**
* A CompositeData for StackTraceElement for the local management support.
@@ -52,12 +52,7 @@
public static StackTraceElement from(CompositeData cd) {
validateCompositeData(cd);
- if (stackTraceElementV6CompositeType.equals(cd.getCompositeType())) {
- return new StackTraceElement(getString(cd, CLASS_NAME),
- getString(cd, METHOD_NAME),
- getString(cd, FILE_NAME),
- getInt(cd, LINE_NUMBER));
- } else {
+ if (STACK_TRACE_ELEMENT_COMPOSITE_TYPE.equals(cd.getCompositeType())) {
return new StackTraceElement(getString(cd, CLASS_LOADER_NAME),
getString(cd, MODULE_NAME),
getString(cd, MODULE_VERSION),
@@ -65,6 +60,12 @@
getString(cd, METHOD_NAME),
getString(cd, FILE_NAME),
getInt(cd, LINE_NUMBER));
+ } else {
+ return new StackTraceElement(getString(cd, CLASS_NAME),
+ getString(cd, METHOD_NAME),
+ getString(cd, FILE_NAME),
+ getInt(cd, LINE_NUMBER));
+
}
}
@@ -75,7 +76,7 @@
protected CompositeData getCompositeData() {
// CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
- // stackTraceElementItemNames!
+ // STACK_TRACE_ELEMENT_ATTRIBUTES!
final Object[] stackTraceElementItemValues = {
ste.getClassLoaderName(),
ste.getModuleName(),
@@ -87,8 +88,8 @@
ste.isNativeMethod(),
};
try {
- return new CompositeDataSupport(stackTraceElementCompositeType,
- stackTraceElementItemNames,
+ return new CompositeDataSupport(STACK_TRACE_ELEMENT_COMPOSITE_TYPE,
+ STACK_TRACE_ELEMENT_ATTRIBUTES,
stackTraceElementItemValues);
} catch (OpenDataException e) {
// Should never reach here
@@ -106,11 +107,7 @@
private static final String LINE_NUMBER = "lineNumber";
private static final String NATIVE_METHOD = "nativeMethod";
-
- private static final String[] stackTraceElementItemNames = {
- CLASS_LOADER_NAME,
- MODULE_NAME,
- MODULE_VERSION,
+ private static final String[] V5_ATTRIBUTES = {
CLASS_NAME,
METHOD_NAME,
FILE_NAME,
@@ -118,30 +115,48 @@
NATIVE_METHOD,
};
- private static final String[] stackTraceElementV9ItemNames = {
+ private static final String[] V9_ATTRIBUTES = {
CLASS_LOADER_NAME,
MODULE_NAME,
MODULE_VERSION,
};
- private static final CompositeType stackTraceElementCompositeType;
- private static final CompositeType stackTraceElementV6CompositeType;
+ private static final String[] STACK_TRACE_ELEMENT_ATTRIBUTES =
+ Stream.of(V5_ATTRIBUTES, V9_ATTRIBUTES).flatMap(Arrays::stream)
+ .toArray(String[]::new);
+
+ private static final CompositeType STACK_TRACE_ELEMENT_COMPOSITE_TYPE;
+ private static final CompositeType V5_COMPOSITE_TYPE;
static {
try {
- stackTraceElementCompositeType = (CompositeType)
+ STACK_TRACE_ELEMENT_COMPOSITE_TYPE = (CompositeType)
MappedMXBeanType.toOpenType(StackTraceElement.class);
- stackTraceElementV6CompositeType =
- TypeVersionMapper.getInstance().getVersionedCompositeType(
- stackTraceElementCompositeType,
- TypeVersionMapper.V6
- );
+
+ OpenType<?>[] types = new OpenType<?>[V5_ATTRIBUTES.length];
+ for (int i=0; i < V5_ATTRIBUTES.length; i++) {
+ String name = V5_ATTRIBUTES[i];
+ types[i] = STACK_TRACE_ELEMENT_COMPOSITE_TYPE.getType(name);
+ }
+ V5_COMPOSITE_TYPE = new CompositeType("StackTraceElement",
+ "JDK 5 StackTraceElement",
+ V5_ATTRIBUTES,
+ V5_ATTRIBUTES,
+ types);
} catch (OpenDataException e) {
// Should never reach here
throw new AssertionError(e);
}
}
- /** Validate if the input CompositeData has the expected
+ static CompositeType v5CompositeType() {
+ return V5_COMPOSITE_TYPE;
+ }
+ static CompositeType compositeType() {
+ return STACK_TRACE_ELEMENT_COMPOSITE_TYPE;
+ }
+
+ /**
+ * Validate if the input CompositeData has the expected
* CompositeType (i.e. contain all attributes with expected
* names and types).
*/
@@ -151,22 +166,11 @@
}
CompositeType ct = cd.getCompositeType();
- if (!isTypeMatched(stackTraceElementCompositeType, ct)) {
- if (!isTypeMatched(stackTraceElementV6CompositeType, ct)) {
- throw new IllegalArgumentException(
- "Unexpected composite type for StackTraceElement");
- }
+ if (!isTypeMatched(STACK_TRACE_ELEMENT_COMPOSITE_TYPE, ct) &&
+ !isTypeMatched(V5_COMPOSITE_TYPE, ct)) {
+ throw new IllegalArgumentException(
+ "Unexpected composite type for StackTraceElement");
}
}
-
- static boolean isV6Attribute(String name) {
- for(String attrName : stackTraceElementV9ItemNames) {
- if (name.equals(attrName)) {
- return false;
- }
- }
- return true;
- }
-
private static final long serialVersionUID = -2704607706598396827L;
}
--- a/src/java.management/share/classes/sun/management/ThreadInfoCompositeData.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/java.management/share/classes/sun/management/ThreadInfoCompositeData.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,10 +28,16 @@
import java.lang.management.ThreadInfo;
import java.lang.management.MonitorInfo;
import java.lang.management.LockInfo;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.stream.Stream;
+import javax.management.openmbean.ArrayType;
import javax.management.openmbean.CompositeType;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
/**
* A CompositeData for ThreadInfo for the local management support.
@@ -41,35 +47,21 @@
public class ThreadInfoCompositeData extends LazyCompositeData {
private final ThreadInfo threadInfo;
private final CompositeData cdata;
- private final boolean currentVersion;
- private final boolean hasV6;
private ThreadInfoCompositeData(ThreadInfo ti) {
this.threadInfo = ti;
- this.currentVersion = true;
this.cdata = null;
- this.hasV6 = true;
}
private ThreadInfoCompositeData(CompositeData cd) {
this.threadInfo = null;
- this.currentVersion = ThreadInfoCompositeData.isCurrentVersion(cd);
this.cdata = cd;
- this.hasV6 = ThreadInfoCompositeData.hasV6(cd);
}
public ThreadInfo getThreadInfo() {
return threadInfo;
}
- public boolean hasV6() {
- return hasV6;
- }
-
- public boolean isCurrentVersion() {
- return currentVersion;
- }
-
public static ThreadInfoCompositeData getInstance(CompositeData cd) {
validateCompositeData(cd);
return new ThreadInfoCompositeData(cd);
@@ -112,7 +104,7 @@
}
// CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
- // threadInfoItemNames!
+ // THREAD_INFO_ATTRIBUTES!
final Object[] threadInfoItemValues = {
threadInfo.getThreadId(),
threadInfo.getThreadName(),
@@ -126,8 +118,8 @@
threadInfo.getLockOwnerId(),
threadInfo.getLockOwnerName(),
stackTraceData,
- threadInfo.isSuspended(),
- threadInfo.isInNative(),
+ threadInfo.isSuspended(),
+ threadInfo.isInNative(),
lockedMonitorsData,
lockedSyncsData,
threadInfo.isDaemon(),
@@ -135,8 +127,8 @@
};
try {
- return new CompositeDataSupport(threadInfoCompositeType,
- threadInfoItemNames,
+ return new CompositeDataSupport(compositeType(),
+ THREAD_INFO_ATTRIBTUES,
threadInfoItemValues);
} catch (OpenDataException e) {
// Should never reach here
@@ -164,7 +156,7 @@
private static final String LOCKED_MONITORS = "lockedMonitors";
private static final String LOCKED_SYNCS = "lockedSynchronizers";
- private static final String[] threadInfoItemNames = {
+ private static final String[] V5_ATTRIBUTES = {
THREAD_ID,
THREAD_NAME,
THREAD_STATE,
@@ -172,109 +164,28 @@
BLOCKED_COUNT,
WAITED_TIME,
WAITED_COUNT,
- LOCK_INFO,
LOCK_NAME,
LOCK_OWNER_ID,
LOCK_OWNER_NAME,
STACK_TRACE,
SUSPENDED,
- IN_NATIVE,
- LOCKED_MONITORS,
- LOCKED_SYNCS,
- DAEMON,
- PRIORITY,
+ IN_NATIVE
};
- // New attributes added in 6.0 ThreadInfo
- private static final String[] threadInfoV6Attributes = {
+ private static final String[] V6_ATTRIBUTES = {
LOCK_INFO,
LOCKED_MONITORS,
LOCKED_SYNCS,
};
- private static final String[] threadInfoV9Attributes = {
+ private static final String[] V9_ATTRIBUTES = {
DAEMON,
PRIORITY,
};
- // Current version of ThreadInfo
- private static final CompositeType threadInfoCompositeType;
- // Previous version of ThreadInfo
- private static final CompositeType threadInfoV6CompositeType;
- // Previous-previous version of ThreadInfo
- private static final CompositeType threadInfoV5CompositeType;
- private static final CompositeType lockInfoCompositeType;
- static {
- try {
- threadInfoCompositeType = (CompositeType)
- MappedMXBeanType.toOpenType(ThreadInfo.class);
- // Form a CompositeType for JDK 5.0 ThreadInfo version
-
- threadInfoV5CompositeType =
- TypeVersionMapper.getInstance().getVersionedCompositeType(
- threadInfoCompositeType, TypeVersionMapper.V5
- );
-
- threadInfoV6CompositeType =
- TypeVersionMapper.getInstance().getVersionedCompositeType(
- threadInfoCompositeType, TypeVersionMapper.V6
- );
- } catch (OpenDataException e) {
- // Should never reach here
- throw new AssertionError(e);
- }
-
- // Each CompositeData object has its CompositeType associated
- // with it. So we can get the CompositeType representing LockInfo
- // from a mapped CompositeData for any LockInfo object.
- // Thus we construct a random LockInfo object and pass it
- // to LockInfoCompositeData to do the conversion.
- Object o = new Object();
- LockInfo li = new LockInfo(o.getClass().getName(),
- System.identityHashCode(o));
- CompositeData cd = LockInfoCompositeData.toCompositeData(li);
- lockInfoCompositeType = cd.getCompositeType();
- }
-
- static boolean isV5Attribute(String itemName) {
- for (String n : threadInfoV6Attributes) {
- if (itemName.equals(n)) {
- return false;
- }
- }
- for (String n : threadInfoV9Attributes) {
- if (itemName.equals(n)) {
- return false;
- }
- }
- return true;
- }
-
- static boolean isV6Attribute(String itemName) {
- for (String n : threadInfoV9Attributes) {
- if (itemName.equals(n)) {
- return false;
- }
- }
- return true;
- }
-
- public static boolean isCurrentVersion(CompositeData cd) {
- if (cd == null) {
- throw new NullPointerException("Null CompositeData");
- }
-
- return isTypeMatched(threadInfoCompositeType, cd.getCompositeType());
- }
-
- private static boolean hasV6(CompositeData cd) {
- if (cd == null) {
- throw new NullPointerException("Null CompositeData");
- }
-
- return isTypeMatched(threadInfoCompositeType, cd.getCompositeType()) ||
- isTypeMatched(threadInfoV6CompositeType, cd.getCompositeType());
- }
+ private static final String[] THREAD_INFO_ATTRIBTUES =
+ Stream.of(V5_ATTRIBUTES, V6_ATTRIBUTES, V9_ATTRIBUTES)
+ .flatMap(Arrays::stream).toArray(String[]::new);
public long threadId() {
return getLong(cdata, THREAD_ID);
@@ -333,12 +244,18 @@
return getBoolean(cdata, IN_NATIVE);
}
+ /*
+ * if daemon attribute is not present, default to false.
+ */
public boolean isDaemon() {
- return getBoolean(cdata, DAEMON);
+ return cdata.containsKey(DAEMON) ? getBoolean(cdata, DAEMON) : false;
}
+ /*
+ * if priority attribute is not present, default to norm priority.
+ */
public int getPriority(){
- return getInt(cdata, PRIORITY);
+ return cdata.containsKey(PRIORITY) ? getInt(cdata, PRIORITY) : Thread.NORM_PRIORITY;
}
public StackTraceElement[] stackTrace() {
@@ -356,13 +273,37 @@
return stackTrace;
}
- // 6.0 new attributes
+ /*
+ * lockInfo is a new attribute added in JDK 6 ThreadInfo
+ * If cd is a 5.0 version, construct the LockInfo object
+ * from the lockName value.
+ */
public LockInfo lockInfo() {
- CompositeData lockInfoData = (CompositeData) cdata.get(LOCK_INFO);
- return LockInfo.from(lockInfoData);
+ if (cdata.containsKey(LOCK_INFO)) {
+ CompositeData lockInfoData = (CompositeData) cdata.get(LOCK_INFO);
+ return LockInfo.from(lockInfoData);
+ } else {
+ String lockName = lockName();
+ LockInfo lock = null;
+ if (lockName != null) {
+ String result[] = lockName.split("@");
+ if (result.length == 2) {
+ int identityHashCode = Integer.parseInt(result[1], 16);
+ lock = new LockInfo(result[0], identityHashCode);
+ }
+ }
+ return lock;
+ }
}
+ /**
+ * Returns an empty array if locked_monitors attribute is not present.
+ */
public MonitorInfo[] lockedMonitors() {
+ if (!cdata.containsKey(LOCKED_MONITORS)) {
+ return new MonitorInfo[0];
+ }
+
CompositeData[] lockedMonitorsData =
(CompositeData[]) cdata.get(LOCKED_MONITORS);
@@ -377,7 +318,14 @@
return monitors;
}
+ /**
+ * Returns an empty array if locked_monitors attribute is not present.
+ */
public LockInfo[] lockedSynchronizers() {
+ if (!cdata.containsKey(LOCKED_SYNCS)) {
+ return new LockInfo[0];
+ }
+
CompositeData[] lockedSyncsData =
(CompositeData[]) cdata.get(LOCKED_SYNCS);
@@ -391,7 +339,8 @@
return locks;
}
- /** Validate if the input CompositeData has the expected
+ /**
+ * Validate if the input CompositeData has the expected
* CompositeType (i.e. contain all attributes with expected
* names and types).
*/
@@ -401,62 +350,98 @@
}
CompositeType type = cd.getCompositeType();
- boolean currentVersion = true;
- if (!isTypeMatched(threadInfoCompositeType, type)) {
- currentVersion = false;
- // check if cd is an older version
- if (!isTypeMatched(threadInfoV5CompositeType, type) &&
- !isTypeMatched(threadInfoV6CompositeType, type)) {
- throw new IllegalArgumentException(
- "Unexpected composite type for ThreadInfo");
+ int version;
+ if (Arrays.stream(V9_ATTRIBUTES).anyMatch(type::containsKey)) {
+ version = Runtime.version().feature();
+ } else if (Arrays.stream(V6_ATTRIBUTES).anyMatch(type::containsKey)) {
+ version = 6;
+ } else {
+ version = 5;
+ }
+
+ if (!isTypeMatched(ThreadInfoCompositeTypes.ofVersion(version), type)) {
+ throw new IllegalArgumentException(
+ "Unexpected composite type for ThreadInfo of version " + version);
+ }
+ }
+
+ public static CompositeType compositeType() {
+ return ThreadInfoCompositeTypes.compositeTypes.get(0);
+ }
+
+ static class ThreadInfoCompositeTypes {
+ static final int CURRENT = Runtime.version().feature();
+ static final Map<Integer, CompositeType> compositeTypes = initCompositeTypes();
+ /*
+ * Returns CompositeType of the given runtime version
+ */
+ static CompositeType ofVersion(int version) {
+ return compositeTypes.get(version);
+ }
+
+ static Map<Integer, CompositeType> initCompositeTypes() {
+ Map<Integer, CompositeType> types = new HashMap<>();
+ CompositeType ctype = initCompositeType();
+ types.put(CURRENT, ctype);
+ types.put(5, initV5CompositeType(ctype));
+ types.put(6, initV6CompositeType(ctype));
+ return types;
+ }
+
+ static CompositeType initCompositeType() {
+ try {
+ return (CompositeType)MappedMXBeanType.toOpenType(ThreadInfo.class);
+ } catch (OpenDataException e) {
+ // Should never reach here
+ throw new AssertionError(e);
}
}
- CompositeData[] stackTraceData =
- (CompositeData[]) cd.get(STACK_TRACE);
- if (stackTraceData == null) {
- throw new IllegalArgumentException(
- "StackTraceElement[] is missing");
- }
- if (stackTraceData.length > 0) {
- StackTraceElementCompositeData.validateCompositeData(stackTraceData[0]);
+ static CompositeType initV5CompositeType(CompositeType threadInfoCompositeType) {
+ try {
+ OpenType<?>[] v5Types = new OpenType<?>[V5_ATTRIBUTES.length];
+ for (int i = 0; i < v5Types.length; i++) {
+ String name = V5_ATTRIBUTES[i];
+ v5Types[i] = name.equals(STACK_TRACE)
+ ? new ArrayType<>(1, StackTraceElementCompositeData.v5CompositeType())
+ : threadInfoCompositeType.getType(name);
+ }
+ return new CompositeType("ThreadInfo",
+ "JDK 5 ThreadInfo",
+ V5_ATTRIBUTES,
+ V5_ATTRIBUTES,
+ v5Types);
+ } catch (OpenDataException e) {
+ // Should never reach here
+ throw new AssertionError(e);
+ }
}
- // validate v6 attributes
- if (currentVersion) {
- CompositeData li = (CompositeData) cd.get(LOCK_INFO);
- if (li != null) {
- if (!isTypeMatched(lockInfoCompositeType,
- li.getCompositeType())) {
- throw new IllegalArgumentException(
- "Unexpected composite type for \"" +
- LOCK_INFO + "\" attribute.");
+ static CompositeType initV6CompositeType(CompositeType threadInfoCompositeType) {
+ try {
+ String[] v6Names = Stream.of(V5_ATTRIBUTES, V6_ATTRIBUTES)
+ .flatMap(Arrays::stream).toArray(String[]::new);
+ OpenType<?>[] v6Types = new OpenType<?>[v6Names.length];
+ for (int i = 0; i < v6Names.length; i++) {
+ String name = v6Names[i];
+ OpenType<?> ot = threadInfoCompositeType.getType(name);
+ if (name.equals(STACK_TRACE)) {
+ ot = new ArrayType<>(1, StackTraceElementCompositeData.v5CompositeType());
+ } else if (name.equals(LOCKED_MONITORS)) {
+ ot = new ArrayType<>(1, MonitorInfoCompositeData.v6CompositeType());
+ }
+ v6Types[i] = ot;
}
- }
-
- CompositeData[] lms = (CompositeData[]) cd.get(LOCKED_MONITORS);
- if (lms == null) {
- throw new IllegalArgumentException("MonitorInfo[] is null");
+ return new CompositeType("ThreadInfo",
+ "JDK 6 ThreadInfo",
+ v6Names,
+ v6Names,
+ v6Types);
+ } catch (OpenDataException e) {
+ // Should never reach here
+ throw new AssertionError(e);
}
- if (lms.length > 0) {
- MonitorInfoCompositeData.validateCompositeData(lms[0]);
- }
-
- CompositeData[] lsyncs = (CompositeData[]) cd.get(LOCKED_SYNCS);
- if (lsyncs == null) {
- throw new IllegalArgumentException("LockInfo[] is null");
- }
- if (lsyncs.length > 0) {
- if (!isTypeMatched(lockInfoCompositeType,
- lsyncs[0].getCompositeType())) {
- throw new IllegalArgumentException(
- "Unexpected composite type for \"" +
- LOCKED_SYNCS + "\" attribute.");
- }
- }
-
}
}
-
private static final long serialVersionUID = 2464378539119753175L;
}
--- a/src/java.management/share/classes/sun/management/TypeVersionMapper.java Fri Mar 02 15:02:26 2018 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management;
-
-import java.lang.management.ThreadInfo;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Predicate;
-import javax.management.openmbean.ArrayType;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.TabularType;
-import static sun.management.Util.toStringArray;
-
-/**
- * Provides simplistic support for versioning of {@linkplain CompositeType} instances
- * based on the latest version and filtering out certain items.
- */
-final class TypeVersionMapper {
- private static final class Singleton {
- private final static TypeVersionMapper INSTANCE = new TypeVersionMapper();
- }
-
- final static String V5 = "J2SE 5.0";
- final static String V6 = "Java SE 6";
-
- private final Map<String, Map<String, Predicate<String>>> filterMap;
-
- private TypeVersionMapper() {
- filterMap = new HashMap<>();
- setupStackTraceElement();
- setupThreadInfo();
- }
-
- public static TypeVersionMapper getInstance() {
- return Singleton.INSTANCE;
- }
-
- private void setupStackTraceElement() {
- Map<String, Predicate<String>> filter = new HashMap<>();
- filterMap.put(StackTraceElement.class.getName(), filter);
- filter.put(V5, StackTraceElementCompositeData::isV6Attribute);
- filter.put(V6, StackTraceElementCompositeData::isV6Attribute);
- }
-
- private void setupThreadInfo() {
- Map<String, Predicate<String>> filter = new HashMap<>();
- filterMap.put(ThreadInfo.class.getName(), filter);
- filter.put(V5, ThreadInfoCompositeData::isV5Attribute);
- filter.put(V6, ThreadInfoCompositeData::isV6Attribute);
- }
-
- /**
- * Retrieves the specified version of a {@linkplain CompositeType} instance.
- * @param type The current (latest) version of {@linkplain CompositeType}
- * @param version The version identifier (eg. {@linkplain TypeVersionMapper#V5})
- * @return Returns the {@linkplain CompositeType} corresponding to the requested
- * version.
- * @throws OpenDataException
- */
- CompositeType getVersionedCompositeType(CompositeType type, String version)
- throws OpenDataException
- {
- Predicate<String> filter = getFilter(type.getTypeName(), version);
- if (filter == null) {
- return type;
- }
-
- List<String> itemNames = new ArrayList<>();
- List<String> itemDesc = new ArrayList<>();
- List<OpenType<?>> itemTypes = new ArrayList<>();
-
- for(String item : type.keySet()) {
- if (filter.test(item)) {
- itemNames.add(item);
- itemDesc.add(type.getDescription(item));
- itemTypes.add(getVersionedType(
- type.getType(item),
- version
- ));
- }
- }
- return new CompositeType(
- type.getTypeName(),
- version != null ? version + " " + type.getDescription() : type.getDescription(),
- itemNames.toArray(new String[itemNames.size()]),
- itemDesc.toArray(new String[itemDesc.size()]),
- itemTypes.toArray(new OpenType<?>[itemTypes.size()])
- );
- }
-
- private OpenType<?> getVersionedType(OpenType<?> type, String version)
- throws OpenDataException
- {
- if (type instanceof ArrayType) {
- return getVersionedArrayType((ArrayType)type, version);
- }
- if (type instanceof CompositeType) {
- return getVersionedCompositeType((CompositeType)type, version);
- }
- if (type instanceof TabularType) {
- return getVersionedTabularType((TabularType)type, version);
- }
- return type;
- }
-
- private ArrayType<?> getVersionedArrayType(ArrayType<?> type, String version)
- throws OpenDataException
- {
- if (type.isPrimitiveArray()) {
- return type;
- }
- OpenType<?> ot = getVersionedType(
- type.getElementOpenType(),
- version
- );
- if (ot instanceof SimpleType) {
- return new ArrayType<>((SimpleType<?>)ot, type.isPrimitiveArray());
- } else {
- return new ArrayType<>(type.getDimension(), ot);
- }
- }
-
- private TabularType getVersionedTabularType(TabularType type, String version)
- throws OpenDataException
- {
- CompositeType ct = getVersionedCompositeType(
- type.getRowType(),
- version
- );
-
- if (ct != null) {
- return new TabularType(
- type.getTypeName(), type.getDescription(), ct,
- toStringArray(type.getIndexNames()));
- }
- return null;
- }
-
- private Predicate<String> getFilter(String type, String version) {
- Map<String, Predicate<String>> versionMap = filterMap.get(type);
- if (versionMap == null) {
- return null;
- }
-
- return versionMap.get(version);
- }
-}
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Fri Mar 02 21:00:12 2018 +0100
@@ -35,7 +35,6 @@
import com.sun.tools.javac.code.Source.Feature;
import com.sun.tools.javac.parser.Tokens.*;
import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle;
-import com.sun.tools.javac.resources.CompilerProperties;
import com.sun.tools.javac.resources.CompilerProperties.Errors;
import com.sun.tools.javac.resources.CompilerProperties.Fragments;
import com.sun.tools.javac.resources.CompilerProperties.Warnings;
@@ -43,9 +42,7 @@
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
-import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.util.JCDiagnostic.Error;
-import com.sun.tools.javac.util.JCDiagnostic.Warning;
import com.sun.tools.javac.util.JCDiagnostic.Fragment;
import com.sun.tools.javac.util.List;
@@ -58,6 +55,9 @@
import static com.sun.tools.javac.parser.Tokens.TokenKind.IMPORT;
import static com.sun.tools.javac.parser.Tokens.TokenKind.LT;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
+import static com.sun.tools.javac.resources.CompilerProperties.Fragments.ImplicitAndExplicitNotAllowed;
+import static com.sun.tools.javac.resources.CompilerProperties.Fragments.VarAndExplicitNotAllowed;
+import static com.sun.tools.javac.resources.CompilerProperties.Fragments.VarAndImplicitNotAllowed;
/** The parser maps a token sequence into an abstract syntax
* tree. It operates by recursive descent, with code derived
@@ -1673,8 +1673,6 @@
CAST,
EXPLICIT_LAMBDA,
IMPLICIT_LAMBDA,
- IMPLICIT_LAMBDA_ALL_VAR,
- BAD_LAMBDA,
PARENS
}
@@ -1682,89 +1680,77 @@
List<JCVariableDecl> params = explicitParams ?
formalParameters(true) :
implicitParameters(hasParens);
-
if (explicitParams) {
- LambdaClassfier lambdaClassfier = new LambdaClassfier();
+ LambdaClassifier lambdaClassifier = new LambdaClassifier();
for (JCVariableDecl param: params) {
if (param.vartype != null &&
isRestrictedLocalVarTypeName(param.vartype) &&
param.vartype.hasTag(TYPEARRAY)) {
log.error(DiagnosticFlag.SYNTAX, param.pos, Errors.VarNotAllowedArray);
}
- if (param.vartype != null && param.name != names.empty) {
- if (isRestrictedLocalVarTypeName(param.vartype)) {
- lambdaClassfier.addImplicitVarParameter();
- } else {
- lambdaClassfier.addExplicitParameter();
- }
- }
- if (param.vartype == null && param.name != names.empty ||
- param.vartype != null && param.name == names.empty) {
- lambdaClassfier.addImplicitParameter();
- }
- if (lambdaClassfier.result() == ParensResult.BAD_LAMBDA) {
+ lambdaClassifier.addParameter(param);
+ if (lambdaClassifier.result() == LambdaParameterKind.ERROR) {
break;
}
}
- if (lambdaClassfier.diagFragment != null) {
- log.error(DiagnosticFlag.SYNTAX, pos, Errors.InvalidLambdaParameterDeclaration(lambdaClassfier.diagFragment));
+ if (lambdaClassifier.diagFragment != null) {
+ log.error(DiagnosticFlag.SYNTAX, pos, Errors.InvalidLambdaParameterDeclaration(lambdaClassifier.diagFragment));
}
}
return lambdaExpressionOrStatementRest(params, pos);
}
- class LambdaClassfier {
- ParensResult kind; //ParensResult.EXPLICIT_LAMBDA;
+ enum LambdaParameterKind {
+ EXPLICIT(0),
+ IMPLICIT(1),
+ VAR(2),
+ ERROR(-1);
+
+ private final int index;
+
+ LambdaParameterKind(int index) {
+ this.index = index;
+ }
+ }
+
+ private final static Fragment[][] decisionTable = new Fragment[][]{
+ /* EXPLICIT IMPLICIT VAR */
+ /* EXPLICIT */ {null, ImplicitAndExplicitNotAllowed, VarAndExplicitNotAllowed},
+ /* IMPLICIT */ {ImplicitAndExplicitNotAllowed, null, VarAndImplicitNotAllowed},
+ /* VAR */ {VarAndExplicitNotAllowed, VarAndImplicitNotAllowed, null}
+ };
+
+ class LambdaClassifier {
+
+ LambdaParameterKind kind;
Fragment diagFragment;
List<JCVariableDecl> params;
- void addExplicitParameter() {
- reduce(ParensResult.EXPLICIT_LAMBDA);
- }
-
- void addImplicitVarParameter() {
- reduce(ParensResult.IMPLICIT_LAMBDA_ALL_VAR);
+ void addParameter(JCVariableDecl param) {
+ if (param.vartype != null && param.name != names.empty) {
+ if (isRestrictedLocalVarTypeName(param.vartype)) {
+ reduce(LambdaParameterKind.VAR);
+ } else {
+ reduce(LambdaParameterKind.EXPLICIT);
+ }
+ }
+ if (param.vartype == null && param.name != names.empty ||
+ param.vartype != null && param.name == names.empty) {
+ reduce(LambdaParameterKind.IMPLICIT);
+ }
}
- void addImplicitParameter() {
- reduce(ParensResult.IMPLICIT_LAMBDA);
- }
-
- private void reduce(ParensResult newKind) {
+ private void reduce(LambdaParameterKind newKind) {
if (kind == null) {
kind = newKind;
- } else if (kind != newKind && kind != ParensResult.BAD_LAMBDA) {
- ParensResult currentKind = kind;
- kind = ParensResult.BAD_LAMBDA;
- switch (currentKind) {
- case EXPLICIT_LAMBDA:
- if (newKind == ParensResult.IMPLICIT_LAMBDA) {
- diagFragment = Fragments.ImplicitAndExplicitNotAllowed;
- } else if (newKind == ParensResult.IMPLICIT_LAMBDA_ALL_VAR) {
- diagFragment = Fragments.VarAndExplicitNotAllowed;
- }
- break;
- case IMPLICIT_LAMBDA:
- if (newKind == ParensResult.EXPLICIT_LAMBDA) {
- diagFragment = Fragments.ImplicitAndExplicitNotAllowed;
- } else if (newKind == ParensResult.IMPLICIT_LAMBDA_ALL_VAR) {
- diagFragment = Fragments.VarAndImplicitNotAllowed;
- }
- break;
- case IMPLICIT_LAMBDA_ALL_VAR:
- if (newKind == ParensResult.EXPLICIT_LAMBDA) {
- diagFragment = Fragments.VarAndExplicitNotAllowed;
- } else if (newKind == ParensResult.IMPLICIT_LAMBDA) {
- diagFragment = Fragments.VarAndImplicitNotAllowed;
- }
- break;
- default:
- throw new AssertionError("unexpected option for field kind");
- }
+ } else if (kind != newKind && kind != LambdaParameterKind.ERROR) {
+ LambdaParameterKind currentKind = kind;
+ kind = LambdaParameterKind.ERROR;
+ diagFragment = decisionTable[currentKind.index][newKind.index];
}
}
- ParensResult result() {
+ LambdaParameterKind result() {
return kind;
}
}
--- a/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java Fri Mar 02 15:02:26 2018 -0800
+++ b/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java Fri Mar 02 21:00:12 2018 +0100
@@ -311,15 +311,18 @@
return fm.createSourceFileObject(w, w.classFullName(), w.wrapped());
}
+ /**
+ * Get the source information from the wrap. If this is external, or
+ * otherwise does not have wrap info, just use source code.
+ * @param d the Diagnostic from the compiler
+ * @return the corresponding Diag
+ */
@Override
public Diag diag(Diagnostic<? extends JavaFileObject> d) {
- SourceMemoryJavaFileObject smjfo = (SourceMemoryJavaFileObject) d.getSource();
- if (smjfo == null) {
- // Handle failure that doesn't preserve mapping
- return new StringSourceHandler().diag(d);
- }
- OuterWrap w = (OuterWrap) smjfo.getOrigin();
- return w.wrapDiag(d);
+ JavaFileObject jfo = d.getSource();
+ return jfo instanceof SourceMemoryJavaFileObject
+ ? ((OuterWrap) ((SourceMemoryJavaFileObject) jfo).getOrigin()).wrapDiag(d)
+ : new StringSourceHandler().diag(d);
}
}
--- a/test/jdk/ProblemList.txt Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/ProblemList.txt Fri Mar 02 21:00:12 2018 +0100
@@ -111,8 +111,10 @@
# jdk_awt
+java/awt/BasicStroke/DashScaleMinWidth.java 8198411 windows-all
+java/awt/BasicStroke/DashZeroWidth.java 8198411 windows-all
java/awt/event/MouseEvent/MouseClickTest/MouseClickTest.html 8168389 windows-all,macosx-all
-java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java 8168408 windows-all
+java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java 8168408 windows-all,macosx-all
java/awt/Focus/FocusOwnerFrameOnClick/FocusOwnerFrameOnClick.java 8081489 generic-all
java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java 6849364 generic-all
java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 generic-all
@@ -120,28 +122,62 @@
java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all
java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all
+java/awt/FileDialog/8003399/bug8003399.java 8198334 windows-all
java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all
java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all
java/awt/dnd/BadSerializaionTest/BadSerializationTest.java 8039082 generic-all
-java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all
+java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all
+java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html 8171510 macosx-all
+java/awt/dnd/7171812/bug7171812.java 8041447 macosx-all
+java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all
+java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all
+java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252 macosx-all
+java/awt/Focus/FocusTraversalPolicy/ButtonGroupLayoutTraversal/ButtonGroupLayoutTraversalTest.java 8198619 macosx-all
+java/awt/Focus/KeyEventForBadFocusOwnerTest/KeyEventForBadFocusOwnerTest.java 8198621 macosx-all
+java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java 8194753 linux-all,macosx-all
+java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest.java 7152980 macosx-all
+java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java 8028701 macosx-all
+java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java 8159599 macosx-all
+java/awt/Focus/TypeAhead/TestFocusFreeze.java 8198622 macosx-all
+java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096 macosx-all
java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 6626492 generic-all
+java/awt/EventQueue/6980209/bug6980209.java 8198615 macosx-all
java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java 8129569 generic-all
+java/awt/Frame/ExceptionOnSetExtendedStateTest/ExceptionOnSetExtendedStateTest.java 8198237 macosx-all
+java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java 8144030 macosx-all
+java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java 7158623 macosx-all
+java/awt/grab/EmbeddedFrameTest1/EmbeddedFrameTest1.java 7080150 macosx-all
java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
+java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 8198623 macosx-all
+java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java 8198623 macosx-all
+java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.html 8198624 macosx-all
+java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html 8198626 macosx-all
+java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8049405 macosx-all
java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all
-java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java 8159451 linux-all,windows-all
+java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java 8159451 linux-all,windows-all,macosx-all
java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 6986109 windows-all
java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 6986109 windows-all
-java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 8194765 windows-all
+java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 8194765 windows-all,macosx-all
java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java 8049405 generic-all
+java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8049405 macosx-all
+java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java 8049405 macosx-all
+java/awt/Mixing/NonOpaqueInternalFrame.java 7124549 macosx-all
java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all
java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all
+java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all
java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all
+java/awt/Toolkit/RealSync/Test.java 6849383 macosx-all
java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all
java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 6990210 generic-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html 4931413 windows-all
java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all
-java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all
-java/awt/Focus/6981400/Test1.java 8029675 windows-all
+java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java 8198335 windows-all
+java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all
+java/awt/Focus/6378278/InputVerifierTest.java 8198616 macosx-all
+java/awt/Focus/6382144/EndlessLoopTest.java 8198617 macosx-all
+java/awt/Focus/6981400/Test1.java 8029675 windows-all,macosx-all
+java/awt/Focus/8073453/AWTFocusTransitionTest.java 8136517 macosx-all
+java/awt/Focus/8073453/SwingFocusTransitionTest.java 8136517 macosx-all
java/awt/Focus/6981400/Test3.java 8173264 generic-all
java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all
java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474 windows-all
@@ -152,8 +188,8 @@
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.html 8194947 generic-all
java/awt/dnd/ImageTransferTest/ImageTransferTest.java 8176556 generic-all
-java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java 7054585 generic-all
java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java 8196006 windows-all
+java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java 8047218 generic-all
java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java 8000171 windows-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8196017 windows-all
@@ -161,7 +197,7 @@
java/awt/TrayIcon/ActionCommand/ActionCommand.java 8150540 windows-all
java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8150540 windows-all
java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 8150540 windows-all
-java/awt/TrayIcon/ModalityTest/ModalityTest.java 8150540 windows-all
+java/awt/TrayIcon/ModalityTest/ModalityTest.java 8150540 windows-all,macosx-all
java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java 8150540 windows-all
java/awt/TrayIcon/MouseEventMask/MouseEventMovedTest.java 8150540 windows-all
java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java 8150540 windows-all
@@ -169,102 +205,275 @@
java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java 8150540 windows-all
java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java 8150540 windows-all
java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 8150540 windows-all
-java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8150540 windows-all
+java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8150540 windows-all,macosx-all
java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 8150540 windows-all
java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java 8196440 linux-all
java/awt/Window/Grab/GrabTest.java 8196019 windows-all
java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java 8196020 windows-all
+java/awt/Window/ShapedAndTranslucentWindows/FocusAWTTest.java 8061236 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/SetShapeAndClick.java 8197936 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/SetShapeDynamicallyAndClick.java 8013450 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/Shaped.java 8078999 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/ShapedByAPI.java 8078999 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucent.java 8078999 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java 8196020 macosx-all
+java/awt/Window/ShapedAndTranslucentWindows/StaticallyShaped.java 8165218 macosx-all
+java/awt/Window/AlwaysOnTop/AutoTestOnTop.java 6847593 macosx-all
+java/awt/Window/GrabSequence/GrabSequence.java 6848409 macosx-all
java/awt/font/TextLayout/CombiningPerf.java 8192931 generic-all
+java/awt/font/TextLayout/TextLayoutBounds.java 8169188 macosx-all
+java/awt/font/MonospacedGlyphWidth/MonospacedGlyphWidthTest.java 8198412 linux-all,solaris-all
+java/awt/font/StyledMetrics/BoldSpace.java 8198422 linux-all
+java/awt/FontMetrics/FontCrash.java 8198336 windows-all
java/awt/image/DrawImage/IncorrectAlphaSurface2SW.java 8056077 generic-all
java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java 8196025 windows-all
java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java 8196025 windows-all
java/awt/image/DrawImage/IncorrectSourceOffset.java 8196086 windows-all
java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java 8196087 windows-all
+java/awt/image/MultiResolutionImage/MultiResolutionDrawImageWithTransformTest.java 8198390 generic-all
+java/awt/image/multiresolution/MultiresolutionIconTest.java 8169187 macosx-all
java/awt/print/Headless/HeadlessPrinterJob.java 8196088 windows-all
+java/awt/print/PrinterJob/TestPgfmtSetMPA.java 8198343 generic-all
+sun/awt/datatransfer/SuplementaryCharactersTransferTest.java 8011371 generic-all
+sun/awt/shell/ShellFolderMemoryLeak.java 8197794 windows-all
sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java 8022403 generic-all
sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java 8196102 generic-all
sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java 8196180 windows-all
sun/java2d/GdiRendering/InsetClipping.java 8196181 windows-all
-sun/java2d/OpenGL/CopyAreaOOB.java 7001973 windows-all
+sun/java2d/OpenGL/CopyAreaOOB.java 7001973 windows-all,macosx-all
+sun/java2d/SunGraphics2D/EmptyClipRenderingTest.java 8144029 macosx-all
sun/java2d/SunGraphics2D/DrawImageBilinear.java 8191506 generic-all
sun/java2d/SunGraphics2D/PolyVertTest.java 6986565 generic-all
sun/java2d/SunGraphics2D/SimplePrimQuality.java 7992007 generic-all
-sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java 8196191 windows-all
-sun/java2d/pipe/InterpolationQualityTest.java 8171303 windows-all,linux-all
+sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java 8196191 windows-all,macosx-all
+sun/java2d/pipe/InterpolationQualityTest.java 8171303 windows-all,linux-all,macosx-all
java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java 8196186 windows-all
java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469 windows-all
java/awt/FullScreen/NonExistentDisplayModeTest/NonExistentDisplayModeTest.java 8196187 windows-all
java/awt/Graphics/ClippedCopyAreaTest/ClippedCopyAreaTest.java 8196436 linux-all
java/awt/Graphics/CopyScaledArea/CopyScaledAreaTest.java 8196189 windows-all
+java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8197796 generic-all
java/awt/GraphicsDevice/CloneConfigsTest.java 8196190 windows-all
java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java 8196300 windows-all
java/awt/print/PrinterJob/Margins.java 8196301 windows-all
+java/awt/print/PrinterJob/PSQuestionMark.java 7003378 windows-all
+java/awt/print/PrinterJob/GlyphPositions.java 7003378 windows-all
java/awt/Choice/PopupPosTest/PopupPosTest.html 8192930 windows-all
+java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html 6849922 macosx-all
+java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all
+java/awt/Component/CreateImage/CreateImage.java 8198334 windows-all
java/awt/Component/GetScreenLocTest.java 4753654 windows-all
java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html 8192929 windows-all
-java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java 7054586 windows-all
+java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html 8017454 macosx-all
java/awt/Dialog/SiblingChildOrder/SiblingChildOrderTest.java 8193940 windows-all
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all
java/awt/Frame/MiscUndecorated/RepaintTest.java 8079267 windows-all
java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java 8157173 windows-all
+java/awt/Modal/FileDialog/FileDialogAppModal1Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogAppModal2Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogAppModal3Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogAppModal4Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogAppModal5Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogAppModal6Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal1Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal2Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal3Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal4Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal5Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal6Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogDocModal7Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogModal1Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogModal2Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogModal3Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogModal4Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogModal5Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogModal6Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal1Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal2Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal3Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal4Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal5Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal6Test.java 8198664 macosx-all
+java/awt/Modal/FileDialog/FileDialogNonModal7Test.java 8198664 macosx-all
java/awt/Modal/FileDialog/FileDialogTKModal1Test.java 8196430 generic-all
java/awt/Modal/FileDialog/FileDialogTKModal2Test.java 8196430 generic-all
java/awt/Modal/FileDialog/FileDialogTKModal3Test.java 8196430 generic-all
java/awt/Modal/FileDialog/FileDialogTKModal4Test.java 8196430 generic-all
java/awt/Modal/FileDialog/FileDialogTKModal5Test.java 8196430 generic-all
java/awt/Modal/FileDialog/FileDialogTKModal6Test.java 8196430 generic-all
-java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPageSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPrintSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePageSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePrintSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPageSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPrintSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePageSetupTest.java 8196431 linux-all
-java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePrintSetupTest.java 8196431 linux-all
+java/awt/Modal/FileDialog/FileDialogTKModal7Test.java 8196430 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingDocModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDModelessTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDNonModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal3Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWDocModal4Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWModeless1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWModeless2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWModeless3Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWModeless4Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal3Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingFDWNonModal4Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal3Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal4Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal5Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsAppModal6Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsDocModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal3Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal4Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal5Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsSetModal6Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal1Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal2Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal3Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal4Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal5Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/BlockingWindowsToolkitModal6Test.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/UnblockedDialogAppModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/UnblockedDialogDocModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/UnblockedDialogModelessTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/UnblockedDialogNonModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/UnblockedDialogSetModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalBlockingTests/UnblockedDialogToolkitModalTest.java 8198665 macosx-all
+java/awt/Modal/ModalDialogOrderingTest/ModalDialogOrderingTest.java 8066259 macosx-all
+java/awt/Modal/ModalExclusionTests/ApplicationExcludeFrameFileTest.java 8047179 macosx-all
+java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogFileTest.java 8047179 macosx-all
+java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPageSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPrintSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePageSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePrintSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ToolkitExcludeFrameFileTest.java 8047179 macosx-all
+java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogFileTest.java 8196431 macosx-all
+java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPageSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPrintSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePageSetupTest.java 8196431 linux-all,macosx-all
+java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePrintSetupTest.java 8196431 linux-all,macosx-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java 8058813 windows-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java 8196191 windows-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java 8196432 linux-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java 8196432 linux-all,macosx-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java 8196432 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java 8196432 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java 8196432 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java 8196432 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java 8196432 linux-all
-java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java 8196432 linux-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java 8196432 linux-all,macosx-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java 8196432 linux-all,macosx-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java 8196432 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java 8196432 linux-all
+java/awt/Modal/MultipleDialogs/MultipleDialogs1Test.java 8198665 macosx-all
+java/awt/Modal/MultipleDialogs/MultipleDialogs2Test.java 8198665 macosx-all
+java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java 8198665 macosx-all
+java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java 8198665 macosx-all
+java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java 8198665 macosx-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8196435 linux-all
+java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all
+java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8023562 macosx-all
+java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all
+java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all
+java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all
+java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java 8157170 macosx-all
java/awt/Focus/ForwardingFocusToProxyMotifTest/ForwardingFocusToProxyMotifTest.java 8196436 linux-all
java/awt/Window/OverrideRedirectRemoved/ChildWindowProblem.java 8196438 linux-all
-java/awt/Modal/ToBack/ToBackAppModal1Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackAppModal2Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackAppModal3Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackAppModal4Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackModal1Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackModal2Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackModal3Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackModal4Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackTKModal1Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackTKModal2Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackTKModal3Test.java 8196441 linux-all
-java/awt/Modal/ToBack/ToBackTKModal4Test.java 8196441 linux-all
+java/awt/Modal/ToBack/ToBackAppModal1Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackAppModal2Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackAppModal3Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackAppModal4Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackAppModal5Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackModal1Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackModal2Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackModal3Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackModal4Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackTKModal1Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackTKModal2Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackTKModal3Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackTKModal4Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackTKModal5Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackDocModal1Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackDocModal2Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackDocModal3Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackDocModal4Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackDocModal5Test.java 8196441 linux-all,macosx-all
+java/awt/Modal/ToBack/ToBackModeless1Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackModeless2Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackModeless3Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackModeless4Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackModeless5Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackNonModal1Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackNonModal2Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackNonModal3Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackNonModal4Test.java 8196441 macosx-all
+java/awt/Modal/ToBack/ToBackNonModal5Test.java 8196441 macosx-all
+java/awt/Modal/OnTop/OnTopAppModal1Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopAppModal2Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopAppModal3Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopAppModal4Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopAppModal5Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopAppModal6Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopDocModal1Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopDocModal2Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopDocModal3Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopDocModal4Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopDocModal5Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopDocModal6Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal1Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal2Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal3Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal4Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal5Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal6Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModal6Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModeless1Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModeless2Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModeless3Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModeless4Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModeless5Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopModeless6Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopTKModal1Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopTKModal2Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopTKModal3Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopTKModal4Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopTKModal5Test.java 8198666 macosx-all
+java/awt/Modal/OnTop/OnTopTKModal6Test.java 8198666 macosx-all
java/awt/List/SingleModeDeselect/SingleModeDeselect.java 8196301 windows-all
+java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235 macosx-all
+javax/print/PrintSEUmlauts/PrintSEUmlauts.java 8135174 generic-all
############################################################################
@@ -274,6 +483,8 @@
java/beans/Introspector/8132566/OverridePropertyInfoTest.java 8132565 generic-all
java/beans/Introspector/8132566/OverrideUserDefPropertyInfoTest.java 8132565 generic-all
+java/beans/XMLEncoder/Test6570354.java 8015593 macosx-all
+
############################################################################
# jdk_lang
@@ -403,52 +614,91 @@
# jdk_swing
+com/sun/java/swing/plaf/windows/Test8173145.java 8198334 windows-all
+
+javax/swing/border/Test6981576.java 8198339 generic-all
javax/swing/JComponent/7154030/bug7154030.java 7190978 generic-all
-javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java 8186513 generic-all
javax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java 8067986 generic-all
javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
-javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all
+javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all,macosx-all
javax/swing/text/html/parser/Test8017492.java 8022535 generic-all
-javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java 8081476 windows-all
+javax/swing/JButton/8151303/PressedIconTest.java 8198689 macosx-all
+javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java 8081476 windows-all,macosx-all
+javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128 macosx-all
+javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8198667 macosx-all
+javax/swing/JWindow/ShapedAndTranslucentWindows/SetShapeAndClickSwing.java 8013450 macosx-all
+javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8190347 macosx-all
# The next test below is an intermittent failure
javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
-javax/swing/JColorChooser/Test6541987.java 8143021 windows-all,linux-all
+javax/swing/JColorChooser/Test6541987.java 8143021 windows-all,linux-all,macosx-all
+javax/swing/JColorChooser/Test7194184.java 8194126 linux-all,macosx-all
javax/swing/JTable/7124218/SelectEditTableCell.java 8148958 linux-all
+javax/swing/JTable/4235420/bug4235420.java 8079127 linux-all,macosx-all
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
+javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
+javax/swing/JTree/8003400/Test8003400.java 8011259 macosx-all
javax/swing/JFileChooser/8041694/bug8041694.java 8196302 windows-all
javax/swing/JInternalFrame/8069348/bug8069348.java 8196303 windows-all
-javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all
-javax/swing/Action/8133039/bug8133039.java 8196089 windows-all
-javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all
+javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
+javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
+javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all
javax/swing/JComboBox/6607130/bug6607130.java 8196091 windows-all
-javax/swing/JComboBox/8032878/bug8032878.java 8196092 windows-all
-javax/swing/JComboBox/8057893/bug8057893.java 8169953 windows-all
-javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all
+javax/swing/JComboBox/8032878/bug8032878.java 8196092 windows-all,macosx-all
+javax/swing/JComboBox/8057893/bug8057893.java 8169953 windows-all,macosx-all
+javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all
+javax/swing/JEditorPane/5076514/bug5076514.java 8198321 generic-all
javax/swing/JEditorPane/6917744/bug6917744.java 8194767 generic-all
javax/swing/JFileChooser/4524490/bug4524490.java 8042380 generic-all
javax/swing/JFileChooser/8002077/bug8002077.java 8196094 windows-all
javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.java 8196095 generic-all
+javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8058231 macosx-all
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all
javax/swing/JInternalFrame/8020708/bug8020708.java 8194943 windows-all
javax/swing/JList/6462008/bug6462008.java 7156347 generic-all
-javax/swing/JPopupMenu/6580930/bug6580930.java 8196096 windows-all
+javax/swing/JPopupMenu/6580930/bug6580930.java 8196096 windows-all,macosx-all
+javax/swing/JPopupMenu/6800513/bug6800513.java 7184956 macosx-all
javax/swing/JPopupMenu/6675802/bug6675802.java 8196097 windows-all
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
+javax/swing/JTabbedPane/4624207/bug4624207.java 8064922 macosx-all
+javax/swing/JTabbedPane/7024235/Test7024235.java 8028281 macosx-all
javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8196098 windows-all
+javax/swing/plaf/basic/Test6984643.java 8198340 windows-all
javax/swing/text/CSSBorder/6796710/bug6796710.java 8196099 windows-all
javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java 8194048 windows-all
javax/swing/text/JTextComponent/5074573/bug5074573.java 8196100 windows-all
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
-javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java 8196434 linux-all
+javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java 8196434 linux-all,solaris-all
javax/swing/JComboBox/8032878/bug8032878.java 8196439 linux-all
-javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all
-javax/swing/JFileChooser/6738668/bug6738668.java 8194946 linux-all,macosx-all
-javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all
-javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all
-javax/swing/JInternalFrame/Test6325652.java 8196467 linux-all
-
+javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all,macosx-all
+javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
+javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all,macosx-all
+javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all
+javax/swing/JFileChooser/FileSystemView/FileSystemViewListenerLeak.java 8198342 generic-all
+javax/swing/JInternalFrame/Test6325652.java 8196467 linux-all,macosx-all
+javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 8194944 macosx-all
+javax/swing/JLabel/6596966/bug6596966.java 8040914 macosx-all
+javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all
+javax/swing/JPopupMenu/4966112/bug4966112.java 8064915 macosx-all
+javax/swing/MultiUIDefaults/Test6860438.java 8198391 generic-all
+javax/swing/MultiUIDefaults/4300666/bug4300666.java 7105119 macosx-all
+javax/swing/UITest/UITest.java 8198392 generic-all
+javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java 8198394 linux-all,macosx-all
+javax/swing/plaf/metal/MetalLookAndFeel/Test8039750.java 8198395 generic-all
+javax/swing/text/DevanagariEditor.java 8198397 linux-all
+javax/swing/JColorChooser/Test6199676.java 8198398 linux-all,macosx-all
+javax/swing/JTable/6735286/bug6735286.java 8198398 linux-all,macosx-all
+javax/swing/SpringLayout/4726194/bug4726194.java 8198399 generic-all
+javax/swing/SwingUtilities/6797139/bug6797139.java 8198400 generic-all
+javax/swing/text/html/parser/Parser/6836089/bug6836089.java 8198401 linux-all,macosx-all
+javax/swing/JTable/8133919/DrawGridLinesTest.java 8198407 generic-all
+javax/swing/text/html/StyleSheet/BackgroundImage/BackgroundImagePosition.java 8198409 generic-all
+javax/swing/text/AbstractDocument/DocumentInsert/DocumentInsertAtWrongPositionTest.java 8198396 generic-all
+javax/swing/JFileChooser/6868611/bug6868611.java 7059834 windows-all
+javax/swing/SwingWorker/6493680/bug6493680.java 8198410 windows-all
+javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 8042383 macosx-all
+javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099 macosx-all
############################################################################
@@ -486,10 +736,6 @@
com/sun/jdi/NashornPopFrameTest.java 8187143 generic-all
-com/sun/jdi/EarlyReturnTest.java 8198803 generic-all
-com/sun/jdi/EarlyReturnNegativeTest.java 8198803 generic-all
-com/sun/jdi/MethodExitReturnValuesTest.java 8198803 generic-all
-
############################################################################
# jdk_time
--- a/test/jdk/com/sun/jdi/EarlyReturnNegativeTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/com/sun/jdi/EarlyReturnNegativeTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -77,8 +77,9 @@
public static ClassLoader classLoaderValue;
{
try {
- urls[0] = new URL("hi there");
- } catch (java.net.MalformedURLException ee) {
+ urls[0] = new URL("file:/foo");
+ } catch (java.net.MalformedURLException ex) {
+ throw new AssertionError(ex);
}
classLoaderValue = new URLClassLoader(urls);
}
--- a/test/jdk/com/sun/jdi/EarlyReturnTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/com/sun/jdi/EarlyReturnTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -82,8 +82,9 @@
public static ClassLoader classLoaderValue;
{
try {
- urls[0] = new URL("hi there");
- } catch (java.net.MalformedURLException ee) {
+ urls[0] = new URL("file:/foo");
+ } catch (java.net.MalformedURLException ex) {
+ throw new AssertionError(ex);
}
classLoaderValue = new URLClassLoader(urls);
}
@@ -116,8 +117,9 @@
public static ClassLoader eclassLoaderValue;
{
try {
- urls[0] = new URL("been there, done that");
- } catch (java.net.MalformedURLException ee) {
+ urls[0] = new URL("file:/bar");
+ } catch (java.net.MalformedURLException ex) {
+ throw new AssertionError(ex);
}
classLoaderValue = new URLClassLoader(urls);
}
--- a/test/jdk/com/sun/jdi/MethodExitReturnValuesTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/com/sun/jdi/MethodExitReturnValuesTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -66,8 +66,9 @@
public static ClassLoader classLoaderValue;
{
try {
- urls[0] = new URL("hi there");
- } catch (java.net.MalformedURLException ee) {
+ urls[0] = new URL("file:/foo");
+ } catch (java.net.MalformedURLException ex) {
+ throw new AssertionError(ex);
}
classLoaderValue = new URLClassLoader(urls);
}
--- a/test/jdk/java/awt/Color/XRenderTranslucentColorDrawTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Color/XRenderTranslucentColorDrawTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/*
* @test
+ * @key headful
* @bug 8176795
* @summary Test verifies that we get proper color when we draw translucent
* color over an opaque color using X Render extension in Linux.
--- a/test/jdk/java/awt/Desktop/8064934/bug8064934.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Desktop/8064934/bug8064934.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,8 @@
/* @test
* @bug 8064934
+ * @key headful
+ * @requires (os.family == "windows")
* @summary Incorrect Exception message from java.awt.Desktop.open()
* @author Dmitry Markov
* @library ../../../../lib/testlibrary
--- a/test/jdk/java/awt/Desktop/OpenByUNCPathNameTest/OpenByUNCPathNameTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Desktop/OpenByUNCPathNameTest/OpenByUNCPathNameTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,8 @@
/* @test
@bug 6550588
+ @key headful
+ @requires (os.family == "windows")
@summary java.awt.Desktop cannot open file with Windows UNC filename
@author Anton Litvinov
*/
--- a/test/jdk/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
/*
@test
@key headful
- @bug 6829546
+ @bug 6829546, 8197808
@summary tests that an always-on-top modal dialog doesn't make any windows always-on-top
@author artem.ananiev: area=awt.modal
@library ../../regtesthelpers
@@ -32,9 +32,13 @@
@run main MakeWindowAlwaysOnTop
*/
-import java.awt.*;
-import java.awt.event.*;
-
+import java.awt.Frame;
+import java.awt.Dialog;
+import java.awt.EventQueue;
+import java.awt.Color;
+import java.awt.Robot;
+import java.awt.Point;
+import java.awt.event.InputEvent;
import test.java.awt.regtesthelpers.Util;
public class MakeWindowAlwaysOnTop
@@ -59,21 +63,9 @@
d = new Dialog(null, "Modal dialog", Dialog.ModalityType.APPLICATION_MODAL);
d.setBounds(500, 500, 160, 160);
d.setAlwaysOnTop(true);
- EventQueue.invokeLater(new Runnable()
- {
- public void run()
- {
- d.setVisible(true);
- }
- });
+ EventQueue.invokeLater(() -> d.setVisible(true) );
// Wait until the dialog is shown
- EventQueue.invokeAndWait(new Runnable()
- {
- public void run()
- {
- // Empty
- }
- });
+ EventQueue.invokeAndWait(() -> { /* Empty */ });
r.delay(100);
Util.waitForIdle(r);
@@ -104,29 +96,30 @@
// Bring it above the first frame
t.toFront();
- r.delay(100);
+
+ r.delay(200);
Util.waitForIdle(r);
+
Color c = r.getPixelColor(p.x + f.getWidth() / 2, p.y + f.getHeight() / 2);
System.out.println("Color = " + c);
- System.out.flush();
+
+ String exceptionMessage = null;
// If the color is RED, then the first frame is now always-on-top
- if (Color.RED.equals(c))
- {
- throw new RuntimeException("Test FAILED: the frame is always-on-top");
- }
- else if (!Color.BLUE.equals(c))
- {
- throw new RuntimeException("Test FAILED: unknown window is on top of the frame");
- }
- else
- {
- System.out.println("Test PASSED");
- System.out.flush();
+ if (Color.RED.equals(c)) {
+ exceptionMessage = "Test FAILED: the frame is always-on-top";
+ } else if (!Color.BLUE.equals(c)) {
+ exceptionMessage = "Test FAILED: unknown window is on top of the frame";
}
// Dispose all the windows
t.dispose();
f.dispose();
+
+ if (exceptionMessage != null) {
+ throw new RuntimeException(exceptionMessage);
+ } else {
+ System.out.println("Test PASSED");
+ }
}
}
--- a/test/jdk/java/awt/EmbeddedFrame/GraphicsConfigTest/GraphicsConfigTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/EmbeddedFrame/GraphicsConfigTest/GraphicsConfigTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
* @test
* @bug 6356322
+ * @key headful
* @summary Tests that embedded frame's graphics configuration is updated
* correctly when it is moved to another screen in multiscreen system,
* XToolkit
--- a/test/jdk/java/awt/FileDialog/FileDialogMemoryLeak/FileDialogLeakTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/FileDialog/FileDialogMemoryLeak/FileDialogLeakTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/**
* @test
+ * @key headful
* @bug 8177758
* @requires os.family == "windows"
* @summary Regression in java.awt.FileDialog
--- a/test/jdk/java/awt/FileDialog/ISCthrownByFileListTest/ISCthrownByFileListTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/FileDialog/ISCthrownByFileListTest/ISCthrownByFileListTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
@test
@bug 6304979
+ @key headful
@summary REG: File Dialog throws ArrayIndexOutOfBounds Exception on XToolkit with b45
@author Dmitry Cherepanov: area=awt.filedialog
@run main/othervm -Dsun.awt.disableGtkFileDialogs=true ISCthrownByFileListTest
--- a/test/jdk/java/awt/FileDialog/MoveToTrashTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/FileDialog/MoveToTrashTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/*
@test
+ @key headful
@bug 8190515 8193468
@summary java.awt.Desktop.moveToTrash(File) prompts on Windows 7 but not on Mac.
@run main MoveToTrashTest
--- a/test/jdk/java/awt/Focus/SortingFPT/JDK8048887.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Focus/SortingFPT/JDK8048887.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/*
@test
+ @key headful
@bug 8048887 8164937
@summary Tests SortingFTP for an exception caused by the tim-sort algo.
@author anton.tarasov: area=awt.focus
--- a/test/jdk/java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,9 +31,11 @@
/**
* @test
* @key headful
- * @bug 8065739
+ * @bug 8065739 8129569
+ * @requires (os.family == "mac")
* @summary [macosx] Frame warps to lower left of screen when displayed
* @author Alexandr Scherbatiy
+ * @run main MaximizedToUnmaximized
*/
public class MaximizedToUnmaximized {
--- a/test/jdk/java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,8 +23,8 @@
/**
* @test
- * @bug 6358034
- * @bug 6568560
+ * @bug 6358034 6568560
+ * @key headful
* @summary Tests that no exception is thrown when display mode is changed
* externally
* @compile UninitializedDisplayModeChangeTest.java DisplayModeChanger.java
--- a/test/jdk/java/awt/Graphics2D/ScaledTransform/ScaledTransform.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Graphics2D/ScaledTransform/ScaledTransform.java Fri Mar 02 21:00:12 2018 +0100
@@ -33,6 +33,7 @@
/*
* @test
* @bug 8069361
+ * @key headful
* @summary SunGraphics2D.getDefaultTransform() does not include scale factor
* @author Alexander Scherbatiy
* @run main ScaledTransform
--- a/test/jdk/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,6 +22,7 @@
*/
/* @test
+ * @key headful
* @bug 8156121
* @summary "Fail forward" fails for GTK3 if no GTK2 available
* @modules java.desktop/sun.awt
--- a/test/jdk/java/awt/JAWT/JAWT.sh Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/JAWT/JAWT.sh Fri Mar 02 21:00:12 2018 +0100
@@ -22,6 +22,7 @@
# questions.
# @test JAWT.sh
+# @key headful
# @bug 7190587
# @summary Tests Java AWT native interface library
# @author kshefov
@@ -111,7 +112,7 @@
else
ARCH="i386"
fi
- SYST="cygwin"
+ SYST="cygwin"
MAKE="make"
;;
Darwin )
--- a/test/jdk/java/awt/List/SetBackgroundTest/SetBackgroundTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/List/SetBackgroundTest/SetBackgroundTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,8 @@
/*
@test
@bug 6246467
+ @key headful
+ @requires (os.family == "linux") | (os.family == "solaris")
@summary List does not honor user specified background, foreground colors on XToolkit
@author Dmitry Cherepanov area=awt.list
@library ../../../../lib/testlibrary
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/MenuBar/DefaultMenuBarDispose.java Fri Mar 02 21:00:12 2018 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @key headful
+ * @bug 8196322
+ * @summary [macosx] When the screen menu bar is used, clearing the default menu bar should permit AWT shutdown
+ * @author Alan Snyder
+ * @run main/othervm DefaultMenuBarDispose
+ * @requires (os.family == "mac")
+ */
+
+import java.awt.Desktop;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JMenuBar;
+import javax.swing.SwingUtilities;
+
+public class DefaultMenuBarDispose
+{
+ public DefaultMenuBarDispose()
+ {
+ Thread watcher = new Thread(() -> {
+ try {
+ synchronized (this) {
+ wait(5000);
+ }
+ throw new RuntimeException("Test failed: failed to exit");
+ } catch (InterruptedException ex) {
+ }
+ });
+ watcher.setDaemon(true);
+ watcher.start();
+
+ runSwing(() ->
+ {
+ JMenuBar mb = new JMenuBar();
+ Desktop.getDesktop().setDefaultMenuBar(mb);
+ Desktop.getDesktop().setDefaultMenuBar(null);
+ }
+ );
+ }
+
+ private static void runSwing(Runnable r)
+ {
+ try {
+ SwingUtilities.invokeAndWait(r);
+ } catch (InterruptedException e) {
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ if (!System.getProperty("os.name").contains("OS X")) {
+ System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
+ return;
+ }
+
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+
+ new DefaultMenuBarDispose();
+ }
+}
--- a/test/jdk/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,7 +22,7 @@
*/
/*
- @test %I% %E%
+ @test
@key headful
@bug 6315717
@summary verifies that drag events are coming for every button if the property is set to true
--- a/test/jdk/java/awt/Paint/PaintNativeOnUpdate.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Paint/PaintNativeOnUpdate.java Fri Mar 02 21:00:12 2018 +0100
@@ -36,7 +36,7 @@
* @library ../../../lib/testlibrary
* @build ExtendedRobot
* @author Sergey Bylokhov
- @ @run main PaintNativeOnUpdate
+ * @run main PaintNativeOnUpdate
*/
public final class PaintNativeOnUpdate extends Label {
--- a/test/jdk/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,7 +22,7 @@
*/
/*
- @test %I% %E%
+ @test
@key headful
@bug 6315717
@summary verifies that Robot is accepting extra mouse buttons
--- a/test/jdk/java/awt/TextArea/DisposeTest/TestDispose.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TextArea/DisposeTest/TestDispose.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/* @test
* @bug 7155298
+ * @key headful
* @run main/othervm/timeout=60 TestDispose
* @summary Editable TextArea blocks GUI application from exit.
* @author Sean Chou
--- a/test/jdk/java/awt/TextField/DisposeTest/TestDispose.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TextField/DisposeTest/TestDispose.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/* @test
* @bug 7155298
+ * @key headful
* @run main/othervm/timeout=60 TestDispose
* @summary Editable TextField blocks GUI application from exit.
* @author Sean Chou
--- a/test/jdk/java/awt/Toolkit/BadDisplayTest/BadDisplayTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Toolkit/BadDisplayTest/BadDisplayTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 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
@@ -24,18 +24,23 @@
/*
* @test
+ * @key headful
* @summary Test that Toolkit.getDefaultToolkit throws AWTError exception if bad DISPLAY variable was set
* @bug 6818083
*
* @run shell/timeout=240 BadDisplayTest.sh
*/
-import java.awt.*;
+import java.awt.AWTError;
+import java.awt.Toolkit;
public class BadDisplayTest{
public static void main(String[] args) {
+ if (Boolean.getBoolean("java.awt.headless")) {
+ return;
+ }
- Throwable th = null;
+ Throwable th = null;
try {
Toolkit.getDefaultToolkit();
} catch (Throwable x) {
--- a/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.java Fri Mar 02 21:00:12 2018 +0100
@@ -28,6 +28,7 @@
/*
* @test
+ * @key headful
* @bug 4758438
* @summary Testcase to check the implementation of RFE 4758438
* The RFE suggests that the GNOME desktop properties
--- a/test/jdk/java/awt/Toolkit/RealSync/Test.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Toolkit/RealSync/Test.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
@test
@bug 6252005
+ @key headful
@summary Tests that realSync feature works
@author denis.mikhalkin: area=awt.toolkit
@modules java.desktop/sun.awt
@@ -150,7 +151,7 @@
}
}
errors.clear();
- System.exit(1);
+ throw new Error();
}
public static void asser(boolean value) {
--- a/test/jdk/java/awt/TrayIcon/8072769/bug8072769.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/8072769/bug8072769.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,8 @@
/* @test
@bug 8072769
+ @key headful
+ @requires (os.family == "windows")
@summary System tray icon title freezes java
@author Semyon Sadetsky
@library ../../../../lib/testlibrary
--- a/test/jdk/java/awt/TrayIcon/ActionCommand/ActionCommand.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/ActionCommand/ActionCommand.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
/*
* @test
+ * @key headful
* @summary Check the return value of the getActionCommand method
* of the ActionEvent triggered when TrayIcon is double clicked
* (single clicked, on Mac)
--- a/test/jdk/java/awt/TrayIcon/ActionEventMask/ActionEventMask.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/ActionEventMask/ActionEventMask.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Check if ActionEvent triggered when a TrayIcon is double
* (single, on Mac) clicked is visible by an AWTEventListener
* added to the Toolkit. It also checks if all listeners are
--- a/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
* @test
* @bug 6191390 8154328
+ * @key headful
* @summary Verify that ActionEvent is received with correct modifiers set.
* @modules java.desktop/java.awt:open
* @modules java.desktop/java.awt.peer
--- a/test/jdk/java/awt/TrayIcon/CtorTest/CtorTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/CtorTest/CtorTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
@test
@bug 6759726
+ @key headful
@summary TrayIcon constructor throws NPE instead of documented IAE
@author Dmitry Cherepanov area=awt.tray
@run main CtorTest
--- a/test/jdk/java/awt/TrayIcon/GetTrayIconsTest/GetTrayIcons.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/GetTrayIconsTest/GetTrayIcons.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
/*
* @test
+ * @key headful
* @summary Check the getTrayIcons method of the SystemTray
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @run main GetTrayIcons
--- a/test/jdk/java/awt/TrayIcon/InterJVMTest/InterJVM.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/InterJVMTest/InterJVM.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/*
* @test
+ * @key headful
* @summary Check if TrayIcon added by a JVM is not visible
* in another JVM
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
--- a/test/jdk/java/awt/TrayIcon/ModalityTest/ModalityTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/ModalityTest/ModalityTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Check for MouseEvents with all mouse buttons
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @modules java.desktop/java.awt:open
--- a/test/jdk/java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Check if MouseEvents triggered by TrayIcon are visible
* by an AWTEventListener added to the Toolkit. It also
* checks if all listeners are triggered when AWTEventListeners
--- a/test/jdk/java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @bug 7153700
* @summary Check for mouseMoved event for java.awt.TrayIcon
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
--- a/test/jdk/java/awt/TrayIcon/PropertyChangeListenerTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/PropertyChangeListenerTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -28,6 +28,7 @@
/*
* @test
+ * @key headful
* @summary Check if custom property change listener added
* to system tray works correctly
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
--- a/test/jdk/java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Check for MouseEvents with all mouse buttons
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @modules java.desktop/java.awt:open
--- a/test/jdk/java/awt/TrayIcon/SecurityCheck/NoPermissionTest/NoPermissionTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/SecurityCheck/NoPermissionTest/NoPermissionTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
/*
* @test
+ * @key headful
* @summary Check for SecurityException occurrence if no permissions for system tray granted
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @run main/othervm/policy=tray.policy -Djava.security.manager NoPermissionTest
--- a/test/jdk/java/awt/TrayIcon/SecurityCheck/PermissionTest/PermissionTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/SecurityCheck/PermissionTest/PermissionTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
/*
* @test
+ * @key headful
* @summary Check for no Exception occurrence if permissions for system tray granted
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @run main/othervm/policy=tray.policy -Djava.security.manager PermissionTest
--- a/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -25,6 +25,7 @@
/*
* @test
+ * @key headful
* @summary Check the getSystemTray method of the SystemTray. Checks if
* a proper instance is returned in supported platforms and a proper
* exception is thrown in unsupported platforms
--- a/test/jdk/java/awt/TrayIcon/TrayIconAddTest/TrayIconAddTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconAddTest/TrayIconAddTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Tests the add method of the SystemTray. Checks if it
* throws proper exceptions in case of invalid arguments and adds the
* TrayIcon correctly in case of a proper argument
--- a/test/jdk/java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -28,6 +28,7 @@
/*
* @test
+ * @key headful
* @summary Check for MouseEvents with all mouse buttons
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @modules java.desktop/java.awt:open
--- a/test/jdk/java/awt/TrayIcon/TrayIconMethodsTest/TrayIconMethodsTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconMethodsTest/TrayIconMethodsTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Check various methods of the TrayIcon - whether the methods
* return the proper values, throws the proper exceptions etc
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
--- a/test/jdk/java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -31,6 +31,7 @@
/*
* @test
* @bug 6384991
+ * @key headful
* @summary Check if ActionEvent is triggered by a TrayIcon when
* it is double clicked with mouse button 1 on windows
* or single clicked with button 3 on Mac OS X
--- a/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -34,6 +34,7 @@
/*
* @test
+ * @key headful
* @summary Check if a action performed event is received when TrayIcon display
* message is clicked on.
* @author Shashidhara Veerabhadraiah (shashidhara.veerabhadraiah@oracle.com)
--- a/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
/*
* @test
+ * @key headful
* @summary Check if a JPopupMenu can be displayed when TrayIcon is
* right clicked. It uses a JWindow as the parent of the JPopupMenu
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
--- a/test/jdk/java/awt/TrayIcon/TrayIconRemoveTest/TrayIconRemoveTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconRemoveTest/TrayIconRemoveTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
/*
* @test
+ * @key headful
* @summary Test the remove method of the TrayIcon
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @run main TrayIconRemoveTest
--- a/test/jdk/java/awt/TrayIcon/TrayIconSizeTest/TrayIconSizeTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/TrayIconSizeTest/TrayIconSizeTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,6 +27,7 @@
/*
* @test
+ * @key headful
* @summary Test the methods TrayIcon.getSize and SystemTray.getTrayIconSize.
* There is no way to check whether the values returned are correct,
* so its checked whether the value is greater than a minimum
--- a/test/jdk/java/awt/TrayIcon/UpdatePopupMenu/UpdatePopupMenu.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/TrayIcon/UpdatePopupMenu/UpdatePopupMenu.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
@test
@bug 8147841
+ @key headful
@summary Updating Tray Icon popup menu does not update menu items on Mac OS X
@run main/manual UpdatePopupMenu
*/
--- a/test/jdk/java/awt/Window/GetScreenLocation/GetScreenLocationTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Window/GetScreenLocation/GetScreenLocationTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,7 +22,8 @@
*/
/**
- * @test @summary setLocationRelativeTo stopped working in Ubuntu 13.10 (Unity)
+ * @test
+ * @summary setLocationRelativeTo stopped working in Ubuntu 13.10 (Unity)
* @key headful
* @bug 8036915 8161273
* @run main/othervm -Dsun.java2d.uiScale=1 GetScreenLocationTest
--- a/test/jdk/java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,8 +22,10 @@
*/
/**
- * @test @summary setAlwaysOnTop doesn't behave correctly in Linux/Solaris under
- * certain scenarios
+ * @test
+ * @key headful
+ * @summary setAlwaysOnTop doesn't behave correctly in Linux/Solaris under
+ * certain scenarios
* @bug 8021961
* @author Semyon Sadetsky
* @run main ChildAlwaysOnTopTest
--- a/test/jdk/java/awt/Window/MultiWindowApp/MultiWindowAppTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/Window/MultiWindowApp/MultiWindowAppTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,7 +22,8 @@
*/
/**
- * @test @summary After calling frame.toBack() dialog goes to the back on Ubuntu 12.04
+ * @test
+ * @summary After calling frame.toBack() dialog goes to the back on Ubuntu 12.04
* @key headful
* @bug 8022334
* @author Semyon Sadetsky
--- a/test/jdk/java/awt/dnd/BadSerializaionTest/BadSerializationTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/dnd/BadSerializaionTest/BadSerializationTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/**
* @test
+ * @key headful
* @bug 8030050
* @summary Validate fields on DnD class deserialization
* @author petr.pchelko@oracle.com
--- a/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,7 +22,8 @@
*/
/**
- * @test @summary JVM crash if the frame is disposed in DropTargetListener
+ * @test
+ * @summary JVM crash if the frame is disposed in DropTargetListener
* @key headful
* @author Petr Pchelko
* @library ../../regtesthelpers
--- a/test/jdk/java/awt/dnd/ImageTransferTest/ImageTransferTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/dnd/ImageTransferTest/ImageTransferTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,16 +22,17 @@
*/
/*
- @test
- @key headful
- @bug 4397404 4720930
- @summary tests that images of all supported native image formats are transfered properly
- @library ../../../../lib/testlibrary
- @library ../../regtesthelpers/process/
- @build jdk.testlibrary.OSInfo ProcessResults ProcessCommunicator
- @author gas@sparc.spb.su area=Clipboard
- @run main ImageTransferTest
-*/
+ * @test
+ * @key headful
+ * @bug 4397404 4720930 8197926
+ * @summary tests that images of all supported native image formats are
+ * transferred properly
+ * @library ../../../../lib/testlibrary
+ * @library ../../regtesthelpers/process/
+ * @build jdk.testlibrary.OSInfo ProcessResults ProcessCommunicator
+ * @author gas@sparc.spb.su area=Clipboard
+ * @run main/timeout=240 ImageTransferTest
+ */
import test.java.awt.regtesthelpers.process.ProcessCommunicator;
import test.java.awt.regtesthelpers.process.ProcessResults;
@@ -58,48 +59,59 @@
public class ImageTransferTest {
public static void main(String[] arg) throws Exception {
ImageDragSource ids = new ImageDragSource();
- ids.frame.setLocation(100, 100);
- ids.frame.setVisible(true);
- Util.sync();
- String classpath = System.getProperty("java.class.path");
- String[] args = new String[ids.formats.length + 4];
- args[0] = "200";
- args[1] = "100";
- args[2] = args[3] = "150";
+ try {
+ ids.frame.setUndecorated(true);
+ ids.frame.setLocation(100, 100);
+ ids.frame.setVisible(true);
+ Util.sync();
+ String classpath = System.getProperty("java.class.path");
+ String[] args = new String[ids.formats.length + 4];
+ args[0] = "200";
+ args[1] = "100";
+ args[2] = args[3] = "150";
- System.arraycopy(ids.formats, 0, args, 4, ids.formats.length);
- ProcessResults pres = ProcessCommunicator.executeChildProcess(ImageDropTarget.class, classpath, args);
+ System.arraycopy(ids.formats, 0, args, 4, ids.formats.length);
+ String scale = System.getProperty("sun.java2d.uiScale");
+ ProcessResults pres = ProcessCommunicator.
+ executeChildProcess(ImageDropTarget.class, classpath +
+ " -Dsun.java2d.uiScale=" + scale, args);
- if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
- System.err.println("========= Child VM System.err ========");
- System.err.print(pres.getStdErr());
- System.err.println("======================================");
- }
+ if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
+ System.err.println("========= Child VM System.err ========");
+ System.err.print(pres.getStdErr());
+ System.err.println("======================================");
+ }
- if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
- System.err.println("========= Child VM System.out ========");
- System.err.print(pres.getStdOut());
- System.err.println("======================================");
- }
+ if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
+ System.err.println("========= Child VM System.out ========");
+ System.err.print(pres.getStdOut());
+ System.err.println("======================================");
+ }
- boolean failed = false;
- String passedFormats = "";
- String failedFormats = "";
+ boolean failed = false;
+ String passedFormats = "";
+ String failedFormats = "";
- for (int i = 0; i < ids.passedArray.length; i++) {
- if (ids.passedArray[i]) passedFormats += ids.formats[i] + " ";
- else {
- failed = true;
- failedFormats += ids.formats[i] + " ";
+ for (int i = 0; i < ids.passedArray.length; i++) {
+ if (ids.passedArray[i]) passedFormats += ids.formats[i] + " ";
+ else {
+ failed = true;
+ failedFormats += ids.formats[i] + " ";
+ }
}
- }
- if (failed) {
- throw new RuntimeException("test failed: images in following " +
- "native formats are not transferred properly: " + failedFormats);
- } else {
- System.err.println("images in following " +
- "native formats are transferred properly: " + passedFormats);
+ if (failed) {
+ throw new RuntimeException("test failed: images in following " +
+ "native formats are not transferred properly: " +
+ failedFormats);
+ } else {
+ System.err.println("images in following " +
+ "native formats are transferred properly: " + passedFormats);
+ }
+ } finally {
+ if (ids.frame != null) {
+ ids.frame.dispose();
+ }
}
}
}
@@ -148,17 +160,23 @@
alpha = 0;
red = 0;
}
- pix[index++] = (alpha << 24) | (red << 16) | (green << 8) | blue;
+ pix[index++] =
+ (alpha << 24) | (red << 16) | (green << 8) | blue;
}
}
- return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, pix, 0, w));
+ return Toolkit.getDefaultToolkit().
+ createImage(new MemoryImageSource(w, h, pix, 0, w));
}
static String[] retrieveFormatsToTest() {
- SystemFlavorMap sfm = (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
- java.util.List<String> ln = sfm.getNativesForFlavor(DataFlavor.imageFlavor);
- if (OSInfo.OSType.WINDOWS.equals(OSInfo.getOSType()) && !ln.contains("METAFILEPICT")) {
+ SystemFlavorMap sfm =
+ (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
+ java.util.List<String> ln =
+ sfm.getNativesForFlavor(DataFlavor.imageFlavor);
+ if (OSInfo.OSType.WINDOWS.equals(OSInfo.getOSType()) &&
+ !ln.contains("METAFILEPICT"))
+ {
// for test failing on JDK without this fix
ln.add("METAFILEPICT");
}
@@ -166,15 +184,17 @@
}
static void leaveFormat(String format) {
- SystemFlavorMap sfm = (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
- sfm.setFlavorsForNative(format, new DataFlavor[]{DataFlavor.imageFlavor});
+ SystemFlavorMap sfm =
+ (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
+ sfm.setFlavorsForNative(format,
+ new DataFlavor[]{DataFlavor.imageFlavor});
sfm.setNativesForFlavor(DataFlavor.imageFlavor, new String[]{format});
}
boolean areImagesIdentical(Image im1, Image im2) {
if (formats[fi].equals("JFIF") || formats[fi].equals("image/jpeg") ||
- formats[fi].equals("GIF") || formats[fi].equals("image/gif")) {
+ formats[fi].equals("GIF") || formats[fi].equals("image/gif")) {
// JFIF and GIF are lossy formats
return true;
}
@@ -186,14 +206,14 @@
}
if (formats[fi].equals("PNG") ||
- formats[fi].equals("image/png") ||
- formats[fi].equals("image/x-png")) {
+ formats[fi].equals("image/png") ||
+ formats[fi].equals("image/x-png")) {
// check alpha as well
for (int i = 0; i < ib1.length; i++) {
if (ib1[i] != ib2[i]) {
System.err.println("different pixels: " +
- Integer.toHexString(ib1[i]) + " " +
- Integer.toHexString(ib2[i]));
+ Integer.toHexString(ib1[i]) + " " +
+ Integer.toHexString(ib2[i]));
return false;
}
}
@@ -201,8 +221,8 @@
for (int i = 0; i < ib1.length; i++) {
if ((ib1[i] & 0x00FFFFFF) != (ib2[i] & 0x00FFFFFF)) {
System.err.println("different pixels: " +
- Integer.toHexString(ib1[i]) + " " +
- Integer.toHexString(ib2[i]));
+ Integer.toHexString(ib1[i]) + " " +
+ Integer.toHexString(ib2[i]));
return false;
}
}
@@ -213,7 +233,8 @@
private static int[] getImageData(Image image) {
int width = image.getWidth(null);
int height = image.getHeight(null);
- BufferedImage bimage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+ BufferedImage bimage =
+ new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = bimage.createGraphics();
try {
g2d.drawImage(image, 0, 0, width, height, null);
@@ -247,8 +268,8 @@
};
new DragSource().createDefaultDragGestureRecognizer(frame,
- DnDConstants.ACTION_COPY,
- dge -> dge.startDrag(null, new ImageSelection(image), dsl));
+ DnDConstants.ACTION_COPY,
+ dge -> dge.startDrag(null, new ImageSelection(image), dsl));
leaveFormat(formats[fi]);
}
@@ -261,12 +282,15 @@
class ImageDropTarget extends ImageTransferer {
private final Robot robot;
+ private static ImageDropTarget idt;
private static Point startPoint, endPoint = new Point(250, 150);
+ private static int dropCount = 0;
ImageDropTarget() throws AWTException {
DropTargetAdapter dropTargetAdapter = new DropTargetAdapter() {
@Override
public void drop(DropTargetDropEvent dtde) {
+ dropCount++;
checkImage(dtde);
startImageDrag();
}
@@ -299,7 +323,8 @@
dtde.dropComplete(true);
notifyTransferSuccess(true);
} else {
- System.err.println("transferred image is different from initial image");
+ System.err.println("transferred image is different from" +
+ " initial image");
dtde.dropComplete(false);
notifyTransferSuccess(false);
}
@@ -317,6 +342,9 @@
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
+ if (idt.frame != null) {
+ idt.frame.dispose();
+ }
e.printStackTrace();
// Exit from the child process
System.exit(1);
@@ -324,7 +352,9 @@
robot.mouseMove(startPoint.x, startPoint.y);
robot.mousePress(InputEvent.BUTTON1_MASK);
for (Point p = new Point(startPoint); !p.equals(endPoint);
- p.translate(sign(endPoint.x - p.x), sign(endPoint.y - p.y))) {
+ p.translate(sign(endPoint.x - p.x),
+ sign(endPoint.y - p.y)))
+ {
robot.mouseMove(p.x, p.y);
try {
Thread.sleep(50);
@@ -341,6 +371,9 @@
if (status) {
System.err.println("format passed: " + formats[fi]);
} else {
+ if (idt.frame != null) {
+ idt.frame.dispose();
+ }
System.err.println("format failed: " + formats[fi]);
System.exit(1);
}
@@ -359,13 +392,15 @@
}
- public static void main(String[] args) {
+ public static void main(String[] args) throws Exception {
+ idt = new ImageDropTarget();
try {
- ImageDropTarget idt = new ImageDropTarget();
+ idt.frame.setUndecorated(true);
int x = Integer.parseInt(args[0]);
int y = Integer.parseInt(args[1]);
- startPoint = new Point(Integer.parseInt(args[2]), Integer.parseInt(args[3]));
+ startPoint = new Point(Integer.parseInt(args[2]),
+ Integer.parseInt(args[3]));
idt.formats = new String[args.length - 4];
System.arraycopy(args, 4, idt.formats, 0, args.length - 4);
@@ -376,7 +411,23 @@
Util.sync();
idt.startImageDrag();
+ new Thread(() -> {
+ try {
+ Thread.sleep(120000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ if (dropCount == 0) {
+ if (idt.frame != null) {
+ idt.frame.dispose();
+ }
+ System.exit(1);
+ }
+ }).start();
} catch (Throwable e) {
+ if (idt.frame != null) {
+ idt.frame.dispose();
+ }
e.printStackTrace();
System.exit(1);
}
@@ -407,7 +458,9 @@
}
@Override
- public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException
+ {
if (flavor.equals(flavors[IMAGE])) {
return data;
} else {
@@ -415,3 +468,4 @@
}
}
}
+
--- a/test/jdk/java/awt/font/TextLayout/TestAATMorxFont.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/font/TextLayout/TestAATMorxFont.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
*/
/* @test
+ * @key headful
* @summary verify rendering of MORX fonts on OS X.
* @bug 8031462
*/
--- a/test/jdk/java/awt/image/MultiResolutionImageCommonTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/image/MultiResolutionImageCommonTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -34,7 +34,8 @@
import java.awt.image.MultiResolutionImage;
/**
- * @test @bug 8011059
+ * @test
+ * @bug 8011059
* @author Alexander Scherbatiy
* @summary Test MultiResolution image loading and painting with various scaling
* combinations
--- a/test/jdk/java/awt/image/MultiResolutionImageTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/image/MultiResolutionImageTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -40,7 +40,8 @@
import java.awt.image.MultiResolutionImage;
/**
- * @test @bug 8011059
+ * @test
+ * @bug 8011059
* @key headful
* @author Alexander Scherbatiy
* @summary [macosx] Make JDK demos look perfect on retina displays
--- a/test/jdk/java/awt/print/PrinterJob/DeviceScale.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/print/PrinterJob/DeviceScale.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/* @test 1.2 02/05/15
@bug 4810363 4924441
+ @key printer
@run main DeviceScale
@summary check the peek scale is the same as the device scale, and that the
clips are also the same
--- a/test/jdk/java/awt/print/PrinterJob/DummyPrintTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/print/PrinterJob/DummyPrintTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/*
* @test
* @bug 6921664
+ * @key printer
* @summary Verifies number of copies and the job name are passed to a
* 3rd party PrintService.
* @run main DummyPrintTest
--- a/test/jdk/java/awt/print/PrinterJob/HeadlessPrintingTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/print/PrinterJob/HeadlessPrintingTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/**
* @test
* @bug 4936867
+ * @key printer
* @summary Printing crashes in headless mode.
* @run main/othervm HeadlessPrintingTest
*/
--- a/test/jdk/java/awt/print/PrinterJob/PrintCrashTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/awt/print/PrinterJob/PrintCrashTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,7 +23,7 @@
/**
* @test
- * @key printer
+ * @key printer headful
* @bug 8163889
* @summary Printing crashes on OSX.
* @run main PrintCrashTest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/CharSequence/Comparison.java Fri Mar 02 21:00:12 2018 +0100
@@ -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.
+ */
+
+import java.nio.CharBuffer;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @test
+ * @bug 8137326
+ * @summary Test to verify the compare method for the CharSequence class.
+ * @run testng Comparison
+ */
+public class Comparison {
+ static char SEP = ':';
+
+ static String[][] books = {
+ {"Biography", "Steve Jobs"},
+ {"Biography", "Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future"},
+ {"Law", "Law 101: Everything You Need to Know About American Law, Fourth Edition"},
+ {"Law", "The Tools of Argument: How the Best Lawyers Think, Argue, and Win"},
+ {"History", "The History Book (Big Ideas Simply Explained)"},
+ {"History", "A People's History of the United States"},
+ };
+
+ /**
+ * Verifies the compare method by comparing StringBuilder objects with String
+ * objects.
+ */
+ @Test
+ public void compareWithString() {
+ Set<StringBuilder> sbSet = constructSBSet();
+ Set<String> sSet = constructStringSet();
+ Iterator<StringBuilder> iSB = sbSet.iterator();
+ Iterator<String> iS = sSet.iterator();
+ while (iSB.hasNext()) {
+ int result = CharSequence.compare(iSB.next(), iS.next());
+
+ Assert.assertTrue(result == 0, "Comparing item by item");
+ }
+ }
+
+ /**
+ * Verify comparison between two CharSequence implementations, including String,
+ * StringBuffer and StringBuilder.
+ *
+ * Note: CharBuffer states that "A char buffer is not comparable to any other type of object."
+ */
+ @Test
+ public void testCompare() {
+ StringBuilder sb1 = generateTestBuilder(65, 70, 97, 102);
+ StringBuilder sb2 = generateTestBuilder(65, 70, 97, 102);
+ StringBuilder sb3 = generateTestBuilder(65, 71, 97, 103);
+
+ Assert.assertTrue(CharSequence.compare(sb1, sb2) == 0, "Compare between StringBuilders");
+ Assert.assertFalse(CharSequence.compare(sb1, sb3) == 0, "Compare between StringBuilders");
+
+ Assert.assertTrue(CharSequence.compare(sb1, sb2.toString()) == 0, "Compare between a StringBuilder and String");
+ Assert.assertFalse(CharSequence.compare(sb1, sb3.toString()) == 0, "Compare between a StringBuilder and String");
+
+ StringBuffer buf1 = generateTestBuffer(65, 70, 97, 102);
+ StringBuffer buf2 = generateTestBuffer(65, 70, 97, 102);
+ StringBuffer buf3 = generateTestBuffer(65, 71, 97, 103);
+
+ Assert.assertTrue(CharSequence.compare(buf1, buf2) == 0, "Compare between StringBuffers");
+ Assert.assertFalse(CharSequence.compare(buf1, buf3) == 0, "Compare between StringBuffers");
+
+ Assert.assertTrue(CharSequence.compare(sb1, buf2) == 0, "Compare between a StringBuilder and StringBuffer");
+ Assert.assertFalse(CharSequence.compare(sb1, buf3) == 0, "Compare between a StringBuilder and StringBuffer");
+
+ CharSequence cs1 = (CharSequence)buf1;
+ CharSequence cs2 = (CharSequence)sb1;
+ @SuppressWarnings("unchecked")
+ int result = ((Comparable<Object>)cs1).compareTo(buf2);
+ Assert.assertTrue(result == 0, "Compare between a StringBuilder and StringBuffer");
+ }
+
+
+ private Set<String> constructStringSet() {
+ Set<String> sSet = new TreeSet<>();
+ for (String[] book : books) {
+ sSet.add(book[0] + SEP + book[1]);
+ }
+ return sSet;
+ }
+
+ private Set<StringBuilder> constructSBSet() {
+ Set<StringBuilder> sbSet = new TreeSet<>();
+ for (String[] book : books) {
+ sbSet.add(new StringBuilder(book[0]).append(SEP).append(book[1]));
+ }
+ return sbSet;
+ }
+
+ private static StringBuilder generateTestBuilder(int from1, int to1,
+ int from2, int to2) {
+ StringBuilder aBuffer = new StringBuilder(50);
+
+ for (int i = from1; i < to1; i++) {
+ aBuffer.append((char)i);
+ }
+ for (int i = from2; i < to2; i++) {
+ aBuffer.append((char)i);
+ }
+ return aBuffer;
+ }
+
+ private static StringBuffer generateTestBuffer(int from1, int to1,
+ int from2, int to2) {
+ StringBuffer aBuffer = new StringBuffer(50);
+
+ for (int i = from1; i < to1; i++) {
+ aBuffer.append((char)i);
+ }
+ for (int i = from2; i < to2; i++) {
+ aBuffer.append((char)i);
+ }
+ return aBuffer;
+ }
+}
--- a/test/jdk/java/lang/String/CompactString/CompareTo.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/lang/String/CompactString/CompareTo.java Fri Mar 02 21:00:12 2018 +0100
@@ -28,8 +28,9 @@
/*
* @test
- * @bug 8077559
- * @summary Tests Compact String. This one is for String.compareTo.
+ * @bug 8077559 8137326
+ * @summary Tests Compact String. Verifies the compareTo method for String,
+ * StringBuilder and StringBuffer.
* @run testng/othervm -XX:+CompactStrings CompareTo
* @run testng/othervm -XX:-CompactStrings CompareTo
*/
@@ -91,4 +92,46 @@
source));
});
}
+
+ /*
+ * Runs the same test with StringBuilder
+ */
+ @Test(dataProvider = "provider")
+ public void testStringBuilder(String str, String anotherString, int expected) {
+ StringBuilder another = new StringBuilder(anotherString);
+ map.get(str)
+ .forEach(
+ (source, data) -> {
+ StringBuilder sb = new StringBuilder(data);
+ assertEquals(
+ sb.compareTo(another),
+ expected,
+ String.format(
+ "testing StringBuilder(%s).compareTo(%s), source : %s, ",
+ escapeNonASCIIs(data),
+ escapeNonASCIIs(anotherString),
+ source));
+ });
+ }
+
+ /*
+ * Runs the same test with StringBuffer
+ */
+ @Test(dataProvider = "provider")
+ public void testStringBuffer(String str, String anotherString, int expected) {
+ StringBuffer another = new StringBuffer(anotherString);
+ map.get(str)
+ .forEach(
+ (source, data) -> {
+ StringBuffer sb = new StringBuffer(data);
+ assertEquals(
+ sb.compareTo(another),
+ expected,
+ String.format(
+ "testing StringBuffer(%s).compareTo(%s), source : %s, ",
+ escapeNonASCIIs(data),
+ escapeNonASCIIs(anotherString),
+ source));
+ });
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/String/StringRepeat.java Fri Mar 02 21:00:12 2018 +0100
@@ -0,0 +1,133 @@
+/*
+ * 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
+ * @summary This exercises String#repeat patterns and limits.
+ * @run main/othervm -Xmx4G StringRepeat
+ */
+
+import java.nio.CharBuffer;
+
+public class StringRepeat {
+ public static void main(String... arg) {
+ test1();
+ test2();
+ }
+
+ /*
+ * Varitions of repeat count.
+ */
+ static int[] REPEATS = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 32, 64, 128, 256, 512, 1024, 64 * 1024, 1024 * 1024,
+ 16 * 1024 * 1024
+ };
+
+ /*
+ * Varitions of Strings.
+ */
+ static String[] STRINGS = new String[] {
+ "", "\0", " ", "a", "$", "\u2022",
+ "ab", "abc", "abcd", "abcde",
+ "The quick brown fox jumps over the lazy dog."
+ };
+
+ /*
+ * Repeat String function tests.
+ */
+ static void test1() {
+ for (int repeat : REPEATS) {
+ for (String string : STRINGS) {
+ long limit = (long)string.length() * (long)repeat;
+
+ if ((long)(Integer.MAX_VALUE >> 1) <= limit) {
+ break;
+ }
+
+ verify(string.repeat(repeat), string, repeat);
+ }
+ }
+ }
+
+ /*
+ * Repeat String exception tests.
+ */
+ static void test2() {
+ try {
+ "abc".repeat(-1);
+ throw new RuntimeException("No exception for negative repeat count");
+ } catch (IllegalArgumentException ex) {
+ // Correct
+ }
+
+ try {
+ "abc".repeat(Integer.MAX_VALUE - 1);
+ throw new RuntimeException("No exception for large repeat count");
+ } catch (OutOfMemoryError ex) {
+ // Correct
+ }
+ }
+
+ static String truncate(String string) {
+ if (string.length() < 80) {
+ return string;
+ }
+ return string.substring(0, 80) + "...";
+ }
+
+ /*
+ * Verify string repeat patterns.
+ */
+ static void verify(String result, String string, int repeat) {
+ if (string.isEmpty() || repeat == 0) {
+ if (!result.isEmpty()) {
+ System.err.format("\"%s\".repeat(%d)%n", truncate(string), repeat);
+ System.err.format("Result \"%s\"%n", truncate(result));
+ System.err.format("Result expected to be empty, found string of length %d%n", result.length());
+ throw new RuntimeException();
+ }
+ } else {
+ int expected = 0;
+ int count = 0;
+ for (int offset = result.indexOf(string, expected);
+ 0 <= offset;
+ offset = result.indexOf(string, expected)) {
+ count++;
+ if (offset != expected) {
+ System.err.format("\"%s\".repeat(%d)%n", truncate(string), repeat);
+ System.err.format("Result \"%s\"%n", truncate(result));
+ System.err.format("Repeat expected at %d, found at = %d%n", expected, offset);
+ throw new RuntimeException();
+ }
+ expected += string.length();
+ }
+ if (count != repeat) {
+ System.err.format("\"%s\".repeat(%d)%n", truncate(string), repeat);
+ System.err.format("Result \"%s\"%n", truncate(result));
+ System.err.format("Repeat count expected to be %d, found %d%n", repeat, count);
+ throw new RuntimeException();
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/StringBuffer/Comparison.java Fri Mar 02 21:00:12 2018 +0100
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @test
+ * @bug 8137326
+ * @summary Test to verify the Comparable implementation for the StringBuffer class.
+ * @run testng Comparison
+ */
+public class Comparison {
+ static char SEP = ':';
+
+ static String[][] books = {
+ {"Biography", "Steve Jobs"},
+ {"Biography", "Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future"},
+ {"Law", "Law 101: Everything You Need to Know About American Law, Fourth Edition"},
+ {"Law", "The Tools of Argument: How the Best Lawyers Think, Argue, and Win"},
+ {"History", "The History Book (Big Ideas Simply Explained)"},
+ {"History", "A People's History of the United States"},
+ };
+
+ /**
+ * Verifies the Comparable implementation by comparing with two TreeSet that
+ * contain either StringBuffer or String.
+ */
+ @Test
+ public void compareWithString() {
+ Set<StringBuffer> sbSet = constructSBSet();
+ Set<String> sSet = constructStringSet();
+ Iterator<StringBuffer> iSB = sbSet.iterator();
+ Iterator<String> iS = sSet.iterator();
+ while (iSB.hasNext()) {
+ String temp1 = iSB.next().toString();
+ System.out.println(temp1);
+ String temp2 = iS.next();
+ System.out.println(temp2);
+
+ Assert.assertTrue(temp1.equals(temp2), "Comparing item by item");
+ }
+
+ }
+
+ /**
+ * Compares between StringBuffers
+ */
+ @Test
+ public void testCompare() {
+ StringBuffer sb1 = generateTestBuffer(65, 70, 97, 102);
+ StringBuffer sb2 = generateTestBuffer(65, 70, 97, 102);
+ StringBuffer sb3 = generateTestBuffer(65, 71, 97, 103);
+
+ System.out.println(sb1.toString());
+ System.out.println(sb2.toString());
+ System.out.println(sb3.toString());
+ Assert.assertTrue(sb1.compareTo(sb2) == 0, "Compare sb1 and sb2");
+ Assert.assertFalse(sb1.compareTo(sb3) == 0, "Compare sb1 and sb3");
+ }
+
+ /**
+ * Verifies that the comparison is from index 0 to length() - 1 of the two
+ * character sequences.
+ */
+ @Test
+ public void testModifiedSequence() {
+ StringBuffer sb1 = generateTestBuffer(65, 70, 97, 102);
+ StringBuffer sb2 = generateTestBuffer(65, 70, 98, 103);
+
+ // contain different character sequences
+ Assert.assertFalse(sb1.compareTo(sb2) == 0, "Compare the sequences before truncation");
+
+ // the first 5 characters however are the same
+ sb1.setLength(5);
+ sb2.setLength(5);
+
+ System.out.println(sb1.toString());
+ System.out.println(sb2.toString());
+
+ Assert.assertTrue(sb1.compareTo(sb2) == 0, "Compare sb1 and sb2");
+ Assert.assertTrue(sb1.toString().compareTo(sb2.toString()) == 0, "Compare strings of sb1 and sb2");
+ }
+
+ private Set<String> constructStringSet() {
+ Set<String> sSet = new TreeSet<>();
+ for (String[] book : books) {
+ sSet.add(book[0] + SEP + book[1]);
+ }
+ return sSet;
+ }
+
+ private Set<StringBuffer> constructSBSet() {
+ Set<StringBuffer> sbSet = new TreeSet<>();
+ for (String[] book : books) {
+ sbSet.add(new StringBuffer(book[0]).append(SEP).append(book[1]));
+ }
+ return sbSet;
+ }
+
+ private static StringBuffer generateTestBuffer(int from1, int to1,
+ int from2, int to2) {
+ StringBuffer aBuffer = new StringBuffer(50);
+
+ for (int i = from1; i < to1; i++) {
+ aBuffer.append((char)i);
+ }
+ for (int i = from2; i < to2; i++) {
+ aBuffer.append((char)i);
+ }
+ return aBuffer;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/StringBuilder/Comparison.java Fri Mar 02 21:00:12 2018 +0100
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @test
+ * @bug 8137326
+ * @summary Test to verify the Comparable implementation for the StringBuilder class.
+ * @run testng Comparison
+ */
+public class Comparison {
+ static char SEP = ':';
+
+ static String[][] books = {
+ {"Biography", "Steve Jobs"},
+ {"Biography", "Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future"},
+ {"Law", "Law 101: Everything You Need to Know About American Law, Fourth Edition"},
+ {"Law", "The Tools of Argument: How the Best Lawyers Think, Argue, and Win"},
+ {"History", "The History Book (Big Ideas Simply Explained)"},
+ {"History", "A People's History of the United States"},
+ };
+
+ /**
+ * Verifies the Comparable implementation by comparing with two TreeSet that
+ * contain either StringBuilder or String.
+ */
+ @Test
+ public void compareWithString() {
+ Set<StringBuilder> sbSet = constructSBSet();
+ Set<String> sSet = constructStringSet();
+ Iterator<StringBuilder> iSB = sbSet.iterator();
+ Iterator<String> iS = sSet.iterator();
+ while (iSB.hasNext()) {
+ String temp1 = iSB.next().toString();
+ System.out.println(temp1);
+ String temp2 = iS.next();
+ System.out.println(temp2);
+
+ Assert.assertTrue(temp1.equals(temp2), "Comparing item by item");
+ }
+
+ }
+
+ /**
+ * Compares between StringBuilders
+ */
+ @Test
+ public void testCompare() {
+ StringBuilder sb1 = generateTestBuffer(65, 70, 97, 102);
+ StringBuilder sb2 = generateTestBuffer(65, 70, 97, 102);
+ StringBuilder sb3 = generateTestBuffer(65, 71, 97, 103);
+
+ System.out.println(sb1.toString());
+ System.out.println(sb2.toString());
+ System.out.println(sb3.toString());
+ Assert.assertTrue(sb1.compareTo(sb2) == 0, "Compare sb1 and sb2");
+ Assert.assertFalse(sb1.compareTo(sb3) == 0, "Compare sb1 and sb3");
+ }
+
+ /**
+ * Verifies that the comparison is from index 0 to length() - 1 of the two
+ * character sequences.
+ */
+ @Test
+ public void testModifiedSequence() {
+ StringBuilder sb1 = generateTestBuffer(65, 70, 97, 102);
+ StringBuilder sb2 = generateTestBuffer(65, 70, 98, 103);
+
+ // contain different character sequences
+ Assert.assertFalse(sb1.compareTo(sb2) == 0, "Compare the sequences before truncation");
+
+ // the first 5 characters however are the same
+ sb1.setLength(5);
+ sb2.setLength(5);
+
+ System.out.println(sb1.toString());
+ System.out.println(sb2.toString());
+
+ Assert.assertTrue(sb1.compareTo(sb2) == 0, "Compare sb1 and sb2");
+ Assert.assertTrue(sb1.toString().compareTo(sb2.toString()) == 0, "Compare strings of sb1 and sb2");
+ }
+
+ private Set<String> constructStringSet() {
+ Set<String> sSet = new TreeSet<>();
+ for (String[] book : books) {
+ sSet.add(book[0] + SEP + book[1]);
+ }
+ return sSet;
+ }
+
+ private Set<StringBuilder> constructSBSet() {
+ Set<StringBuilder> sbSet = new TreeSet<>();
+ for (String[] book : books) {
+ sbSet.add(new StringBuilder(book[0]).append(SEP).append(book[1]));
+ }
+ return sbSet;
+ }
+
+ private static StringBuilder generateTestBuffer(int from1, int to1,
+ int from2, int to2) {
+ StringBuilder aBuffer = new StringBuilder(50);
+
+ for (int i = from1; i < to1; i++) {
+ aBuffer.append((char)i);
+ }
+ for (int i = from2; i < to2; i++) {
+ aBuffer.append((char)i);
+ }
+ return aBuffer;
+ }
+}
--- a/test/jdk/java/lang/management/CompositeData/ThreadInfoCompositeData.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/lang/management/CompositeData/ThreadInfoCompositeData.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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,26 +23,26 @@
/*
* @test
- * @bug 4982289
+ * @bug 4982289 8198253
* @summary Test ThreadInfo.from to return a valid
* ThreadInfo object. Or throw exception if
* the input CompositeData is invalid.
* @author Mandy Chung
*
- * @compile OpenTypeConverter.java
- * @build ThreadInfoCompositeData
+ * @build ThreadInfoCompositeData OpenTypeConverter
* @run main ThreadInfoCompositeData
*/
+
import javax.management.openmbean.*;
import java.lang.management.LockInfo;
import java.lang.management.MonitorInfo;
import java.lang.management.ThreadInfo;
+import java.util.Arrays;
import java.util.Objects;
+import java.util.stream.Stream;
public class ThreadInfoCompositeData {
- private static StackTraceElement[] ste = new StackTraceElement[1];
- private static CompositeData[] steCD = new CompositeData[1];
private static String lockClassName = "myClass";
private static int lockIdentityHashCode = 123456;
private static String lockName = lockClassName + '@' +
@@ -53,55 +53,100 @@
public static void main(String[] argv) throws Exception {
// A valid CompositeData is passed to ThreadInfo
createGoodCompositeData();
- // A valid CompositeData for JDK 5.0 ThreadInfo
+ // A valid CompositeData for JDK 5 ThreadInfo
// is passed to ThreadInfo
createV5ThreadInfo();
+ // ThreadInfo of version N can accept lockedMonitors of version >= N
+ withNewMonitorInfoCompositeData();
+
// An invalid CompositeData is passed to ThreadInfo.from()
badNameCompositeData();
badTypeCompositeData();
+ badMissingCompositeData();
+ withV5StackTraceCompositeData();
+ withInvalidMonitorInfoCompositeData();
System.out.println("Test passed");
}
public static void createGoodCompositeData() throws Exception {
- CompositeType ct =
- new CompositeType("MyCompositeType",
- "CompositeType for ThreadInfo",
- validItemNames,
- validItemNames,
- validItemTypes);
- CompositeData cd =
- new CompositeDataSupport(ct,
- validItemNames,
- values);
+ CompositeData cd = Factory.makeThreadInfoCompositeData();
ThreadInfo info = ThreadInfo.from(cd);
checkThreadInfo(info);
+ }
+
+ /*
+ * An invalid CompositeData with JDK 9 attributes but missing JDK 6 attributes
+ */
+ public static void badMissingCompositeData() throws Exception {
+ CompositeData cd = Factory.makeCompositeDataMissingV6();
+ try {
+ ThreadInfo info = ThreadInfo.from(cd);
+ throw new RuntimeException("IllegalArgumentException not thrown");
+ } catch (IllegalArgumentException e) {}
+ }
+
+ static final StackTraceElement STE =
+ new StackTraceElement("FooClass", "getFoo", "Foo.java", 100);
+
+
+ /*
+ * Current version of ThreadInfo but an older version of StackTraceElement
+ */
+ public static void withV5StackTraceCompositeData() throws Exception {
+ CompositeData cd = Factory.makeThreadInfoWithV5StackTrace();
+ try {
+ ThreadInfo info = ThreadInfo.from(cd);
+ throw new RuntimeException("IllegalArgumentException not thrown");
+ } catch (IllegalArgumentException e) {}
+ }
+
+ /*
+ * Current version of ThreadInfo but an older version of MonitorInfo
+ * and the value of "lockedStackFrame" attribute is null.
+ */
+ public static void withInvalidMonitorInfoCompositeData() throws Exception {
+ CompositeData cd = Factory.makeThreadInfoWithIncompatibleMonitorInfo();
+
+ // verify MonitorInfo is valid
+ CompositeData[] monitors = (CompositeData[])cd.get("lockedMonitors");
+ CompositeData ste = (CompositeData)monitors[0].get("lockedStackFrame");
+ if (((Integer)monitors[0].get("lockedStackDepth")) >= 0 || ste != null) {
+ throw new RuntimeException("Expected negative stack depth and null stack frame");
+ }
+ MonitorInfo minfo = MonitorInfo.from(monitors[0]);
+ checkLockInfo(minfo);
+ if (minfo.getLockedStackFrame() != null) {
+ throw new RuntimeException("Expected null stack frame");
+ }
+
+ try {
+ ThreadInfo info = ThreadInfo.from(cd);
+ throw new RuntimeException("IllegalArgumentException not thrown");
+ } catch (IllegalArgumentException e) {}
+ }
+
+ /*
+ * ThreadInfo of version N can accept lockedMonitors of version >= N
+ */
+ public static void withNewMonitorInfoCompositeData() throws Exception {
+ CompositeData cd = Factory.makeThreadInfoWithNewMonitorInfo();
+ ThreadInfo info = ThreadInfo.from(cd);
+ checkThreadInfo(info);
+ }
+
+ /*
+ * Test CompositeData representing JDK 5 ThreadInfo
+ */
+ public static void createV5ThreadInfo() throws Exception {
+ CompositeData cd = Factory.makeThreadInfoV5CompositeData();
+ ThreadInfo info = ThreadInfo.from(cd);
+ checkThreadInfoV5(info);
}
- public static void createV5ThreadInfo() throws Exception {
- String[] v5ItemNames = new String[NUM_V5_ATTS];
- OpenType[] v5ItemTypes = new OpenType[NUM_V5_ATTS];
- Object[] v5ItemValues = new Object[NUM_V5_ATTS];
- for (int i = 0; i < NUM_V5_ATTS; i++) {
- v5ItemNames[i] = validItemNames[i];
- v5ItemTypes[i] = validItemTypes[i];
- v5ItemValues[i] = values[i];
- }
- CompositeType ct =
- new CompositeType("MyCompositeType",
- "CompositeType for JDK 5.0 ThreadInfo",
- v5ItemNames,
- v5ItemNames,
- v5ItemTypes);
- CompositeData cd =
- new CompositeDataSupport(ct,
- v5ItemNames,
- v5ItemValues);
- ThreadInfo info = ThreadInfo.from(cd);
- checkThreadInfo(info);
- }
+ static void checkThreadInfoV5(ThreadInfo info) {
+ Object[] values = Factory.VALUES;
- static void checkThreadInfo(ThreadInfo info) throws Exception {
- if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) {
+ if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) {
throw new RuntimeException("Thread Id = " + info.getThreadId() +
" expected = " + values[THREAD_ID]);
}
@@ -148,30 +193,35 @@
info.getLockOwnerName() + " expected = " +
values[LOCK_OWNER_NAME]);
}
+
+ checkStackTrace(info.getStackTrace());
+ checkLockInfo(info.getLockInfo());
+ }
+
+ static void checkThreadInfo(ThreadInfo info) {
+ Object[] values = Factory.VALUES;
+
+ checkThreadInfoV5(info);
+
if (!values[DAEMON].equals(info.isDaemon())) {
throw new RuntimeException("Daemon = " +
- info.isDaemon() + " expected = " +
- values[DAEMON]);
+ info.isDaemon() + " expected = " + values[DAEMON]);
}
-
- checkStackTrace(info.getStackTrace());
-
- checkLockInfo(info.getLockInfo());
}
- private static void checkStackTrace(StackTraceElement[] s)
- throws Exception {
- if (ste.length != s.length) {
+ private static void checkStackTrace(StackTraceElement[] s) {
+ if (s.length != 1) {
throw new RuntimeException("Stack Trace length = " +
- s.length + " expected = " + ste.length);
+ s.length + " expected = 1");
}
- StackTraceElement s1 = ste[0];
+ StackTraceElement s1 = STE;
StackTraceElement s2 = s[0];
- if (!s1.getClassName().equals(s2.getClassName())) {
- throw new RuntimeException("Class name = " +
- s2.getClassName() + " expected = " + s1.getClassName());
+ // these attributes may be null
+ if (!Objects.equals(s1.getClassLoaderName(), s2.getClassLoaderName())) {
+ throw new RuntimeException("Class loader name = " +
+ s2.getClassLoaderName() + " expected = " + s1.getClassLoaderName());
}
if (!Objects.equals(s1.getModuleName(), s2.getModuleName())) {
throw new RuntimeException("Module name = " +
@@ -181,6 +231,11 @@
throw new RuntimeException("Module version = " +
s2.getModuleVersion() + " expected = " + s1.getModuleVersion());
}
+
+ if (!s1.getClassName().equals(s2.getClassName())) {
+ throw new RuntimeException("Class name = " +
+ s2.getClassName() + " expected = " + s1.getClassName());
+ }
if (!s1.getMethodName().equals(s2.getMethodName())) {
throw new RuntimeException("Method name = " +
s2.getMethodName() + " expected = " + s1.getMethodName());
@@ -195,8 +250,7 @@
}
}
- private static void checkLockInfo(LockInfo li)
- throws Exception {
+ private static void checkLockInfo(LockInfo li) {
if (!li.getClassName().equals(lockInfo.getClassName())) {
throw new RuntimeException("Class Name = " +
li.getClassName() + " expected = " + lockInfo.getClassName());
@@ -209,227 +263,493 @@
}
public static void badNameCompositeData() throws Exception {
- CompositeType ct =
- new CompositeType("MyCompositeType",
- "CompositeType for ThreadInfo",
- badItemNames,
- badItemNames,
- validItemTypes);
- CompositeData cd =
- new CompositeDataSupport(ct,
- badItemNames,
- values);
-
+ CompositeData cd = Factory.makeCompositeDataWithBadNames();
try {
ThreadInfo info = ThreadInfo.from(cd);
- } catch (IllegalArgumentException e) {
- System.out.println("Expected exception: " +
- e.getMessage());
- return;
- }
- throw new RuntimeException(
- "IllegalArgumentException not thrown");
+ throw new RuntimeException("IllegalArgumentException not thrown");
+ } catch (IllegalArgumentException e) { }
}
public static void badTypeCompositeData() throws Exception {
- CompositeType ct =
- new CompositeType("MyCompositeType",
- "CompositeType for ThreadInfo",
- validItemNames,
- validItemNames,
- badItemTypes);
-
- // patch values[STACK_TRACE] to Long
- values[STACK_TRACE] = new Long(1000);
- values[LOCK_INFO] = new Long(1000);
- CompositeData cd =
- new CompositeDataSupport(ct,
- validItemNames,
- values);
+ CompositeData cd = Factory.makeCompositeDataWithBadTypes();
try {
ThreadInfo info = ThreadInfo.from(cd);
- } catch (IllegalArgumentException e) {
- System.out.println("Expected exception: " +
- e.getMessage());
- return;
- }
- throw new RuntimeException(
- "IllegalArgumentException not thrown");
+ throw new RuntimeException("IllegalArgumentException not thrown");
+ } catch (IllegalArgumentException e) { }
}
- private static final int THREAD_ID = 0;
- private static final int THREAD_NAME = 1;
- private static final int THREAD_STATE = 2;
- private static final int BLOCKED_TIME = 3;
- private static final int BLOCKED_COUNT = 4;
- private static final int WAITED_TIME = 5;
- private static final int WAITED_COUNT = 6;
- private static final int LOCK_NAME = 7;
- private static final int LOCK_OWNER_ID = 8;
+ private static final int THREAD_ID = 0;
+ private static final int THREAD_NAME = 1;
+ private static final int THREAD_STATE = 2;
+ private static final int BLOCKED_TIME = 3;
+ private static final int BLOCKED_COUNT = 4;
+ private static final int WAITED_TIME = 5;
+ private static final int WAITED_COUNT = 6;
+ private static final int LOCK_NAME = 7;
+ private static final int LOCK_OWNER_ID = 8;
private static final int LOCK_OWNER_NAME = 9;
- private static final int STACK_TRACE = 10;
- private static final int SUSPENDED = 11;
- private static final int IN_NATIVE = 12;
- private static final int NUM_V5_ATTS = 13;
- // JDK 6.0 ThreadInfo attributes
- private static final int LOCK_INFO = 13;
- // JDK 9.0 ThreadInfo attributes
- private static final int DAEMON = 14;
- private static final int PRIORITY = 15;
+ private static final int STACK_TRACE = 10;
+ private static final int SUSPENDED = 11;
+ private static final int IN_NATIVE = 12;
+ // JDK 6 ThreadInfo attributes
+ private static final int LOCK_INFO = 13;
+ private static final int LOCKED_MONITORS = 14;
+ private static final int LOCKED_SYNCS = 15;
+ // JDK 9 ThreadInfo attributes
+ private static final int DAEMON = 16;
+ private static final int PRIORITY = 17;
+
+ static class Factory {
- private static final String[] validItemNames = {
- "threadId",
- "threadName",
- "threadState",
- "blockedTime",
- "blockedCount",
- "waitedTime",
- "waitedCount",
- "lockName",
- "lockOwnerId",
- "lockOwnerName",
- "stackTrace",
- "suspended",
- "inNative",
- "lockInfo",
- "daemon",
- "priority",
- };
+ static final CompositeType STE_COMPOSITE_TYPE;
+ static final CompositeType LOCK_INFO_COMPOSITE_TYPE;
+ static final CompositeType MONITOR_INFO_COMPOSITE_TYPE;
+ static final ArrayType STE_ARRAY_COMPOSITE_TYPE;
+ static final ArrayType LOCK_INFO_ARRAY_COMPOSITE_TYPE;
+ static final ArrayType MONITOR_INFO_ARRAY_COMPOSITE_TYPE;
+
+ static {
+ CompositeType steCType = null;
+ CompositeType lockInfoCType = null;
+ CompositeType monitorInfoCType = null;
+ ArrayType steArrayType = null;
+ ArrayType lockInfoArrayType = null;
+ ArrayType monitorInfoArrayType = null;
- private static OpenType[] validItemTypes = {
- SimpleType.LONG,
- SimpleType.STRING,
- SimpleType.STRING,
- SimpleType.LONG,
- SimpleType.LONG,
- SimpleType.LONG,
- SimpleType.LONG,
- SimpleType.STRING,
- SimpleType.LONG,
- SimpleType.STRING,
- null, // ArrayType for StackTraceElement[]
- SimpleType.BOOLEAN,
- SimpleType.BOOLEAN,
- null, // CompositeType for LockInfo
- SimpleType.BOOLEAN,
- SimpleType.INTEGER,
- };
+ try {
+ steCType = (CompositeType) OpenTypeConverter.toOpenType(StackTraceElement.class);
+ lockInfoCType = (CompositeType) OpenTypeConverter.toOpenType(LockInfo.class);
+ monitorInfoCType = (CompositeType) OpenTypeConverter.toOpenType(MonitorInfo.class);
+ steArrayType = new ArrayType(1, steCType);
+ lockInfoArrayType = new ArrayType(1, lockInfoCType);
+ monitorInfoArrayType = new ArrayType(1, monitorInfoCType);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ STE_COMPOSITE_TYPE = steCType;
+ LOCK_INFO_COMPOSITE_TYPE = lockInfoCType;
+ MONITOR_INFO_COMPOSITE_TYPE = monitorInfoCType;
+ STE_ARRAY_COMPOSITE_TYPE = steArrayType;
+ LOCK_INFO_ARRAY_COMPOSITE_TYPE = lockInfoArrayType;
+ MONITOR_INFO_ARRAY_COMPOSITE_TYPE = monitorInfoArrayType;
+ }
+
+ static CompositeData makeThreadInfoCompositeData() throws OpenDataException {
+ CompositeType ct = new CompositeType("MyCompositeType",
+ "CompositeType for ThreadInfo",
+ ITEM_NAMES,
+ ITEM_NAMES,
+ ITEM_TYPES);
+ return new CompositeDataSupport(ct, ITEM_NAMES, VALUES);
+ }
- private static Object[] values = {
- new Long(100),
- "FooThread",
- "RUNNABLE",
- new Long(200),
- new Long(10),
- new Long(300),
- new Long(20),
- lockName,
- new Long(99),
- "BarThread",
- steCD,
- new Boolean(false),
- new Boolean(false),
- null, // To be initialized to lockInfoCD
- new Boolean(false),
- Thread.NORM_PRIORITY,
- };
+ static CompositeData makeThreadInfoV5CompositeData() throws OpenDataException {
+ CompositeType ct = new CompositeType("MyCompositeType",
+ "CompositeType for JDK 5 ThreadInfo",
+ V5_ITEM_NAMES,
+ V5_ITEM_NAMES,
+ V5_ITEM_TYPES);
+ return new CompositeDataSupport(ct, V5_ITEM_NAMES, V5_VALUES);
+ }
- private static final String[] steItemNames = {
- "classLoaderName",
- "moduleName",
- "moduleVersion",
- "className",
- "methodName",
- "fileName",
- "lineNumber",
- "nativeMethod",
- };
-
- private static final String[] lockInfoItemNames = {
- "className",
- "identityHashCode",
- };
-
- static {
- // create stack trace element
- ste[0] = new StackTraceElement("FooClass", "getFoo", "Foo.java", 100);
-
- // initialize the ste[0] and values and validItemTypes
- try {
- CompositeType steCType = (CompositeType)
- OpenTypeConverter.toOpenType(StackTraceElement.class);
- validItemTypes[STACK_TRACE] = new ArrayType(1, steCType);
-
- final Object[] steValue = {
- ste[0].getClassLoaderName(),
- ste[0].getModuleName(),
- ste[0].getModuleVersion(),
- ste[0].getClassName(),
- ste[0].getMethodName(),
- ste[0].getFileName(),
- new Integer(ste[0].getLineNumber()),
- new Boolean(ste[0].isNativeMethod()),
+ static CompositeData makeCompositeDataWithBadTypes() throws OpenDataException {
+ OpenType[] badItemTypes = {
+ SimpleType.LONG,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.LONG,
+ SimpleType.LONG,
+ SimpleType.LONG,
+ SimpleType.LONG,
+ SimpleType.STRING,
+ SimpleType.LONG,
+ SimpleType.STRING,
+ SimpleType.LONG, // bad type
+ SimpleType.BOOLEAN,
+ SimpleType.BOOLEAN,
+ SimpleType.LONG, // bad type
+ SimpleType.LONG, // bad type
+ SimpleType.LONG, // bad type
+ SimpleType.BOOLEAN,
+ SimpleType.INTEGER,
};
- steCD[0] =
- new CompositeDataSupport(steCType,
- steItemNames,
- steValue);
+ CompositeType ct =
+ new CompositeType("Bad item types",
+ "CompositeType for ThreadInfo",
+ ITEM_NAMES,
+ ITEM_NAMES,
+ badItemTypes);
+
+ // Copy before mutating to avoid affecting other tests.
+ Object[] localValues = VALUES.clone();
+
+ // patch values[STACK_TRACE] to Long
+ localValues[STACK_TRACE] = Long.valueOf(1000);
+ localValues[LOCK_INFO] = Long.valueOf(1000);
+ localValues[LOCKED_MONITORS] = Long.valueOf(1000);
+ localValues[LOCKED_SYNCS] = Long.valueOf(1000);
+ return new CompositeDataSupport(ct, ITEM_NAMES, localValues);
+ }
+
+ static CompositeData makeCompositeDataWithBadNames() throws OpenDataException {
+ String[] badItemNames = ITEM_NAMES.clone();
+ badItemNames[STACK_TRACE] = "BadStackTrace"; // bad item name
+
+ CompositeType ct = new CompositeType("Bad item names",
+ "CompositeType for ThreadInfo",
+ badItemNames,
+ badItemNames,
+ ITEM_TYPES);
+ return new CompositeDataSupport(ct,
+ badItemNames,
+ VALUES);
+ }
+
+ /*
+ * Create a CompositeData of ThreadInfo without JDK 6 attributes
+ */
+ static CompositeData makeCompositeDataMissingV6() throws OpenDataException {
+ String[] itemNames = concat(V5_ITEM_NAMES, V9_ITEM_NAMES).toArray(String[]::new);
+ OpenType[] itemTypes = concat(V5_ITEM_TYPES, V9_ITEM_TYPES).toArray(OpenType[]::new);
+ Object[] values = concat(V5_VALUES, V9_VALUES).toArray(Object[]::new);
+
+ CompositeType ct =
+ new CompositeType("InvalidCompositeType",
+ "CompositeType for ThreadInfo",
+ itemNames,
+ itemNames,
+ itemTypes);
+ return new CompositeDataSupport(ct, itemNames, values);
+ }
+
+ static CompositeData makeStackTraceElement() {
+ Object[] steValue = {
+ STE.getClassLoaderName(),
+ STE.getModuleName(),
+ STE.getModuleVersion(),
+ STE.getClassName(),
+ STE.getMethodName(),
+ STE.getFileName(),
+ Integer.valueOf(STE.getLineNumber()),
+ Boolean.valueOf(STE.isNativeMethod()),
+ };
+
+ try {
+ return new CompositeDataSupport(STE_COMPOSITE_TYPE,
+ STE_ITEM_NAMES,
+ steValue);
+ } catch (OpenDataException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ static CompositeData makeStackTraceElementV5() throws OpenDataException {
+ CompositeType steV5CType =
+ new CompositeType("JDK 5 StackTraceElement",
+ "CompositeType for JDK 5 StackTraceElement",
+ STE_V5_ITEM_NAMES,
+ STE_V5_ITEM_NAMES,
+ STE_V5_ITEM_TYPES);
+
+ Object[] steV5Value = {
+ STE.getClassName(),
+ STE.getMethodName(),
+ STE.getFileName(),
+ Integer.valueOf(STE.getLineNumber()),
+ Boolean.valueOf(STE.isNativeMethod()),
+ };
+
+ return new CompositeDataSupport(steV5CType, STE_V5_ITEM_NAMES, steV5Value);
+ }
+
+ /*
+ * Create a CompositeData of ThreadInfo without JDK 5 StackTraceElement
+ */
+ static CompositeData makeThreadInfoWithV5StackTrace() throws OpenDataException {
+ OpenType[] badTypes = ITEM_TYPES.clone();
+ Object[] badValues = VALUES.clone();
- CompositeType lockInfoCType = (CompositeType)
- OpenTypeConverter.toOpenType(LockInfo.class);
- validItemTypes[LOCK_INFO] = lockInfoCType;
+ CompositeData[] stackTrace = new CompositeData[1];
+ stackTrace[0] = makeStackTraceElementV5();
+ badTypes[STACK_TRACE] = new ArrayType(1, stackTrace[0].getCompositeType());
+ badValues[STACK_TRACE] = stackTrace;
+ CompositeType ct = new CompositeType("CompositeType",
+ "ThreadInfo with JDK 5 StackTraceElement",
+ ITEM_NAMES,
+ ITEM_NAMES,
+ badTypes);
+ return new CompositeDataSupport(ct, ITEM_NAMES, badValues);
+ }
+
+ /*
+ * Create MonitorInfo with JDK 5 StackTraceElement (i.e. JDK 6 MonitorInfo)
+ * The value of "lockedStackFrame" attribute is null to ensure that
+ * the validation is done.
+ */
+ static CompositeData makeV6MonitorInfo() throws OpenDataException {
+ CompositeData steV5 = makeStackTraceElementV5();
+
+ String[] names = MONITOR_INFO_COMPOSITE_TYPE.keySet().toArray(new String[0]);
+ OpenType[] types = new OpenType[names.length];
+ for (int i=0; i < names.length; i++) {
+ String n = names[i];
+ types[i] = "lockedStackFrame".equals(n)
+ ? steV5.getCompositeType()
+ : MONITOR_INFO_COMPOSITE_TYPE.getType(n);
+ }
+
+ CompositeType ctype =
+ new CompositeType("JDK 6 MonitorInfo",
+ "CompositeType for JDK 6 MonitorInfo",
+ names,
+ names,
+ types);
+
+ Object[] values = {
+ lockClassName,
+ lockIdentityHashCode,
+ -1,
+ null
+ };
+
+ return new CompositeDataSupport(ctype, names, values);
+ }
+
+ /*
+ * Create a CompositeData of ThreadInfo with incompatible MonitorInfo
+ */
+ static CompositeData makeThreadInfoWithIncompatibleMonitorInfo() throws OpenDataException {
+ OpenType[] badTypes = ITEM_TYPES.clone();
+ Object[] badValues = VALUES.clone();
- final Object[] lockInfoValue = {
+ CompositeData[] lockedMonitors = new CompositeData[1];
+ lockedMonitors[0] = makeV6MonitorInfo();
+ badTypes[LOCKED_MONITORS] = new ArrayType(1, lockedMonitors[0].getCompositeType());
+ badValues[LOCKED_MONITORS] = lockedMonitors;
+ CompositeType ct = new CompositeType("CompositeType",
+ "ThreadInfo with incompatible MonitorInfo",
+ ITEM_NAMES,
+ ITEM_NAMES,
+ badTypes);
+ return new CompositeDataSupport(ct, ITEM_NAMES, badValues);
+ }
+
+ static CompositeData makeNewMonitorInfo() throws OpenDataException {
+ String[] names = Stream.concat(MONITOR_INFO_COMPOSITE_TYPE.keySet().stream(),
+ Stream.of("extra")).toArray(String[]::new);
+ OpenType[] types = new OpenType[names.length];
+ for (int i=0; i < names.length; i++) {
+ String n = names[i];
+ types[i] = "extra".equals(n)
+ ? SimpleType.STRING
+ : MONITOR_INFO_COMPOSITE_TYPE.getType(n);
+ }
+
+ CompositeType compositeType =
+ new CompositeType("JDK X MonitorInfo",
+ "CompositeType for JDK X MonitorInfo",
+ names,
+ names,
+ types);
+
+ Object[] values = {
+ lockClassName,
+ lockIdentityHashCode,
+ Integer.valueOf(1),
+ makeStackTraceElement(),
+ "extra"
+ };
+
+ return new CompositeDataSupport(compositeType, names, values);
+ }
+
+ /*
+ * Create a CompositeData of ThreadInfo with a newer version of MonitorInfo
+ */
+ static CompositeData makeThreadInfoWithNewMonitorInfo() throws OpenDataException {
+ OpenType[] types = ITEM_TYPES.clone();
+ Object[] badValues = VALUES.clone();
+
+ CompositeData[] lockedMonitors = new CompositeData[1];
+ lockedMonitors[0] = makeNewMonitorInfo();
+ types[LOCKED_MONITORS] = new ArrayType(1, lockedMonitors[0].getCompositeType());
+ badValues[LOCKED_MONITORS] = lockedMonitors;
+ CompositeType ct = new CompositeType("CompositeType",
+ "ThreadInfo with JDK 5 MonitorInfo",
+ ITEM_NAMES,
+ ITEM_NAMES,
+ types);
+ return new CompositeDataSupport(ct, ITEM_NAMES, badValues);
+ }
+
+ static CompositeData makeLockInfo() {
+ Object[] lockInfoValue = {
lockInfo.getClassName(),
lockInfo.getIdentityHashCode(),
};
- values[LOCK_INFO] =
- new CompositeDataSupport(lockInfoCType,
- lockInfoItemNames,
- lockInfoValue);
- } catch (Exception e) {
- throw new RuntimeException(e);
+ try {
+ return new CompositeDataSupport(LOCK_INFO_COMPOSITE_TYPE,
+ LOCK_INFO_ITEM_NAMES,
+ lockInfoValue);
+ } catch (OpenDataException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ static CompositeData[] makeLockedSynchronizers() {
+ CompositeData[] lockedSyncs = new CompositeData[1];
+ lockedSyncs[0] = makeLockInfo();
+ return lockedSyncs;
+ }
+
+ static CompositeData[] makeLockedMonitors() {
+ CompositeData[] lockedMonitorsCD = new CompositeData[1];
+
+ Object[] lockedMonitorsValue = {
+ lockInfo.getClassName(),
+ lockInfo.getIdentityHashCode(),
+ makeStackTraceElement(),
+ Integer.valueOf(1),
+ };
+ try {
+ lockedMonitorsCD[0] =
+ new CompositeDataSupport(MONITOR_INFO_COMPOSITE_TYPE,
+ LOCKED_MONITORS_ITEM_NAMES,
+ lockedMonitorsValue);
+ } catch (OpenDataException e) {
+ throw new RuntimeException(e);
+ }
+ return lockedMonitorsCD;
+ }
+
+ static final String[] V5_ITEM_NAMES = {
+ "threadId",
+ "threadName",
+ "threadState",
+ "blockedTime",
+ "blockedCount",
+ "waitedTime",
+ "waitedCount",
+ "lockName",
+ "lockOwnerId",
+ "lockOwnerName",
+ "stackTrace",
+ "suspended",
+ "inNative",
+ };
+
+ static final String[] V6_ITEM_NAMES = {
+ "lockInfo",
+ "lockedMonitors",
+ "lockedSynchronizers",
+ };
+
+ static final String[] V9_ITEM_NAMES = {
+ "daemon",
+ "priority",
+ };
+
+ static final OpenType[] V5_ITEM_TYPES = {
+ SimpleType.LONG,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.LONG,
+ SimpleType.LONG,
+ SimpleType.LONG,
+ SimpleType.LONG,
+ SimpleType.STRING,
+ SimpleType.LONG,
+ SimpleType.STRING,
+ STE_ARRAY_COMPOSITE_TYPE,
+ SimpleType.BOOLEAN,
+ SimpleType.BOOLEAN,
+ };
+
+ static final OpenType[] V6_ITEM_TYPES = {
+ LOCK_INFO_COMPOSITE_TYPE,
+ MONITOR_INFO_ARRAY_COMPOSITE_TYPE,
+ LOCK_INFO_ARRAY_COMPOSITE_TYPE,
+ };
+
+ static final OpenType[] V9_ITEM_TYPES = {
+ SimpleType.BOOLEAN,
+ SimpleType.INTEGER,
+ };
+
+ static final String[] STE_ITEM_NAMES = {
+ "classLoaderName",
+ "moduleName",
+ "moduleVersion",
+ "className",
+ "methodName",
+ "fileName",
+ "lineNumber",
+ "nativeMethod",
+ };
+
+ static final String[] STE_V5_ITEM_NAMES = Arrays.copyOfRange(STE_ITEM_NAMES, 3, 8);
+
+ static final OpenType[] STE_V5_ITEM_TYPES = {
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.INTEGER,
+ SimpleType.BOOLEAN
+ };
+
+ static final String[] LOCK_INFO_ITEM_NAMES = {
+ "className",
+ "identityHashCode",
+ };
+
+ static final String[] LOCKED_MONITORS_ITEM_NAMES = {
+ LOCK_INFO_ITEM_NAMES[0],
+ LOCK_INFO_ITEM_NAMES[1],
+ "lockedStackFrame",
+ "lockedStackDepth",
+ };
+
+ static final Object[] V5_VALUES = {
+ Long.valueOf(100),
+ "FooThread",
+ "RUNNABLE",
+ Long.valueOf(200),
+ Long.valueOf(10),
+ Long.valueOf(300),
+ Long.valueOf(20),
+ lockName,
+ Long.valueOf(99),
+ "BarThread",
+ new CompositeData[] { makeStackTraceElement() },
+ Boolean.valueOf(false),
+ Boolean.valueOf(false),
+ };
+
+ static final Object[] V6_VALUES = {
+ makeLockInfo(),
+ makeLockedMonitors(),
+ makeLockedSynchronizers(),
+ };
+
+ static final Object[] V9_VALUES = {
+ Boolean.valueOf(true),
+ Thread.NORM_PRIORITY,
+ };
+
+ static final String[] ITEM_NAMES =
+ concat(V5_ITEM_NAMES, V6_ITEM_NAMES, V9_ITEM_NAMES).toArray(String[]::new);
+
+ static final OpenType[] ITEM_TYPES =
+ concat(V5_ITEM_TYPES, V6_ITEM_TYPES, V9_ITEM_TYPES).toArray(OpenType[]::new);
+
+ static final Object[] VALUES =
+ concat(V5_VALUES, V6_VALUES, V9_VALUES).toArray(Object[]::new);
+
+ static <T> Stream<T> concat(T[]... streams) {
+ return Stream.of(streams).flatMap(a -> Arrays.stream(a));
}
}
-
- private static final String[] badItemNames = {
- "threadId",
- "threadName",
- "threadState",
- "blockedTime",
- "blockedCount",
- "waitedTime",
- "waitedCount",
- "lockName",
- "lockOwnerId",
- "lockOwnerName",
- "BadStackTrace", // bad item name
- "suspended",
- "inNative",
- "lockInfo",
- "daemon",
- "priority",
- };
- private static final OpenType[] badItemTypes = {
- SimpleType.LONG,
- SimpleType.STRING,
- SimpleType.STRING,
- SimpleType.LONG,
- SimpleType.LONG,
- SimpleType.LONG,
- SimpleType.LONG,
- SimpleType.STRING,
- SimpleType.LONG,
- SimpleType.STRING,
- SimpleType.LONG, // bad type
- SimpleType.BOOLEAN,
- SimpleType.BOOLEAN,
- SimpleType.LONG, // bad type
- SimpleType.BOOLEAN,
- SimpleType.INTEGER,
- };
-
}
--- a/test/jdk/java/net/URLClassLoader/NullURLTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/net/URLClassLoader/NullURLTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -71,14 +71,14 @@
} catch (NullPointerException e) {
// expected
}
- // This section should be uncommented if 8026517 is fixed.
-// try {
-// loader = new URLClassLoader(invalidURLArray);
-// System.err.println("URLClassLoader(invalidURLArray) did not throw NPE");
-// failures++;
-// } catch (NullPointerException e) {
-// // expected
-// }
+
+ try {
+ loader = new URLClassLoader(invalidURLArray);
+ System.err.println("URLClassLoader(invalidURLArray) did not throw NPE");
+ failures++;
+ } catch (NullPointerException e) {
+ // expected
+ }
try {
loader = new URLClassLoader(validURLArray, null);
@@ -93,14 +93,14 @@
} catch (NullPointerException e) {
// expected
}
- // This section should be uncommented if 8026517 is fixed.
-// try {
-// loader = new URLClassLoader(invalidURLArray, null);
-// System.err.println("URLClassLoader(invalidURLArray, null) did not throw NPE");
-// failures++;
-// } catch (NullPointerException e) {
-// // expected
-// }
+
+ try {
+ loader = new URLClassLoader(invalidURLArray, null);
+ System.err.println("URLClassLoader(invalidURLArray, null) did not throw NPE");
+ failures++;
+ } catch (NullPointerException e) {
+ // expected
+ }
try {
loader = new URLClassLoader(validURLArray, null, null);
@@ -115,14 +115,14 @@
} catch (NullPointerException e) {
// expected
}
- // This section should be uncommented if 8026517 is fixed.
-// try {
-// loader = new URLClassLoader(invalidURLArray, null, null);
-// System.err.println("URLClassLoader(invalidURLArray, null, null) did not throw NPE");
-// failures++;
-// } catch (NullPointerException e) {
-// // expected
-// }
+
+ try {
+ loader = new URLClassLoader(invalidURLArray, null, null);
+ System.err.println("URLClassLoader(invalidURLArray, null, null) did not throw NPE");
+ failures++;
+ } catch (NullPointerException e) {
+ // expected
+ }
try {
loader = URLClassLoader.newInstance(validURLArray);
@@ -137,14 +137,14 @@
} catch (NullPointerException e) {
// expected
}
- // This section should be uncommented if 8026517 is fixed.
-// try {
-// loader = URLClassLoader.newInstance(invalidURLArray);
-// System.err.println("URLClassLoader.newInstance(invalidURLArray) did not throw NPE");
-// failures++;
-// } catch (NullPointerException e) {
-// // expected
-// }
+
+ try {
+ loader = URLClassLoader.newInstance(invalidURLArray);
+ System.err.println("URLClassLoader.newInstance(invalidURLArray) did not throw NPE");
+ failures++;
+ } catch (NullPointerException e) {
+ // expected
+ }
try {
loader = URLClassLoader.newInstance(validURLArray, null);
@@ -159,14 +159,14 @@
} catch (NullPointerException e) {
// expected
}
- // This section should be uncommented if 8026517 is fixed.
-// try {
-// loader = URLClassLoader.newInstance(invalidURLArray, null);
-// System.err.println("URLClassLoader.newInstance(invalidURLArray, null) did not throw NPE");
-// failures++;
-// } catch (NullPointerException e) {
-// // expected
-// }
+
+ try {
+ loader = URLClassLoader.newInstance(invalidURLArray, null);
+ System.err.println("URLClassLoader.newInstance(invalidURLArray, null) did not throw NPE");
+ failures++;
+ } catch (NullPointerException e) {
+ // expected
+ }
if (failures != 0) {
throw new Exception("URLClassLoader NullURLTest had "+failures+" failures!");
--- a/test/jdk/java/text/Normalizer/NormalizerAPITest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/java/text/Normalizer/NormalizerAPITest.java Fri Mar 02 21:00:12 2018 +0100
@@ -78,7 +78,7 @@
/*
* Check if normalize(null) throws NullPointerException as expected.
*/
- void Test_NullPointerException_java_normalize() {
+ public void Test_NullPointerException_java_normalize() {
boolean error = false;
/* Check null as String to be normalized */
@@ -107,7 +107,7 @@
/*
* Check if normalize(null) throws NullPointerException as expected.
*/
- void Test_NullPointerException_sun_normalize() {
+ public void Test_NullPointerException_sun_normalize() {
boolean error = false;
for (int j = 0; j < options.length; j++) {
@@ -138,7 +138,7 @@
/*
* Check if isNormalized(null) throws NullPointerException as expected.
*/
- void Test_NullPointerException_java_isNormalized() {
+ public void Test_NullPointerException_java_isNormalized() {
boolean error = false;
for (int i = 0; i < forms.length; i++) {
@@ -167,7 +167,7 @@
/*
* Check if isNormalized(null) throws NullPointerException as expected.
*/
- void Test_NullPointerException_sun_isNormalized() {
+ public void Test_NullPointerException_sun_isNormalized() {
boolean error = false;
for (int j = 0; j < options.length; j++) {
@@ -199,7 +199,7 @@
* Check if isNormalized("") doesn't throw NullPointerException and returns
* "" as expected.
*/
- void Test_No_NullPointerException_java_normalize() {
+ public void Test_No_NullPointerException_java_normalize() {
boolean error = false;
for (int i = 0; i < forms.length; i++) {
@@ -223,7 +223,7 @@
* Check if isNormalized("") doesn't throw NullPointerException and returns
* "" as expected.
*/
- void Test_No_NullPointerException_sun_normalize() {
+ public void Test_No_NullPointerException_sun_normalize() {
boolean error = false;
for (int j = 0; j < options.length; j++) {
@@ -248,7 +248,7 @@
* Check if isNormalized("") doesn't throw NullPointerException and returns
* "" as expected.
*/
- void Test_No_NullPointerException_java_isNormalized() {
+ public void Test_No_NullPointerException_java_isNormalized() {
boolean error = false;
for (int i = 0; i < forms.length; i++) {
@@ -271,7 +271,7 @@
* Check if isNormalized("") doesn't throw NullPointerException and returns
* "" as expected.
*/
- void Test_No_NullPointerException_sun_isNormalized() {
+ public void Test_No_NullPointerException_sun_isNormalized() {
boolean error = false;
for (int j = 0; j < options.length; j++) {
@@ -296,7 +296,7 @@
* Check if normalize() and isNormalized() work as expected for every
* known class which implement CharSequence Interface.
*/
- void Test_CharSequence() {
+ public void Test_CharSequence() {
check_CharSequence(String.valueOf(inputData),
String.valueOf(outputData));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/jar/Manifest/LineBreakLineWidth.java Fri Mar 02 21:00:12 2018 +0100
@@ -0,0 +1,284 @@
+/*
+ * 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.
+ */
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.jar.Manifest;
+import java.util.jar.Attributes;
+import java.util.jar.Attributes.Name;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 6372077
+ * @run testng LineBreakLineWidth
+ * @summary write valid manifests with respect to line breaks
+ * and read any line width
+ */
+public class LineBreakLineWidth {
+
+ /**
+ * maximum header name length from {@link Name#isValid(String)}
+ * not including the name-value delimiter <code>": "</code>
+ */
+ final static int MAX_HEADER_NAME_LENGTH = 70;
+
+ /**
+ * range of one..{@link #TEST_WIDTH_RANGE} covered in this test that
+ * exceeds the range of allowed header name lengths or line widths
+ * in order to also cover invalid cases beyond the valid boundaries
+ * and to keep it somewhat independent from the actual manifest width.
+ * <p>
+ * bigger than 72 (maximum manifest header line with in bytes (not utf-8
+ * encoded characters) but otherwise arbitrarily chosen
+ */
+ final static int TEST_WIDTH_RANGE = 123;
+
+ /**
+ * tests if only valid manifest files can written depending on the header
+ * name length or that an exception occurs already on the attempt to write
+ * an invalid one otherwise and that no invalid manifest can be written.
+ * <p>
+ * due to bug JDK-6372077 it was possible to write a manifest that could
+ * not be read again. independent of the actual manifest line width, such
+ * a situation should never happen, which is the subject of this test.
+ */
+ @Test
+ public void testWriteValidManifestOrException() throws IOException {
+ /*
+ * multi-byte utf-8 characters cannot occur in header names,
+ * only in values which are not subject of this test here.
+ * hence, each character in a header name uses exactly one byte and
+ * variable length utf-8 character encoding doesn't affect this test.
+ */
+
+ String name = "";
+ for (int l = 1; l <= TEST_WIDTH_RANGE; l++) {
+ name += "x";
+ System.out.println("name = " + name + ", "
+ + "name.length = " + name.length());
+
+ if (l <= MAX_HEADER_NAME_LENGTH) {
+ writeValidManifest(name, "somevalue");
+ } else {
+ writeInvalidManifestThrowsException(name, "somevalue");
+ }
+ }
+ }
+
+ static void writeValidManifest(String name, String value)
+ throws IOException {
+ byte[] mfBytes = writeManifest(name, value);
+ Manifest mf = new Manifest(new ByteArrayInputStream(mfBytes));
+ assertMainAndSectionValues(mf, name, value);
+ }
+
+ static void writeInvalidManifestThrowsException(String name, String value)
+ throws IOException {
+ try {
+ writeManifest(name, value);
+ } catch (IllegalArgumentException e) {
+ // no invalid manifest was produced which is considered acceptable
+ return;
+ }
+
+ fail("no error writing manifest considered invalid");
+ }
+
+ /**
+ * tests that manifest files can be read even if the line breaks are
+ * placed in different positions than where the current JDK's
+ * {@link Manifest#write(java.io.OutputStream)} would have put it provided
+ * the manifest is valid otherwise.
+ * <p>
+ * the <a href="{@docRoot}/../specs/jar/jar.html#Notes_on_Manifest_and_Signature_Files">
+ * "Notes on Manifest and Signature Files" in the "JAR File
+ * Specification"</a> state that "no line may be longer than 72 bytes
+ * (not characters), in its utf8-encoded form." but allows for earlier or
+ * additional line breaks.
+ * <p>
+ * the most important purpose of this test case is probably to make sure
+ * that manifest files broken at 70 bytes line width written with the
+ * previous version of {@link Manifest} before this fix still work well.
+ */
+ @Test
+ public void testReadDifferentLineWidths() throws IOException {
+ /*
+ * uses only one-byte utf-8 encoded characters as values.
+ * correctly breaking multi-byte utf-8 encoded characters
+ * would be subject of another test if there was one such.
+ */
+
+ // w: line width
+ // 6 minimum required for section names starting with "Name: "
+ for (int w = 6; w <= TEST_WIDTH_RANGE; w++) {
+
+ // ln: header name length
+ String name = "";
+ // - 2 due to the delimiter ": " that has to fit on the same
+ // line as the name
+ for (int ln = 1; ln <= w - 2; ln++) {
+ name += "x";
+
+ // lv: value length
+ String value = "";
+ for (int lv = 1; lv <= TEST_WIDTH_RANGE; lv++) {
+ value += "y";
+ }
+
+ System.out.println("lineWidth = " + w);
+ System.out.println("name = " + name + ""
+ + ", name.length = " + name.length());
+ System.out.println("value = " + value + ""
+ + ", value.length = " + value.length());
+
+ readSpecificLineWidthManifest(name, value, w);
+ }
+ }
+ }
+
+ static void readSpecificLineWidthManifest(String name, String value,
+ int lineWidth) throws IOException {
+ /*
+ * breaking header names is not allowed and hence cannot be reasonably
+ * tested. it cannot easily be helped, that invalid manifest files
+ * written by the previous Manifest version implementation are illegal
+ * if the header name is 69 or 70 bytes and in that case the name/value
+ * delimiter ": " was broken on a new line.
+ *
+ * changing the line width in Manifest#make72Safe(StringBuffer),
+ * however, also affects at which positions values are broken across
+ * lines (should always have affected values only and never header
+ * names or the delimiter) which is tested here.
+ *
+ * ideally, any previous Manifest implementation would have been used
+ * here to provide manifest files to test reading but these are no
+ * longer available in this version's sources and there might as well
+ * be other libraries writing manifests. Therefore, in order to be able
+ * to test any manifest file considered valid with respect to line
+ * breaks that could not possibly be produced with the current Manifest
+ * implementation, this test provides its own manifests in serialized
+ * form.
+ */
+ String lineBrokenSectionName = breakLines(lineWidth, "Name: " + name);
+ String lineBrokenNameAndValue = breakLines(lineWidth, name + ": " + value);
+
+ ByteArrayOutputStream mfBuf = new ByteArrayOutputStream();
+ mfBuf.write("Manifest-Version: 1.0".getBytes(UTF_8));
+ mfBuf.write("\r\n".getBytes(UTF_8));
+ mfBuf.write(lineBrokenNameAndValue.getBytes(UTF_8));
+ mfBuf.write("\r\n".getBytes(UTF_8));
+ mfBuf.write("\r\n".getBytes(UTF_8));
+ mfBuf.write(lineBrokenSectionName.getBytes(UTF_8));
+ mfBuf.write("\r\n".getBytes(UTF_8));
+ mfBuf.write(lineBrokenNameAndValue.getBytes(UTF_8));
+ mfBuf.write("\r\n".getBytes(UTF_8));
+ mfBuf.write("\r\n".getBytes(UTF_8));
+ byte[] mfBytes = mfBuf.toByteArray();
+ printManifest(mfBytes);
+
+ boolean nameValid = name.length() <= MAX_HEADER_NAME_LENGTH;
+
+ Manifest mf;
+ try {
+ mf = new Manifest(new ByteArrayInputStream(mfBytes));
+ } catch (IOException e) {
+ if (!nameValid &&
+ e.getMessage().startsWith("invalid header field")) {
+ // expected because the name is not valid
+ return;
+ }
+
+ throw new AssertionError(e.getMessage(), e);
+ }
+
+ assertTrue(nameValid, "failed to detect invalid manifest");
+
+ assertMainAndSectionValues(mf, name, value);
+ }
+
+ static String breakLines(int lineWidth, String nameAndValue) {
+ String lineBrokenNameAndValue = "";
+ int charsOnLastLine = 0;
+ for (int i = 0; i < nameAndValue.length(); i++) {
+ lineBrokenNameAndValue += nameAndValue.substring(i, i + 1);
+ charsOnLastLine++;
+ if (0 < i && i < nameAndValue.length() - 1
+ && charsOnLastLine == lineWidth) {
+ lineBrokenNameAndValue += "\r\n ";
+ charsOnLastLine = 1;
+ }
+ }
+ return lineBrokenNameAndValue;
+ }
+
+ static byte[] writeManifest(String name, String value) throws IOException {
+ /*
+ * writing manifest main headers is implemented separately from
+ * writing named sections manifest headers:
+ * - java.util.jar.Attributes.writeMain(DataOutputStream)
+ * - java.util.jar.Attributes.write(DataOutputStream)
+ * which is why this is also covered separately in this test by
+ * always adding the same value twice, in the main attributes as
+ * well as in a named section (using the header name also as the
+ * section name).
+ */
+
+ Manifest mf = new Manifest();
+ mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
+ mf.getMainAttributes().putValue(name, value);
+
+ Attributes section = new Attributes();
+ section.putValue(name, value);
+ mf.getEntries().put(name, section);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ mf.write(out);
+ byte[] mfBytes = out.toByteArray();
+ printManifest(mfBytes);
+ return mfBytes;
+ }
+
+ private static void printManifest(byte[] mfBytes) {
+ final String sepLine = "----------------------------------------------"
+ + "---------------------|-|-|"; // |-positions: ---68-70-72
+ System.out.println(sepLine);
+ System.out.print(new String(mfBytes, UTF_8));
+ System.out.println(sepLine);
+ }
+
+ private static void assertMainAndSectionValues(Manifest mf, String name,
+ String value) {
+ String mainValue = mf.getMainAttributes().getValue(name);
+ String sectionValue = mf.getAttributes(name).getValue(name);
+
+ assertEquals(value, mainValue, "value different in main section");
+ assertEquals(value, sectionValue, "value different in named section");
+ }
+
+}
--- a/test/jdk/javax/accessibility/AccessibilityProvider/basic.sh Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/accessibility/AccessibilityProvider/basic.sh Fri Mar 02 21:00:12 2018 +0100
@@ -21,6 +21,7 @@
# questions.
#
# @test
+# @key headful
# @bug 8055160
# @summary Unit test for javax.accessibility.AccessibilitySPI
#
--- a/test/jdk/javax/imageio/plugins/shared/ImageWriterCompressionTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/imageio/plugins/shared/ImageWriterCompressionTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -42,7 +42,8 @@
import javax.imageio.stream.ImageOutputStream;
/**
- * @test @bug 6488522
+ * @test
+ * @bug 6488522
* @summary Check the compression support in imageio ImageWriters
* @run main ImageWriterCompressionTest
*/
--- a/test/jdk/javax/print/PrintServiceLookup/CountPrintServices.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/print/PrintServiceLookup/CountPrintServices.java Fri Mar 02 21:00:12 2018 +0100
@@ -32,6 +32,7 @@
/*
* @test
* @bug 8032693
+ * @key printer
* @summary Test that lpstat and JDK agree whether there are printers.
*/
public class CountPrintServices {
--- a/test/jdk/javax/print/attribute/ChromaticityValues.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/print/attribute/ChromaticityValues.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,8 @@
/*
* @test
* @bug 4446106
+ * @key printer
+ * @requires (os.family == "windows")
* @summary Test for chromaticity values.
* @run main ChromaticityValues
*/
--- a/test/jdk/javax/swing/ClientProperty/UIClientPropertyKeyTest/UIClientPropertyKeyTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/ClientProperty/UIClientPropertyKeyTest/UIClientPropertyKeyTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -92,8 +92,10 @@
try {
UIManager.setLookAndFeel(laf.getClassName());
System.out.println("LookAndFeel: " + laf.getClassName());
+ } catch (final UnsupportedLookAndFeelException ignored){
+ System.out.println("Unsupported LookAndFeel: " + laf.getClassName());
} catch (ClassNotFoundException | InstantiationException |
- UnsupportedLookAndFeelException | IllegalAccessException e) {
+ IllegalAccessException e) {
throw new RuntimeException(e);
}
}
--- a/test/jdk/javax/swing/GroupLayout/7071166/bug7071166.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/GroupLayout/7071166/bug7071166.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,9 +28,22 @@
* @author Pavel Porvatov
*/
-import javax.swing.*;
-import static javax.swing.SwingConstants.*;
-import java.awt.*;
+import java.awt.Container;
+
+import javax.swing.JButton;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+import static javax.swing.SwingConstants.EAST;
+import static javax.swing.SwingConstants.NORTH;
+import static javax.swing.SwingConstants.NORTH_EAST;
+import static javax.swing.SwingConstants.NORTH_WEST;
+import static javax.swing.SwingConstants.SOUTH;
+import static javax.swing.SwingConstants.SOUTH_EAST;
+import static javax.swing.SwingConstants.SOUTH_WEST;
+import static javax.swing.SwingConstants.WEST;
public class bug7071166 {
private static final int[] POSITIONS = {NORTH, EAST, SOUTH, WEST, // valid positions
@@ -38,8 +51,11 @@
public static void main(String[] args) throws Exception {
for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
- UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
-
+ try {
+ UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
+ } catch (final UnsupportedLookAndFeelException ignored) {
+ continue;
+ }
System.out.println("LookAndFeel: " + lookAndFeelInfo.getName());
SwingUtilities.invokeAndWait(new Runnable() {
--- a/test/jdk/javax/swing/JComboBox/6632953/bug6632953.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JComboBox/6632953/bug6632953.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
import javax.swing.JComboBox;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.metal.MetalComboBoxUI;
public class bug6632953 {
@@ -43,6 +44,8 @@
: UIManager.getInstalledLookAndFeels()) {
try {
UIManager.setLookAndFeel(lafInfo.getClassName());
+ } catch (UnsupportedLookAndFeelException ignored) {
+ continue;
} catch (Exception e) {
throw new RuntimeException(e);
}
--- a/test/jdk/javax/swing/JComboBox/7082443/bug7082443.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JComboBox/7082443/bug7082443.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,11 @@
public static void main(String[] args) throws Exception {
for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
if (lookAndFeelInfo.getClassName().contains(GTK_LAF_CLASS)) {
- UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
-
+ try {
+ UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
+ } catch (final UnsupportedLookAndFeelException ignored) {
+ continue;
+ }
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
--- a/test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java Fri Mar 02 21:00:12 2018 +0100
@@ -40,6 +40,7 @@
* @summary Audit Core Reflection in module java.desktop for places that will
* require changes to work with modules
* @author Alexander Scherbatiy
+ * @run main/othervm TestJEditor
*/
public class TestJEditor {
--- a/test/jdk/javax/swing/JEditorPane/bug4714674.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JEditorPane/bug4714674.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,7 +27,7 @@
@author Peter Zhelezniakov
@modules java.desktop
jdk.httpserver
- @run main bug4714674
+ @run main/othervm bug4714674
*/
import javax.swing.*;
--- a/test/jdk/javax/swing/JFileChooser/6489130/bug6489130.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFileChooser/6489130/bug6489130.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,6 +22,7 @@
*/
/* @test
+ * @key headful
* @bug 6489130
* @summary FileChooserDemo hung by keeping pressing Enter key
* @author Pavel Porvatov
--- a/test/jdk/javax/swing/JFileChooser/6520101/bug6520101.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFileChooser/6520101/bug6520101.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,7 +22,7 @@
*/
/*
- * @test @(#)bug6520101
+ * @test
* @key headful
* @bug 6520101
* @summary JFileChooser throws OOM in 1.4.2, 5.0u4 and 1.6.0
--- a/test/jdk/javax/swing/JFileChooser/6868611/bug6868611.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFileChooser/6868611/bug6868611.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 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
@@ -21,73 +21,74 @@
* questions.
*/
-/* @test
- @bug 6868611
- @summary FileSystemView throws NullPointerException
- @author Pavel Porvatov
- @run main bug6868611
-*/
+/*
+ * @test
+ * @bug 6868611 8198004
+ * @summary FileSystemView throws NullPointerException
+ * @author Pavel Porvatov
+ * @run main bug6868611
+ */
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
import java.io.File;
+import java.nio.file.Files;
public class bug6868611 {
private static final int COUNT = 1000;
+ private static File tempFolder;
+ private static File files[] = new File[COUNT];
public static void main(String[] args) throws Exception {
- String tempDirProp = System.getProperty("java.io.tmpdir");
-
- final String tempDir = tempDirProp == null || !new File(tempDirProp).isDirectory() ?
- System.getProperty("user.home") : tempDirProp;
-
- System.out.println("Temp directory: " + tempDir);
+ int fileCount = 0;
+ try {
+ tempFolder = Files.createTempDirectory("temp_folder").toFile();
- // Create 1000 files
- for (int i = 0; i < 1000; i++) {
- new File(tempDir, "temp" + i).createNewFile();
- }
-
- // Init default FileSystemView
- SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- FileSystemView.getFileSystemView().getFiles(new File(tempDir), false);
+ // Try creating 1000 files
+ for (fileCount = 0; fileCount < COUNT; fileCount++) {
+ files[fileCount] = new
+ File(tempFolder, "temp" + fileCount + ".txt");
+ files[fileCount].createNewFile();
}
- });
- for (int i = 0; i < COUNT; i++) {
- Thread thread = new MyThread(tempDir);
+ // Init default FileSystemView
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ FileSystemView.getFileSystemView().
+ getFiles(tempFolder, false);
+ }
+ });
- thread.start();
-
- Thread.sleep((long) (Math.random() * 100));
-
- thread.interrupt();
+ for (int i = 0; i < COUNT; i++) {
+ Thread thread = new MyThread(tempFolder);
- if (i % 100 == 0) {
- System.out.print("*");
- }
- }
+ thread.start();
+
+ Thread.sleep((long) (Math.random() * 100));
- System.out.println();
-
- // Remove 1000 files
- for (int i = 0; i < 1000; i++) {
- new File(tempDir, "temp" + i).delete();
+ thread.interrupt();
+ }
+ } finally {
+ // Remove created files
+ for (int i = 0; i < fileCount; i++) {
+ Files.delete(files[i].toPath());
+ }
+ Files.delete(tempFolder.toPath());
}
}
private static class MyThread extends Thread {
- private final String dir;
+ private final File dir;
- private MyThread(String dir) {
+ private MyThread(File dir) {
this.dir = dir;
}
public void run() {
FileSystemView fileSystemView = FileSystemView.getFileSystemView();
- fileSystemView.getFiles(new File(dir), false);
+ fileSystemView.getFiles(dir, false);
}
}
}
+
--- a/test/jdk/javax/swing/JFileChooser/7199708/bug7199708.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFileChooser/7199708/bug7199708.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,10 +41,10 @@
/**
* @test
* @key headful
- * @bug 7199708 8159587
+ * @bug 7199708 8159587 8198005
* @author Alexander Scherbatiy
* @summary FileChooser crashs when opening large folder
- * @run main bug7199708
+ * @run main/timeout=240 bug7199708
*/
public class bug7199708 {
@@ -53,72 +53,88 @@
private static volatile int locationX;
private static volatile int locationY;
private static volatile int width;
+ private static File largeFolder;
+ private static File files[] = new File[FILE_NUMBER];
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
robot.setAutoDelay(50);
- final File folder = createLargeFolder();
- UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
+ try {
+ final File folder = createLargeFolder();
+ UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- fileChooser = new JFileChooser(folder);
- fileChooser.showSaveDialog(null);
- }
- });
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ fileChooser = new JFileChooser(folder);
+ fileChooser.showSaveDialog(null);
+ }
+ });
- robot.waitForIdle();
+ robot.waitForIdle();
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- final String detailsTooltip = UIManager.getString("FileChooser."
- + "detailsViewButtonToolTipText", fileChooser.getLocale());
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ final String detailsTooltip =
+ UIManager.getString("FileChooser."
+ + "detailsViewButtonToolTipText",
+ fileChooser.getLocale());
- doAction(fileChooser, new ComponentAction() {
- @Override
- public boolean accept(Component component) {
- return (component instanceof AbstractButton)
+ doAction(fileChooser, new ComponentAction() {
+ @Override
+ public boolean accept(Component component) {
+ return (component instanceof AbstractButton)
&& detailsTooltip.equals(
((AbstractButton) component).getToolTipText());
- }
+ }
- @Override
- public void perform(Component component) {
- ((AbstractButton) component).doClick();
- }
- });
+ @Override
+ public void perform(Component component) {
+ ((AbstractButton) component).doClick();
+ }
+ });
- doAction(fileChooser, new ComponentAction() {
- @Override
- public boolean accept(Component component) {
- return (component instanceof JTable);
- }
+ doAction(fileChooser, new ComponentAction() {
+ @Override
+ public boolean accept(Component component) {
+ return (component instanceof JTable);
+ }
- @Override
- public void perform(Component component) {
- Point tableLocation = component.getLocationOnScreen();
- locationX = (int) tableLocation.getX();
- locationY = (int) tableLocation.getY();
- width = (int) fileChooser.getBounds().getWidth();
- }
- });
- }
- });
+ @Override
+ public void perform(Component component) {
+ Point tableLocation = component.getLocationOnScreen();
+ locationX = (int) tableLocation.getX();
+ locationY = (int) tableLocation.getY();
+ width = (int) fileChooser.getBounds().getWidth();
+ }
+ });
+ }
+ });
+
+ robot.waitForIdle();
- robot.waitForIdle();
+ int d = 25;
+ for (int i = 0; i < width / d; i++) {
+ robot.mouseMove(locationX + i * d, locationY + 5);
+ robot.waitForIdle();
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ robot.waitForIdle();
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ robot.waitForIdle();
+ }
- int d = 25;
- for (int i = 0; i < width / d; i++) {
- robot.mouseMove(locationX + i * d, locationY + 5);
- robot.mousePress(InputEvent.BUTTON1_MASK);
- robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ robot.keyPress(KeyEvent.VK_ESCAPE);
+ robot.waitForIdle();
+ robot.keyRelease(KeyEvent.VK_ESCAPE);
robot.waitForIdle();
+
+ } finally {
+ for (int i = 0; i < FILE_NUMBER; i++) {
+ Files.delete(files[i].toPath());
+ }
+ Files.delete(largeFolder.toPath());
}
-
- robot.keyPress(KeyEvent.VK_ESCAPE);
- robot.keyRelease(KeyEvent.VK_ESCAPE);
}
static void doAction(Component component, ComponentAction action) {
@@ -134,13 +150,11 @@
private static File createLargeFolder() {
try {
- File largeFolder = Files.createTempDirectory("large_folder").toFile();
- largeFolder.deleteOnExit();
+ largeFolder = Files.createTempDirectory("large_folder").toFile();
for (int i = 0; i < FILE_NUMBER; i++) {
- File file = new File(largeFolder, "File_" + i + ".txt");
- file.createNewFile();
- file.deleteOnExit();
+ files[i] = new File(largeFolder, "File_" + i + ".txt");
+ files[i].createNewFile();
}
return largeFolder;
} catch (IOException ex) {
--- a/test/jdk/javax/swing/JFileChooser/8062561/bug8062561.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFileChooser/8062561/bug8062561.java Fri Mar 02 21:00:12 2018 +0100
@@ -36,6 +36,8 @@
/**
* @test
* @bug 8062561
+ * @key headful
+ * @requires (os.family == "windows")
* @summary File system view returns null default directory
* @library ../../../../lib/testlibrary
* @modules java.desktop/sun.awt
--- a/test/jdk/javax/swing/JFileChooser/8080628/bug8080628.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFileChooser/8080628/bug8080628.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.UnsupportedLookAndFeelException;
import sun.swing.SwingUtilities2;
@@ -77,7 +78,11 @@
try {
LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
for (LookAndFeelInfo info : lafInfo) {
- UIManager.setLookAndFeel(info.getClassName());
+ try {
+ UIManager.setLookAndFeel(info.getClassName());
+ } catch (final UnsupportedLookAndFeelException ignored) {
+ continue;
+ }
for (Locale locale : LOCALES) {
for (String key : MNEMONIC_KEYS) {
--- a/test/jdk/javax/swing/JFrame/Serialization/JFrameMenuSerializationTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JFrame/Serialization/JFrameMenuSerializationTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,6 +23,7 @@
/**
* @test
+ * @key headful
* @bug 8189201
* @summary [macosx] NotSerializableException during JFrame with MenuBar
* serialization
--- a/test/jdk/javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
/**
* @test
* @key headful
- * @bug 8160248 8160332
+ * @bug 8160248 8160332 8186513
* @summary Dragged internal frame leaves artifacts for floating point ui scale
* @run main/othervm -Dsun.java2d.uiScale=1.2 JInternalFrameDraggingTest
* @run main/othervm -Dsun.java2d.uiScale=1.5 JInternalFrameDraggingTest
@@ -69,10 +69,14 @@
BufferedImage img = robot.createScreenCapture(rect);
int testRGB = BACKGROUND_COLOR.getRGB();
- for (int i = 0; i < size; i++) {
+ for (int i = 1; i < size; i++) {
int rgbCW = img.getRGB(i, size / 2);
int rgbCH = img.getRGB(size / 2, i);
if (rgbCW != testRGB || rgbCH != testRGB) {
+ System.out.println("i " + i + " rgbCW " +
+ Integer.toHexString(rgbCW) +
+ " testRGB " + Integer.toHexString(testRGB) +
+ " rgbCH " + Integer.toHexString(rgbCH));
throw new RuntimeException("Background color is wrong!");
}
}
@@ -81,6 +85,7 @@
private static void createAndShowGUI() {
frame = new JFrame();
+ frame.setUndecorated(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
--- a/test/jdk/javax/swing/JLayer/8041982/bug8041982.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JLayer/8041982/bug8041982.java Fri Mar 02 21:00:12 2018 +0100
@@ -22,6 +22,7 @@
*/
/* @test
+ * @key headful
* @bug 8041982
* @summary Use of animated icon in JLayer causes CPU spin
* @author Alexander Potochkin
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/SetSelectedValueTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -0,0 +1,77 @@
+/*
+ * 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
+ * @key headful
+ * @bug 5076761
+ * @summary Verifies that the selection is cleared when setSelectedValue is
+ * called with null
+ * @run main SetSelectedValueTest
+ */
+
+import javax.swing.SwingUtilities;
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+import javax.swing.ListSelectionModel;
+import java.util.Collections;
+import java.util.List;
+
+public class SetSelectedValueTest {
+ public static void main(String[] args) throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ // Create a JList with 2 elements
+ DefaultListModel dlm = new DefaultListModel();
+ JList list = new JList<String>(dlm);
+ list.setSelectionMode(
+ ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+ dlm.addElement("1");
+ dlm.addElement("2");
+
+ // Select both the elements added in list
+ list.setSelectionInterval(0, 1);
+ checkSelectionByList(list, List.of("1", "2"));
+
+ // Set the selected value as null. This should clear the
+ // selection
+ list.setSelectedValue(null, true);
+ checkSelectionByList(list, Collections.emptyList());
+
+ // Select both the elements added in list
+ list.setSelectionInterval(0, 1);
+ checkSelectionByList(list, List.of("1", "2"));
+ }
+ });
+ }
+
+ static void checkSelectionByList(JList list, List<String> selectionList)
+ throws RuntimeException {
+ List<String> listSelection = list.getSelectedValuesList();
+ if (!listSelection.equals(selectionList)) {
+ System.out.println("Expected: " + selectionList);
+ System.out.println("Actual: " + listSelection);
+ throw new RuntimeException("Wrong selection");
+ }
+ }
+}
--- a/test/jdk/javax/swing/JMenuItem/6883341/bug6883341.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JMenuItem/6883341/bug6883341.java Fri Mar 02 21:00:12 2018 +0100
@@ -24,6 +24,7 @@
/*
* @test
* @bug 6883341
+ * @key headful
* @summary Checks that menu items with no text don't throw an exception
* @author Alexander Potochkin
* @run main bug6883341
--- a/test/jdk/javax/swing/JTable/8031971/bug8031971.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JTable/8031971/bug8031971.java Fri Mar 02 21:00:12 2018 +0100
@@ -32,7 +32,7 @@
* @bug 8031971 8039750
* @author Alexander Scherbatiy
* @summary Use only public methods in the SwingLazyValue
- * @run main bug8031971
+ * @run main/othervm bug8031971
*/
public class bug8031971 {
--- a/test/jdk/javax/swing/JTableHeader/8020039/TableHeaderRendererExceptionTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/JTableHeader/8020039/TableHeaderRendererExceptionTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
*/
import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.JTableHeader;
/**
@@ -40,8 +41,11 @@
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
String lookAndFeelString = lookAndFeelItem.getClassName();
-
- UIManager.setLookAndFeel(lookAndFeelString);
+ try{
+ UIManager.setLookAndFeel(lookAndFeelString);
+ } catch (final UnsupportedLookAndFeelException ignored) {
+ continue;
+ }
// Test getTableCellRendererComponent method by passing null table
JTableHeader header = new JTableHeader();
--- a/test/jdk/javax/swing/Popup/TaskbarPositionTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/Popup/TaskbarPositionTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -27,7 +27,8 @@
import javax.swing.event.*;
/**
- * @test @bug 4245587 4474813 4425878 4767478 8015599
+ * @test
+ * @bug 4245587 4474813 4425878 4767478 8015599
* @key headful
* @author Mark Davidson
* @summary Tests the location of the heavy weight popup portion of JComboBox,
--- a/test/jdk/javax/swing/RepaintManager/DisplayListenerLeak/DisplayListenerLeak.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/RepaintManager/DisplayListenerLeak/DisplayListenerLeak.java Fri Mar 02 21:00:12 2018 +0100
@@ -34,6 +34,7 @@
/**
* @test
* @bug 8041654
+ * @key headful
* @modules java.desktop/sun.java2d
* @run main/othervm -Xmx80m DisplayListenerLeak
*/
--- a/test/jdk/javax/swing/Security/6657138/bug6657138.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/Security/6657138/bug6657138.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2015, 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
@@ -68,7 +68,11 @@
continue;
}
String className = laf.getClassName();
- UIManager.setLookAndFeel(className);
+ try {
+ UIManager.setLookAndFeel(className);
+ } catch (final UnsupportedLookAndFeelException ignored) {
+ continue;
+ }
ComponentUI ui = UIManager.getUI(c);
if (ui == null) {
throw new RuntimeException("UI is null for " + c);
--- a/test/jdk/javax/swing/UIDefaults/6302464/bug6302464.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/UIDefaults/6302464/bug6302464.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
import javax.swing.UIManager;
import javax.swing.UIDefaults;
import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.basic.BasicLookAndFeel;
import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING;
import static java.awt.RenderingHints.KEY_TEXT_LCD_CONTRAST;
@@ -178,6 +179,7 @@
private static void setLookAndFeel(String lafClass) {
try {
UIManager.setLookAndFeel(lafClass);
+ } catch (final UnsupportedLookAndFeelException ignored) {
} catch (Exception e) {
throw new RuntimeException(e);
}
--- a/test/jdk/javax/swing/UIDefaults/6622002/bug6622002.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/UIDefaults/6622002/bug6622002.java Fri Mar 02 21:00:12 2018 +0100
@@ -26,6 +26,7 @@
* @bug 6622002
* @author Alexander Potochkin
* @summary UIDefault.ProxyLazyValue has unsafe reflection usage
+ * @run main/othervm bug6622002
*/
import javax.swing.*;
--- a/test/jdk/javax/swing/UIDefaults/8080972/TestProxyLazyValue.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/UIDefaults/8080972/TestProxyLazyValue.java Fri Mar 02 21:00:12 2018 +0100
@@ -28,6 +28,7 @@
* @summary Audit Core Reflection in module java.desktop for places that will
* require changes to work with modules
* @author Alexander Scherbatiy
+ * @run main/othervm TestProxyLazyValue
*/
public class TestProxyLazyValue {
--- a/test/jdk/javax/swing/UIDefaults/8133926/InternalFrameIcon.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/UIDefaults/8133926/InternalFrameIcon.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,9 +45,10 @@
try {
UIManager.setLookAndFeel(laf.getClassName());
System.out.println("LookAndFeel: " + laf.getClassName());
- } catch (ClassNotFoundException | InstantiationException |
- UnsupportedLookAndFeelException | IllegalAccessException e) {
+ } catch (ClassNotFoundException | IllegalAccessException |
+ InstantiationException e) {
throw new RuntimeException(e);
+ } catch (final UnsupportedLookAndFeelException ignored) {
}
}
--- a/test/jdk/javax/swing/plaf/metal/MetalUtils/bug6190373.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/plaf/metal/MetalUtils/bug6190373.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, 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
@@ -102,8 +102,10 @@
try {
UIManager.setLookAndFeel(laf.getClassName());
System.out.println("LookAndFeel: " + laf.getClassName());
+ } catch (final UnsupportedLookAndFeelException ignored){
+ System.out.println("Unsupported LookAndFeel: " + laf.getClassName());
} catch (ClassNotFoundException | InstantiationException |
- UnsupportedLookAndFeelException | IllegalAccessException e) {
+ IllegalAccessException e) {
throw new RuntimeException(e);
}
}
--- a/test/jdk/javax/swing/plaf/nimbus/TestDisabledToolTipBorder.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/plaf/nimbus/TestDisabledToolTipBorder.java Fri Mar 02 21:00:12 2018 +0100
@@ -21,7 +21,8 @@
* questions.
*/
/**
- * @test @bug 8058785
+ * @test
+ * @bug 8058785
* @summary Displaying border around the disabled component's tool tip text
* @run main/manual TestDisabledToolTipBorder
*/
--- a/test/jdk/javax/swing/text/View/8080972/TestObjectView.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/javax/swing/text/View/8080972/TestObjectView.java Fri Mar 02 21:00:12 2018 +0100
@@ -36,6 +36,7 @@
* @summary Audit Core Reflection in module java.desktop for places that will
* require changes to work with modules
* @author Alexander Scherbatiy
+ * @run main/othervm TestObjectView
*/
public class TestObjectView {
--- a/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -101,6 +101,7 @@
JButtonOperator jbo = new JButtonOperator(containerOperator, GO);
JLabelOperator dowLabel = new JLabelOperator(containerOperator);
Calendar calendar = Calendar.getInstance(Locale.ENGLISH);
+ calendar.setTime((Date) getUIValue(jtfo, jtf -> ((JFormattedTextField)jtf).getValue()));
// Check default date Day of the Week
jbo.push();
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/ComponentChooser.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/ComponentChooser.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,5 +50,7 @@
*
* @return a String representing the description value
*/
- public String getDescription();
+ public default String getDescription() {
+ return toString();
+ }
}
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -718,6 +718,25 @@
}
}
+ /**
+ * Waits a state specified by a ComponentChooser instance on EDT queue.
+ *
+ * @param state a ComponentChooser defining the state criteria.
+ * @throws TimeoutExpiredException if the state has not achieved in a value
+ * defined by {@code "ComponentOperator.WaitStateTimeout"}
+ */
+ public void waitStateOnQueue(final ComponentChooser state) {
+ waitState((comp) -> {
+ return (boolean) (queueTool.invokeSmoothly(
+ new QueueTool.QueueAction<Object>("checkComponent") {
+ @Override
+ public final Object launch() throws Exception {
+ return state.checkComponent(comp);
+ }
+ }));
+ });
+ }
+
////////////////////////////////////////////////////////
//Mapping //
////////////////////////////////////////////////////////
--- a/test/jdk/sun/java2d/marlin/TextClipErrorTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/sun/java2d/marlin/TextClipErrorTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -50,7 +50,8 @@
import javax.imageio.ImageIO;
/**
- * @test @bug 8144718
+ * @test
+ * @bug 8144718
* @summary Check the Stroker.drawBezApproxForArc() bug (stoke with round
* joins): if cosext2 > 0.5, it generates curves with NaN coordinates
* @run main TextClipErrorTest
--- a/test/jdk/sun/management/StackTraceElementCompositeData/CompatibilityTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/sun/management/StackTraceElementCompositeData/CompatibilityTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,3 +1,25 @@
+/*
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
import java.util.HashMap;
import java.util.Map;
@@ -6,6 +28,7 @@
import javax.management.openmbean.CompositeType;
import javax.management.openmbean.OpenType;
import javax.management.openmbean.SimpleType;
+
import sun.management.StackTraceElementCompositeData;
import org.testng.annotations.*;
@@ -14,6 +37,7 @@
/*
* @test
* @bug 8139587
+ * @modules java.management/sun.management
* @summary Check backward compatibility of StackTraceElementCompositeData
* @author Jaroslav Bachorik
*
@@ -22,21 +46,33 @@
public class CompatibilityTest {
private static CompositeType compositeTypeV6;
- private static Map<String, Object> itemsV6;
- private static CompositeData compositeDataV6;
+ private static CompositeType compositeType;
+
+ // Attribute names
+ private static final String CLASS_LOADER_NAME = "classLoaderName";
+ private static final String MODULE_NAME = "moduleName";
+ private static final String MODULE_VERSION = "moduleVersion";
+ private static final String CLASS_NAME = "className";
+ private static final String METHOD_NAME = "methodName";
+ private static final String FILE_NAME = "fileName";
+ private static final String LINE_NUMBER = "lineNumber";
+ private static final String NATIVE_METHOD = "nativeMethod";
@BeforeClass
public static void setup() throws Exception {
+ String[] v6Names = {
+ CLASS_NAME, METHOD_NAME, FILE_NAME, NATIVE_METHOD, LINE_NUMBER
+ };
+ String[] names = {
+ CLASS_LOADER_NAME, MODULE_NAME, MODULE_VERSION,
+ CLASS_NAME, METHOD_NAME, FILE_NAME, NATIVE_METHOD, LINE_NUMBER
+ };
compositeTypeV6 = new CompositeType(
StackTraceElement.class.getName(),
"StackTraceElement",
- new String[]{
- "className", "methodName", "fileName", "nativeMethod", "lineNumber"
- },
- new String[]{
- "className", "methodName", "fileName", "nativeMethod", "lineNumber"
- },
- new OpenType[]{
+ v6Names,
+ v6Names,
+ new OpenType[] {
SimpleType.STRING,
SimpleType.STRING,
SimpleType.STRING,
@@ -44,20 +80,52 @@
SimpleType.INTEGER
}
);
+ compositeType = new CompositeType(
+ StackTraceElement.class.getName(),
+ "StackTraceElement",
+ names,
+ names,
+ new OpenType[] {
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.STRING,
+ SimpleType.BOOLEAN,
+ SimpleType.INTEGER
+ }
+ );
+ }
- itemsV6 = new HashMap<>();
- itemsV6.put("className", "MyClass");
- itemsV6.put("methodName", "myMethod");
- itemsV6.put("fileName", "MyClass.java");
- itemsV6.put("nativeMethod", false);
- itemsV6.put("lineNumber", 123);
+ private static CompositeData makeCompositeDataV6() throws Exception {
+ Map<String, Object> itemsV6 = new HashMap<>();
+ itemsV6.put(CLASS_NAME, "MyClass");
+ itemsV6.put(METHOD_NAME, "myMethod");
+ itemsV6.put(FILE_NAME, "MyClass.java");
+ itemsV6.put(NATIVE_METHOD, false);
+ itemsV6.put(LINE_NUMBER, 123);
+
+ return new CompositeDataSupport(compositeTypeV6, itemsV6);
+ }
- compositeDataV6 = new CompositeDataSupport(compositeTypeV6, itemsV6);
+ private static CompositeData makeCompositeData() throws Exception {
+ Map<String, Object> items = new HashMap<>();
+ items.put(CLASS_LOADER_NAME, "app");
+ items.put(MODULE_NAME, "m");
+ items.put(MODULE_VERSION, "1.0");
+ items.put(CLASS_NAME, "MyClass");
+ items.put(METHOD_NAME, "myMethod");
+ items.put(FILE_NAME, "MyClass.java");
+ items.put(NATIVE_METHOD, false);
+ items.put(LINE_NUMBER, 123);
+
+ return new CompositeDataSupport(compositeType, items);
}
@Test
public void testV6Compatibility() throws Exception {
- StackTraceElement ste = StackTraceElementCompositeData.from(compositeDataV6);
+ StackTraceElement ste = StackTraceElementCompositeData.from(makeCompositeDataV6());
assertNotNull(ste);
assertEquals(ste.getClassName(), "MyClass");
@@ -69,5 +137,22 @@
assertNull(ste.getModuleName());
assertNull(ste.getModuleVersion());
}
+
+ @Test
+ public void test() throws Exception {
+ StackTraceElement ste = StackTraceElementCompositeData.from(makeCompositeData());
+
+ assertNotNull(ste);
+
+ assertEquals(ste.getModuleName(), "m");
+ assertEquals(ste.getModuleVersion(), "1.0");
+ assertEquals(ste.getClassLoaderName(), "app");
+
+ assertEquals(ste.getClassName(), "MyClass");
+ assertEquals(ste.getMethodName(), "myMethod");
+ assertEquals(ste.getFileName(), "MyClass.java");
+ assertEquals(ste.isNativeMethod(), false);
+ assertEquals(ste.getLineNumber(), 123);
+ }
}
--- a/test/jdk/sun/security/tools/jarsigner/LineBrokenMultiByteCharacter.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/jdk/sun/security/tools/jarsigner/LineBrokenMultiByteCharacter.java Fri Mar 02 21:00:12 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
* @see #verifyClassNameLineBroken(JarFile, String)
*/
static final String testClassName =
- "LineBrokenMultiByteCharacterA1234567890B1234567890C123456789D12\u00E9xyz.class";
+ "LineBrokenMultiByteCharacterA1234567890B1234567890C123456789D1234\u00E9xyz.class";
static final String anotherName =
"LineBrokenMultiByteCharacterA1234567890B1234567890C123456789D1234567890.class";
--- a/test/langtools/jdk/jshell/ToolBasicTest.java Fri Mar 02 15:02:26 2018 -0800
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java Fri Mar 02 21:00:12 2018 +0100
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508 8166232
+ * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508 8166232 8196133
* @summary Tests for Basic tests for REPL tool
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
@@ -350,6 +350,34 @@
);
}
+ private String makeBadSourceJar() {
+ Compiler compiler = new Compiler();
+ Path outDir = Paths.get("testClasspathJar");
+ Path src = compiler.getPath(outDir.resolve("pkg/A.java"));
+ compiler.writeToFile(src, "package pkg; /** \u0086 */public class A { public String toString() { return \"A\"; } }");
+ String jarName = "test.jar";
+ compiler.jar(outDir, jarName, "pkg/A.java");
+ return compiler.getPath(outDir).resolve(jarName).toString();
+ }
+
+ public void testBadSourceJarClasspath() {
+ String jarPath = makeBadSourceJar();
+ test(
+ (a) -> assertCommand(a, "/env --class-path " + jarPath,
+ "| Setting new options and restoring state."),
+ (a) -> assertCommandOutputStartsWith(a, "new pkg.A();",
+ "| Error:\n"
+ + "| cannot find symbol\n"
+ + "| symbol: class A")
+ );
+ test(new String[]{"--class-path", jarPath},
+ (a) -> assertCommandOutputStartsWith(a, "new pkg.A();",
+ "| Error:\n"
+ + "| cannot find symbol\n"
+ + "| symbol: class A")
+ );
+ }
+
public void testModulePath() {
Compiler compiler = new Compiler();
Path modsDir = Paths.get("mods");